feat: 初始化文字马赛克生成器
This commit is contained in:
+585
@@ -0,0 +1,585 @@
|
||||
:root {
|
||||
color: #171815;
|
||||
background: #e9e7dd;
|
||||
font-family:
|
||||
Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
|
||||
sans-serif;
|
||||
font-synthesis: none;
|
||||
text-rendering: optimizeLegibility;
|
||||
--ink: #171815;
|
||||
--paper: #e9e7dd;
|
||||
--acid: #d8ff52;
|
||||
--muted: #6b6b63;
|
||||
--line: rgba(23, 24, 21, 0.24);
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
min-width: 320px;
|
||||
min-height: 100%;
|
||||
background: var(--paper);
|
||||
}
|
||||
|
||||
body {
|
||||
min-width: 320px;
|
||||
min-height: 100vh;
|
||||
margin: 0;
|
||||
background:
|
||||
linear-gradient(rgba(23, 24, 21, 0.035) 1px, transparent 1px),
|
||||
linear-gradient(90deg, rgba(23, 24, 21, 0.025) 1px, transparent 1px),
|
||||
var(--paper);
|
||||
background-size: 100% 48px, 48px 100%, auto;
|
||||
}
|
||||
|
||||
button,
|
||||
textarea,
|
||||
input {
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
button {
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
button:focus-visible,
|
||||
textarea:focus-visible,
|
||||
input:focus-visible {
|
||||
outline: 3px solid var(--acid);
|
||||
outline-offset: 3px;
|
||||
}
|
||||
|
||||
.page-shell {
|
||||
width: min(1440px, 100%);
|
||||
margin: 0 auto;
|
||||
padding: 32px clamp(20px, 4vw, 64px) 28px;
|
||||
}
|
||||
|
||||
.hero {
|
||||
position: relative;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr auto;
|
||||
min-height: 220px;
|
||||
padding: 22px 0 30px;
|
||||
border-top: 1px solid var(--ink);
|
||||
}
|
||||
|
||||
.hero__index {
|
||||
position: absolute;
|
||||
top: 22px;
|
||||
left: 0;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
font-size: 11px;
|
||||
letter-spacing: 0.14em;
|
||||
}
|
||||
|
||||
.hero__content {
|
||||
align-self: end;
|
||||
}
|
||||
|
||||
.hero h1 {
|
||||
margin: 0;
|
||||
font-family: ui-serif, "Noto Serif SC", "Songti SC", serif;
|
||||
font-size: clamp(58px, 9vw, 132px);
|
||||
font-weight: 800;
|
||||
line-height: 0.88;
|
||||
letter-spacing: -0.08em;
|
||||
}
|
||||
|
||||
.hero p {
|
||||
max-width: 560px;
|
||||
margin: 25px 0 0 6px;
|
||||
color: var(--muted);
|
||||
font-family: ui-serif, "Noto Serif SC", "Songti SC", serif;
|
||||
font-size: clamp(16px, 2vw, 22px);
|
||||
letter-spacing: 0.08em;
|
||||
}
|
||||
|
||||
.hero__mark {
|
||||
align-self: end;
|
||||
padding-bottom: 2px;
|
||||
font-size: clamp(64px, 9vw, 124px);
|
||||
font-weight: 300;
|
||||
line-height: 0.8;
|
||||
}
|
||||
|
||||
.workspace {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
|
||||
border: 1px solid var(--ink);
|
||||
box-shadow: 9px 9px 0 var(--ink);
|
||||
}
|
||||
|
||||
.panel {
|
||||
min-height: 460px;
|
||||
}
|
||||
|
||||
.panel--input {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background: rgba(244, 242, 234, 0.76);
|
||||
}
|
||||
|
||||
.panel--output {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background:
|
||||
radial-gradient(circle at 15% 18%, rgba(216, 255, 82, 0.08), transparent 25%),
|
||||
var(--ink);
|
||||
color: #efeee6;
|
||||
border-left: 1px solid var(--ink);
|
||||
}
|
||||
|
||||
.panel__heading {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
min-height: 76px;
|
||||
padding: 18px 22px;
|
||||
border-bottom: 1px solid var(--line);
|
||||
}
|
||||
|
||||
.panel__heading > div {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.panel__heading--dark {
|
||||
border-color: rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.panel__heading h2,
|
||||
.keyword-stage h2,
|
||||
.control-deck h2 {
|
||||
margin: 0;
|
||||
font-size: 19px;
|
||||
font-weight: 650;
|
||||
letter-spacing: 0.06em;
|
||||
}
|
||||
|
||||
.panel__number {
|
||||
color: var(--muted);
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.panel--output .panel__number {
|
||||
color: #9c9d93;
|
||||
}
|
||||
|
||||
.counter {
|
||||
color: var(--muted);
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.panel--output .counter {
|
||||
color: #9c9d93;
|
||||
}
|
||||
|
||||
textarea {
|
||||
flex: 1;
|
||||
width: 100%;
|
||||
min-height: 340px;
|
||||
padding: 28px 30px 34px;
|
||||
resize: none;
|
||||
color: var(--ink);
|
||||
background: transparent;
|
||||
border: 0;
|
||||
font-family: ui-serif, "Noto Serif SC", "Songti SC", serif;
|
||||
font-size: clamp(20px, 2.1vw, 28px);
|
||||
line-height: 1.85;
|
||||
letter-spacing: 0.04em;
|
||||
}
|
||||
|
||||
textarea::placeholder {
|
||||
color: #9b9a91;
|
||||
}
|
||||
|
||||
.mosaic-output {
|
||||
flex: 1;
|
||||
min-height: 316px;
|
||||
padding: 30px;
|
||||
overflow-wrap: anywhere;
|
||||
font-family:
|
||||
"Noto Serif SC", "Songti SC", ui-serif, "Courier New", serif;
|
||||
font-size: clamp(21px, 2.25vw, 31px);
|
||||
line-height: 1.75;
|
||||
letter-spacing: 0.09em;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.mosaic-output--empty {
|
||||
color: #77786f;
|
||||
}
|
||||
|
||||
.output-actions {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
border-top: 1px solid rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.button {
|
||||
min-height: 64px;
|
||||
padding: 12px 20px;
|
||||
cursor: pointer;
|
||||
border: 0;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.06em;
|
||||
transition:
|
||||
color 160ms ease,
|
||||
background 160ms ease;
|
||||
}
|
||||
|
||||
.button--light {
|
||||
background: var(--acid);
|
||||
color: var(--ink);
|
||||
}
|
||||
|
||||
.button--light:hover {
|
||||
background: #efffb4;
|
||||
}
|
||||
|
||||
.button--outline {
|
||||
color: #efeee6;
|
||||
background: transparent;
|
||||
border-left: 1px solid rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.button--outline:hover {
|
||||
color: var(--ink);
|
||||
background: #efeee6;
|
||||
}
|
||||
|
||||
.control-deck {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(160px, 0.7fr) 2fr;
|
||||
gap: 40px;
|
||||
margin-top: 76px;
|
||||
padding: 26px 0 38px;
|
||||
border-top: 1px solid var(--ink);
|
||||
border-bottom: 1px solid var(--ink);
|
||||
}
|
||||
|
||||
.control-deck__title > span {
|
||||
display: block;
|
||||
margin-bottom: 14px;
|
||||
color: var(--muted);
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
font-size: 10px;
|
||||
letter-spacing: 0.13em;
|
||||
}
|
||||
|
||||
.controls {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 34px;
|
||||
}
|
||||
|
||||
.control {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.control__heading {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
font-weight: 720;
|
||||
}
|
||||
|
||||
.control__heading output {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
font-size: 13px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.control__hint {
|
||||
display: block;
|
||||
min-height: 36px;
|
||||
margin-top: 7px;
|
||||
color: var(--muted);
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
input[type="range"] {
|
||||
width: 100%;
|
||||
height: 18px;
|
||||
margin-top: 18px;
|
||||
cursor: pointer;
|
||||
appearance: none;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
input[type="range"]::-webkit-slider-runnable-track {
|
||||
height: 2px;
|
||||
background: var(--ink);
|
||||
}
|
||||
|
||||
input[type="range"]::-moz-range-track {
|
||||
height: 2px;
|
||||
background: var(--ink);
|
||||
}
|
||||
|
||||
input[type="range"]::-webkit-slider-thumb {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
margin-top: -8px;
|
||||
appearance: none;
|
||||
background: var(--acid);
|
||||
border: 2px solid var(--ink);
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
input[type="range"]::-moz-range-thumb {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
background: var(--acid);
|
||||
border: 2px solid var(--ink);
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.keyword-stage {
|
||||
margin-top: 74px;
|
||||
}
|
||||
|
||||
.keyword-stage__heading {
|
||||
display: flex;
|
||||
align-items: end;
|
||||
justify-content: space-between;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
.keyword-stage__heading > div {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr;
|
||||
align-items: baseline;
|
||||
gap: 0 12px;
|
||||
}
|
||||
|
||||
.keyword-stage__heading p {
|
||||
grid-column: 2;
|
||||
margin: 9px 0 0;
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.text-button {
|
||||
padding: 8px 0;
|
||||
cursor: pointer;
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-bottom: 1px solid var(--ink);
|
||||
font-size: 13px;
|
||||
font-weight: 650;
|
||||
}
|
||||
|
||||
.text-button:hover {
|
||||
border-bottom-width: 3px;
|
||||
}
|
||||
|
||||
.keyword-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 9px;
|
||||
min-height: 110px;
|
||||
margin-top: 24px;
|
||||
padding: 24px;
|
||||
background: rgba(244, 242, 234, 0.7);
|
||||
border: 1px solid var(--ink);
|
||||
}
|
||||
|
||||
.keyword-token {
|
||||
min-width: 46px;
|
||||
padding: 9px 13px;
|
||||
cursor: pointer;
|
||||
background: transparent;
|
||||
border: 1px solid var(--line);
|
||||
font-family: ui-serif, "Noto Serif SC", "Songti SC", serif;
|
||||
font-size: 15px;
|
||||
transition:
|
||||
transform 120ms ease,
|
||||
color 120ms ease,
|
||||
background 120ms ease;
|
||||
}
|
||||
|
||||
.keyword-token:hover {
|
||||
transform: translateY(-2px);
|
||||
border-color: var(--ink);
|
||||
}
|
||||
|
||||
.keyword-token--selected {
|
||||
color: var(--acid);
|
||||
background: var(--ink);
|
||||
border-color: var(--ink);
|
||||
}
|
||||
|
||||
.keyword-list__empty {
|
||||
margin: auto;
|
||||
color: var(--muted);
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
footer {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 24px;
|
||||
margin-top: 96px;
|
||||
padding-top: 18px;
|
||||
color: var(--muted);
|
||||
border-top: 1px solid var(--line);
|
||||
font-size: 11px;
|
||||
letter-spacing: 0.08em;
|
||||
}
|
||||
|
||||
footer p {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.toast {
|
||||
position: fixed;
|
||||
right: 24px;
|
||||
bottom: 24px;
|
||||
z-index: 10;
|
||||
padding: 13px 18px;
|
||||
color: var(--ink);
|
||||
background: var(--acid);
|
||||
border: 1px solid var(--ink);
|
||||
box-shadow: 5px 5px 0 var(--ink);
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
opacity: 0;
|
||||
transform: translateY(18px);
|
||||
pointer-events: none;
|
||||
transition:
|
||||
opacity 180ms ease,
|
||||
transform 180ms ease;
|
||||
}
|
||||
|
||||
.toast--visible {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
padding: 0;
|
||||
margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap;
|
||||
border: 0;
|
||||
}
|
||||
|
||||
@media (max-width: 860px) {
|
||||
.page-shell {
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.hero {
|
||||
min-height: 190px;
|
||||
}
|
||||
|
||||
.hero__mark {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.workspace {
|
||||
grid-template-columns: 1fr;
|
||||
box-shadow: 6px 6px 0 var(--ink);
|
||||
}
|
||||
|
||||
.panel {
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
.panel--output {
|
||||
border-top: 1px solid var(--ink);
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
.control-deck {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 30px;
|
||||
margin-top: 64px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 640px) {
|
||||
.page-shell {
|
||||
padding-inline: 14px;
|
||||
}
|
||||
|
||||
.hero {
|
||||
min-height: 164px;
|
||||
padding-bottom: 22px;
|
||||
}
|
||||
|
||||
.hero h1 {
|
||||
font-size: clamp(52px, 17vw, 78px);
|
||||
}
|
||||
|
||||
.hero p {
|
||||
margin-top: 18px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.panel {
|
||||
min-height: 360px;
|
||||
}
|
||||
|
||||
.panel__heading {
|
||||
min-height: 66px;
|
||||
padding: 15px 17px;
|
||||
}
|
||||
|
||||
textarea,
|
||||
.mosaic-output {
|
||||
min-height: 290px;
|
||||
padding: 22px 18px;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.controls {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 30px;
|
||||
}
|
||||
|
||||
.control__hint {
|
||||
min-height: auto;
|
||||
}
|
||||
|
||||
.keyword-stage {
|
||||
margin-top: 58px;
|
||||
}
|
||||
|
||||
.keyword-stage__heading {
|
||||
align-items: start;
|
||||
}
|
||||
|
||||
.keyword-stage__heading p {
|
||||
grid-column: 1 / -1;
|
||||
}
|
||||
|
||||
.keyword-list {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
footer {
|
||||
flex-direction: column;
|
||||
margin-top: 70px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
scroll-behavior: auto !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user