adasd
This commit is contained in:
@@ -599,6 +599,11 @@ a {
|
||||
.setup-shell {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
background: color-mix(in srgb, var(--surface) 92%, transparent);
|
||||
padding: 16px;
|
||||
box-shadow: 0 10px 24px rgba(1, 22, 32, 0.06);
|
||||
}
|
||||
|
||||
.setup-title {
|
||||
@@ -664,6 +669,38 @@ a {
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
|
||||
.setup-tab {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.setup-tab.is-active {
|
||||
border-color: var(--accent);
|
||||
background: color-mix(in srgb, var(--accent) 14%, var(--surface));
|
||||
color: var(--text);
|
||||
}
|
||||
|
||||
.setup-tab[aria-selected="true"] {
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.setup-db-message {
|
||||
margin: 0 0 14px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
padding: 12px 14px;
|
||||
font-weight: 800;
|
||||
}
|
||||
|
||||
.setup-db-message--success {
|
||||
border-color: color-mix(in srgb, var(--accent-2) 60%, var(--line));
|
||||
background: color-mix(in srgb, var(--accent-2) 14%, var(--surface));
|
||||
}
|
||||
|
||||
.setup-db-message--error {
|
||||
border-color: color-mix(in srgb, #d92d20 60%, var(--line));
|
||||
background: color-mix(in srgb, #d92d20 10%, var(--surface));
|
||||
}
|
||||
|
||||
.setup-db-panels {
|
||||
display: grid;
|
||||
gap: 14px;
|
||||
@@ -680,6 +717,23 @@ a {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.setup-field input:not([type="checkbox"]),
|
||||
.setup-field select,
|
||||
.setup-field textarea {
|
||||
width: 100%;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: 8px;
|
||||
background: var(--surface);
|
||||
color: var(--text);
|
||||
padding: 10px 12px;
|
||||
}
|
||||
|
||||
.setup-field input[type="checkbox"] {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
accent-color: var(--accent);
|
||||
}
|
||||
|
||||
.setup-field > span {
|
||||
font-weight: 800;
|
||||
color: var(--text);
|
||||
|
||||
@@ -83,3 +83,40 @@ if (themeAccentSelect) {
|
||||
for (const element of document.querySelectorAll('[data-reveal]')) {
|
||||
element.classList.add('reveal');
|
||||
}
|
||||
|
||||
const setupTabs = document.querySelectorAll('[data-setup-tab-target]');
|
||||
if (setupTabs.length > 0) {
|
||||
const setupPanels = document.querySelectorAll('.setup-db-panel');
|
||||
const setupControls = document.querySelectorAll('.setup-db-panel input, .setup-db-panel select, .setup-db-panel textarea');
|
||||
for (const control of setupControls) {
|
||||
if (control.required) {
|
||||
control.dataset.setupRequired = 'true';
|
||||
}
|
||||
}
|
||||
|
||||
const activateSetupTab = (targetId) => {
|
||||
for (const tab of setupTabs) {
|
||||
const isActive = tab.dataset.setupTabTarget === targetId;
|
||||
tab.classList.toggle('is-active', isActive);
|
||||
tab.setAttribute('aria-selected', isActive ? 'true' : 'false');
|
||||
}
|
||||
for (const panel of setupPanels) {
|
||||
const isActive = panel.id === targetId;
|
||||
panel.hidden = !isActive;
|
||||
for (const control of panel.querySelectorAll('input, select, textarea')) {
|
||||
if (control.dataset.setupRequired === 'true') {
|
||||
control.required = isActive;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
for (const tab of setupTabs) {
|
||||
tab.addEventListener('click', () => {
|
||||
activateSetupTab(tab.dataset.setupTabTarget);
|
||||
});
|
||||
}
|
||||
|
||||
const activeSetupTab = document.querySelector('[data-setup-tab-target].is-active') || setupTabs[0];
|
||||
activateSetupTab(activeSetupTab.dataset.setupTabTarget);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user