Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[web] Ensure current lyric is centered #1687

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion htdocs/assets/index.css

Large diffs are not rendered by default.

58 changes: 32 additions & 26 deletions htdocs/assets/index.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions htdocs/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand All @@ -17,9 +17,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>OwnTone</title>
<script type="module" crossorigin src="./assets/index.js"></script>
<link rel="stylesheet" crossorigin href="./assets/index.css">
<link rel="stylesheet" href="./assets/index.css">
</head>
<body>
<div id="app"></div>

</body>
</html>
2 changes: 1 addition & 1 deletion web-src/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!doctype html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
7 changes: 5 additions & 2 deletions web-src/src/components/LyricsPane.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,15 @@ export default {
return
}

let currentLyric = scrollTouch.children[0].children[this.lyricIndex],
let currentLyric = scrollTouch.children[0].children[this.lyricIndex + 1], // Because of space item
offsetToCenter = scrollTouch.offsetHeight >> 1
if (!this.lyricsArr || !currentLyric) return

let currOff = scrollTouch.scrollTop,
destOff = currentLyric.offsetTop - offsetToCenter
destOff =
currentLyric.offsetTop -
offsetToCenter +
(currentLyric.offsetHeight >> 1)
// Using scrollBy ensure that scrolling will happen
// even if the element is visible before scrolling
scrollTouch.scrollBy({
Expand Down
4 changes: 1 addition & 3 deletions web-src/src/components/NotificationList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ export default {
margin-bottom: 10px;
margin-left: 24px;
margin-right: 24px;
box-shadow:
0 4px 8px 0 rgba(0, 0, 0, 0.2),
0 6px 20px 0 rgba(0, 0, 0, 0.19);
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
</style>
8 changes: 2 additions & 6 deletions web-src/src/mystyles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
color: $black;
}
.lyrics-overlay {
box-shadow:
0px 40px 40px 0px $white inset,
0px -40px 40px 0px $white inset;
box-shadow: 0px 40px 40px 0px $white inset, 0px -40px 40px 0px $white inset;
}

.progress-bar {
Expand Down Expand Up @@ -80,9 +78,7 @@ a.navbar-item {
}

.fd-has-shadow img {
box-shadow:
0 4px 8px 0 rgba(0, 0, 0, 0.2),
0 6px 20px 0 rgba(0, 0, 0, 0.19);
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}

.fd-page {
Expand Down