diff --git a/custom/public/assets/css/qq-fx.css b/custom/public/assets/css/qq-fx.css new file mode 100644 index 0000000..340b2a8 --- /dev/null +++ b/custom/public/assets/css/qq-fx.css @@ -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; } +} diff --git a/custom/public/assets/js/qq-fx.js b/custom/public/assets/js/qq-fx.js new file mode 100644 index 0000000..e61bb13 --- /dev/null +++ b/custom/public/assets/js/qq-fx.js @@ -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(); +})(); diff --git a/custom/templates/custom/footer.tmpl b/custom/templates/custom/footer.tmpl index c776b2f..3da18c1 100644 --- a/custom/templates/custom/footer.tmpl +++ b/custom/templates/custom/footer.tmpl @@ -10,3 +10,9 @@ X ICP 备 XXXXXXXX 号 */}} + +{{/* + 动效层:只在首页(.page-content.home)和登录页(.page-content.user.signin)生效, + 其它页面 qq-fx.js 里第一行就 return,不会加载 canvas、不会挂 rAF。 +*/}} + diff --git a/custom/templates/custom/header.tmpl b/custom/templates/custom/header.tmpl index 5184c93..d1996b1 100644 --- a/custom/templates/custom/header.tmpl +++ b/custom/templates/custom/header.tmpl @@ -5,6 +5,7 @@ */}} + diff --git a/custom/templates/home.tmpl b/custom/templates/home.tmpl index b14604a..3b3ed23 100644 --- a/custom/templates/home.tmpl +++ b/custom/templates/home.tmpl @@ -1,16 +1,19 @@ {{/* home.tmpl —— 未登录首页(基于 Gitea 1.21.11 官方 home.tmpl 精简) - 改动:四栏宣传块 → 三张克制的小卡片;大 Logo 居中;文案沿用官方 i18n key,不硬编码中文。 + 改动: + · 四栏宣传块 → 三张毛玻璃小卡片 + · Logo 套旋转光环,标题走渐变流动,口号打字机(动效在 qq-fx.css / qq-fx.js) + · 文案沿用官方 i18n key,不硬编码中文(口号除外,它已经是我们自己的文案) 这是**模板覆盖**,不改源码,删掉本文件即回到官方首页。 */}} {{template "base/head" .}} -
-
-
- -
-

{{AppName}}

- {{/* 品牌口号:想换回官方文案就恢复下面注释里那行 {{ctx.Locale.Tr "startpage.app_desc"}} */}} -

自己的代码,自己的地方。

+
+
+
+
+
+

{{AppName}}

+ {{/* 品牌口号:想换回官方文案就换成 {{ctx.Locale.Tr "startpage.app_desc"}} */}} +

自己的代码,自己的地方。

diff --git a/preview/_debug.html b/preview/_debug.html new file mode 100644 index 0000000..7503a77 --- /dev/null +++ b/preview/_debug.html @@ -0,0 +1,51 @@ + + + + + + + + + + + + +
pending
+ + + + + diff --git a/preview/app.js b/preview/app.js index 5186701..cf180f0 100644 --- a/preview/app.js +++ b/preview/app.js @@ -29,3 +29,18 @@ try { saved = localStorage.getItem('qq-preview-theme'); } catch (e) { /* ignore */ } 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'; + }); +})(); diff --git a/preview/index.html b/preview/index.html index 379b4fd..43c21d0 100644 --- a/preview/index.html +++ b/preview/index.html @@ -10,6 +10,7 @@ + @@ -39,11 +40,15 @@
-
- logo -

QQGit

-

自己的代码,自己的地方。

-
+
+
+
+ +
+

QQGit

+

自己的代码,自己的地方。

+
+

◆跨平台

支持 Linux、macOS 和 Windows,从 x86 到 ARM 再到 PowerPC 均可运行。

@@ -57,6 +62,7 @@

MIT 协议,社区驱动,所有代码与决策都完全开放透明。

+
@@ -169,11 +175,52 @@ DARK_PRIMARY = "#38BDF8"
+ + + +
+ +
+
+ diff --git a/preview/login.html b/preview/login.html new file mode 100644 index 0000000..bb2a800 --- /dev/null +++ b/preview/login.html @@ -0,0 +1,78 @@ + + + + + +QQGit · 登录页预览 + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + + + diff --git a/preview/preview.css b/preview/preview.css index fdeb7f4..745de4d 100644 --- a/preview/preview.css +++ b/preview/preview.css @@ -14,7 +14,6 @@ html, body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; font-size: 14px; - transition: background 200ms ease, color 200ms ease; } a { color: var(--color-primary); text-decoration: none; } @@ -244,3 +243,57 @@ pre { body { 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; } +}