From 9f27ad65b66aa3a0fed3ecdcf8f04bde7d4e6350 Mon Sep 17 00:00:00 2001 From: xiaohua030729 <3123183787@qq.com> Date: Tue, 9 Jan 2024 10:55:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=98=BC=E5=A4=9C=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- public/index.html | 2 +- src/assets/css/color.css | 3 + src/assets/css/index.css | 44 +++ src/components/home.vue | 8 +- src/components/index.vue | 814 ++++++++++++++++++++------------------- src/utils/constant.js | 4 +- 7 files changed, 466 insertions(+), 411 deletions(-) diff --git a/package.json b/package.json index 7673a22..77060ff 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { - "serve": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service serve", + "serve": "vue-cli-service serve", "build": "set NODE_OPTIONS=--openssl-legacy-provider & vue-cli-service build", "lint": "vue-cli-service lint" }, diff --git a/public/index.html b/public/index.html index 5ed96d7..7701a9b 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ - Poetize + 药药相互 diff --git a/src/assets/css/color.css b/src/assets/css/color.css index 0f70c7d..f162fdc 100644 --- a/src/assets/css/color.css +++ b/src/assets/css/color.css @@ -32,6 +32,8 @@ --maxGreyFont: #595A5A; /* footer背景 */ --gradientBG: linear-gradient(-90deg, #ee7752, #e73c7e, #23a6d5, #23d5ab); + + /* 白色遮罩 */ --whiteMask: rgba(255, 255, 255, 0.3); /* max白色遮罩 */ @@ -51,6 +53,7 @@ --maxMask: rgba(0, 0, 0, 0.7); + --white: white; --red: red; diff --git a/src/assets/css/index.css b/src/assets/css/index.css index f45dec4..7a80c0e 100644 --- a/src/assets/css/index.css +++ b/src/assets/css/index.css @@ -288,3 +288,47 @@ body { width: 90% !important; } } + +/* 背景*/ +.dark-mode-sky, +.dark-mode-sky::before{ + content: ""; + position: fixed; + width: 100vw; + height: 100vh; + /* 固定位置,不随滚动条滚动 */ + position: fixed; + z-index: -1; + transition: 2s ease all; +} +.dark-mode-sky{ + background: linear-gradient(#fcd5ce,#f8edeb); +} +.dark-mode-sky::before{ + opacity: 0; + background: linear-gradient(#001233,#002855,#0466c8); +} +.dark-mode .dark-mode-sky::before{ + opacity: 1; +} +/*日月*/ +.dark-mode-planet { + z-index: 19999999999; + position: fixed; + left: -50%; + top: -50%; + width: 200%; + height: 200%; + transition: 2s cubic-bezier(.7,0,0,1) all; + transform-origin: center bottom; +} +.dark-mode-planet::after{ + position: absolute; + left: 35%; + top: 40%; + width: 150px; + height: 150px; + border-radius: 50%; + content: ""; + background: linear-gradient(#ffffff,#f1f3b7); +} diff --git a/src/components/home.vue b/src/components/home.vue index b82311f..c6d8357 100644 --- a/src/components/home.vue +++ b/src/components/home.vue @@ -38,7 +38,7 @@ - +
  • 🥼 预测研发流程 @@ -421,7 +421,7 @@ this.isDark = !this.isDark; let root = document.querySelector(":root"); - if (this.isDark) { + if (this.isDark) { root.style.setProperty("--background", "#272727"); root.style.setProperty("--fontColor", "white"); root.style.setProperty("--borderColor", "#4F4F4F"); @@ -440,6 +440,10 @@ root.style.setProperty("--commentContent", "#F7F9FE"); root.style.setProperty("--favoriteBg", "#f7f9fe"); } + $("body").toggleClass("dark-mode"); + var angle = $('.dark-mode-planet').data('angle') + 360 || 360; + $('.dark-mode-planet').css({'transform': 'rotate(' + angle + 'deg)'}); + $('.dark-mode-planet').data('angle',angle); }, toTop() { window.scrollTo({ diff --git a/src/components/index.vue b/src/components/index.vue index 34a8464..f0b6723 100644 --- a/src/components/index.vue +++ b/src/components/index.vue @@ -10,19 +10,23 @@