eternalibre-notes/static/style.css

757 lines
14 KiB
CSS

/* Rasuti Notes — Apple Elegance meets Classic Desktop GUI */
* {
box-sizing: border-box;
}
html, body {
margin: 0;
padding: 0;
height: 100%;
font-family: -apple-system, BlinkMacSystemFont, "SF Pro", "Inter", "Segoe UI", Roboto, sans-serif;
background-color: var(--app-bg);
color: var(--app-fg);
transition: background-color 0.15s ease, color 0.15s ease;
}
body {
display: flex;
flex-direction: column;
height: 100dvh;
overflow: hidden;
}
a {
color: var(--ansi-4);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
button, input, select, textarea {
font: inherit;
color: inherit;
}
/* Menu Bar */
.menu-bar {
display: flex;
align-items: center;
justify-content: space-between;
height: 32px;
padding: 0 12px;
background-color: var(--app-bg);
border-bottom: 1px solid var(--ui-border);
user-select: none;
flex-shrink: 0;
transition: background-color 0.15s ease, border-color 0.15s ease;
}
.menu-list {
display: flex;
list-style: none;
margin: 0;
padding: 0;
gap: 4px;
}
.menu-item {
position: relative;
padding: 4px 10px;
border-radius: 4px;
cursor: pointer;
font-size: 13px;
font-weight: 500;
}
/* Menus are opened by click (see `openMenu` in app.js), not CSS hover, so
that only one can be open at a time. `.open` both highlights the trigger
and reveals its dropdown. */
.menu-item:hover,
.menu-item:focus,
.menu-item.open {
background-color: var(--ui-hover);
outline: none;
}
.menu-item.open .menu-dropdown {
display: block;
}
.menu-dropdown {
display: none;
position: absolute;
top: calc(100% - 4px);
left: 0;
min-width: 180px;
/* The Theme menu has 28 entries; cap the height so it cannot run off
the bottom of the viewport (body has overflow: hidden). */
max-height: calc(100dvh - 48px);
overflow-y: auto;
-webkit-overflow-scrolling: touch;
overscroll-behavior: contain;
background-color: var(--app-bg);
border: 1px solid var(--ui-border);
border-radius: 6px;
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
list-style: none;
margin: 0;
padding: 12px 6px 6px;
z-index: 100;
}
.menu-dropdown li {
padding: 0;
}
.menu-dropdown button,
.menu-dropdown a {
display: block;
width: 100%;
padding: 6px 10px;
background: none;
border: none;
text-align: left;
color: var(--app-fg);
border-radius: 4px;
cursor: pointer;
font-size: 13px;
}
.menu-dropdown button:hover,
.menu-dropdown a:hover {
background-color: var(--ui-hover);
text-decoration: none;
}
.menu-dropdown hr {
border: none;
border-top: 1px solid var(--ui-border);
margin: 6px 0;
}
.app-title {
font-size: 12px;
font-weight: 600;
opacity: 0.7;
}
/* Toolbar */
.toolbar {
display: flex;
align-items: center;
justify-content: space-between;
height: 44px;
padding: 0 12px;
background-color: var(--app-bg);
border-bottom: 1px solid var(--ui-border);
gap: 12px;
flex-shrink: 0;
transition: background-color 0.15s ease, border-color 0.15s ease;
}
.toolbar-group {
display: flex;
align-items: center;
gap: 8px;
}
.btn {
padding: 5px 12px;
background-color: var(--ui-hover);
border: 1px solid var(--ui-border);
border-radius: 6px;
color: var(--app-fg);
cursor: pointer;
font-size: 13px;
font-weight: 500;
transition: background-color 0.15s ease, border-color 0.15s ease;
}
.btn:hover {
background-color: var(--ansi-12);
border-color: var(--app-fg);
}
.btn-primary {
background-color: var(--btn-primary-bg);
color: var(--btn-primary-fg);
border-color: var(--btn-primary-bg);
}
.btn-primary:hover {
background-color: var(--btn-primary-bg);
box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.12);
}
.btn-danger {
background-color: var(--btn-danger-bg);
color: var(--btn-danger-fg);
border-color: var(--btn-danger-bg);
}
.btn-danger:hover {
background-color: var(--btn-danger-bg);
box-shadow: inset 0 0 0 999px rgba(255, 255, 255, 0.12);
}
.search-form input,
.theme-form select {
padding: 5px 10px;
background-color: var(--app-bg);
border: 1px solid var(--ui-border);
border-radius: 6px;
font-size: 13px;
outline: none;
}
.search-form input:focus,
.theme-form select:focus {
border-color: var(--ansi-4);
box-shadow: 0 0 0 2px var(--ui-hover);
}
.theme-form {
display: flex;
align-items: center;
gap: 6px;
font-size: 13px;
}
/* Flash Messages */
.flash-message {
padding: 8px 12px;
background-color: var(--ansi-2);
color: var(--app-bg);
font-size: 13px;
font-weight: 500;
flex-shrink: 0;
}
/* App Body */
.app-body {
display: grid;
grid-template-columns: 280px 1fr 1fr;
flex: 1;
min-height: 0;
overflow: hidden;
}
/* Sidebar */
.sidebar {
background-color: var(--app-bg);
border-right: 1px solid var(--ui-border);
overflow-y: auto;
display: flex;
flex-direction: column;
transition: background-color 0.15s ease, border-color 0.15s ease;
}
.sidebar-header {
padding: 12px 16px;
font-size: 12px;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.5px;
opacity: 0.6;
border-bottom: 1px solid var(--ui-border);
}
.note-list {
list-style: none;
margin: 0;
padding: 8px;
display: flex;
flex-direction: column;
gap: 4px;
}
.note-item {
border-radius: 8px;
transition: background-color 0.15s ease;
}
.note-item:hover {
background-color: var(--ui-hover);
}
.note-item.active {
background-color: var(--ui-hover);
}
.note-item a {
display: block;
padding: 10px 12px;
color: inherit;
}
.note-item a:hover {
text-decoration: none;
}
.note-title {
font-size: 14px;
font-weight: 600;
margin-bottom: 2px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.note-meta {
font-size: 11px;
opacity: 0.6;
margin-bottom: 4px;
}
.note-preview {
font-size: 12px;
opacity: 0.7;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.note-item.empty {
padding: 20px;
text-align: center;
opacity: 0.5;
font-size: 13px;
}
/* Editor Pane */
.editor-pane {
display: flex;
flex-direction: column;
background-color: var(--app-bg);
border-right: 1px solid var(--ui-border);
overflow: hidden;
transition: background-color 0.15s ease, border-color 0.15s ease;
}
.note-form {
display: flex;
flex-direction: column;
height: 100%;
}
.note-title-input {
padding: 14px 16px;
font-size: 20px;
font-weight: 700;
background: transparent;
border: none;
border-bottom: 1px solid var(--ui-border);
outline: none;
color: var(--app-fg);
}
.note-title-input:focus {
border-bottom-color: var(--ansi-4);
}
.note-content-input {
flex: 1;
width: 100%;
padding: 16px;
font-family: "SF Mono", "Monaco", "Inconsolata", "Fira Code", monospace;
font-size: 14px;
line-height: 1.6;
background: transparent;
border: none;
outline: none;
resize: none;
color: var(--app-fg);
tab-size: 2;
}
.form-actions {
padding: 10px 16px;
border-top: 1px solid var(--ui-border);
display: flex;
justify-content: flex-end;
}
.empty-state {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
opacity: 0.5;
font-size: 14px;
}
/* Preview Pane */
.preview-pane {
display: flex;
flex-direction: column;
background-color: var(--app-bg);
overflow-y: auto;
transition: background-color 0.15s ease;
}
.preview-pane.hidden {
display: none;
}
.markdown-body {
flex: 1;
padding: 20px 24px;
font-size: 15px;
line-height: 1.7;
max-width: 100%;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin-top: 24px;
margin-bottom: 12px;
font-weight: 700;
line-height: 1.3;
}
.markdown-body h1 { font-size: 28px; border-bottom: 1px solid var(--ui-border); padding-bottom: 8px; }
.markdown-body h2 { font-size: 22px; border-bottom: 1px solid var(--ui-border); padding-bottom: 6px; }
.markdown-body h3 { font-size: 18px; }
.markdown-body h4 { font-size: 16px; }
.markdown-body p {
margin: 0 0 14px;
}
.markdown-body ul,
.markdown-body ol {
margin: 0 0 14px;
padding-left: 24px;
}
.markdown-body li {
margin-bottom: 4px;
}
.markdown-body blockquote {
margin: 0 0 14px;
padding: 8px 16px;
border-left: 4px solid var(--ansi-4);
background-color: var(--ui-hover);
border-radius: 0 6px 6px 0;
}
.markdown-body code {
font-family: "SF Mono", "Monaco", "Inconsolata", "Fira Code", monospace;
font-size: 13px;
padding: 2px 6px;
background-color: var(--ui-hover);
border-radius: 4px;
}
.markdown-body pre {
padding: 14px;
background-color: var(--ansi-0);
border-radius: 8px;
overflow-x: auto;
margin: 0 0 14px;
}
.markdown-body pre code {
background: transparent;
padding: 0;
}
.markdown-body table {
width: 100%;
border-collapse: collapse;
margin-bottom: 14px;
}
.markdown-body th,
.markdown-body td {
padding: 8px 12px;
border: 1px solid var(--ui-border);
text-align: left;
}
.markdown-body th {
background-color: var(--ui-hover);
font-weight: 600;
}
.markdown-body hr {
border: none;
border-top: 1px solid var(--ui-border);
margin: 20px 0;
}
.markdown-body input[type="checkbox"] {
margin-right: 8px;
}
/* Status Bar */
.status-bar {
display: flex;
align-items: center;
justify-content: flex-start;
gap: 16px;
height: 24px;
padding: 0 12px;
background-color: var(--app-bg);
border-top: 1px solid var(--ui-border);
font-size: 11px;
opacity: 0.8;
flex-shrink: 0;
transition: background-color 0.15s ease, border-color 0.15s ease;
}
/* About Page */
.about-page {
display: flex;
flex-direction: column;
height: 100dvh;
}
.about-page main {
flex: 1;
padding: 40px;
max-width: 720px;
}
/* Mobile Tab Bar — hidden on desktop */
.tab-bar {
display: none;
}
/* Responsive */
@media (max-width: 900px) {
.app-body {
grid-template-columns: 240px 1fr 1fr;
}
}
/* Mobile: <= 600px (covers iPhone 11 at 390px CSS width) */
@media (max-width: 600px) {
html, body {
height: 100%;
overscroll-behavior: none;
}
body {
height: 100dvh;
}
/* Menu bar wraps to a second row.
NOTE: do not use `overflow: auto` here — it would create a new stacking
context and trap the absolutely-positioned `.menu-dropdown` underneath
the toolbar and content panes. */
.menu-bar {
height: auto;
min-height: 40px;
padding: 0 8px;
flex-shrink: 0;
}
.menu-list {
flex-wrap: wrap;
overflow: visible;
}
.menu-item {
padding: 8px 10px;
min-height: 40px;
display: flex;
align-items: center;
white-space: nowrap;
font-size: 14px;
}
/* Constrain the dropdown to the viewport width and a conservative height
on phones. Safe to use `overflow` here: it only clips the dropdown's own
contents, it does not trap the dropdown inside an ancestor's context. */
.menu-dropdown {
max-width: calc(100vw - 16px);
max-height: 55dvh;
}
.app-title {
display: none;
}
/* Toolbar wraps instead of stretching off-screen */
.toolbar {
flex-wrap: wrap;
height: auto;
padding: 8px;
gap: 8px;
flex-shrink: 0;
}
.toolbar-group {
flex: 1 1 auto;
min-width: 0;
}
.search-form {
flex: 1 1 100%;
min-width: 0;
display: flex;
}
.search-form input {
flex: 1;
width: 100%;
min-width: 0;
}
.theme-form {
flex: 1 1 auto;
min-width: 0;
}
.theme-form select {
flex: 1;
min-width: 0;
}
/* Apple HIG minimum 44px touch targets */
.btn {
min-height: 44px;
padding: 10px 14px;
font-size: 15px;
flex-shrink: 0;
}
.search-form input,
.theme-form select {
min-height: 44px;
padding: 10px 12px;
font-size: 16px; /* prevents iOS zoom-on-focus */
}
/* Tab bar replaces the 3-column layout on mobile */
.tab-bar {
display: flex;
flex-shrink: 0;
background-color: var(--app-bg);
border-bottom: 1px solid var(--ui-border);
padding: 4px 8px;
gap: 4px;
transition: background-color 0.15s ease, border-color 0.15s ease;
}
.tab-button {
flex: 1;
min-height: 48px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2px;
padding: 6px 4px;
background: none;
border: none;
border-radius: 8px;
color: var(--app-fg);
font-size: 12px;
font-weight: 500;
cursor: pointer;
transition: background-color 0.15s ease, color 0.15s ease;
}
.tab-button.active {
background-color: var(--ui-hover);
}
.tab-icon {
font-size: 18px;
line-height: 1;
}
/* Single-pane view: only the active tab's pane is displayed */
.app-body {
display: block;
flex: 1;
min-height: 0;
overflow: hidden;
}
.app-body > * {
display: none;
height: 100%;
border-right: none;
border-bottom: none;
-webkit-overflow-scrolling: touch;
}
.app-body > .mobile-active {
display: flex;
flex-direction: column;
}
/* Sidebar fills the pane on mobile */
.sidebar-header {
padding: 12px 16px;
}
.note-list {
padding: 8px;
}
.note-item a {
padding: 14px 12px;
}
/* Editor fills the pane on mobile */
.note-title-input {
font-size: 18px;
padding: 14px 16px;
flex-shrink: 0;
}
.note-content-input {
font-size: 16px; /* prevents iOS zoom-on-focus */
padding: 16px;
}
.form-actions {
padding: 12px 16px;
flex-shrink: 0;
}
.form-actions .btn {
width: 100%;
}
/* Preview fills the pane on mobile */
.markdown-body {
padding: 20px 16px;
font-size: 16px;
}
/* Status bar stays compact */
.status-bar {
height: 28px;
flex-shrink: 0;
gap: 10px;
font-size: 11px;
overflow-x: auto;
scrollbar-width: none;
}
.status-bar::-webkit-scrollbar {
display: none;
}
/* Prevent horizontal page scroll */
.flash-message {
flex-shrink: 0;
}
.about-page main {
padding: 24px 16px;
}
}