Drive toggle glyphs with html.dark/body theme classes only, drop inline display styles that lost to !important CSS, and give the float rail a solid surface + brighter ink in dark mode.
405 lines
9.7 KiB
CSS
405 lines
9.7 KiB
CSS
/* ============================================================
|
|
* Floating Buttons
|
|
* ============================================================ */
|
|
|
|
.float-right {
|
|
--float-btn-size: 42px;
|
|
--float-btn-spacing: 8px;
|
|
--float-btn-opacity: 1;
|
|
--float-btn-color: var(--color-ink-3);
|
|
--float-btn-bg: transparent;
|
|
--float-btn-active-color: var(--color-primary);
|
|
position: fixed;
|
|
right: 20px;
|
|
bottom: 96px;
|
|
z-index: 900;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: var(--float-btn-spacing, 8px);
|
|
opacity: var(--float-btn-opacity, 1);
|
|
transition: transform var(--dur, 0.25s) var(--ease, ease), opacity var(--dur, 0.25s) var(--ease, ease);
|
|
padding-bottom: env(safe-area-inset-bottom, 0px);
|
|
}
|
|
|
|
.float-right.no-shadow .float-btn {
|
|
box-shadow: none;
|
|
}
|
|
|
|
.float-right.no-animation .float-btn {
|
|
transition: none;
|
|
}
|
|
|
|
.float-right.no-animation .float-btn:hover {
|
|
transform: none;
|
|
}
|
|
|
|
.float-right.position-center {
|
|
top: 50%;
|
|
bottom: auto;
|
|
transform: translateY(-50%);
|
|
}
|
|
|
|
.float-right.square {
|
|
gap: 0;
|
|
overflow: hidden;
|
|
border-radius: var(--radius-lg, 8px);
|
|
box-shadow: var(--shadow-md, 0 10px 30px rgba(17, 24, 39, 0.12));
|
|
}
|
|
|
|
.float-right .float-btn {
|
|
width: var(--float-btn-size);
|
|
min-height: var(--float-btn-size);
|
|
display: inline-flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
position: relative;
|
|
color: var(--this-color, var(--float-btn-color));
|
|
background: var(--this-bg, var(--float-btn-bg));
|
|
border: 1px solid var(--color-line-soft, #f0f1f3);
|
|
text-decoration: none;
|
|
box-shadow: var(--shadow, 0 8px 24px rgba(17, 24, 39, 0.08));
|
|
transition: transform var(--dur-fast, 0.15s) var(--ease, ease), box-shadow var(--dur-fast, 0.15s) var(--ease, ease), color var(--dur-fast, 0.15s) var(--ease, ease), background var(--dur-fast, 0.15s) var(--ease, ease);
|
|
cursor: pointer;
|
|
outline: none;
|
|
overflow: visible;
|
|
}
|
|
|
|
.float-right.round .float-btn {
|
|
border-radius: 12px;
|
|
}
|
|
|
|
.float-right.square .float-btn {
|
|
border-radius: 0;
|
|
box-shadow: none;
|
|
border-top-width: 0;
|
|
}
|
|
|
|
.float-right.square .float-btn:first-child {
|
|
border-top-width: 1px;
|
|
}
|
|
|
|
.float-right .float-btn:hover {
|
|
transform: translateY(-2px);
|
|
color: var(--float-btn-active-color, var(--color-primary));
|
|
text-decoration: none;
|
|
box-shadow: var(--shadow-md, 0 10px 30px rgba(17, 24, 39, 0.12));
|
|
z-index: 2;
|
|
}
|
|
|
|
.float-right .float-btn:active {
|
|
transform: scale(0.96);
|
|
}
|
|
|
|
.float-right .float-btn::after {
|
|
content: "";
|
|
position: absolute;
|
|
inset: auto;
|
|
width: 6px;
|
|
height: 6px;
|
|
border-radius: 999px;
|
|
background: currentColor;
|
|
opacity: 0;
|
|
transform: scale(1);
|
|
pointer-events: none;
|
|
}
|
|
|
|
.float-right .float-btn.is-rippling::after {
|
|
animation: float-btn-ripple 0.55s ease-out;
|
|
}
|
|
|
|
.float-right .float-btn i {
|
|
font-size: 16px;
|
|
line-height: 1;
|
|
}
|
|
|
|
.float-right .float-btn.ontop {
|
|
opacity: 0;
|
|
visibility: hidden;
|
|
pointer-events: none;
|
|
}
|
|
|
|
.float-right .float-btn.ontop.is-visible {
|
|
opacity: 1;
|
|
visibility: visible;
|
|
pointer-events: auto;
|
|
}
|
|
|
|
.float-right.has-blur-pc .float-btn {
|
|
backdrop-filter: saturate(1.5) blur(10px);
|
|
-webkit-backdrop-filter: saturate(1.5) blur(10px);
|
|
}
|
|
|
|
.float-right .hover-show-con {
|
|
position: absolute;
|
|
display: block;
|
|
right: calc(100% + 12px);
|
|
top: 50%;
|
|
transform: translateY(-50%);
|
|
min-width: 180px;
|
|
max-width: 280px;
|
|
padding: 12px;
|
|
border-radius: var(--radius-lg, 8px);
|
|
background: var(--surface-1, #fff);
|
|
border: 1px solid var(--color-line);
|
|
box-shadow: var(--shadow-lg, 0 18px 40px rgba(17, 24, 39, 0.18));
|
|
color: var(--color-ink-2);
|
|
opacity: 0;
|
|
visibility: hidden;
|
|
pointer-events: none;
|
|
transition: opacity var(--dur-fast, 0.15s) var(--ease, ease), transform var(--dur-fast, 0.15s) var(--ease, ease), visibility var(--dur-fast, 0.15s) var(--ease, ease);
|
|
}
|
|
|
|
.float-right .hover-show-con::before {
|
|
content: "";
|
|
position: absolute;
|
|
top: 50%;
|
|
right: -8px;
|
|
width: 16px;
|
|
height: 16px;
|
|
background: inherit;
|
|
border-top: 1px solid var(--color-line);
|
|
border-right: 1px solid var(--color-line);
|
|
transform: translateY(-50%) rotate(45deg);
|
|
}
|
|
|
|
.float-right .hover-show-con img {
|
|
display: block;
|
|
width: 100%;
|
|
max-width: 160px;
|
|
height: auto;
|
|
margin: 0 auto 10px;
|
|
border-radius: var(--radius, 10px);
|
|
}
|
|
|
|
.float-right .hover-show-con p {
|
|
margin: 0;
|
|
font-size: 13px;
|
|
line-height: 1.6;
|
|
color: var(--color-ink-3);
|
|
text-align: center;
|
|
}
|
|
|
|
.float-btn-qrcode {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
width: 100%;
|
|
min-height: 120px;
|
|
margin: 0 auto 10px;
|
|
background: #fff;
|
|
border-radius: var(--radius, 10px);
|
|
}
|
|
|
|
.float-right .service-wechat .hover-show-con,
|
|
.float-right .service-qq .hover-show-con,
|
|
.float-right .qrcode-btn .hover-show-con {
|
|
padding: 14px;
|
|
text-align: center;
|
|
}
|
|
|
|
/* Page QR hover card: keep title/caption centered under the code */
|
|
.float-right .qrcode-btn .hover-show-con {
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
|
|
.float-right .qrcode-btn .hover-show-con p {
|
|
width: 100%;
|
|
text-align: center;
|
|
margin-top: 2px;
|
|
}
|
|
|
|
.float-right .qrcode-btn .hover-show-con .float-btn-qrcode__title {
|
|
width: 100%;
|
|
text-align: center;
|
|
margin: 2px 0 0;
|
|
font-size: 13px;
|
|
line-height: 1.6;
|
|
color: var(--color-ink-3);
|
|
}
|
|
|
|
|
|
.float-right .service-wechat .hover-show-con img,
|
|
.float-right .service-qq .hover-show-con img {
|
|
margin: 0 auto;
|
|
box-shadow: 0 10px 24px rgba(17, 24, 39, 0.12);
|
|
}
|
|
|
|
.float-right .service-wechat .hover-show-con p,
|
|
.float-right .service-qq .hover-show-con p {
|
|
display: none;
|
|
}
|
|
|
|
.float-right .newadd-btns .hover-show-con {
|
|
min-width: 196px;
|
|
padding: 10px;
|
|
}
|
|
|
|
.float-add-menu {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 6px;
|
|
}
|
|
|
|
.float-add-menu__item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 10px;
|
|
padding: 10px 12px;
|
|
border-radius: 10px;
|
|
color: var(--color-ink-2);
|
|
text-decoration: none;
|
|
transition: background var(--dur-fast, 0.15s) var(--ease, ease), color var(--dur-fast, 0.15s) var(--ease, ease), transform var(--dur-fast, 0.15s) var(--ease, ease);
|
|
}
|
|
|
|
.float-add-menu__item i {
|
|
width: 18px;
|
|
text-align: center;
|
|
color: var(--color-primary, var(--color-primary));
|
|
}
|
|
|
|
.float-add-menu__item:hover {
|
|
background: var(--color-primary-soft, rgba(240, 68, 148, 0.1));
|
|
color: var(--color-primary, var(--color-primary));
|
|
transform: translateX(-2px);
|
|
}
|
|
|
|
.float-btn-qrcode :deep(canvas),
|
|
.float-btn-qrcode :deep(img),
|
|
.float-btn-qrcode svg {
|
|
display: block;
|
|
margin: 0 auto;
|
|
}
|
|
|
|
.float-right .float-btn:hover .hover-show-con,
|
|
.float-right .float-btn:focus-visible .hover-show-con {
|
|
opacity: 1;
|
|
visibility: visible;
|
|
pointer-events: auto;
|
|
transform: translateY(-50%) translateX(-4px);
|
|
}
|
|
|
|
.float-right.scrolling-hide.is-hidden,
|
|
.float-right.scroll-down-hide.is-hidden {
|
|
transform: translateX(calc(100% + 24px));
|
|
}
|
|
|
|
.float-right.position-center.scrolling-hide.is-hidden,
|
|
.float-right.position-center.scroll-down-hide.is-hidden {
|
|
transform: translateX(calc(100% + 24px)) translateY(-50%);
|
|
}
|
|
|
|
.float-right__html {
|
|
font-size: 13px;
|
|
line-height: 1.6;
|
|
}
|
|
|
|
.float-right__html a {
|
|
color: var(--color-primary, var(--color-primary));
|
|
}
|
|
|
|
.float-right__html a:hover {
|
|
color: var(--color-primary-hover, #7099CC);
|
|
}
|
|
|
|
@keyframes float-btn-ripple {
|
|
0% {
|
|
opacity: 0.22;
|
|
transform: scale(1);
|
|
}
|
|
100% {
|
|
opacity: 0;
|
|
transform: scale(14);
|
|
}
|
|
}
|
|
|
|
/*
|
|
* Theme float glyph: light → moon, dark → sun.
|
|
* Match nav toggle + theme.js contract. Class-driven only.
|
|
*/
|
|
.float-right .float-btn__icon-sun {
|
|
display: none !important;
|
|
}
|
|
|
|
.float-right .float-btn__icon-moon {
|
|
display: inline-block !important;
|
|
}
|
|
|
|
html.dark .float-right .float-btn__icon-moon,
|
|
body.theme-dark .float-right .float-btn__icon-moon,
|
|
body.dark-theme .float-right .float-btn__icon-moon {
|
|
display: none !important;
|
|
}
|
|
|
|
html.dark .float-right .float-btn__icon-sun,
|
|
body.theme-dark .float-right .float-btn__icon-sun,
|
|
body.dark-theme .float-right .float-btn__icon-sun {
|
|
display: inline-block !important;
|
|
}
|
|
|
|
/* VIP float rail entry */
|
|
.float-right .float-btn.pay-vip {
|
|
color: var(--this-color, #f5a623);
|
|
}
|
|
|
|
.float-right .float-btn.pay-vip:hover {
|
|
color: var(--this-color, #f5a623);
|
|
opacity: 0.9;
|
|
}
|
|
|
|
.float-right .float-btn.signin-loader {
|
|
cursor: pointer;
|
|
}
|
|
|
|
/* Dark: solid surface + brighter icon so transparent btn doesn't vanish */
|
|
html.dark .float-right,
|
|
body.theme-dark .float-right,
|
|
body.dark-theme .float-right {
|
|
--float-btn-color: var(--color-ink-2, #e5eef7);
|
|
--float-btn-bg: var(--surface-1, #323335);
|
|
}
|
|
|
|
html.dark .float-right .float-btn,
|
|
body.theme-dark .float-right .float-btn,
|
|
body.dark-theme .float-right .float-btn {
|
|
border-color: rgba(255, 255, 255, 0.12);
|
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
|
|
color: var(--this-color, var(--float-btn-color));
|
|
background: var(--this-bg, var(--float-btn-bg));
|
|
}
|
|
|
|
html.dark .float-right .hover-show-con,
|
|
body.theme-dark .float-right .hover-show-con,
|
|
body.dark-theme .float-right .hover-show-con {
|
|
background: var(--surface-2, #1f2430);
|
|
border-color: rgba(255, 255, 255, 0.08);
|
|
}
|
|
|
|
@media (max-width: 767px) {
|
|
.float-right {
|
|
right: 12px;
|
|
bottom: 84px;
|
|
--float-btn-size: 40px;
|
|
}
|
|
|
|
.float-right.has-blur-mobile .float-btn {
|
|
backdrop-filter: saturate(1.5) blur(10px);
|
|
-webkit-backdrop-filter: saturate(1.5) blur(10px);
|
|
}
|
|
|
|
.float-right .hover-show-con {
|
|
max-width: min(240px, calc(100vw - 84px));
|
|
}
|
|
|
|
.float-right .float-btn.hide-on-mobile {
|
|
display: none;
|
|
}
|
|
}
|
|
|
|
@media (min-width: 768px) {
|
|
.float-right .float-btn.hide-on-pc {
|
|
display: none;
|
|
}
|
|
}
|