1
0
Fork 0
mirror of https://github.com/dillonzq/LoveIt.git synced 2025-03-26 00:17:00 +01:00

feat: modify the order of fixed buttons ()

* feat: modify the order of fixed buttons

* feat: modify the order of fixed buttons

* feat: modify the order of fixed buttons
This commit is contained in:
Dillon 2025-02-14 20:51:45 +08:00 committed by GitHub
parent f59fb4ecc2
commit dac626f461
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 23 additions and 11 deletions
assets
layouts/_default
resources/_gen/assets/css
src/js

View file

@ -2,11 +2,16 @@
display: none;
}
.fixed-button {
#fixed-buttons-hidden {
display: none;
}
.fixed-button {
display: block;
z-index: 100;
position: fixed;
right: 1.5rem;
bottom: 1.5rem;
font-size: 1rem;
line-height: 1.3rem;
padding: .6rem .6rem;
@ -34,13 +39,16 @@
color: $global-font-color-dark;
}
}
}
#back-to-top {
display: block;
bottom: 1.5rem;
}
&:nth-last-of-type(1) {
bottom: 1.5rem;
}
#view-comments {
bottom: 4.5rem;
&:nth-last-of-type(2) {
bottom: 4.5rem;
}
&:nth-last-of-type(3) {
bottom: 7.5rem;
}
}

View file

@ -832,7 +832,8 @@ class Theme {
if (document.getElementById('comments')) {
const $viewComments = document.getElementById('view-comments');
$viewComments.href = `#comments`;
$viewComments.style.display = 'block';
$viewComments.parentElement.removeChild($viewComments);
document.getElementById('fixed-buttons').appendChild($viewComments);
}
const $fixedButtons = document.getElementById('fixed-buttons');

View file

@ -35,7 +35,9 @@
<a href="#" id="back-to-top" class="fixed-button" title="{{ T `backToTop` }}">
<i class="fas fa-arrow-up fa-fw" aria-hidden="true"></i>
</a>
</div>
<div id="fixed-buttons-hidden">
{{- /* comment button */ -}}
<a href="#" id="view-comments" class="fixed-button" title="{{ T `viewComments` }}">
<i class="fas fa-comment fa-fw" aria-hidden="true"></i>

File diff suppressed because one or more lines are too long

View file

@ -692,7 +692,8 @@ class Theme {
if (document.getElementById('comments')) {
const $viewComments = document.getElementById('view-comments');
$viewComments.href = `#comments`;
$viewComments.style.display = 'block';
$viewComments.parentElement.removeChild($viewComments);
document.getElementById('fixed-buttons').appendChild($viewComments);
}
const $fixedButtons = document.getElementById('fixed-buttons');
const ACCURACY = 20, MINIMUM = 100;