feat(fx): 首页与登录页动效层(粒子星座/旋转光环/渐变标题/打字口号/毛玻璃卡片)
- 新增 custom/public/assets/js/qq-fx.js:仅 home 与 signin 两个页面生效, Canvas 粒子星座(DPR<=2、按面积定点数、近邻连线)、口号打字机、 hero 鼠标光斑;prefers-reduced-motion 下只画一帧静态星图 - 新增 custom/public/assets/css/qq-fx.css:光雾漂移、conic 渐变旋转光环、 渐变流动标题、毛玻璃卡片、登录卡片与输入框/渐变按钮重绘; 窄屏 600px 以下压缩光环与标题字号;body overflow-x 裁剪光斑溢出 - home.tmpl 重写 hero 结构;custom/header.tmpl 引入 qq-fx.css; custom/footer.tmpl 引入 qq-fx.js(defer) - 预览侧新增 preview/login.html 独立登录预览;preview.css 补 .ui.form 栅格、 卡片标题居中、窄屏收纳规则;修掉 html,body 的 background 过渡 (headless 截图会冻在过渡起始值,导致深色预览发白) - 未部署:等 QQ 看过预览图再跑 deploy.sh --yes
This commit is contained in:
parent
63f622dbad
commit
dd19bbb341
|
|
@ -0,0 +1,464 @@
|
||||||
|
/*
|
||||||
|
* qq-fx.css —— 首页 / 登录页的动效与氛围层
|
||||||
|
* ---------------------------------------------------------------------------
|
||||||
|
* 加载顺序:theme-qq-*.css → index.css → qq-ui.css → qq-fx.css(本文件)
|
||||||
|
* 因此这里的规则可以放心覆盖前面几层,且全部走 --color-* 变量,深浅色自动跟随。
|
||||||
|
*
|
||||||
|
* 结构:
|
||||||
|
* 1. 全局氛围(只在 body.qq-fx-active 下生效):粒子画布 + 两团缓慢漂移的光雾
|
||||||
|
* 2. 首页 hero:旋转光环 + 渐变标题 + 打字口号 + 鼠标光斑
|
||||||
|
* 3. 首页三卡:毛玻璃 + 悬停抬升 + 顶部渐变细线
|
||||||
|
* 4. 登录页:整块毛玻璃卡片 + 渐变描边 + 输入框聚焦光晕 + 按钮流光
|
||||||
|
* 5. 无障碍:prefers-reduced-motion 全关
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* =========================================================================
|
||||||
|
1. 全局氛围
|
||||||
|
========================================================================= */
|
||||||
|
html {
|
||||||
|
background-color: var(--color-body);
|
||||||
|
}
|
||||||
|
|
||||||
|
body.qq-fx-active {
|
||||||
|
position: relative;
|
||||||
|
min-height: 100vh;
|
||||||
|
overflow-x: hidden;
|
||||||
|
background-color: var(--color-body);
|
||||||
|
}
|
||||||
|
|
||||||
|
#qq-fx-canvas {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
z-index: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 两团极慢漂移的光雾,给纯白/纯黑背景一点体积感 */
|
||||||
|
body.qq-fx-active::before,
|
||||||
|
body.qq-fx-active::after {
|
||||||
|
content: "";
|
||||||
|
position: fixed;
|
||||||
|
z-index: 0;
|
||||||
|
pointer-events: none;
|
||||||
|
border-radius: 50%;
|
||||||
|
filter: blur(70px);
|
||||||
|
opacity: 0.55;
|
||||||
|
will-change: transform;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.qq-fx-active::before {
|
||||||
|
width: 46vw;
|
||||||
|
height: 46vw;
|
||||||
|
left: -12vw;
|
||||||
|
top: -14vw;
|
||||||
|
background: radial-gradient(circle at 50% 50%,
|
||||||
|
color-mix(in srgb, var(--color-primary) 30%, transparent) 0%,
|
||||||
|
transparent 68%);
|
||||||
|
animation: qq-drift-a 26s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.qq-fx-active::after {
|
||||||
|
width: 40vw;
|
||||||
|
height: 40vw;
|
||||||
|
right: -10vw;
|
||||||
|
bottom: -12vw;
|
||||||
|
background: radial-gradient(circle at 50% 50%,
|
||||||
|
color-mix(in srgb, #38BDF8 26%, transparent) 0%,
|
||||||
|
transparent 70%);
|
||||||
|
animation: qq-drift-b 32s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 内容压在氛围层之上 */
|
||||||
|
body.qq-fx-active > .full.height,
|
||||||
|
body.qq-fx-active .page {
|
||||||
|
position: relative;
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes qq-drift-a {
|
||||||
|
0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
|
||||||
|
50% { transform: translate3d(6vw, 5vw, 0) scale(1.12); }
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes qq-drift-b {
|
||||||
|
0%, 100% { transform: translate3d(0, 0, 0) scale(1.05); }
|
||||||
|
50% { transform: translate3d(-5vw, -4vw, 0) scale(0.94); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* =========================================================================
|
||||||
|
2. 首页 hero
|
||||||
|
========================================================================= */
|
||||||
|
.page-content.home.qq-home {
|
||||||
|
padding-top: 6vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-hero {
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
padding: 2vh 0 5vh;
|
||||||
|
text-align: center;
|
||||||
|
--qq-mx: 50%;
|
||||||
|
--qq-my: 40%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 鼠标光斑(JS 只改两个变量) */
|
||||||
|
.qq-hero::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
inset: -8% -20%;
|
||||||
|
z-index: -1;
|
||||||
|
pointer-events: none;
|
||||||
|
background: radial-gradient(320px circle at var(--qq-mx) var(--qq-my),
|
||||||
|
color-mix(in srgb, var(--color-primary) 16%, transparent),
|
||||||
|
transparent 62%);
|
||||||
|
transition: background 0.12s linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 会转的光环 */
|
||||||
|
.qq-logo-halo {
|
||||||
|
position: relative;
|
||||||
|
width: 172px;
|
||||||
|
height: 172px;
|
||||||
|
display: grid;
|
||||||
|
place-items: center;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-logo-halo::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
inset: -13px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: conic-gradient(from 0deg,
|
||||||
|
transparent 0deg 200deg,
|
||||||
|
color-mix(in srgb, var(--color-primary) 85%, transparent) 260deg,
|
||||||
|
#38BDF8 300deg,
|
||||||
|
transparent 340deg);
|
||||||
|
filter: blur(9px);
|
||||||
|
opacity: 0.7;
|
||||||
|
animation: qq-spin 8s linear infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-logo-halo::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
inset: -2px;
|
||||||
|
border-radius: 50%;
|
||||||
|
box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-primary) 22%, transparent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-logo-halo .logo {
|
||||||
|
width: 152px;
|
||||||
|
height: 152px;
|
||||||
|
border-radius: 50%;
|
||||||
|
animation: qq-breathe 6s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes qq-spin {
|
||||||
|
to { transform: rotate(360deg); }
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes qq-breathe {
|
||||||
|
0%, 100% { transform: translateY(0) scale(1); }
|
||||||
|
50% { transform: translateY(-6px) scale(1.03); }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 渐变标题:字色随背景流动 */
|
||||||
|
.qq-hero-title {
|
||||||
|
margin: 0;
|
||||||
|
font-size: clamp(38px, 6.2vw, 66px);
|
||||||
|
font-weight: 800;
|
||||||
|
line-height: 1.1;
|
||||||
|
letter-spacing: -0.02em;
|
||||||
|
background: linear-gradient(100deg,
|
||||||
|
var(--color-text) 6%,
|
||||||
|
var(--color-primary) 38%,
|
||||||
|
#38BDF8 62%,
|
||||||
|
var(--color-text) 94%);
|
||||||
|
background-size: 240% 100%;
|
||||||
|
-webkit-background-clip: text;
|
||||||
|
background-clip: text;
|
||||||
|
color: transparent;
|
||||||
|
-webkit-text-fill-color: transparent;
|
||||||
|
animation: qq-shimmer 9s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes qq-shimmer {
|
||||||
|
0%, 100% { background-position: 0% 50%; }
|
||||||
|
50% { background-position: 100% 50%; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 口号 + 光标 */
|
||||||
|
.qq-hero-tag {
|
||||||
|
min-height: 1.6em;
|
||||||
|
margin: 2px 0 0;
|
||||||
|
font-size: 15px;
|
||||||
|
letter-spacing: 0.04em;
|
||||||
|
color: var(--color-text-light-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-hero-tag.qq-typing::after,
|
||||||
|
.qq-hero-tag.qq-typed::after {
|
||||||
|
content: "▌";
|
||||||
|
margin-left: 2px;
|
||||||
|
color: var(--color-primary);
|
||||||
|
animation: qq-caret 1.1s step-end infinite;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes qq-caret {
|
||||||
|
0%, 49% { opacity: 1; }
|
||||||
|
50%, 100% { opacity: 0; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* =========================================================================
|
||||||
|
3. 首页三卡
|
||||||
|
========================================================================= */
|
||||||
|
.qq-home-cards {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
|
||||||
|
gap: 16px;
|
||||||
|
max-width: 980px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0 0 9vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-home-card {
|
||||||
|
position: relative;
|
||||||
|
padding: 20px 22px;
|
||||||
|
border: 1px solid var(--color-secondary);
|
||||||
|
border-radius: 16px;
|
||||||
|
background: color-mix(in srgb, var(--color-box-body) 72%, transparent);
|
||||||
|
backdrop-filter: blur(14px);
|
||||||
|
-webkit-backdrop-filter: blur(14px);
|
||||||
|
overflow: hidden;
|
||||||
|
transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1),
|
||||||
|
border-color 0.3s ease, box-shadow 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 悬停时从顶部扫过的一条渐变细线 */
|
||||||
|
.qq-home-card::after {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
height: 2px;
|
||||||
|
width: 100%;
|
||||||
|
background: linear-gradient(90deg, transparent, var(--color-primary), #38BDF8, transparent);
|
||||||
|
transform: scaleX(0);
|
||||||
|
transform-origin: left center;
|
||||||
|
transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-home-card:hover {
|
||||||
|
transform: translateY(-6px);
|
||||||
|
border-color: color-mix(in srgb, var(--color-primary) 45%, transparent);
|
||||||
|
box-shadow: 0 20px 44px -22px color-mix(in srgb, var(--color-primary) 60%, transparent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-home-card:hover::after {
|
||||||
|
transform: scaleX(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-home-card h3 {
|
||||||
|
margin: 0 0 8px;
|
||||||
|
font-size: 15px;
|
||||||
|
font-weight: 600;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
color: var(--color-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-home-card h3 svg {
|
||||||
|
color: var(--color-primary);
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-home-card p {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 13px;
|
||||||
|
line-height: 1.75;
|
||||||
|
color: var(--color-text-light-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* =========================================================================
|
||||||
|
4. 登录页
|
||||||
|
========================================================================= */
|
||||||
|
.page-content.user.signin .ui.middle.very.relaxed.page.grid {
|
||||||
|
margin-top: 5vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content.user.signin .ui.container.column.fluid {
|
||||||
|
position: relative;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 430px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 卡片外发光 */
|
||||||
|
.page-content.user.signin .ui.container.column.fluid::before {
|
||||||
|
content: "";
|
||||||
|
position: absolute;
|
||||||
|
inset: -2px;
|
||||||
|
z-index: -1;
|
||||||
|
border-radius: 22px;
|
||||||
|
background: linear-gradient(135deg,
|
||||||
|
color-mix(in srgb, var(--color-primary) 55%, transparent),
|
||||||
|
transparent 45%,
|
||||||
|
color-mix(in srgb, #38BDF8 45%, transparent));
|
||||||
|
filter: blur(14px);
|
||||||
|
opacity: 0.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 顶部标题:从「贴附表头」变成卡片标题 */
|
||||||
|
.page-content.user.signin h4.ui.top.attached.header.center {
|
||||||
|
margin: 0;
|
||||||
|
padding: 26px 0 10px;
|
||||||
|
border: 1px solid var(--color-secondary);
|
||||||
|
border-bottom: 0;
|
||||||
|
border-radius: 18px 18px 0 0;
|
||||||
|
background: color-mix(in srgb, var(--color-box-body) 78%, transparent);
|
||||||
|
backdrop-filter: blur(18px);
|
||||||
|
-webkit-backdrop-filter: blur(18px);
|
||||||
|
font-size: 20px;
|
||||||
|
font-weight: 700;
|
||||||
|
letter-spacing: 0.06em;
|
||||||
|
color: var(--color-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 表单主体:毛玻璃卡片 */
|
||||||
|
.page-content.user.signin .ui.attached.segment {
|
||||||
|
margin: 0;
|
||||||
|
padding: 18px 24px 26px;
|
||||||
|
border: 1px solid var(--color-secondary);
|
||||||
|
border-top: 0;
|
||||||
|
border-radius: 0 0 18px 18px;
|
||||||
|
background: color-mix(in srgb, var(--color-box-body) 78%, transparent);
|
||||||
|
backdrop-filter: blur(18px);
|
||||||
|
-webkit-backdrop-filter: blur(18px);
|
||||||
|
box-shadow: 0 30px 70px -40px color-mix(in srgb, var(--color-primary) 75%, transparent);
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 登录/注册/OpenID 三个页签,收成卡片顶部的一条 */
|
||||||
|
.page-content.user.signin .new-menu.navbar {
|
||||||
|
margin: 0 auto;
|
||||||
|
max-width: 430px;
|
||||||
|
border-bottom: 1px solid var(--color-secondary);
|
||||||
|
background: transparent;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content.user.signin .new-menu.navbar .item {
|
||||||
|
padding: 10px 14px;
|
||||||
|
font-size: 13px;
|
||||||
|
border-radius: 8px 8px 0 0;
|
||||||
|
transition: color 0.2s ease, background 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content.user.signin .new-menu.navbar .item.active {
|
||||||
|
color: var(--color-primary);
|
||||||
|
background: color-mix(in srgb, var(--color-primary) 10%, transparent);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 输入框:圆角 + 聚焦光晕 */
|
||||||
|
.page-content.user.signin .ui.form .field input {
|
||||||
|
padding: 11px 14px;
|
||||||
|
border-radius: 10px;
|
||||||
|
border: 1px solid var(--color-input-border, var(--color-secondary));
|
||||||
|
background: var(--color-input-background, var(--color-body));
|
||||||
|
color: var(--color-input-text, var(--color-text));
|
||||||
|
transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 复选框文字在深色下别丢 */
|
||||||
|
.page-content.user.signin .ui.checkbox label {
|
||||||
|
color: var(--color-text-light-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content.user.signin .ui.form .field > label {
|
||||||
|
color: var(--color-text-light-2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content.user.signin .ui.form .field input:focus {
|
||||||
|
border-color: var(--color-primary);
|
||||||
|
box-shadow: 0 0 0 4px color-mix(in srgb, var(--color-primary) 18%, transparent);
|
||||||
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 主按钮:渐变底 + 悬停流光 */
|
||||||
|
.page-content.user.signin .ui.primary.button {
|
||||||
|
position: relative;
|
||||||
|
min-width: 108px;
|
||||||
|
border: 0;
|
||||||
|
border-radius: 10px;
|
||||||
|
background: linear-gradient(120deg, var(--color-primary), #38BDF8 55%, var(--color-primary));
|
||||||
|
background-size: 200% 100%;
|
||||||
|
box-shadow: 0 10px 24px -12px color-mix(in srgb, var(--color-primary) 85%, transparent);
|
||||||
|
transition: background-position 0.5s ease, transform 0.15s ease, box-shadow 0.3s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content.user.signin .ui.primary.button:hover {
|
||||||
|
background-position: 100% 0;
|
||||||
|
transform: translateY(-1px);
|
||||||
|
box-shadow: 0 14px 28px -12px color-mix(in srgb, var(--color-primary) 90%, transparent);
|
||||||
|
}
|
||||||
|
|
||||||
|
.page-content.user.signin .ui.primary.button:active {
|
||||||
|
transform: translateY(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 「记住此设备」这类复选框也跟着主色走 */
|
||||||
|
.page-content.user.signin .ui.checkbox input:checked ~ label::before,
|
||||||
|
.page-content.user.signin .ui.checkbox label::before {
|
||||||
|
border-color: var(--color-secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* =========================================================================
|
||||||
|
5. 减少动态效果
|
||||||
|
========================================================================= */
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
/* 过渡也一并压掉:主题在 JS 切换时有 200ms 过渡,弱动画用户不应看到它 */
|
||||||
|
*,
|
||||||
|
*::before,
|
||||||
|
*::after {
|
||||||
|
transition-duration: 0.01ms !important;
|
||||||
|
animation-duration: 0.01ms !important;
|
||||||
|
animation-iteration-count: 1 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
body.qq-fx-active::before,
|
||||||
|
body.qq-fx-active::after,
|
||||||
|
.qq-logo-halo::before,
|
||||||
|
.qq-logo-halo .logo,
|
||||||
|
.qq-hero-title {
|
||||||
|
animation: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-hero-tag.qq-typing::after,
|
||||||
|
.qq-hero-tag.qq-typed::after {
|
||||||
|
animation: none;
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.qq-home-card,
|
||||||
|
.qq-home-card::after,
|
||||||
|
.page-content.user.signin .ui.primary.button {
|
||||||
|
transition: none !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 窄屏:光环缩小,卡片贴边 */
|
||||||
|
@media (max-width: 600px) {
|
||||||
|
.qq-logo-halo { width: 132px; height: 132px; }
|
||||||
|
.qq-logo-halo .logo { width: 118px; height: 118px; }
|
||||||
|
.qq-hero { padding: 3vh 0 6vh; gap: 8px; }
|
||||||
|
.qq-hero-title { font-size: clamp(32px, 11vw, 46px); }
|
||||||
|
.qq-hero-tag { font-size: 14px; }
|
||||||
|
.qq-home-cards { padding: 0 16px 9vh; }
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,183 @@
|
||||||
|
/*
|
||||||
|
* qq-fx.js —— 首页 / 登录页的「炫酷」动效层(纯前端,无依赖)
|
||||||
|
* ---------------------------------------------------------------------------
|
||||||
|
* 只在两处生效:.page-content.home(首页)、.page-content.user.signin(登录页)。
|
||||||
|
* 其余页面直接 return,一点开销都不加。
|
||||||
|
*
|
||||||
|
* 做三件事:
|
||||||
|
* 1. 背景粒子星座(canvas,40 个慢速漂移的点 + 近邻连线,颜色取 --color-primary)
|
||||||
|
* 2. 首页大标题下的口号打字机(data-qq-type),打完留着光标闪烁
|
||||||
|
* 3. 首页 hero 跟随鼠标的柔和光斑(只改两个 CSS 变量,不做重排)
|
||||||
|
*
|
||||||
|
* 三处护栏:
|
||||||
|
* - prefers-reduced-motion: reduce → 全部动画关闭,只留静态样式
|
||||||
|
* - 标签页切到后台 → 停掉 rAF,回来再继续
|
||||||
|
* - 设备像素比封顶 2,避免 4K 屏把 canvas 撑爆
|
||||||
|
*/
|
||||||
|
(function () {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var page = document.querySelector('.page-content.home, .page-content.user.signin');
|
||||||
|
if (!page) return;
|
||||||
|
|
||||||
|
var isHome = page.classList.contains('home');
|
||||||
|
var body = document.body;
|
||||||
|
body.classList.add('qq-fx-active', isHome ? 'qq-fx-home' : 'qq-fx-login');
|
||||||
|
|
||||||
|
var reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;
|
||||||
|
|
||||||
|
/* ---------------- 1. 背景粒子星座 ---------------- */
|
||||||
|
function initParticles() {
|
||||||
|
var canvas = document.createElement('canvas');
|
||||||
|
canvas.id = 'qq-fx-canvas';
|
||||||
|
canvas.setAttribute('aria-hidden', 'true');
|
||||||
|
body.appendChild(canvas);
|
||||||
|
|
||||||
|
var ctx = canvas.getContext('2d');
|
||||||
|
var dpr = Math.min(window.devicePixelRatio || 1, 2);
|
||||||
|
var w = 0, h = 0, dots = [], raf = 0, running = true;
|
||||||
|
|
||||||
|
function accent() {
|
||||||
|
var v = getComputedStyle(body).getPropertyValue('--color-primary').trim();
|
||||||
|
return v || '#3B82F6';
|
||||||
|
}
|
||||||
|
var color = accent();
|
||||||
|
var LINK_DIST = 132;
|
||||||
|
|
||||||
|
function resize() {
|
||||||
|
w = canvas.clientWidth;
|
||||||
|
h = canvas.clientHeight;
|
||||||
|
canvas.width = Math.round(w * dpr);
|
||||||
|
canvas.height = Math.round(h * dpr);
|
||||||
|
ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
|
||||||
|
// 点数量跟面积走,手机少一点
|
||||||
|
var count = Math.max(18, Math.min(44, Math.round((w * h) / 42000)));
|
||||||
|
dots = [];
|
||||||
|
for (var i = 0; i < count; i++) {
|
||||||
|
dots.push({
|
||||||
|
x: Math.random() * w,
|
||||||
|
y: Math.random() * h,
|
||||||
|
vx: (Math.random() - 0.5) * 0.22,
|
||||||
|
vy: (Math.random() - 0.5) * 0.22,
|
||||||
|
r: 1 + Math.random() * 1.6
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function frame() {
|
||||||
|
ctx.clearRect(0, 0, w, h);
|
||||||
|
|
||||||
|
for (var i = 0; i < dots.length; i++) {
|
||||||
|
var d = dots[i];
|
||||||
|
d.x += d.vx;
|
||||||
|
d.y += d.vy;
|
||||||
|
if (d.x < -20) d.x = w + 20;
|
||||||
|
if (d.x > w + 20) d.x = -20;
|
||||||
|
if (d.y < -20) d.y = h + 20;
|
||||||
|
if (d.y > h + 20) d.y = -20;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 近邻连线
|
||||||
|
ctx.lineWidth = 1;
|
||||||
|
for (var a = 0; a < dots.length; a++) {
|
||||||
|
for (var b = a + 1; b < dots.length; b++) {
|
||||||
|
var dx = dots[a].x - dots[b].x;
|
||||||
|
var dy = dots[a].y - dots[b].y;
|
||||||
|
var dist = Math.sqrt(dx * dx + dy * dy);
|
||||||
|
if (dist > LINK_DIST) continue;
|
||||||
|
ctx.globalAlpha = (1 - dist / LINK_DIST) * 0.18;
|
||||||
|
ctx.strokeStyle = color;
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.moveTo(dots[a].x, dots[a].y);
|
||||||
|
ctx.lineTo(dots[b].x, dots[b].y);
|
||||||
|
ctx.stroke();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 点
|
||||||
|
ctx.globalAlpha = 0.55;
|
||||||
|
ctx.fillStyle = color;
|
||||||
|
for (var k = 0; k < dots.length; k++) {
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc(dots[k].x, dots[k].y, dots[k].r, 0, Math.PI * 2);
|
||||||
|
ctx.fill();
|
||||||
|
}
|
||||||
|
ctx.globalAlpha = 1;
|
||||||
|
|
||||||
|
if (running) raf = requestAnimationFrame(frame);
|
||||||
|
}
|
||||||
|
|
||||||
|
resize();
|
||||||
|
window.addEventListener('resize', function () {
|
||||||
|
cancelAnimationFrame(raf);
|
||||||
|
resize();
|
||||||
|
if (running) raf = requestAnimationFrame(frame);
|
||||||
|
});
|
||||||
|
|
||||||
|
// 深浅色切换后换一版粒子颜色
|
||||||
|
var mq = window.matchMedia('(prefers-color-scheme: dark)');
|
||||||
|
if (mq.addEventListener) {
|
||||||
|
mq.addEventListener('change', function () {
|
||||||
|
setTimeout(function () { color = accent(); }, 50);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('visibilitychange', function () {
|
||||||
|
if (document.hidden) {
|
||||||
|
running = false;
|
||||||
|
cancelAnimationFrame(raf);
|
||||||
|
} else if (!reduceMotion) {
|
||||||
|
running = true;
|
||||||
|
raf = requestAnimationFrame(frame);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
if (reduceMotion) {
|
||||||
|
// 关掉动画:只画一帧静态星座
|
||||||
|
running = false;
|
||||||
|
frame();
|
||||||
|
} else {
|
||||||
|
raf = requestAnimationFrame(frame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------------- 2. 口号打字机 ---------------- */
|
||||||
|
function initTyping() {
|
||||||
|
var el = document.querySelector('[data-qq-type]');
|
||||||
|
if (!el) return;
|
||||||
|
var text = (el.getAttribute('data-qq-type') || el.textContent || '').trim();
|
||||||
|
if (!text) return;
|
||||||
|
if (reduceMotion) { el.textContent = text; el.classList.add('qq-typed'); return; }
|
||||||
|
|
||||||
|
el.textContent = '';
|
||||||
|
el.classList.add('qq-typing');
|
||||||
|
var i = 0;
|
||||||
|
var timer = setInterval(function () {
|
||||||
|
el.textContent = text.slice(0, ++i);
|
||||||
|
if (i >= text.length) {
|
||||||
|
clearInterval(timer);
|
||||||
|
el.classList.remove('qq-typing');
|
||||||
|
el.classList.add('qq-typed');
|
||||||
|
}
|
||||||
|
}, 95);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ---------------- 3. hero 跟随鼠标的光斑 ---------------- */
|
||||||
|
function initSpotlight() {
|
||||||
|
var hero = document.querySelector('.qq-hero');
|
||||||
|
if (!hero || reduceMotion) return;
|
||||||
|
hero.addEventListener('mousemove', function (e) {
|
||||||
|
var r = hero.getBoundingClientRect();
|
||||||
|
hero.style.setProperty('--qq-mx', (e.clientX - r.left) + 'px');
|
||||||
|
hero.style.setProperty('--qq-my', (e.clientY - r.top) + 'px');
|
||||||
|
});
|
||||||
|
hero.addEventListener('mouseleave', function () {
|
||||||
|
hero.style.setProperty('--qq-mx', '50%');
|
||||||
|
hero.style.setProperty('--qq-my', '40%');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
initParticles();
|
||||||
|
initTyping();
|
||||||
|
initSpotlight();
|
||||||
|
})();
|
||||||
|
|
@ -10,3 +10,9 @@
|
||||||
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer">X ICP 备 XXXXXXXX 号</a>
|
<a href="https://beian.miit.gov.cn/" target="_blank" rel="noopener noreferrer">X ICP 备 XXXXXXXX 号</a>
|
||||||
</div>
|
</div>
|
||||||
*/}}
|
*/}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
动效层:只在首页(.page-content.home)和登录页(.page-content.user.signin)生效,
|
||||||
|
其它页面 qq-fx.js 里第一行就 return,不会加载 canvas、不会挂 rAF。
|
||||||
|
*/}}
|
||||||
|
<script src="{{AssetUrlPrefix}}/js/qq-fx.js" defer></script>
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@
|
||||||
*/}}
|
*/}}
|
||||||
<link rel="preload" href="{{AssetUrlPrefix}}/fonts/jetbrains-mono-latin-400-normal.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
<link rel="preload" href="{{AssetUrlPrefix}}/fonts/jetbrains-mono-latin-400-normal.woff2" as="font" type="font/woff2" crossorigin="anonymous">
|
||||||
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/qq-ui.css">
|
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/qq-ui.css">
|
||||||
|
<link rel="stylesheet" href="{{AssetUrlPrefix}}/css/qq-fx.css">
|
||||||
<meta name="theme-color" content="#60A5FA" media="(prefers-color-scheme: light)">
|
<meta name="theme-color" content="#60A5FA" media="(prefers-color-scheme: light)">
|
||||||
<meta name="theme-color" content="#0D1117" media="(prefers-color-scheme: dark)">
|
<meta name="theme-color" content="#0D1117" media="(prefers-color-scheme: dark)">
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,16 +1,19 @@
|
||||||
{{/* home.tmpl —— 未登录首页(基于 Gitea 1.21.11 官方 home.tmpl 精简)
|
{{/* home.tmpl —— 未登录首页(基于 Gitea 1.21.11 官方 home.tmpl 精简)
|
||||||
改动:四栏宣传块 → 三张克制的小卡片;大 Logo 居中;文案沿用官方 i18n key,不硬编码中文。
|
改动:
|
||||||
|
· 四栏宣传块 → 三张毛玻璃小卡片
|
||||||
|
· Logo 套旋转光环,标题走渐变流动,口号打字机(动效在 qq-fx.css / qq-fx.js)
|
||||||
|
· 文案沿用官方 i18n key,不硬编码中文(口号除外,它已经是我们自己的文案)
|
||||||
这是**模板覆盖**,不改源码,删掉本文件即回到官方首页。 */}}
|
这是**模板覆盖**,不改源码,删掉本文件即回到官方首页。 */}}
|
||||||
{{template "base/head" .}}
|
{{template "base/head" .}}
|
||||||
<div role="main" aria-label="{{ctx.Locale.Tr "home"}}" class="page-content home">
|
<div role="main" aria-label="{{ctx.Locale.Tr "home"}}" class="page-content home qq-home">
|
||||||
<div class="gt-mb-5 gt-px-5">
|
<div class="gt-px-5">
|
||||||
<div class="center">
|
<div class="qq-hero">
|
||||||
<img class="logo" width="168" height="168" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}">
|
<div class="qq-logo-halo">
|
||||||
<div class="hero">
|
<img class="logo" width="152" height="152" src="{{AssetUrlPrefix}}/img/logo.svg" alt="{{ctx.Locale.Tr "logo"}}">
|
||||||
<h1 class="ui icon header title">{{AppName}}</h1>
|
|
||||||
{{/* 品牌口号:想换回官方文案就恢复下面注释里那行 {{ctx.Locale.Tr "startpage.app_desc"}} */}}
|
|
||||||
<h2>自己的代码,自己的地方。</h2>
|
|
||||||
</div>
|
</div>
|
||||||
|
<h1 class="qq-hero-title">{{AppName}}</h1>
|
||||||
|
{{/* 品牌口号:想换回官方文案就换成 {{ctx.Locale.Tr "startpage.app_desc"}} */}}
|
||||||
|
<p class="qq-hero-tag" data-qq-type="自己的代码,自己的地方。">自己的代码,自己的地方。</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<link id="css-auto" rel="stylesheet" href="../custom/public/assets/css/theme-qq-auto.css">
|
||||||
|
<link id="css-light" rel="stylesheet" href="../custom/public/assets/css/theme-qq-light.css" disabled>
|
||||||
|
<link id="css-dark" rel="stylesheet" href="../custom/public/assets/css/theme-qq-dark.css" disabled>
|
||||||
|
<link rel="stylesheet" href="../custom/public/assets/css/qq-ui.css">
|
||||||
|
<link rel="stylesheet" href="../custom/public/assets/css/qq-fx.css">
|
||||||
|
<link rel="stylesheet" href="preview.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<pre id="out">pending</pre>
|
||||||
|
<div class="page-content user signin">
|
||||||
|
<div class="ui middle very relaxed page grid">
|
||||||
|
<div class="ui container column fluid">
|
||||||
|
<h4 class="ui top attached header center">登录</h4>
|
||||||
|
<div class="ui attached segment">
|
||||||
|
<form class="ui form">
|
||||||
|
<div class="required inline field"><label for="u">user</label><input id="u" type="text"></div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="app.js"></script>
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
var cs = getComputedStyle;
|
||||||
|
var html = document.documentElement, body = document.body;
|
||||||
|
var inp = document.getElementById('u');
|
||||||
|
var sheets = [].map.call(document.styleSheets, function (s) {
|
||||||
|
var n = 0;
|
||||||
|
try { n = s.cssRules.length; } catch (e) { n = -1; }
|
||||||
|
return (s.href || '').split('/').pop() + ' rules=' + n + ' disabled=' + (s.disabled);
|
||||||
|
});
|
||||||
|
var lines = [
|
||||||
|
'theme param = ' + new URLSearchParams(location.search).get('theme'),
|
||||||
|
'--color-body html = ' + cs(html).getPropertyValue('--color-body').trim(),
|
||||||
|
'--color-body body = ' + cs(body).getPropertyValue('--color-body').trim(),
|
||||||
|
'--color-body input = ' + cs(inp).getPropertyValue('--color-body').trim(),
|
||||||
|
'--input-bg input = ' + cs(inp).getPropertyValue('--color-input-background').trim(),
|
||||||
|
'html bg = ' + cs(html).backgroundColor + ' | body bg = ' + cs(body).backgroundColor,
|
||||||
|
'input bg = ' + cs(inp).backgroundColor + ' | border = ' + cs(inp).borderTopColor,
|
||||||
|
'sheets: ' + sheets.join(' ;; ')
|
||||||
|
];
|
||||||
|
document.getElementById('out').textContent = lines.join('\n');
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -29,3 +29,18 @@
|
||||||
try { saved = localStorage.getItem('qq-preview-theme'); } catch (e) { /* ignore */ }
|
try { saved = localStorage.getItem('qq-preview-theme'); } catch (e) { /* ignore */ }
|
||||||
apply(saved && links[saved] ? saved : 'auto');
|
apply(saved && links[saved] ? saved : 'auto');
|
||||||
})();
|
})();
|
||||||
|
|
||||||
|
|
||||||
|
/* ?only=login —— 只显示登录页演示区(方便单独截图/对比) */
|
||||||
|
(function () {
|
||||||
|
var only = new URLSearchParams(location.search).get('only');
|
||||||
|
if (only !== 'login') return;
|
||||||
|
var page = document.querySelector('.page');
|
||||||
|
if (!page) return;
|
||||||
|
var keep = document.getElementById('login-demo');
|
||||||
|
var label = keep && keep.previousElementSibling;
|
||||||
|
Array.prototype.forEach.call(page.children, function (el) {
|
||||||
|
if (el === keep || el === label) return;
|
||||||
|
el.style.display = 'none';
|
||||||
|
});
|
||||||
|
})();
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
<link id="css-light" rel="stylesheet" href="../custom/public/assets/css/theme-qq-light.css" disabled>
|
<link id="css-light" rel="stylesheet" href="../custom/public/assets/css/theme-qq-light.css" disabled>
|
||||||
<link id="css-dark" rel="stylesheet" href="../custom/public/assets/css/theme-qq-dark.css" disabled>
|
<link id="css-dark" rel="stylesheet" href="../custom/public/assets/css/theme-qq-dark.css" disabled>
|
||||||
<link rel="stylesheet" href="../custom/public/assets/css/qq-ui.css">
|
<link rel="stylesheet" href="../custom/public/assets/css/qq-ui.css">
|
||||||
|
<link rel="stylesheet" href="../custom/public/assets/css/qq-fx.css">
|
||||||
<link rel="stylesheet" href="preview.css">
|
<link rel="stylesheet" href="preview.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
@ -39,11 +40,15 @@
|
||||||
<!-- ============ 1. 未登录首页 ============ -->
|
<!-- ============ 1. 未登录首页 ============ -->
|
||||||
<div class="section-label">首页(未登录 · custom/templates/home.tmpl)</div>
|
<div class="section-label">首页(未登录 · custom/templates/home.tmpl)</div>
|
||||||
<div class="segment" style="padding-bottom:34px">
|
<div class="segment" style="padding-bottom:34px">
|
||||||
<div class="hero-home">
|
<div class="page-content home qq-home" style="padding-top:0">
|
||||||
<img src="../custom/public/assets/img/logo.svg" alt="logo">
|
<div class="qq-hero">
|
||||||
<h1>QQGit</h1>
|
<div class="qq-logo-halo">
|
||||||
<h2>自己的代码,自己的地方。</h2>
|
<img class="logo" src="../custom/public/assets/img/logo.svg" alt="logo">
|
||||||
<div class="qq-home-cards" style="max-width:900px;margin:32px auto 0">
|
</div>
|
||||||
|
<h1 class="qq-hero-title">QQGit</h1>
|
||||||
|
<p class="qq-hero-tag" data-qq-type="自己的代码,自己的地方。">自己的代码,自己的地方。</p>
|
||||||
|
</div>
|
||||||
|
<div class="qq-home-cards" style="max-width:900px;margin:8px auto 0">
|
||||||
<div class="qq-home-card">
|
<div class="qq-home-card">
|
||||||
<h3><span>◆</span>跨平台</h3>
|
<h3><span>◆</span>跨平台</h3>
|
||||||
<p>支持 Linux、macOS 和 Windows,从 x86 到 ARM 再到 PowerPC 均可运行。</p>
|
<p>支持 Linux、macOS 和 Windows,从 x86 到 ARM 再到 PowerPC 均可运行。</p>
|
||||||
|
|
@ -57,6 +62,7 @@
|
||||||
<p>MIT 协议,社区驱动,所有代码与决策都完全开放透明。</p>
|
<p>MIT 协议,社区驱动,所有代码与决策都完全开放透明。</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -169,11 +175,52 @@ DARK_PRIMARY = <span style="color:var(--color-primary)">"#38BDF8"</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- ============ 6. 登录页(/user/login) ============ -->
|
||||||
|
<div class="section-label">登录页(user/login · 纯 CSS 改造,不覆盖模板)</div>
|
||||||
|
<div class="segment" id="login-demo" style="padding:26px 20px 30px">
|
||||||
|
<div class="page-content user signin">
|
||||||
|
<div class="new-menu navbar" style="display:flex;gap:4px;justify-content:center">
|
||||||
|
<a class="item active">登录</a>
|
||||||
|
<a class="item">注册帐号</a>
|
||||||
|
<a class="item">OpenID</a>
|
||||||
|
</div>
|
||||||
|
<div class="ui middle very relaxed page grid">
|
||||||
|
<div class="ui container column fluid">
|
||||||
|
<h4 class="ui top attached header center">登录</h4>
|
||||||
|
<div class="ui attached segment">
|
||||||
|
<form class="ui form">
|
||||||
|
<div class="required inline field">
|
||||||
|
<label for="p-user">用户名或邮箱</label>
|
||||||
|
<input id="p-user" type="text" placeholder="">
|
||||||
|
</div>
|
||||||
|
<div class="required inline field">
|
||||||
|
<label for="p-pass">密码</label>
|
||||||
|
<input id="p-pass" type="password">
|
||||||
|
</div>
|
||||||
|
<div class="inline field">
|
||||||
|
<div class="ui checkbox"><input type="checkbox" id="p-remember"><label for="p-remember">记住此设备</label></div>
|
||||||
|
</div>
|
||||||
|
<div class="inline field">
|
||||||
|
<button class="ui primary button" type="button">登录</button>
|
||||||
|
<a href="#" style="margin-left:10px">忘记密码?</a>
|
||||||
|
</div>
|
||||||
|
<div class="inline field">
|
||||||
|
<a href="#">还没帐户?马上注册。</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="page-footer qq-icp-footer">
|
<div class="page-footer qq-icp-footer">
|
||||||
<a class="qq-icp" href="https://beian.miit.gov.cn/">粤ICP备________号</a>
|
<a class="qq-icp" href="https://beian.miit.gov.cn/">闽ICP备2023002932号</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script src="../custom/public/assets/js/qq-fx.js" defer></script>
|
||||||
<script src="app.js"></script>
|
<script src="app.js"></script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN" data-theme="auto">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<title>QQGit · 登录页预览</title>
|
||||||
|
|
||||||
|
<!-- 与线上一致的加载顺序:主题 → qq-ui → qq-fx -->
|
||||||
|
<link id="css-auto" rel="stylesheet" href="../custom/public/assets/css/theme-qq-auto.css">
|
||||||
|
<link id="css-light" rel="stylesheet" href="../custom/public/assets/css/theme-qq-light.css" disabled>
|
||||||
|
<link id="css-dark" rel="stylesheet" href="../custom/public/assets/css/theme-qq-dark.css" disabled>
|
||||||
|
<link rel="stylesheet" href="../custom/public/assets/css/qq-ui.css">
|
||||||
|
<link rel="stylesheet" href="../custom/public/assets/css/qq-fx.css">
|
||||||
|
<link rel="stylesheet" href="preview.css">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="switcher" role="group" aria-label="主题切换">
|
||||||
|
<button data-mode="light">浅色</button>
|
||||||
|
<button data-mode="auto" class="on">自动</button>
|
||||||
|
<button data-mode="dark">深色</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<nav id="navbar">
|
||||||
|
<a id="navbar-logo" href="#"><img src="../custom/public/assets/img/logo.svg" alt="logo"></a>
|
||||||
|
<a class="nav-item" href="#">探索</a>
|
||||||
|
<a class="nav-item" href="#">帮助</a>
|
||||||
|
<span class="nav-spacer"></span>
|
||||||
|
<a class="nav-item" href="#">注册</a>
|
||||||
|
<a class="nav-item active" href="#">登录</a>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div class="page" style="padding-top:6vh">
|
||||||
|
<div class="page-content user signin">
|
||||||
|
<div class="new-menu navbar" style="display:flex;gap:4px;justify-content:center">
|
||||||
|
<a class="item active">登录</a>
|
||||||
|
<a class="item">注册帐号</a>
|
||||||
|
<a class="item">OpenID</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="ui middle very relaxed page grid">
|
||||||
|
<div class="ui container column fluid">
|
||||||
|
<h4 class="ui top attached header center">登录</h4>
|
||||||
|
<div class="ui attached segment">
|
||||||
|
<form class="ui form">
|
||||||
|
<div class="required inline field">
|
||||||
|
<label for="p-user">用户名或邮箱</label>
|
||||||
|
<input id="p-user" type="text">
|
||||||
|
</div>
|
||||||
|
<div class="required inline field">
|
||||||
|
<label for="p-pass">密码</label>
|
||||||
|
<input id="p-pass" type="password">
|
||||||
|
</div>
|
||||||
|
<div class="inline field checkbox-row">
|
||||||
|
<div class="ui checkbox"><input type="checkbox" id="p-remember"><label for="p-remember">记住此设备</label></div>
|
||||||
|
</div>
|
||||||
|
<div class="inline field submit-row">
|
||||||
|
<button class="ui primary button" type="button">登录</button>
|
||||||
|
<a href="#" style="margin-left:10px">忘记密码?</a>
|
||||||
|
</div>
|
||||||
|
<div class="inline field link-row">
|
||||||
|
<a href="#">还没帐户?马上注册。</a>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="page-footer qq-icp-footer">
|
||||||
|
<a class="qq-icp" href="https://beian.miit.gov.cn/">闽ICP备2023002932号</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="../custom/public/assets/js/qq-fx.js" defer></script>
|
||||||
|
<script src="app.js"></script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
@ -14,7 +14,6 @@ html, body {
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
|
||||||
"Hiragino Sans GB", "Microsoft YaHei", sans-serif;
|
"Hiragino Sans GB", "Microsoft YaHei", sans-serif;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
transition: background 200ms ease, color 200ms ease;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
a { color: var(--color-primary); text-decoration: none; }
|
a { color: var(--color-primary); text-decoration: none; }
|
||||||
|
|
@ -244,3 +243,57 @@ pre {
|
||||||
body {
|
body {
|
||||||
padding-bottom: 44px;
|
padding-bottom: 44px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------
|
||||||
|
离线预览用:复刻 Gitea/Fomantic 的 .ui.form 布局(label 在左、输入框在右)
|
||||||
|
线上这套来自 index.css,预览页没有,所以这里补一份最小实现。
|
||||||
|
------------------------------------------------------------------ */
|
||||||
|
.ui.form .field {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 14px;
|
||||||
|
margin: 0 0 14px;
|
||||||
|
}
|
||||||
|
.ui.form .field > label {
|
||||||
|
flex: 0 0 96px;
|
||||||
|
text-align: right;
|
||||||
|
font-size: 13px;
|
||||||
|
color: var(--color-text-light-2);
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
.ui.form .field > input {
|
||||||
|
flex: 1 1 auto;
|
||||||
|
min-width: 0;
|
||||||
|
}
|
||||||
|
.ui.form .field.checkbox-field,
|
||||||
|
.ui.form .inline.field:last-child {
|
||||||
|
justify-content: flex-start;
|
||||||
|
}
|
||||||
|
.ui.checkbox {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 6px;
|
||||||
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 这几行没有 label,靠 gap 对齐即可 */
|
||||||
|
.ui.form .field.checkbox-row,
|
||||||
|
.ui.form .field.submit-row,
|
||||||
|
.ui.form .field.link-row {
|
||||||
|
justify-content: flex-start;
|
||||||
|
margin-left: 110px;
|
||||||
|
}
|
||||||
|
.ui.form .field.submit-row { margin-bottom: 10px; }
|
||||||
|
|
||||||
|
/* 卡片标题居中(线上由 Fomantic 的 .center 提供) */
|
||||||
|
.ui.header.center { text-align: center; }
|
||||||
|
|
||||||
|
/* ------------------------------------------------------------------
|
||||||
|
预览页自身在窄屏下的收纳(线上 Gitea 的导航会折叠成汉堡菜单,
|
||||||
|
这里不做那么复杂的复刻,直接把桌面向导和主题切换藏起来)
|
||||||
|
------------------------------------------------------------------ */
|
||||||
|
@media (max-width: 620px) {
|
||||||
|
html, body { max-width: 100%; overflow-x: hidden; }
|
||||||
|
#navbar { position: static; overflow: hidden; }
|
||||||
|
#navbar .switcher { display: none; }
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue