refactor: make css readable
This commit is contained in:
264
src/styles.gleam
264
src/styles.gleam
@@ -1,7 +1,6 @@
|
||||
// this css is AI-generated, sorry, really not a front guy
|
||||
|
||||
pub const shared_css = "
|
||||
* { margin: 0; padding: 0; box-sizing: border-box; }
|
||||
:root {
|
||||
--bg: #0d1117;
|
||||
--bg2: #161b22;
|
||||
@@ -11,47 +10,232 @@ pub const shared_css = "
|
||||
--accent: #58a6ff;
|
||||
--green: #238636;
|
||||
--border: #30363d;
|
||||
--warning: #d29922;
|
||||
--error: #f85149;
|
||||
--mono: 'JetBrains Mono', monospace;
|
||||
}
|
||||
body { font-family: system-ui, sans-serif; background: var(--bg); color: var(--fg); min-height: 100vh; line-height: 1.6; }
|
||||
.container { max-width: 900px; margin: 0 auto; padding: 40px 20px; }
|
||||
header { text-align: center; margin-bottom: 40px; }
|
||||
.logo { font-size: 2.5rem; font-weight: 700; color: var(--accent); }
|
||||
.tagline { color: var(--dim); margin-top: 8px; }
|
||||
.card { background: var(--bg2); border: 1px solid var(--border); border-radius: 12px; padding: 32px; }
|
||||
textarea, .paste-content, .share-url input, input[readonly] {
|
||||
width: 100%; background: var(--bg3); border: 1px solid var(--border);
|
||||
border-radius: 6px; padding: 14px; font-family: var(--mono); font-size: 14px; color: var(--fg);
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
textarea { min-height: 300px; resize: vertical; }
|
||||
textarea:focus, .share-url input:focus { outline: none; border-color: var(--accent); }
|
||||
textarea::placeholder { color: var(--dim); }
|
||||
.paste-content pre { font-family: var(--mono); font-size: 14px; line-height: 1.6; white-space: pre-wrap; word-wrap: break-word; margin: 0; }
|
||||
.actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 12px; }
|
||||
.actions.center { justify-content: center; }
|
||||
button, .btn-primary {
|
||||
background: var(--green); color: #fff; border: none; padding: 12px 24px;
|
||||
border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; text-decoration: none; display: inline-block;
|
||||
|
||||
body {
|
||||
font-family: system-ui, sans-serif;
|
||||
background: var(--bg);
|
||||
color: var(--fg);
|
||||
min-height: 100vh;
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 900px;
|
||||
margin: 0 auto;
|
||||
padding: 40px 20px;
|
||||
}
|
||||
|
||||
header {
|
||||
text-align: center;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.logo {
|
||||
font-size: 2.5rem;
|
||||
font-weight: 700;
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.tagline {
|
||||
color: var(--dim);
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: var(--bg2);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 12px;
|
||||
padding: 32px;
|
||||
}
|
||||
|
||||
textarea,
|
||||
.paste-content,
|
||||
.share-url input,
|
||||
input[readonly] {
|
||||
width: 100%;
|
||||
background: var(--bg3);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 6px;
|
||||
padding: 14px;
|
||||
font-family: var(--mono);
|
||||
font-size: 14px;
|
||||
color: var(--fg);
|
||||
}
|
||||
|
||||
textarea {
|
||||
min-height: 300px;
|
||||
resize: vertical;
|
||||
}
|
||||
|
||||
textarea::placeholder {
|
||||
color: var(--dim);
|
||||
}
|
||||
|
||||
textarea:focus,
|
||||
.share-url input:focus {
|
||||
outline: none;
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.share-url {
|
||||
margin-bottom: 24px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.share-url label {
|
||||
color: var(--dim);
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.paste-content pre {
|
||||
font-family: var(--mono);
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
white-space: pre-wrap;
|
||||
word-wrap: break-word;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.actions {
|
||||
margin-top: 24px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.actions.center {
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
button,
|
||||
.btn-primary {
|
||||
background: var(--green);
|
||||
color: #fff;
|
||||
border: none;
|
||||
padding: 12px 24px;
|
||||
border-radius: 6px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
button:hover:not(:disabled),
|
||||
.btn-primary:hover {
|
||||
filter: brightness(1.15);
|
||||
}
|
||||
|
||||
button:disabled {
|
||||
opacity: 0.5;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.notice {
|
||||
background: rgba(210,153,34,.15);
|
||||
border: 1px solid var(--warning);
|
||||
border-radius: 6px;
|
||||
padding: 16px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.notice strong {
|
||||
color: var(--warning);
|
||||
}
|
||||
|
||||
.notice.warning {
|
||||
background: rgba(248,81,73,.15);
|
||||
border-color: var(--error);
|
||||
}
|
||||
|
||||
.notice.warning strong {
|
||||
color: var(--error);
|
||||
}
|
||||
|
||||
.error {
|
||||
background: rgba(248,81,73,.15);
|
||||
border: 1px solid var(--error);
|
||||
border-radius: 6px;
|
||||
padding: 16px;
|
||||
color: var(--error);
|
||||
}
|
||||
|
||||
footer {
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
color: var(--dim);
|
||||
font-size: 13px;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.centered {
|
||||
text-align: center;
|
||||
padding: 40px;
|
||||
}
|
||||
|
||||
.centered .logo {
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.centered .card {
|
||||
max-width: 500px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
.centered p {
|
||||
color: var(--dim);
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.centered .btn-primary {
|
||||
background: transparent;
|
||||
color: var(--fg);
|
||||
border: 1px solid var(--border);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.centered .btn-primary:hover {
|
||||
background: var(--bg3);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#loading {
|
||||
text-align: center;
|
||||
padding: 40px;
|
||||
color: var(--dim);
|
||||
}
|
||||
|
||||
.mascot {
|
||||
display: inline-flex;
|
||||
vertical-align: middle;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.mascot svg {
|
||||
height: 1em;
|
||||
width: auto;
|
||||
display: block;
|
||||
}
|
||||
button:hover:not(:disabled), .btn-primary:hover { filter: brightness(1.15); }
|
||||
button:disabled { opacity: 0.5; cursor: not-allowed; }
|
||||
.notice { background: rgba(210,153,34,.15); border: 1px solid #d29922; border-radius: 6px; padding: 16px; margin-bottom: 24px; }
|
||||
.notice strong { color: #d29922; }
|
||||
.notice.warning { background: rgba(248,81,73,.15); border-color: #f85149; }
|
||||
.notice.warning strong { color: #f85149; }
|
||||
.error { background: rgba(248,81,73,.15); border: 1px solid #f85149; border-radius: 6px; padding: 16px; color: #f85149; }
|
||||
footer { text-align: center; padding: 20px; color: var(--dim); font-size: 13px; margin-top: 20px; }
|
||||
.centered { text-align: center; padding: 40px; }
|
||||
.centered .logo { margin-bottom: 40px; }
|
||||
.centered .card { max-width: 500px; margin: 0 auto; }
|
||||
.centered .btn-primary { background: transparent; color: var(--fg); border: 1px solid var(--border); font-weight: 500; }
|
||||
.centered .btn-primary:hover { background: var(--bg3); border-color: var(--accent); }
|
||||
.centered p { color: var(--dim); margin-bottom: 24px; }
|
||||
h2 { font-size: 1.5rem; margin-bottom: 16px; }
|
||||
.share-url { margin-bottom: 24px; display: flex; flex-direction: column; gap: 8px; }
|
||||
.share-url label { color: var(--dim); font-size: 14px; font-weight: 500; }
|
||||
#loading { text-align: center; padding: 40px; color: var(--dim); }
|
||||
.hidden { display: none; }
|
||||
.mascot { display: inline-flex; vertical-align: middle; margin-left: 4px; }
|
||||
.mascot svg { height: 1em; width: auto; display: block; }
|
||||
"
|
||||
|
||||
Reference in New Issue
Block a user