diff --git a/app/router/nav_tracking_template_test.go b/app/router/nav_tracking_template_test.go index ab99d7c..e3fabc2 100644 --- a/app/router/nav_tracking_template_test.go +++ b/app/router/nav_tracking_template_test.go @@ -19,7 +19,7 @@ func TestNavigationPageUsesDedicatedVerificationAndAnalytics(t *testing.T) { t.Fatalf("navigation SEO output does not contain %q", want) } } - for _, unwanted := range []string{"112387687", "G-TZQS2NZ3TN", "6bb06ed5659790d0"} { + for _, unwanted := range []string{"112967594", "G-B5KGM8S5J1", "6bb06ed5659790d0"} { if strings.Contains(navHTML, unwanted) { t.Fatalf("navigation SEO output unexpectedly contains main-site id %q", unwanted) } @@ -31,8 +31,8 @@ func TestMainSiteKeepsMainVerificationAndAnalytics(t *testing.T) { for _, want := range []string{ "r7geXn5kBugzOSLZzyw4v3NBDMQwAmzFCVkqp92odh0", "6bb06ed5659790d0", - "112387687", - "G-TZQS2NZ3TN", + "112967594", + "G-B5KGM8S5J1", } { if !strings.Contains(mainHTML, want) { t.Fatalf("main-site SEO output does not contain %q", want) diff --git a/app/static/css/footer.css b/app/static/css/footer.css index 2d8b6ae..2f5f2f4 100644 --- a/app/static/css/footer.css +++ b/app/static/css/footer.css @@ -29,18 +29,10 @@ a.footer-social-home-item { gap: min(12px, 0.625vw); } - body.home-page .footer-main { - gap: min(32px, 1.666667vw); - } - body.home-page .footer-product { gap: min(18px, 0.9375vw); } - body.home-page .footer-brand { - gap: min(18px, 0.9375vw); - } - body.home-page .footer-logo { width: min(178px, 9.270833vw); height: min(49px, 2.552083vw); @@ -52,28 +44,12 @@ a.footer-social-home-item { line-height: clamp(20px, 1.25vw, 24px); } - body.home-page .footer-contact { - gap: min(4px, 0.208333vw); - } - body.home-page .footer-contact-line, body.home-page .footer-links { - font-size: clamp(12px, 0.833333vw, 16px); + font-size: clamp(13px, 0.833333vw, 16px); line-height: clamp(18px, 1.145833vw, 22px); } - body.home-page .footer-links { - gap: min(15px, 0.78125vw); - } - - body.home-page .footer-links a + a { - padding-left: min(16px, 0.833333vw); - } - - body.home-page .footer-links a + a::before { - height: min(18px, 0.9375vw); - } - body.home-page .footer-bottom { min-height: min(38px, 1.979167vw); gap: min(24px, 1.25vw); @@ -968,3 +944,179 @@ body.site-shell.list-page-body { display: none; } } + +/* ===== 页脚改版:品牌 / 访问地址 / 帮助与支持 三栏 ===== */ +.footer-col-title { + color: #FFFFFF; + font-size: 15px; + font-weight: 500; + line-height: 22px; +} + +.footer-contact-label { + flex: 0 0 auto; + min-width: 6.5em; + color: rgba(255, 255, 255, 0.45); +} + +.footer-contact-url { + min-width: 0; + color: #EC237F; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +a.footer-contact-line:hover .footer-contact-url, +a.footer-contact-line:focus-visible .footer-contact-url { + text-decoration: underline; +} + +@media (min-width: 768px) { + .footer-main { + grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); + align-items: start; + column-gap: 48px; + row-gap: 28px; + } + + .footer-brand { + grid-column: 1 / -1; + grid-row: 1; + flex-direction: column; + align-items: flex-start; + gap: 14px; + max-width: 640px; + } + + .footer-logo { + height: 44px; + } + + .footer-brand .footer-muted-text { + color: rgba(255, 255, 255, 0.55); + font-size: 14px; + line-height: 22px; + } + + .footer-contact { + grid-column: 1; + grid-row: 2; + display: flex; + flex-direction: column; + gap: 10px; + min-width: 0; + max-width: 100%; + } + + .footer-contact-line { + flex-direction: row; + align-items: baseline; + gap: 12px; + max-width: 100%; + font-size: 14px; + line-height: 20px; + } + + .footer-nav-col { + grid-column: 2; + grid-row: 2; + display: flex; + flex-direction: column; + gap: 10px; + } + + .footer-links { + display: grid; + grid-template-columns: repeat(2, max-content); + column-gap: 40px; + row-gap: 10px; + justify-self: start; + color: rgba(255, 255, 255, 0.75); + font-size: 14px; + line-height: 20px; + } + + .footer-links a + a { + padding-left: 0; + } + + .footer-links a + a::before { + display: none; + } + + .footer-divider { + margin-top: 10px; + } +} + +@media (min-width: 1024px) { + .footer-main { + grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) auto; + column-gap: 64px; + } + + .footer-brand { + grid-column: 1; + grid-row: 1; + max-width: 560px; + } + + .footer-contact { + grid-column: 2; + grid-row: 1; + } + + .footer-nav-col { + grid-column: 3; + grid-row: 1; + } +} + +@media (max-width: 767px) { + .footer-col-title { + display: none; + } + + .footer-nav-col { + width: 100%; + } + + /* 链接换行时行首不再挂分隔线:改成 3 列网格 */ + .footer-links { + display: grid; + grid-template-columns: repeat(3, 1fr); + row-gap: 10px; + text-align: center; + } + + .footer-links a + a { + padding-left: 0; + } + + .footer-links a + a::before { + display: none; + } + + .site-shell .home-mobile-footer-links { + display: grid; + grid-template-columns: repeat(3, 1fr); + row-gap: 10px; + column-gap: 8px; + text-align: center; + } + + .site-shell .home-mobile-footer-links a { + padding-left: 0; + } + + .site-shell .home-mobile-footer-links a::before { + display: none; + } +} + +/* 页脚进入视口时,悬浮按钮随之上移,不压住页脚(--footer-lift 由 footer.js 维护) */ +.download-fab, +.floating-action { + translate: 0 calc(var(--footer-lift, 0px) * -1); +} diff --git a/app/static/css/index.css b/app/static/css/index.css index bffb761..fd5eeb2 100644 --- a/app/static/css/index.css +++ b/app/static/css/index.css @@ -422,6 +422,15 @@ line-height: 23px; } + body.home-page .card-grid .poster-card-tags { + height: 29px; + } + + body.home-page .poster-card-episode { + font-size: 16px; + line-height: 23px; + } + body.home-page .poster-card-tag, body.home-page .ranking-card-tag { padding: 2px 9px; @@ -911,6 +920,21 @@ line-height: 20px; } +/* 集数占了标签行右侧:放不下的标签整颗换行并被隐藏,而不是每颗都截成省略号 */ +.home-page .card-grid .poster-card-tags { + flex-wrap: wrap; + height: 26px; +} + +.home-page .poster-card-episode { + flex-shrink: 0; + margin-left: 8px; + color: rgba(255, 255, 255, 0.55); + font-size: 14px; + line-height: 20px; + white-space: nowrap; +} + .home-page .poster-card-tag, .home-page .ranking-card-tag { width: max-content; @@ -1287,6 +1311,15 @@ line-height: 18px; } + .home-page .card-grid .poster-card-tags { + height: 24px; + } + + .home-page .poster-card-episode { + font-size: 12px; + line-height: 18px; + } + .home-page .episode-badge, .home-page .ranking-episode-badge { right: 8px; diff --git a/app/static/js/pages/footer.js b/app/static/js/pages/footer.js index f6dbd93..ae2cd0a 100644 --- a/app/static/js/pages/footer.js +++ b/app/static/js/pages/footer.js @@ -5,4 +5,41 @@ window.scrollTo({ top: 0, behavior: "smooth" }); }); }); + + // 页脚进入视口后,把悬浮按钮(下载 App / 回到顶部)顶到页脚上方,避免遮住页脚内容。 + var footers = document.querySelectorAll(".footer-box, .home-mobile-footer"); + if (!footers.length) return; + var root = document.documentElement; + var ticking = false; + var lastLift = -1; + + function visibleFooter() { + for (var i = 0; i < footers.length; i++) { + if (footers[i].offsetHeight > 0) return footers[i]; + } + return null; + } + + function update() { + ticking = false; + var footer = visibleFooter(); + var lift = 0; + if (footer) { + var top = footer.getBoundingClientRect().top; + lift = Math.max(0, Math.round((window.innerHeight || 0) - top)); + } + if (lift === lastLift) return; + lastLift = lift; + root.style.setProperty("--footer-lift", lift + "px"); + } + + function schedule() { + if (ticking) return; + ticking = true; + window.requestAnimationFrame(update); + } + + window.addEventListener("scroll", schedule, { passive: true }); + window.addEventListener("resize", schedule); + schedule(); })(); diff --git a/app/templates/base/analytics.html b/app/templates/base/analytics.html index 51cf12d..300e68c 100644 --- a/app/templates/base/analytics.html +++ b/app/templates/base/analytics.html @@ -6,18 +6,18 @@ m[i].l=1*new Date(); for (var j = 0; j < document.scripts.length; j++) {if (document.scripts[j].src === r) { return; }} k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a) - })(window, document,'script','https://mc.yandex.ru/metrika/tag.js?id={{if .isNavPage}}112390883{{else}}112387687{{end}}', 'ym'); + })(window, document,'script','https://mc.yandex.ru/metrika/tag.js?id={{if .isNavPage}}112390883{{else}}112967594{{end}}', 'ym'); - ym({{if .isNavPage}}112390883{{else}}112387687{{end}}, 'init', {ssr:true, webvisor:true, clickmap:true, ecommerce:"dataLayer", referrer: document.referrer, url: location.href, accurateTrackBounce:true, trackLinks:true}); + ym({{if .isNavPage}}112390883{{else}}112967594{{end}}, 'init', {ssr:true, webvisor:true, clickmap:true, ecommerce:"dataLayer", referrer: document.referrer, url: location.href, accurateTrackBounce:true, trackLinks:true}); - + {{end}} diff --git a/app/templates/base/footer.html b/app/templates/base/footer.html index 9899eca..22be718 100644 --- a/app/templates/base/footer.html +++ b/app/templates/base/footer.html @@ -1,5 +1,5 @@ {{define "footer"}} - +