Frontend style refactoring

This commit is contained in:
Meleki committed 2026-02-27 07:18:12 +01:00
1 parent 48be82905e
commit 680f1d6fe2
11 files changed
+341 -590

No files matched your search

+19 -152
View File
@@ -1,9 +1,15 @@
* { margin: 0; padding: 0; box-sizing: border-box; }
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: var(--f2-bg);
color: var(--text);
height: 100vh;
display: flex;
flex-direction: column;
}
body, input, select, button, textarea {
@@ -31,163 +37,24 @@ button, select, input, textarea {
outline: none;
}
button:hover, select:hover, input:hover, textarea:hover {
button {
line-height: 1.25;
padding: var(--s2) var(--s3);
}
button:not(:disabled) {
cursor: pointer;
}
button:not(:disabled):hover, select:hover, input:hover, textarea:hover {
border-color: var(--primary);
}
button {
cursor: pointer;
line-height: 1.25;
padding: var(--s2) var(--s3);
button:disabled {
opacity: .5;
}
textarea {
height: 8em;
min-height: 8em;
}
.toggle {
display: flex;
align-items: center;
gap: var(--s2);
margin-left: auto;
}
.toggle label {
cursor: pointer;
}
.session-rename {
background: var(--f2-bg);
border: var(--border-width) solid var(--f2-border);
outline: none;
}
/* ── Header ── */
header {
padding: var(--s4) calc(var(--s4) * 2);
border-bottom: var(--border-width) solid var(--f1-border);
display: flex;
align-items: center;
gap: var(--s4);
flex-shrink: 0;
}
/* ── System Prompt ── */
#systemPrompt {
display: none;
width: calc(100% - calc(var(--s4) * 2));
margin: var(--s4);
padding: var(--s4);
}
#systemPrompt.visible { display: block; }
/* ── Meta Bar ── */
.meta-bar {
padding: var(--s2);
background: var(--f1-bg);
border-bottom: var(--border-width) solid var(--f1-border);
flex-shrink: 0;
min-height: 2.5em;
}
/* ── Chat ── */
#chat {
flex: 1;
overflow-y: auto;
padding: var(--s4);
display: flex;
flex-direction: column;
gap: var(--s4);
}
.msg {
padding: var(--s3) var(--s4);
white-space: pre-wrap;
word-break: break-word;
}
.msg.user {
align-self: flex-end;
background: var(--f3-bg);
border: var(--border-width) solid var(--f3-border);
}
.msg.assistant {
align-self: flex-start;
background: var(--f1-bg);
border: var(--border-width) solid var(--f1-border);
}
.msg.system-info {
align-self: center;
border: var(--border-width) solid var(--f2-border);
text-align: center;
padding: var(--s2);
}
/* ── Cursor ── */
.msg .cursor {
display: inline-block;
width: .125em;
height: 1em;
background: var(--text);
animation: blink 0.8s infinite;
vertical-align: text-bottom;
margin-left: .125em;
}
@keyframes blink {
0%, 50% { opacity: 1; }
51%, 100% { opacity: 0; }
}
/* ── Tool Boxes ── */
.tool-box {
align-self: center;
padding: var(--s2);
background: var(--f3-bg);
border: var(--border-width) solid var(--f3-border);
}
/* ── Input Area ── */
.input-area {
border-top: var(--border-width) solid var(--f1-border);
display: flex;
flex-shrink: 0;
gap: var(--s4);
padding: var(--s4);
}
.input-area textarea {
flex: 1;
}
.input-area button {
align-self: flex-end;
}
.input-area button:disabled { opacity: 0.5; cursor: not-allowed; }
/* ── Archive ── */
.archive-container {
display: flex;
flex-direction: column;
gap: var(--s4);
}
.archived { opacity: 0.6; }
.archive-load-btn {
display: block;
margin-inline: auto;
}
+99
View File
@@ -0,0 +1,99 @@
#chat {
flex: 1;
overflow-y: auto;
padding: var(--s4);
display: flex;
flex-direction: column;
gap: var(--s4);
}
.meta-bar {
padding: var(--s2);
background: var(--f1-bg);
border-bottom: var(--border-width) solid var(--f1-border);
flex-shrink: 0;
min-height: 2.5em;
}
.msg {
padding: var(--s3) var(--s4);
white-space: pre-wrap;
word-break: break-word;
}
.msg.user {
align-self: flex-end;
background: var(--f3-bg);
border: var(--border-width) solid var(--f3-border);
}
.msg.assistant {
align-self: flex-start;
background: var(--f1-bg);
border: var(--border-width) solid var(--f1-border);
}
.msg.system-info {
align-self: center;
border: var(--border-width) solid var(--f2-border);
text-align: center;
padding: var(--s2);
}
.msg .cursor {
display: inline-block;
width: .125em;
height: 1em;
background: var(--text);
animation: blink 0.8s infinite;
vertical-align: text-bottom;
margin-left: .125em;
}
@keyframes blink {
0%, 50% { opacity: 1; }
51%, 100% { opacity: 0; }
}
.tool-box {
align-self: center;
padding: var(--s2);
background: var(--f3-bg);
border: var(--border-width) solid var(--f3-border);
}
.input-area {
border-top: var(--border-width) solid var(--f1-border);
display: flex;
flex-shrink: 0;
gap: var(--s4);
padding: var(--s4);
}
.input-area textarea {
flex: 1;
}
.input-area button {
align-self: flex-end;
}
.input-area button:disabled {
opacity: 0.5;
cursor: not-allowed;
}
.archive-container {
display: flex;
flex-direction: column;
gap: var(--s4);
}
.archived {
opacity: 0.6;
}
.archive-load-btn {
display: block;
margin-inline: auto;
}
+88
View File
@@ -0,0 +1,88 @@
.dashboard {
padding: calc(var(--s4) * 2);
overflow-y: auto;
}
.dashboard section {
margin-bottom: calc(var(--s4) * 2);
}
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--s4);
}
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: var(--s4);
}
.card {
background: var(--f3-bg);
border: var(--border-width) solid var(--f3-border);
display: flex;
flex-direction: column;
overflow: hidden;
}
.card.clickable {
cursor: pointer;
}
.card.clickable:hover {
border-color: var(--primary);
}
.card-image {
aspect-ratio: 1;
background: var(--f2-bg);
overflow: hidden;
}
.card-image img {
width: 100%;
height: 100%;
object-fit: cover;
}
.card-body {
padding: var(--s3);
display: flex;
flex-direction: column;
gap: var(--s1);
}
.card-title-row {
display: flex;
align-items: center;
gap: var(--s2);
}
.card-title {
font-weight: bold;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.card-desc {
display: -webkit-box;
overflow: hidden;
}
.badge {
padding: var(--s1) var(--s2);
background: var(--f1-bg);
border: var(--border-width) solid var(--f2-border);
white-space: nowrap;
flex-shrink: 0;
}
.card.placeholder {
border-style: dashed;
align-items: center;
justify-content: center;
}
+49
View File
@@ -0,0 +1,49 @@
.form {
padding: calc(var(--s4) * 2);
overflow-y: auto;
display: flex;
flex-direction: column;
gap: var(--s3);
max-width: 600px;
}
.avatar-section {
display: flex;
align-items: center;
gap: var(--s4);
}
.avatar-preview {
width: 64px;
height: 64px;
background: var(--f2-bg);
border: var(--border-width) solid var(--f2-border);
display: flex;
align-items: center;
justify-content: center;
font-size: 2em;
overflow: hidden;
flex-shrink: 0;
}
.avatar-preview img {
width: 100%;
height: 100%;
object-fit: cover;
}
.form-actions {
display: flex;
gap: var(--s4);
margin-top: var(--s4);
}
.danger-btn {
color: #ff6b6b;
border-color: #ff6b6b;
}
.danger-btn:hover {
background: #ff6b6b;
color: var(--f1-bg);
}
+6 -213
View File
@@ -1,6 +1,10 @@
body {
header {
padding: var(--s4) calc(var(--s4) * 2);
border-bottom: var(--border-width) solid var(--f1-border);
display: flex;
flex-direction: column;
align-items: center;
gap: var(--s4);
flex-shrink: 0;
}
#app {
@@ -17,219 +21,8 @@ body {
overflow: hidden;
}
/* ── Nav ── */
#nav {
padding: var(--s3) calc(var(--s4) * 1.5);
border-bottom: var(--border-width) solid var(--f2-border);
display: flex;
align-items: center;
gap: calc(var(--s4) * 2);
flex-shrink: 0;
}
.nav-links {
display: flex;
gap: var(--s4);
}
.nav-link {
text-decoration: none;
padding: var(--s1) var(--s2);
color: var(--text);
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); border-bottom: 2px solid var(--primary); }
/* ── Dashboard ── */
.dashboard {
padding: calc(var(--s4) * 2);
overflow-y: auto;
}
.dashboard section {
margin-bottom: calc(var(--s4) * 2);
}
.section-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: var(--s4);
}
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: var(--s4);
}
.card {
background: var(--f3-bg);
border: var(--border-width) solid var(--f3-border);
display: flex;
flex-direction: column;
overflow: hidden;
}
.card.clickable { cursor: pointer; }
.card.clickable:hover { border-color: var(--primary); }
.card-image {
aspect-ratio: 1;
background: var(--f2-bg);
overflow: hidden;
}
.card-image img {
width: 100%;
height: 100%;
object-fit: cover;
}
.card-body {
padding: var(--s3);
display: flex;
flex-direction: column;
gap: var(--s1);
}
.card-title-row {
display: flex;
align-items: center;
gap: var(--s2);
}
.card-title {
font-weight: bold;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.card-desc {
display: -webkit-box;
overflow: hidden;
}
.badge {
padding: var(--s1) var(--s2);
background: var(--f1-bg);
border: var(--border-width) solid var(--f2-border);
white-space: nowrap;
flex-shrink: 0;
}
.card.placeholder {
border-style: dashed;
align-items: center;
justify-content: center;
}
/* ── Session Page ── */
.session-page {
display: flex;
flex-direction: column;
}
.session-header {
padding: var(--s3) calc(var(--s4) * 1.5);
border-bottom: var(--border-width) solid var(--f1-border);
display: flex;
align-items: center;
gap: var(--s4);
flex-shrink: 0;
}
.back-btn {
background: none;
border: none;
padding: var(--s1) var(--s2);
}
.editable-title {
cursor: pointer;
}
.editable-title:hover {
text-decoration: underline;
text-decoration-style: dotted;
}
/* ── Placeholder Pages ── */
.placeholder-page {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: var(--s4);
}
.placeholder-icon {
font-size: 4em;
}
/* ── Agent Form ── */
.agent-form {
padding: calc(var(--s4) * 2);
overflow-y: auto;
display: flex;
flex-direction: column;
gap: var(--s3);
max-width: 600px;
}
.agent-form label {
font-weight: bold;
}
.agent-form textarea {
resize: vertical;
}
.agent-avatar-section {
display: flex;
align-items: center;
gap: var(--s4);
}
.agent-avatar-preview {
width: 64px;
height: 64px;
background: var(--f2-bg);
border: var(--border-width) solid var(--f2-border);
display: flex;
align-items: center;
justify-content: center;
font-size: 2em;
overflow: hidden;
flex-shrink: 0;
}
.agent-avatar-preview img {
width: 100%;
height: 100%;
object-fit: cover;
}
.agent-form-actions {
display: flex;
gap: var(--s4);
margin-top: var(--s4);
}
.danger-btn {
color: #ff6b6b;
border-color: #ff6b6b;
}
.danger-btn:hover {
background: #ff6b6b;
color: var(--f1-bg);
}
+28
View File
@@ -0,0 +1,28 @@
#nav {
padding: var(--s3) calc(var(--s4) * 1.5);
border-bottom: var(--border-width) solid var(--f2-border);
display: flex;
align-items: center;
gap: calc(var(--s4) * 2);
flex-shrink: 0;
}
.nav-links {
display: flex;
gap: var(--s4);
}
.nav-link {
text-decoration: none;
padding: var(--s1) var(--s2);
color: var(--text);
}
.nav-link:hover {
color: var(--text);
}
.nav-link.active {
color: var(--text);
border-bottom: 2px solid var(--primary);
}
+12
View File
@@ -0,0 +1,12 @@
.placeholder-content {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: var(--s4);
}
.placeholder-icon {
font-size: 4em;
}
-57
View File
@@ -1,57 +0,0 @@
body {
display: flex;
}
main {
flex: 1;
display: flex;
flex-direction: column;
min-width: 0;
}
/* ── Sidebar ── */
#sidebar {
width: 260px;
background: var(--f1-bg);
border-right: var(--border-width) solid var(--f1-border);
display: flex;
flex-direction: column;
flex-shrink: 0;
overflow: hidden;
}
.sidebar-header {
padding: var(--s4);
border-bottom: var(--border-width) solid var(--f1-border);
display: flex;
align-items: center;
justify-content: space-between;
}
#sessionList {
flex: 1;
overflow-y: auto;
}
.session-item {
padding: var(--s4);
cursor: pointer;
display: flex;
flex-direction: column;
border-left: 3px solid transparent;
}
.session-item:hover { background: var(--f3-bg); }
.session-item.active {
background: var(--f3-bg);
border-left-color: var(--primary);
}
.session-name {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
border: var(--border-width) solid transparent;
}