Files
qrdamage/style.css
Alexander Wainwright 875e29841f Adjust style
Make shadow a bit pinchier in dark mode.
2025-12-18 20:31:42 +10:00

655 lines
15 KiB
CSS

:root {
/* Color Palette - Strict Monochrome */
--bg-color: #ffffff;
--text-color: #000000;
--border-color: #000000;
--pane-bg: #ffffff;
/* Typography */
/* Serif for the Interface/Authority */
/* --font-serif: "Georgia", "Times New Roman", Times, serif; */
--font-serif: "Courier New", Courier, "Lucida Sans Typewriter", monospace;
/* Monospace for the Data/Inputs */
--font-mono: "Courier New", Courier, "Lucida Sans Typewriter", monospace;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
font-family: var(--font-serif);
background-color: var(--bg-color);
color: var(--text-color);
line-height: 1.6;
min-height: 100vh;
-webkit-font-smoothing: antialiased;
}
/* LAYOUT: CSS GRID
Rows: Content (1fr) -> Footer (auto)
*/
.app-container {
display: grid;
grid-template-columns: 1fr;
grid-template-rows: 1fr auto;
min-height: 100vh;
border-top: 5px solid var(--border-color); /* Masthead line */
}
.pane {
padding: 2rem 2.5rem;
position: relative;
background: var(--pane-bg);
}
/* --- HEADER & TYPOGRAPHY --- */
header h1 {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 2rem;
letter-spacing: -0.05rem;
line-height: 1;
text-transform: uppercase;
border-bottom: 1px solid var(--border-color);
padding-bottom: 1rem;
}
hr {
border: 0;
border-bottom: 1px solid var(--border-color);
margin: 2rem 0;
}
/* --- INPUTS PANE (Left) --- */
.control-group {
margin-bottom: 1.5rem;
}
label {
display: block;
margin-bottom: 0.5rem;
font-size: 0.85rem;
font-weight: 700;
text-transform: uppercase;
letter-spacing: 0.05em;
}
/* The Brutalist Input Style */
input, textarea, select {
width: 100%;
padding: 1rem;
background-color: transparent;
border: 1px solid var(--border-color);
border-radius: 0; /* Crucial: No rounded corners */
/* Data font */
font-family: var(--font-mono);
font-size: 1rem;
color: var(--text-color);
/* Reset native styles */
appearance: none;
-webkit-appearance: none;
box-shadow: none;
}
/* Replaces the inline style for the radio container */
.format-selector {
display: flex;
gap: 2rem;
align-items: center;
border: 1px solid var(--border-color);
padding: 1rem;
background: var(--bg-color); /* Uses variable now! */
}
input:focus, textarea:focus, select:focus {
outline: 2px solid var(--text-color);
outline-offset: -2px;
background-color: #fff;
}
/* Custom Arrow for Select */
select {
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24"><path d="M0 7.33l2.829-2.83 9.175 9.339 9.167-9.339 2.829 2.83-11.996 12.17z"/></svg>');
background-repeat: no-repeat;
background-position: right 1rem center;
background-size: 12px;
cursor: pointer;
}
/* Form Visibility Animation */
.input-form {
display: none;
animation: fadeIn 0.3s ease;
}
/* Advanced Options Module */
details.advanced-options {
margin-top: 2rem;
border: 1px solid var(--border-color);
padding: 0;
background: #fdfdfd; /* Slight contrast from white */
}
#btn-clear {
margin-top: 2rem;
background-color: transparent;
color: var(--text-color);
/* A slightly thicker border makes it feel "bolder" as requested */
border: 2px solid var(--text-color);
}
#btn-clear:hover:not(:disabled) {
background-color: var(--text-color);
color: var(--bg-color);
}
summary {
cursor: pointer;
padding: 1rem;
font-family: var(--font-mono);
font-size: 0.85rem;
font-weight: 700;
text-transform: uppercase;
list-style: none; /* Hide default triangle */
background-color: #f0f0f0;
border-bottom: 1px solid transparent; /* Prepare for expansion */
transition: background 0.1s;
}
/* Custom indicator logic if you want complete control,
but standard text [+]/[-] is very brutalist. */
details[open] summary {
border-bottom: 1px solid var(--border-color);
background-color: var(--border-color); /* Invert header when open */
color: var(--bg-color);
}
details .control-group {
padding: 1.5rem;
margin-bottom: 0; /* Override default margin inside box */
border-bottom: 1px solid var(--border-color);
}
details .control-group:last-child {
border-bottom: none;
}
.input-form.active {
display: block;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(5px); }
to { opacity: 1; transform: translateY(0); }
}
/* --- PREVIEW PANE (Right) --- */
.preview-pane {
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
}
.sticky-wrapper {
width: 100%;
max-width: 320px;
padding-top: 1rem;
}
/* QR Container - The "Art" */
#qr-container {
width: 256px;
height: 256px;
margin: 0 auto 2rem auto;
/* Frame */
border: 1px solid var(--border-color);
padding: 10px;
display: flex;
align-items: center;
justify-content: center;
background: #fff;
}
/* Inside .preview-pane or relevant section */
#qr-container img,
#qr-container canvas,
#qr-container svg {
display: block;
/* CHANGE: Force it to fill the container exactly */
width: 100%;
height: 100%;
/* CRITICAL: This ensures upscaling looks like squares, not blur */
image-rendering: pixelated;
/* Optional: Ensure the SVG scales correctly */
object-fit: contain;
}
/* Buttons */
button {
width: 100%;
padding: 1rem;
background-color: var(--text-color); /* Black */
color: var(--bg-color); /* White */
border: 1px solid var(--text-color);
border-radius: 0;
font-family: var(--font-mono);
font-size: 0.9rem;
font-weight: 700;
text-transform: uppercase;
cursor: pointer;
transition: all 0.1s;
}
button:hover:not(:disabled) {
background-color: var(--bg-color);
color: var(--text-color);
/* Inverted effect */
}
button:disabled {
background-color: #f0f0f0;
color: #aaa;
border-color: #ccc;
cursor: not-allowed;
text-decoration: line-through;
}
/* --- FOOTER --- */
.app-footer {
grid-column: 1 / -1; /* Span full width */
border-top: 5px solid var(--border-color); /* Thick closure line */
padding: 3rem 2rem;
background-color: var(--bg-color);
text-align: center;
}
.footer-content {
max-width: 600px;
margin: 0 auto;
font-size: 0.8rem;
color: var(--text-color);
opacity: 0.8;
}
.app-footer p {
margin-bottom: 0.5rem;
}
.app-footer a {
color: var(--text-color);
text-decoration: underline;
font-family: var(--font-mono);
}
.app-footer a:hover {
background-color: var(--text-color);
color: var(--bg-color);
text-decoration: none;
}
/* --- RESPONSIVE / DESKTOP --- */
@media (min-width: 768px) {
.app-container {
/* Sidebar fixed 400px, Content fluid */
grid-template-columns: 400px 1fr;
max-width: 100%;
margin: 0;
border-top: none;
}
.input-pane {
border-right: 1px solid var(--border-color);
/* Allow natural height so page scrolls to footer */
height: auto;
min-height: 100vh;
}
.preview-pane {
min-height: 100vh;
justify-content: center; /* Center Vertically */
/* Engineering Paper Texture */
background-color: #fdfdfd;
background-image: radial-gradient(#000 0.5px, transparent 0.5px);
background-size: 20px 20px;
}
.sticky-wrapper {
position: sticky;
top: 2rem;
background: #fff;
padding: 2rem;
border: 1px solid black;
box-shadow: 10px 10px 0px 0px #000; /* Hard Block Shadow */
}
}
/* --- PRINT STYLES (The Manifest) --- */
@media print {
/* Hide Interface */
.input-pane, header, hr, button, .app-footer {
display: none !important;
}
.app-container {
display: block;
border: none;
margin: 0;
padding: 0;
}
.preview-pane {
height: auto;
min-height: 0;
background: none;
display: block;
padding: 0;
}
.sticky-wrapper {
border: 4px solid black;
box-shadow: none;
max-width: 100%;
width: 100%;
padding: 4rem;
position: static;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
#qr-container {
border: none;
width: 400px;
height: 400px;
margin-bottom: 2rem;
}
/* Print Timestamp/Watermark */
.sticky-wrapper::after {
content: "GENERATED OUTPUT // DO NOT FOLD";
display: block;
margin-top: 2rem;
font-family: var(--font-mono);
font-size: 1rem;
font-weight: bold;
letter-spacing: 2px;
text-transform: uppercase;
border-top: 2px solid black;
padding-top: 1rem;
width: 100%;
text-align: center;
}
}
/* Styling the Number Input */
input[type="number"] {
-moz-appearance: textfield; /* Remove Firefox spinner */
}
/* Remove Webkit spinners if you prefer a cleaner look */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}
/* Color Group Layout */
.color-group {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1rem;
}
.color-input label {
margin-bottom: 0.5rem;
}
.input-wrapper {
display: flex;
align-items: center;
border: 1px solid var(--border-color);
padding: 0.5rem;
background: #fff;
}
/* The Color Swatch Itself */
input[type="color"] {
border: none;
width: 2rem;
height: 2rem;
padding: 0;
margin-right: 1rem;
background: none;
cursor: pointer;
}
/* Color Swatch Internal (Webkit) */
input[type="color"]::-webkit-color-swatch-wrapper {
padding: 0;
}
input[type="color"]::-webkit-color-swatch {
border: 1px solid var(--border-color);
border-radius: 0; /* Square swatch */
}
/* The Hex Code Text next to it */
.input-wrapper span {
font-family: var(--font-mono);
font-size: 0.9rem;
text-transform: uppercase;
}
/* Radio Button Logic inside the bordered box */
input[type="radio"] {
/* Reset the width 100% from the general input rule */
width: 1.2rem;
height: 1.2rem;
border: 1px solid var(--border-color);
border-radius: 50%; /* Radios can stay round, or make them 0 for squares */
appearance: none;
-webkit-appearance: none;
background: transparent;
position: relative;
margin-right: 0.5rem;
}
input[type="radio"]:checked {
background: var(--text-color); /* Fill black when checked */
box-shadow: inset 0 0 0 3px #fff; /* Create a 'donut' look */
}
input[type="radio"]:focus {
outline: none;
}
/* In-Box Error Message */
.qr-error-msg {
color: red;
font-family: var(--font-mono);
font-weight: 700;
text-align: center;
text-transform: uppercase;
font-size: 0.9rem;
line-height: 1.4;
/* Brutalist Box inside the Box */
border: 2px solid red;
padding: 1rem;
background-color: #fff;
width: 80%; /* Don't touch the edges */
}
/* Ensure the container keeps its shape even when showing error */
#qr-container {
/* Existing styles... */
position: relative; /* Just in case */
}
/* --- CAPACITY METER --- */
#capacity-track {
width: 100%;
height: 4px;
/* Light Mode: Light Grey track */
background: #eee;
border: 1px solid var(--border-color);
}
#capacity-bar {
height: 100%;
width: 0%;
/* Automatically swaps Black (Light) <-> White (Dark) */
background-color: var(--text-color);
transition: width 0.2s ease, background-color 0.2s;
}
/* Specific Dark Mode overrides for the track background */
@media (prefers-color-scheme: dark) {
#capacity-track {
/* Dark Mode: Dark Grey track so the White bar pops */
background: #333;
}
}
/* --- DARK MODE SUPPORT --- */
@media (prefers-color-scheme: dark) {
:root {
/* PURE BLACK & WHITE - No "middling greys" */
--bg-color: #000000;
--text-color: #ffffff;
--border-color: #ffffff;
--pane-bg: #000000;
}
/* 1. TEXTURE: Sharper Dots */
.preview-pane {
background-color: #000000;
/* White dots on black, high contrast */
background-image: radial-gradient(#666 0.5px, transparent 0.5px);
}
/* 2. INPUTS: Remove grey fills, use stark borders */
input, textarea, select {
background-color: transparent;
border-color: #fff;
color: #fff;
}
input:focus, textarea:focus, select:focus {
/* Invert on focus: White Block, Black Text */
background-color: #ffffff;
color: #000000;
outline: none;
}
/* Input Wrappers (Color pickers etc) */
.input-wrapper, .format-selector {
background: #000000;
border-color: #ffffff;
}
/* 3. DETAILS / SUMMARY (Advanced Config) */
details.advanced-options {
background: #000000;
border-color: #ffffff;
}
summary {
background-color: #000000;
color: #ffffff;
border-bottom: 1px solid #ffffff;
}
details[open] summary {
/* Invert header: White Block, Black Text */
background-color: #ffffff;
color: #000000;
border-bottom: 1px solid #ffffff;
}
/* 4. STICKY WRAPPER: Toned down shadow */
.sticky-wrapper {
background: #000000;
border: 1px solid #ffffff;
box-shadow: 10px 10px 0px 0px #ddd;
}
/* 5. QR CONTAINER: Dark to match the theme */
#qr-container {
/* Now transparent/black so it doesn't look like a "flashlight" */
background-color: #000000;
border: 1px solid #ffffff;
}
/* Ensure the generated images (which might be white squares) are centered and clean */
#qr-container img,
#qr-container canvas,
#qr-container svg {
/* Optional: Add a thin border to the actual code so a White QR
doesn't bleed into the White Page Border if sizing matches */
border: 1px solid #333;
}
/* 6. ERROR MESSAGE: Keep it popping */
.qr-error-msg {
background-color: #000000; /* Black box */
color: #ff0000; /* Red Text */
border: 2px solid #ff0000; /* Red Border */
}
/* 6. ICONS & SVGS */
/* Invert Select Arrow to White */
select {
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="white"><path d="M0 7.33l2.829-2.83 9.175 9.339 9.167-9.339 2.829 2.83-11.996 12.17z"/></svg>');
}
/* 7. BUTTONS */
/* Primary Action: White Block, Black Text */
button {
background-color: #ffffff;
color: #000000;
border-color: #ffffff;
}
button:hover:not(:disabled) {
/* Hover: Invert to Black Block, White Text */
background-color: #000000;
color: #ffffff;
border-color: #ffffff;
}
button:disabled {
background-color: #333;
color: #000;
border-color: #333;
}
/* Reset Button: Transparent with White Border */
#btn-clear {
background-color: transparent;
color: #ffffff;
border-color: #ffffff;
}
#btn-clear:hover:not(:disabled) {
/* Hover: White Block, Black Text */
background-color: #ffffff;
color: #000000;
}
}