From 8f172d47a72aa8b498acbf48835e866354b8043e Mon Sep 17 00:00:00 2001 From: ice breaker <1324318532@qq.com> Date: Thu, 19 Sep 2024 15:50:26 +0800 Subject: [PATCH] chore: remove some trash code --- blog-archived/client/assets/scss/global.scss | 84 +++++++++++++---- .../client/assets/sprite/svg/.gitkeep | 0 .../client/assets/sprite/svg/github-file.svg | 4 - .../assets/sprite/svg/github-folder.svg | 4 - .../client/components/global/SomImage.vue | 17 ---- .../components/home/ArticlePagedList/Body.vue | 43 --------- .../home/ArticlePagedList/BodySkeleton.vue | 20 ---- .../home/ArticlePagedList/Header.vue | 29 ------ .../ArticlePagedList/PaginationSkeleton.vue | 5 - .../home/ArticlePagedList/index.vue | 93 ------------------- .../client/components/layout/CommonSlot.vue | 2 +- .../components/layout/DarkModeToggle.vue | 2 - .../client/components/layout/Header.vue | 6 +- .../client/components/layout/NotFound.vue | 0 .../client/components/sitemap/index.vue | 2 - .../client/components/theme/ThemeSwitch.vue | 6 +- .../client/components/utils/LinkCard.vue | 18 ++-- 17 files changed, 84 insertions(+), 251 deletions(-) delete mode 100644 blog-archived/client/assets/sprite/svg/.gitkeep delete mode 100644 blog-archived/client/assets/sprite/svg/github-file.svg delete mode 100644 blog-archived/client/assets/sprite/svg/github-folder.svg delete mode 100644 blog-archived/client/components/home/ArticlePagedList/Body.vue delete mode 100644 blog-archived/client/components/home/ArticlePagedList/BodySkeleton.vue delete mode 100644 blog-archived/client/components/home/ArticlePagedList/Header.vue delete mode 100644 blog-archived/client/components/home/ArticlePagedList/PaginationSkeleton.vue delete mode 100644 blog-archived/client/components/home/ArticlePagedList/index.vue delete mode 100644 blog-archived/client/components/layout/NotFound.vue diff --git a/blog-archived/client/assets/scss/global.scss b/blog-archived/client/assets/scss/global.scss index 45d6895b..16eae6d1 100644 --- a/blog-archived/client/assets/scss/global.scss +++ b/blog-archived/client/assets/scss/global.scss @@ -1,10 +1,12 @@ @use './constants.scss' as C; @use './util.scss' as Util; @use './theme/light.scss' as Light; + // @use '../font/index.scss' as *; -@import '../font/index.scss'; +@import '../font/index'; + // @import './theme.scss'; -@import './prose.scss'; +@import './prose'; :root { @each $var, $color in C.$root-vars { @@ -16,16 +18,29 @@ @each $var, $color in Light.$light-vars { #{$var}: Util.getRgbaString($color); } + + .hover-scroll-bar { + &:hover { + &::-webkit-scrollbar-thumb { + @apply bg-border-muted; + } + } + + // 滚动条上的滚动滑块 + } } + body, html { transition: background-color 0.3s ease; } + @mixin better-scrollbar { // 滚动条高宽及背景 &::-webkit-scrollbar { width: 12px; } + // 滚动条上的滚动滑块 &::-webkit-scrollbar-thumb { @apply bg-header-bg; @@ -37,35 +52,72 @@ html { // } } -.better-scroll-bar { - @include better-scrollbar; -} - .hover-scroll-bar { &::-webkit-scrollbar { width: 12px; } + &::-webkit-scrollbar-thumb { @apply transition-colors; } + &:hover { &::-webkit-scrollbar-thumb { @apply bg-header-bg; } } + // 滚动条上的滚动滑块 } -[data-color-mode='light'] { - .hover-scroll-bar { - &:hover { - &::-webkit-scrollbar-thumb { - @apply bg-border-muted; - } - } - // 滚动条上的滚动滑块 - } +/* 隐藏 Chrome、Edge、Safari 浏览器的滚动条 */ +body::-webkit-scrollbar { + width: 0; + background: transparent; +} + +/* 自定义滚动条的轨道 */ +body::-webkit-scrollbar-track { + background: transparent; +} + +/* 自定义滚动条的滑块 */ +body::-webkit-scrollbar-thumb { + background-color: transparent; + border-radius: 10px; + transition: + background-color 0.3s, + width 0.3s; +} + +/* 滚动的时候显示滚动条 */ +body:active::-webkit-scrollbar-thumb { + background-color: rgb(0 0 0 / 40%); +} + +/* 鼠标悬停时,滚动条变宽和颜色加深 */ +body::-webkit-scrollbar-thumb:hover { + background-color: rgb(0 0 0 / 80%); + width: 8px; } + +/* 滚动条不占用空间 (Chrome, Edge, Safari) */ html { - @include better-scrollbar; + scrollbar-gutter: stable; +} + +/* 针对 Firefox 的放大效果 */ +@media (hover: hover) { + body { + scrollbar-color: transparent transparent; + } + + body:active { + scrollbar-color: rgb(0 0 0 / 40%) transparent; + } + + body:hover { + scrollbar-color: rgb(0 0 0 / 80%) transparent; + scrollbar-width: thin; /* 确保宽度变化的效果 */ + } } diff --git a/blog-archived/client/assets/sprite/svg/.gitkeep b/blog-archived/client/assets/sprite/svg/.gitkeep deleted file mode 100644 index e69de29b..00000000 diff --git a/blog-archived/client/assets/sprite/svg/github-file.svg b/blog-archived/client/assets/sprite/svg/github-file.svg deleted file mode 100644 index 469594d3..00000000 --- a/blog-archived/client/assets/sprite/svg/github-file.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/blog-archived/client/assets/sprite/svg/github-folder.svg b/blog-archived/client/assets/sprite/svg/github-folder.svg deleted file mode 100644 index af20cb82..00000000 --- a/blog-archived/client/assets/sprite/svg/github-folder.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/blog-archived/client/components/global/SomImage.vue b/blog-archived/client/components/global/SomImage.vue index 82933a2d..0a5fed74 100644 --- a/blog-archived/client/components/global/SomImage.vue +++ b/blog-archived/client/components/global/SomImage.vue @@ -1,20 +1,6 @@ - - diff --git a/blog-archived/client/components/home/ArticlePagedList/BodySkeleton.vue b/blog-archived/client/components/home/ArticlePagedList/BodySkeleton.vue deleted file mode 100644 index 68173637..00000000 --- a/blog-archived/client/components/home/ArticlePagedList/BodySkeleton.vue +++ /dev/null @@ -1,20 +0,0 @@ - diff --git a/blog-archived/client/components/home/ArticlePagedList/Header.vue b/blog-archived/client/components/home/ArticlePagedList/Header.vue deleted file mode 100644 index ae45e0a6..00000000 --- a/blog-archived/client/components/home/ArticlePagedList/Header.vue +++ /dev/null @@ -1,29 +0,0 @@ - - - - - diff --git a/blog-archived/client/components/home/ArticlePagedList/PaginationSkeleton.vue b/blog-archived/client/components/home/ArticlePagedList/PaginationSkeleton.vue deleted file mode 100644 index 8d0cd341..00000000 --- a/blog-archived/client/components/home/ArticlePagedList/PaginationSkeleton.vue +++ /dev/null @@ -1,5 +0,0 @@ - diff --git a/blog-archived/client/components/home/ArticlePagedList/index.vue b/blog-archived/client/components/home/ArticlePagedList/index.vue deleted file mode 100644 index 3229641a..00000000 --- a/blog-archived/client/components/home/ArticlePagedList/index.vue +++ /dev/null @@ -1,93 +0,0 @@ - - - - - diff --git a/blog-archived/client/components/layout/CommonSlot.vue b/blog-archived/client/components/layout/CommonSlot.vue index 1e97bd80..bd471bf1 100644 --- a/blog-archived/client/components/layout/CommonSlot.vue +++ b/blog-archived/client/components/layout/CommonSlot.vue @@ -1,6 +1,6 @@