2025-03-28 09:56:51 +08:00

332 lines
6.2 KiB
Plaintext

@import url('/assets/font/index.css');
:root {
// 基础色
--vh-black-color: #34495e; //文字颜色
--vh-white-color: #EDEEF3; //背景颜色
--vh-black-100: rgb(from var(--vh-black-color) r g b);
--vh-black-88: rgb(from var(--vh-black-color) r g b / 88%);
--vh-black-66: rgb(from var(--vh-black-color) r g b / 66%);
--vh-black-56: rgb(from var(--vh-black-color) r g b / 56%);
--vh-black-38: rgb(from var(--vh-black-color) r g b / 38.88%);
--vh-black-28: rgb(from var(--vh-black-color) r g b / 28%);
--vh-black-16: rgb(from var(--vh-black-color) r g b / 16%);
--vh-black-6: rgb(from var(--vh-black-color) r g b / 6%);
--vh-white-100: rgb(from var(--vh-white-color) r g b);
--vh-white-88: rgb(from var(--vh-white-color) r g b / 88%);
--vh-white-66: rgb(from var(--vh-white-color) r g b / 66%);
--vh-white-38: rgb(from var(--vh-white-color) r g b / 38.88%);
--vh-white-28: rgb(from var(--vh-white-color) r g b / 28%);
--vh-white-16: rgb(from var(--vh-white-color) r g b / 16%);
--vh-white-6: rgb(from var(--vh-white-color) r g b / 6%);
// 主题色
--vh-main-color: #EDEEF3;
--vh-main-color-88: rgb(from var(--vh-main-color) r g b / 88%);
--vh-main-color-66: rgb(from var(--vh-main-color) r g b / 66%);
--vh-main-color-56: rgb(from var(--vh-main-color) r g b / 56%);
--vh-main-color-38: rgb(from var(--vh-main-color) r g b / 38.88%);
--vh-main-color-28: rgb(from var(--vh-main-color) r g b / 28%);
--vh-main-color-16: rgb(from var(--vh-main-color) r g b / 16%);
--vh-main-color-6: rgb(from var(--vh-main-color) r g b / 6%);
// Info
--vh-info: #3253b4;
--vh-info-hover: #3253b418;
// Success
--vh-success: #01C4B6;
--vh-success-hover: #01C4B618;
// Warning
--vh-warning: #DD8636;
--vh-warning-hover: #DD863618;
// Error
--vh-error: #DE3C3D;
--vh-error-hover: #DE3C3D18;
// Import
--vh-import: #B984DF;
--vh-import-hover: #B984DF18;
// 尺寸
--vh-size-h1: 1.125rem;
--vh-size-h2: 0.88rem;
--vh-size-h3: 0.8rem;
--vh-size-p: 1rem;
--vh-size-span: 0.875rem;
--vh-size-small: 0.8625rem;
--vh-size-mini: 0.805rem;
--vh-padding-top: calc(66px + 1rem);
--vh-main-max-width: 1388px;
--vh-back-top: calc((calc(100vw - 2rem) - min((100vw - 2rem), var(--vh-main-max-width))) / 2 + 1rem);
}
h1,
h2,
h3,
h4,
h5,
h6,
p,
blockquote {
margin: 0;
padding: 0;
text-decoration: none;
}
span {
text-decoration: none !important;
}
p {
line-height: 2;
}
a {
margin: 0;
padding: 0;
text-decoration: none;
line-height: 1.6;
}
pre,
code {
margin: 0;
padding: 0;
font-family: 'SF Mono' !important;
font-weight: normal;
}
img {
max-width: 100%;
max-height: 100%;
overflow: hidden;
}
* {
color: var(--vh-black-100);
// IOS 点击阴影
-webkit-tap-highlight-color: transparent;
// 隐藏滚动条
scrollbar-width: none;
-ms-overflow-style: none;
// 平滑滚动
scroll-behavior: smooth;
// 消除边框
outline: none; // 隐藏滚动条
::-webkit-scrollbar {
display: none;
}
}
html {
word-wrap: break-word;
overflow-wrap: break-word;
&>body {
position: relative;
margin: 0;
box-sizing: border-box;
padding: var(--vh-padding-top) 0.5rem 0;
display: flex;
flex-direction: column;
align-items: center;
width: 100vw;
height: max-content;
font-family: 'HarmonyOS Sans SC', serif;
font-weight: 400;
cursor: url(/assets/images/default.cur), default;
overflow-x: hidden;
}
// 其他页面Header 封装
header.vh-page-header {
box-sizing: border-box;
padding: 1rem;
width: 100%;
height: max-content;
border-radius: 0.5rem;
background-color: #fff;
box-shadow: 0 3px 8px 6px rgba(7, 17, 27, 0.05);
overflow: hidden;
&>h1 {
padding: 0;
font-size: 1.5rem;
}
&>p {
padding: 0;
font-size: var(--vh-size-p);
line-height: 2;
}
}
}
// 设置图片懒加载样式
main>.vh-container {
img[data-vh-lz-src] {
transition: all 0.18s ease-in;
&:not(.loaded) {
filter: blur(0.88rem) brightness(1);
}
}
}
@media screen and (max-width: 768px) {
// 手机端 禁止选择
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
// 首次加载效果
.vh-animation.vh-animation-init {
opacity: 0;
animation: 300ms vh-init-show;
animation-fill-mode: forwards;
transition: opacity 0.16s ease-in-out, transform 0.16s ease-in-out;
}
// swup 动画效果
html.swup-enabled,
html.is-changing {
.vh-animation {
&.vh-animation-init {
transform: translateY(0);
opacity: 1;
animation: none;
}
}
}
html.is-animating {
.vh-animation {
&.vh-animation-init {
transform: translateY(0.88rem);
opacity: 0;
}
}
}
// 占位加载
.vh-space-loading {
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: center;
grid-column: span 3;
width: 100%;
height: 8.88rem;
overflow: hidden;
&>span {
background-color: #000;
position: relative;
width: 5px;
height: 5px;
margin: 3px;
border-radius: 5px;
&:nth-of-type(1) {
-webkit-animation: scale .8s ease infinite;
animation: vh-loading-animation .8s ease infinite
}
&:nth-of-type(2) {
-webkit-animation: scale .8s ease .2s infinite;
animation: vh-loading-animation .8s ease .2s infinite
}
&:nth-of-type(3) {
-webkit-animation: scale .8s ease .4s infinite;
animation: vh-loading-animation .8s ease .4s infinite
}
}
}
// 谷歌广告模块
.vh-ad {
position: relative;
display: block;
width: 100%;
height: max-content;
min-height: 5.88rem;
overflow: hidden !important;
z-index: 1;
&.vh-article-ad {
margin-bottom: 1rem;
box-sizing: border-box;
padding: 0.75rem;
border-radius: 0.5rem;
background-color: #fff;
box-shadow: 0 3px 8px 6px rgba(7, 17, 27, 0.05);
overflow: hidden;
&::before {
top: 50%;
}
}
&::before {
position: absolute;
left: 50%;
top: 30%;
transform: translate(-50%, -50%);
content: '广告加载中...';
color: #e3e4e6;
z-index: -1;
}
}
@keyframes vh-init-show {
0% {
transform: translateY(2rem);
opacity: 0;
}
100% {
transform: translateY(0);
opacity: 1;
}
}
@keyframes vh-loading-animation {
50% {
height: 25px
}
0% {
height: 5px
}
}
@-webkit-keyframes vh-init-show {
0% {
transform: translateY(2rem);
opacity: 0;
}
100% {
transform: translateY(0);
opacity: 1;
}
}
@-webkit-keyframes vh-loading-animation {
50% {
height: 25px
}
0% {
height: 5px
}
}