@@ -102,7 +128,7 @@ function onLogout(key: string) {
{{ isDark ? "切换到日间" : "切换到夜间" }}
-
+
diff --git a/web/src/styles.css b/web/src/styles.css
index 09e6aa0..a89b2dd 100644
--- a/web/src/styles.css
+++ b/web/src/styles.css
@@ -13,6 +13,10 @@
--accent-soft: rgba(121, 192, 255, 0.16);
--sidebar: #0d1117;
--danger: #f85149;
+ --ok: #3fb950;
+ --warn: #d29922;
+ --paper: #ffffff;
+ --overlay: rgba(13, 17, 23, 0.72);
}
:root[data-scheme="day"] {
@@ -26,6 +30,10 @@
--accent-soft: rgba(9, 105, 218, 0.12);
--sidebar: #ffffff;
--danger: #cf222e;
+ --ok: #1a7f37;
+ --warn: #9a6700;
+ --paper: #ffffff;
+ --overlay: rgba(13, 17, 23, 0.72);
}
::selection {
@@ -62,9 +70,11 @@ select {
box-sizing: border-box;
height: 100%;
min-height: 0;
+ overflow-y: auto;
display: flex;
+ flex-direction: column;
align-items: center;
- justify-content: center;
+ justify-content: flex-start;
padding: 32px 16px;
background: var(--bg);
}
@@ -77,6 +87,9 @@ select {
.gate-card {
width: min(440px, 100%);
+ flex: none;
+ margin-top: auto;
+ margin-bottom: auto;
background: var(--panel);
border: 1px solid var(--line);
border-radius: 4px;
@@ -182,8 +195,7 @@ select {
height: 210px;
padding: 0;
border: 1px solid var(--line);
- background: #fff;
- cursor: pointer;
+ background: var(--paper);
}
.qr-frame img {
@@ -197,14 +209,28 @@ select {
inset: 0;
display: grid;
place-items: center;
- background: rgba(13, 17, 23, 0.72);
- color: #fff;
+ width: 100%;
+ border: 0;
+ background: var(--overlay);
+ color: var(--paper);
+ font: inherit;
font-size: 14px;
+ cursor: pointer;
+}
+
+.qr-ttl {
+ margin: 8px 0 0;
+ color: var(--muted);
+ font-size: 12px;
+}
+
+.qr-refresh {
+ justify-content: center;
}
.gate-card.with-jigsaw {
- width: max-content;
- max-width: calc(100% - 32px);
+ width: min(440px, 100%);
+ max-width: 100%;
}
.jigsaw-block {
@@ -216,17 +242,30 @@ select {
text-align: center;
}
-.jigsaw {
+.jigsaw-stage {
+ width: 100%;
+}
+
+.jigsaw-frame {
position: relative;
margin: 0 auto;
+ overflow: hidden;
+}
+
+.jigsaw {
+ position: absolute;
+ top: 0;
+ left: 0;
+ transform-origin: top left;
user-select: none;
touch-action: none;
}
-.jigsaw .board,
+.jigsaw-board,
.jigsaw .piece {
display: block;
max-width: none;
+ border: 0;
}
.jigsaw .piece {
@@ -235,9 +274,11 @@ select {
}
.jigsaw-track {
- position: relative;
+ position: absolute;
+ top: 0;
+ left: 0;
height: 36px;
- margin: 8px auto 0;
+ transform-origin: top left;
border: 1px solid var(--line);
background: var(--elevated);
touch-action: none;
@@ -245,7 +286,7 @@ select {
.jigsaw-handle {
position: absolute;
- top: -1px;
+ top: 0;
width: 40px;
height: 36px;
display: grid;
@@ -326,8 +367,8 @@ select {
padding-top: 8px;
}
-.shell .n-menu .n-menu-item-content--selected::before {
- background-color: transparent !important;
+.shell .n-layout-sider .n-menu .n-menu-item-content.n-menu-item-content--selected::before {
+ background-color: transparent;
border-left: 2px solid var(--accent);
border-radius: 0;
}
@@ -432,7 +473,8 @@ select {
.home {
flex: 1;
min-height: 0;
- overflow: hidden;
+ overflow-x: hidden;
+ overflow-y: auto;
display: flex;
flex-direction: column;
gap: 16px;
@@ -485,9 +527,9 @@ select {
grid-template-columns: auto minmax(0, 1fr);
}
-.compact-nform .n-form-item-label {
+.compact-nform .n-form-item .n-form-item-label {
white-space: nowrap;
- padding-right: 12px !important;
+ padding-right: 12px;
}
.compact-nform .n-form-item-blank {
@@ -681,14 +723,12 @@ select {
flex-wrap: wrap;
align-items: center;
gap: 8px;
- padding-left: 96px;
margin-top: 12px;
}
.day-warn {
- color: #d29922;
+ color: var(--warn);
font-size: 18px;
- cursor: help;
}
.target-unit {
@@ -713,8 +753,8 @@ select {
}
.study-indicator.active {
- background: #3fb950;
- box-shadow: 0 0 6px rgba(63, 185, 80, 0.5);
+ background: var(--ok);
+ box-shadow: 0 0 6px var(--ok);
}
.study-indicator.down {
@@ -878,13 +918,13 @@ select {
}
.study-dot.up {
- background: #3fb950;
- box-shadow: 0 0 6px rgba(63, 185, 80, 0.5);
+ background: var(--ok);
+ box-shadow: 0 0 6px var(--ok);
}
.study-dot.down {
- background: #f85149;
- box-shadow: 0 0 6px rgba(248, 81, 73, 0.5);
+ background: var(--danger);
+ box-shadow: 0 0 6px var(--danger);
}
.history-facts {
@@ -1310,7 +1350,15 @@ select {
}
}
-@media (max-width: 1099px) {
+@media (max-width: 1100px), (max-height: 760px) {
+ .study-card,
+ .study-card.is-busy {
+ flex: none;
+ overflow: visible;
+ }
+}
+
+@media (max-width: 1100px) {
.study-card-body,
.study-card.is-busy .study-card-body {
grid-template-columns: minmax(0, 1fr);
@@ -1587,6 +1635,41 @@ select {
.modal-actions {
display: flex;
justify-content: flex-end;
+ gap: 8px;
+}
+
+.app-root {
+ position: relative;
+}
+
+.session-note {
+ margin: 0 0 16px;
+ color: var(--ink);
+}
+
+.session-banner {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 12px;
+ color: var(--ink);
+}
+
+.session-banner p {
+ margin: 0;
+}
+
+.session-banner-float {
+ position: absolute;
+ z-index: 30;
+ top: 12px;
+ left: 50%;
+ transform: translateX(-50%);
+ width: min(420px, calc(100% - 24px));
+ padding: 8px 12px;
+ background: var(--panel);
+ border: 1px solid var(--line);
+ border-radius: 4px;
}
body .n-input .n-input__input-el,
@@ -1647,3 +1730,51 @@ body .n-base-select-menu .n-base-select-option__content {
white-space: normal;
}
}
+
+@media (max-width: 480px) {
+ .gate {
+ padding: 16px 12px;
+ }
+
+ .gate-card {
+ padding: 20px 16px 16px;
+ }
+
+ .form-row {
+ grid-template-columns: minmax(0, 1fr);
+ }
+
+ .facts,
+ .history-facts {
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ }
+
+ .page-head,
+ .course-search,
+ .target-control,
+ .start-control {
+ flex-wrap: wrap;
+ }
+
+ .worker-select,
+ .target-control .n-input-number,
+ .day-select {
+ width: 100%;
+ max-width: 100%;
+ }
+
+ .compact-nform .n-form-item {
+ flex-direction: column;
+ align-items: stretch;
+ }
+
+ .compact-nform .n-form-item-label {
+ width: 100% !important;
+ max-width: 100%;
+ height: auto;
+ }
+
+ .schedule-choice {
+ flex-wrap: wrap;
+ }
+}
diff --git a/web/tsconfig.json b/web/tsconfig.json
index ee52135..026fb60 100644
--- a/web/tsconfig.json
+++ b/web/tsconfig.json
@@ -4,6 +4,7 @@
"module": "ESNext",
"moduleResolution": "bundler",
"strict": true,
+ "noUnusedLocals": true,
"jsx": "preserve",
"noEmit": true,
"skipLibCheck": true,
diff --git a/web/vite.config.ts b/web/vite.config.ts
index 9431534..f7d9417 100644
--- a/web/vite.config.ts
+++ b/web/vite.config.ts
@@ -2,6 +2,7 @@ import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
export default defineConfig({
+ base: "/",
plugins: [vue()],
server: {
proxy: {