diff --git a/cwd-admin/src/main.ts b/cwd-admin/src/main.ts index 6333de3..64bafc6 100644 --- a/cwd-admin/src/main.ts +++ b/cwd-admin/src/main.ts @@ -5,6 +5,7 @@ import { router } from './router'; import PhosphorIcons from '@phosphor-icons/vue'; import './styles/theme.css'; +import './styles/common.less'; const app = createApp(App); app.use(router); diff --git a/cwd-admin/src/styles/common.less b/cwd-admin/src/styles/common.less new file mode 100644 index 0000000..4d13997 --- /dev/null +++ b/cwd-admin/src/styles/common.less @@ -0,0 +1,42 @@ +a, +button { + -webkit-tap-highlight-color: transparent; +} + +.toast { + position: fixed; + top: 20px; + left: 50%; + min-width: 220px; + max-width: 320px; + padding: 12px 16px; + border-radius: 8px; + font-size: 13px; + box-shadow: var(--shadow-card); + z-index: 1000; + opacity: 0; + transform: translate(-50%, -10px); + animation: toast-slide-in 0.3s ease-out forwards; +} + +.toast-success { + background-color: var(--color-success); + color: var(--text-inverse); +} + +.toast-error { + background-color: var(--color-danger); + color: var(--text-inverse); +} + +@keyframes toast-slide-in { + from { + opacity: 0; + transform: translate(-50%, -10px); + } + + to { + opacity: 1; + transform: translate(-50%, 0); + } +} \ No newline at end of file diff --git a/cwd-admin/src/styles/components/analyticsvisit.less b/cwd-admin/src/styles/components/analyticsvisit.less index 6035dd0..24aabe3 100644 --- a/cwd-admin/src/styles/components/analyticsvisit.less +++ b/cwd-admin/src/styles/components/analyticsvisit.less @@ -205,30 +205,6 @@ height: 260px; } -.toast { - position: fixed; - top: 20px; - left: 50%; - transform: translateX(-50%); - min-width: 220px; - max-width: 320px; - padding: 10px 14px; - border-radius: 6px; - font-size: 13px; - box-shadow: var(--shadow-card); - z-index: 1000; -} - -.toast-success { - background-color: var(--color-success); - color: var(--text-inverse); -} - -.toast-error { - background-color: var(--color-danger); - color: var(--text-inverse); -} - .visit-tabs { display: inline-flex; border-radius: 999px; diff --git a/cwd-admin/src/styles/components/data.less b/cwd-admin/src/styles/components/data.less index eb86b29..0956363 100644 --- a/cwd-admin/src/styles/components/data.less +++ b/cwd-admin/src/styles/components/data.less @@ -91,30 +91,6 @@ outline: none; } -/* Toast & Log styles same as before */ -.toast { - position: fixed; - top: 20px; - left: 50%; - transform: translateX(-50%); - min-width: 220px; - padding: 10px 14px; - border-radius: 6px; - font-size: 13px; - box-shadow: var(--shadow-card); - z-index: 1000; -} - -.toast-success { - background-color: var(--color-success); - color: var(--text-inverse); -} - -.toast-error { - background-color: var(--color-danger); - color: var(--text-inverse); -} - .log-container { margin-top: 16px; padding: 12px; diff --git a/cwd-admin/src/styles/components/setting.less b/cwd-admin/src/styles/components/setting.less index e142f84..5402aed 100644 --- a/cwd-admin/src/styles/components/setting.less +++ b/cwd-admin/src/styles/components/setting.less @@ -1,7 +1,3 @@ -h1 { - color: red; -} - .page { display: flex; flex-direction: column; @@ -15,6 +11,39 @@ h1 { color: var(--text-primary); } +.settings-tabs { + display: inline-flex; + flex-wrap: nowrap; + align-items: center; + padding: 2px; + border-radius: 999px; + border: 1px solid var(--border-color); + background-color: var(--bg-input); + margin: 12px 0 16px; + overflow-x: auto; +} + +.settings-tab { + border: none; + background: transparent; + padding: 8px 14px; + border-radius: 999px; + font-size: 14px; + color: var(--text-secondary); + cursor: pointer; + white-space: nowrap; + transition: background-color 0.2s ease, color 0.2s ease; +} + +.settings-tab+.settings-tab { + margin-left: 4px; +} + +.settings-tab-active { + background-color: var(--primary-color); + color: var(--text-inverse); +} + .card { background-color: var(--bg-card); border-radius: 6px; @@ -28,7 +57,6 @@ h1 { justify-content: space-between; align-items: center; padding: 6px 0; - cursor: pointer; user-select: none; transition: background-color 0.2s; } @@ -50,10 +78,6 @@ h1 { transform: rotate(180deg); } -.card-body { - /* padding-top: 4px; */ -} - .card-subtitle { margin: 0 0 12px; font-size: 15px; @@ -171,30 +195,6 @@ h1 { color: var(--text-primary); } -.toast { - position: fixed; - top: 20px; - left: 50%; - transform: translateX(-50%); - min-width: 220px; - max-width: 320px; - padding: 10px 14px; - border-radius: 6px; - font-size: 13px; - box-shadow: var(--shadow-card); - z-index: 1000; -} - -.toast-success { - background-color: var(--color-success); - color: var(--text-inverse); -} - -.toast-error { - background-color: var(--color-danger); - color: var(--text-inverse); -} - .switch { position: relative; display: inline-flex; @@ -244,6 +244,7 @@ h1 { .card-actions { display: flex; + flex-wrap: wrap; gap: 10px; justify-content: flex-end; } @@ -354,4 +355,15 @@ h1 { max-height: 0; opacity: 0; overflow: hidden; +} + +.tab-fade-enter-active, +.tab-fade-leave-active { + transition: opacity 0.1s ease, transform 0.1s ease; +} + +.tab-fade-enter-from, +.tab-fade-leave-to { + opacity: 0; + transform: translateY(4px); } \ No newline at end of file diff --git a/cwd-admin/src/styles/components/stats.less b/cwd-admin/src/styles/components/stats.less index c569717..f01c1ec 100644 --- a/cwd-admin/src/styles/components/stats.less +++ b/cwd-admin/src/styles/components/stats.less @@ -172,30 +172,6 @@ height: 260px; } -.toast { - position: fixed; - top: 20px; - left: 50%; - transform: translateX(-50%); - min-width: 220px; - max-width: 320px; - padding: 10px 14px; - border-radius: 6px; - font-size: 13px; - box-shadow: var(--shadow-card); - z-index: 1000; -} - -.toast-success { - background-color: var(--color-success); - color: var(--text-inverse); -} - -.toast-error { - background-color: var(--color-danger); - color: var(--text-inverse); -} - @media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); diff --git a/cwd-admin/src/views/LayoutView/index.vue b/cwd-admin/src/views/LayoutView/index.vue index 8195515..ac12b49 100644 --- a/cwd-admin/src/views/LayoutView/index.vue +++ b/cwd-admin/src/views/LayoutView/index.vue @@ -354,9 +354,8 @@ function closeVersionModal() { } -