From 90fe34f049a06db6a591c428b5fa02a6c57f22e3 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Wed, 22 Jan 2025 17:55:46 +0800 Subject: fix(www): slogan bug, close #32. --- docker/nginx/sites/www/src/main.ts | 6 +----- docker/nginx/sites/www/src/style.css | 8 +++----- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'docker/nginx') diff --git a/docker/nginx/sites/www/src/main.ts b/docker/nginx/sites/www/src/main.ts index 043cb94..09e8661 100644 --- a/docker/nginx/sites/www/src/main.ts +++ b/docker/nginx/sites/www/src/main.ts @@ -3,7 +3,7 @@ import "./style.css"; class Emotion { static opposite_map = new Map(); - constructor(public name: string) { + constructor(public readonly name: string) { } get opposite(): Emotion { @@ -18,9 +18,6 @@ class Emotion { return this.element.clientHeight; } - updateBodyTopPadding(): void { - } - apply() { localStorage.setItem(emotionKey, this.name); document.body.dataset.emotion = this.name; @@ -35,7 +32,6 @@ Emotion.opposite_map.set(angry, happy) const emotionKey = "emotion"; const savedEmotionName = localStorage.getItem(emotionKey) ?? happy.name; -document.body.dataset.emotion = savedEmotionName; for (const emotion of [happy, angry]) { if (emotion.name == savedEmotionName) { diff --git a/docker/nginx/sites/www/src/style.css b/docker/nginx/sites/www/src/style.css index 4dae7ea..f2d4ccc 100644 --- a/docker/nginx/sites/www/src/style.css +++ b/docker/nginx/sites/www/src/style.css @@ -12,7 +12,6 @@ html { body { width: 100%; margin: 0; - box-sizing: border-box; display: flex; flex-direction: column; } @@ -54,7 +53,7 @@ a { to { opacity: 1; - transform: translateY(0); + transform: translateX(0); } } @@ -68,10 +67,9 @@ a { } .slogan-container { - width: 100%; - position: fixed; - z-index: 1; + width: 100vw; top: 0; + position: fixed; } .slogan { -- cgit v1.2.3