mirror of
https://github.com/owntone/owntone-server.git
synced 2024-12-27 15:45:56 -05:00
Merge pull request #1687 from X-Ryl669/FixCenterLyricPos
[web] Ensure current lyric is centered
This commit is contained in:
commit
2f0e19cf41
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1,4 +1,4 @@
|
||||
<!doctype html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
@ -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>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<!doctype html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
|
@ -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({
|
||||
|
@ -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>
|
||||
|
@ -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 {
|
||||
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user