- Book-styled UI with parchment aesthetic and Russian navigation - Characters model with Konva.js 2D canvas drawing (draggable shapes) - StoryPages model with character association and page navigation - Stimulus controllers: canvas (editor) + canvas-preview (read-only) - Full Russian interface: all labels, buttons, flash messages in Russian
512 lines
12 KiB
CSS
512 lines
12 KiB
CSS
/*
|
|
* Волшебная Книга — стили книжного приложения
|
|
*/
|
|
|
|
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');
|
|
|
|
*, *::before, *::after { box-sizing: border-box; }
|
|
|
|
:root {
|
|
--parchment: #f5ecd7;
|
|
--parchment-dark:#e8d9b5;
|
|
--ink: #2c1a0e;
|
|
--ink-light: #5a3e28;
|
|
--gold: #c9922a;
|
|
--gold-light: #e8b84b;
|
|
--leather: #7a3f1e;
|
|
--shadow: rgba(0,0,0,0.18);
|
|
--page-w: 700px;
|
|
}
|
|
|
|
html { scroll-behavior: smooth; }
|
|
|
|
body {
|
|
font-family: 'Playfair Display', 'Georgia', serif;
|
|
background: #1a0d05;
|
|
background-image:
|
|
radial-gradient(ellipse at 20% 50%, #2a1208 0%, transparent 60%),
|
|
radial-gradient(ellipse at 80% 50%, #2a1208 0%, transparent 60%);
|
|
color: var(--ink);
|
|
margin: 0;
|
|
padding: 0;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
/* ── Navigation ─────────────────────────────────────────── */
|
|
.book-nav {
|
|
background: var(--leather);
|
|
background-image: linear-gradient(180deg, #8a4f2e 0%, #5a2e10 100%);
|
|
border-bottom: 3px solid var(--gold);
|
|
box-shadow: 0 4px 16px rgba(0,0,0,0.5);
|
|
position: sticky;
|
|
top: 0;
|
|
z-index: 100;
|
|
}
|
|
|
|
.nav-inner {
|
|
max-width: var(--page-w);
|
|
margin: 0 auto;
|
|
padding: 12px 24px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
gap: 20px;
|
|
}
|
|
|
|
.nav-brand {
|
|
font-size: 1.3rem;
|
|
font-weight: 700;
|
|
color: var(--gold-light);
|
|
text-decoration: none;
|
|
letter-spacing: 0.03em;
|
|
text-shadow: 0 1px 3px rgba(0,0,0,0.4);
|
|
}
|
|
|
|
.nav-links {
|
|
display: flex;
|
|
gap: 16px;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.nav-link {
|
|
color: #e8d4b0;
|
|
text-decoration: none;
|
|
font-size: 0.95rem;
|
|
padding: 4px 10px;
|
|
border-radius: 4px;
|
|
transition: background 0.2s, color 0.2s;
|
|
}
|
|
|
|
.nav-link:hover { background: rgba(255,255,255,0.12); color: var(--gold-light); }
|
|
|
|
.nav-link--action {
|
|
background: var(--gold);
|
|
color: var(--ink);
|
|
font-weight: 700;
|
|
padding: 5px 14px;
|
|
}
|
|
|
|
.nav-link--action:hover { background: var(--gold-light); color: var(--ink); }
|
|
|
|
/* ── Flash messages ──────────────────────────────────────── */
|
|
.flash {
|
|
max-width: var(--page-w);
|
|
margin: 16px auto 0;
|
|
padding: 10px 20px;
|
|
border-radius: 6px;
|
|
font-size: 0.95rem;
|
|
font-style: italic;
|
|
}
|
|
|
|
.flash--notice { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
|
|
.flash--alert { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
|
|
|
|
/* ── Main layout ─────────────────────────────────────────── */
|
|
.book-main {
|
|
max-width: var(--page-w);
|
|
margin: 32px auto;
|
|
padding: 0 16px 60px;
|
|
}
|
|
|
|
/* ── Book page card ──────────────────────────────────────── */
|
|
.page-card {
|
|
background: var(--parchment);
|
|
background-image:
|
|
linear-gradient(90deg, rgba(0,0,0,0.04) 0px, transparent 2px),
|
|
linear-gradient(rgba(0,0,0,0.025) 0px, transparent 1px);
|
|
background-size: 20px 20px, 100% 28px;
|
|
border-radius: 4px 12px 12px 4px;
|
|
box-shadow:
|
|
-6px 0 0 var(--parchment-dark),
|
|
-8px 0 0 #d4c5a0,
|
|
-10px 0 0 #c8b890,
|
|
4px 4px 20px var(--shadow),
|
|
inset 0 0 60px rgba(0,0,0,0.03);
|
|
padding: 48px 56px;
|
|
position: relative;
|
|
border-left: 3px solid #c8b37a;
|
|
}
|
|
|
|
.page-card::before {
|
|
content: '';
|
|
position: absolute;
|
|
top: 0; left: 0; right: 0; bottom: 0;
|
|
background: linear-gradient(90deg, rgba(0,0,0,0.05) 0%, transparent 8%);
|
|
border-radius: inherit;
|
|
pointer-events: none;
|
|
}
|
|
|
|
/* ── Typography ──────────────────────────────────────────── */
|
|
.book-title {
|
|
font-size: 2.4rem;
|
|
color: var(--ink);
|
|
text-align: center;
|
|
margin: 0 0 8px;
|
|
line-height: 1.2;
|
|
letter-spacing: 0.01em;
|
|
}
|
|
|
|
.book-subtitle {
|
|
text-align: center;
|
|
color: var(--ink-light);
|
|
font-style: italic;
|
|
font-size: 1.1rem;
|
|
margin-bottom: 40px;
|
|
}
|
|
|
|
.chapter-title {
|
|
font-size: 1.7rem;
|
|
color: var(--ink);
|
|
margin: 0 0 24px;
|
|
padding-bottom: 12px;
|
|
border-bottom: 1px solid var(--parchment-dark);
|
|
font-style: italic;
|
|
}
|
|
|
|
.section-divider {
|
|
text-align: center;
|
|
color: var(--gold);
|
|
font-size: 1.4rem;
|
|
letter-spacing: 0.4em;
|
|
margin: 32px 0;
|
|
user-select: none;
|
|
}
|
|
|
|
.prose {
|
|
font-size: 1.05rem;
|
|
line-height: 1.85;
|
|
color: var(--ink);
|
|
text-align: justify;
|
|
hyphens: auto;
|
|
margin: 0 0 24px;
|
|
}
|
|
|
|
/* ── Cover page ──────────────────────────────────────────── */
|
|
.book-cover {
|
|
text-align: center;
|
|
padding: 40px 0;
|
|
}
|
|
|
|
.cover-ornament {
|
|
font-size: 3rem;
|
|
display: block;
|
|
margin-bottom: 16px;
|
|
filter: sepia(0.3);
|
|
}
|
|
|
|
.cover-stats {
|
|
display: flex;
|
|
justify-content: center;
|
|
gap: 32px;
|
|
margin: 32px 0;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.stat-block {
|
|
text-align: center;
|
|
}
|
|
|
|
.stat-number {
|
|
display: block;
|
|
font-size: 2.5rem;
|
|
font-weight: 700;
|
|
color: var(--gold);
|
|
line-height: 1;
|
|
}
|
|
|
|
.stat-label {
|
|
display: block;
|
|
font-size: 0.85rem;
|
|
color: var(--ink-light);
|
|
font-style: italic;
|
|
margin-top: 4px;
|
|
}
|
|
|
|
/* ── Page list ───────────────────────────────────────────── */
|
|
.page-list {
|
|
list-style: none;
|
|
padding: 0;
|
|
margin: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 12px;
|
|
}
|
|
|
|
.page-list-item {
|
|
display: flex;
|
|
align-items: flex-start;
|
|
gap: 16px;
|
|
background: rgba(255,255,255,0.4);
|
|
border: 1px solid var(--parchment-dark);
|
|
border-radius: 6px;
|
|
padding: 14px 18px;
|
|
transition: background 0.2s;
|
|
text-decoration: none;
|
|
color: inherit;
|
|
}
|
|
|
|
.page-list-item:hover { background: rgba(255,255,255,0.65); }
|
|
|
|
.page-number {
|
|
font-size: 0.8rem;
|
|
color: var(--gold);
|
|
font-weight: 700;
|
|
min-width: 32px;
|
|
padding-top: 2px;
|
|
font-style: normal;
|
|
}
|
|
|
|
.page-excerpt {
|
|
font-size: 0.9rem;
|
|
color: var(--ink-light);
|
|
font-style: italic;
|
|
margin: 4px 0 0;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
/* ── Character grid ──────────────────────────────────────── */
|
|
.character-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
|
|
gap: 20px;
|
|
margin-top: 24px;
|
|
}
|
|
|
|
.character-card {
|
|
background: rgba(255,255,255,0.45);
|
|
border: 1px solid var(--parchment-dark);
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
text-align: center;
|
|
text-decoration: none;
|
|
color: inherit;
|
|
transition: transform 0.2s, box-shadow 0.2s;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.character-card:hover {
|
|
transform: translateY(-3px);
|
|
box-shadow: 0 8px 24px rgba(0,0,0,0.12);
|
|
}
|
|
|
|
.character-canvas-preview {
|
|
width: 100%;
|
|
height: 150px;
|
|
display: block;
|
|
background: #f0e4c8;
|
|
}
|
|
|
|
.character-name {
|
|
padding: 10px 12px 12px;
|
|
font-weight: 700;
|
|
font-size: 0.95rem;
|
|
color: var(--ink);
|
|
}
|
|
|
|
/* ── Konva canvas container ──────────────────────────────── */
|
|
.canvas-wrap {
|
|
background: #f0e4c8;
|
|
border: 2px solid var(--parchment-dark);
|
|
border-radius: 8px;
|
|
overflow: hidden;
|
|
display: inline-block;
|
|
box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.canvas-toolbar {
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
gap: 8px;
|
|
margin-bottom: 12px;
|
|
}
|
|
|
|
/* ── Forms ───────────────────────────────────────────────── */
|
|
.form-group {
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.form-label {
|
|
display: block;
|
|
font-size: 0.9rem;
|
|
font-weight: 700;
|
|
color: var(--ink-light);
|
|
margin-bottom: 6px;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.06em;
|
|
font-style: normal;
|
|
font-family: system-ui, sans-serif;
|
|
}
|
|
|
|
.form-input,
|
|
.form-textarea,
|
|
.form-select {
|
|
width: 100%;
|
|
padding: 10px 14px;
|
|
background: rgba(255,255,255,0.7);
|
|
border: 1px solid #c8b37a;
|
|
border-radius: 6px;
|
|
font-family: inherit;
|
|
font-size: 1rem;
|
|
color: var(--ink);
|
|
outline: none;
|
|
transition: border-color 0.2s, box-shadow 0.2s;
|
|
}
|
|
|
|
.form-input:focus,
|
|
.form-textarea:focus,
|
|
.form-select:focus {
|
|
border-color: var(--gold);
|
|
box-shadow: 0 0 0 3px rgba(201, 146, 42, 0.15);
|
|
}
|
|
|
|
.form-textarea {
|
|
min-height: 200px;
|
|
resize: vertical;
|
|
line-height: 1.7;
|
|
}
|
|
|
|
/* ── Buttons ─────────────────────────────────────────────── */
|
|
.btn {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 9px 20px;
|
|
border: 1px solid transparent;
|
|
border-radius: 6px;
|
|
font-family: inherit;
|
|
font-size: 0.95rem;
|
|
cursor: pointer;
|
|
text-decoration: none;
|
|
transition: all 0.2s;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: var(--leather);
|
|
color: var(--gold-light);
|
|
border-color: var(--gold);
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: #8a4020;
|
|
color: #fff;
|
|
}
|
|
|
|
.btn-secondary {
|
|
background: rgba(255,255,255,0.5);
|
|
color: var(--ink);
|
|
border-color: #c8b37a;
|
|
}
|
|
|
|
.btn-secondary:hover { background: rgba(255,255,255,0.8); }
|
|
|
|
.btn-danger {
|
|
background: #8b1a1a;
|
|
color: #fde8e8;
|
|
border-color: #a02020;
|
|
}
|
|
|
|
.btn-danger:hover { background: #a02020; }
|
|
|
|
.btn-sm { padding: 5px 12px; font-size: 0.82rem; }
|
|
|
|
.btn-tool {
|
|
background: rgba(255,255,255,0.6);
|
|
border: 1px solid #c8b37a;
|
|
color: var(--ink);
|
|
padding: 6px 12px;
|
|
font-size: 0.85rem;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
transition: background 0.15s;
|
|
}
|
|
|
|
.btn-tool:hover { background: rgba(255,255,255,0.9); }
|
|
.btn-tool.active { background: var(--gold); color: var(--ink); font-weight: 700; }
|
|
|
|
/* ── Page reader (show view) ─────────────────────────────── */
|
|
.page-reader {
|
|
min-height: 400px;
|
|
}
|
|
|
|
.page-navigation {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-top: 40px;
|
|
padding-top: 20px;
|
|
border-top: 1px solid var(--parchment-dark);
|
|
}
|
|
|
|
.page-content {
|
|
white-space: pre-wrap;
|
|
font-size: 1.08rem;
|
|
line-height: 1.9;
|
|
color: var(--ink);
|
|
font-family: 'Playfair Display', 'Georgia', serif;
|
|
}
|
|
|
|
/* ── Errors ──────────────────────────────────────────────── */
|
|
.error-messages {
|
|
background: #fef0f0;
|
|
border: 1px solid #f5c6cb;
|
|
border-radius: 6px;
|
|
padding: 12px 16px;
|
|
margin-bottom: 20px;
|
|
color: #8b1a1a;
|
|
font-size: 0.9rem;
|
|
font-style: italic;
|
|
}
|
|
|
|
.error-messages ul { margin: 6px 0 0 16px; padding: 0; }
|
|
|
|
/* ── Action row ──────────────────────────────────────────── */
|
|
.action-row {
|
|
display: flex;
|
|
gap: 10px;
|
|
align-items: center;
|
|
flex-wrap: wrap;
|
|
margin-top: 24px;
|
|
}
|
|
|
|
/* ── Character avatar chip ───────────────────────────────── */
|
|
.character-badge {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
padding: 3px 10px;
|
|
border-radius: 20px;
|
|
font-size: 0.82rem;
|
|
font-style: italic;
|
|
border: 1px solid currentColor;
|
|
opacity: 0.85;
|
|
}
|
|
|
|
/* ── Footer ──────────────────────────────────────────────── */
|
|
.book-footer {
|
|
text-align: center;
|
|
color: #8a6a3a;
|
|
font-size: 0.82rem;
|
|
font-style: italic;
|
|
padding: 20px;
|
|
border-top: 1px solid #3a1a08;
|
|
}
|
|
|
|
/* ── Empty state ─────────────────────────────────────────── */
|
|
.empty-state {
|
|
text-align: center;
|
|
padding: 48px 20px;
|
|
color: var(--ink-light);
|
|
font-style: italic;
|
|
}
|
|
|
|
.empty-state-icon { font-size: 3rem; display: block; margin-bottom: 16px; }
|
|
|
|
@media (max-width: 600px) {
|
|
.page-card { padding: 28px 24px; }
|
|
.book-title { font-size: 1.8rem; }
|
|
.nav-inner { flex-direction: column; gap: 10px; }
|
|
.nav-links { justify-content: center; }
|
|
}
|