updated Version
This commit is contained in:
parent
35d7c2243d
commit
43ebf18ba8
778
CSS/styles.css
778
CSS/styles.css
@ -1,314 +1,570 @@
|
||||
*, *::after, *::before{
|
||||
box-sizing: border-box;
|
||||
:root {
|
||||
--bg: oklch(97% 0.018 70);
|
||||
--surface: oklch(99% 0.008 70);
|
||||
--fg: oklch(22% 0.02 50);
|
||||
--muted: oklch(50% 0.018 50);
|
||||
--border: oklch(90% 0.014 70);
|
||||
--accent: oklch(64% 0.13 28);
|
||||
--font-display: 'Tiempos Headline', 'Newsreader', 'Iowan Old Style', Georgia, serif;
|
||||
--font-body: 'Söhne', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
|
||||
|
||||
--correct: oklch(59% 0.12 145);
|
||||
--present: oklch(73% 0.12 82);
|
||||
--absent: oklch(47% 0.018 50);
|
||||
--tile: oklch(99% 0.008 70);
|
||||
--key: oklch(91% 0.018 70);
|
||||
--shadow: 0 24px 80px oklch(22% 0.02 50 / 0.12);
|
||||
}
|
||||
|
||||
body{
|
||||
background-color: hsl(0, 67%, 96%);
|
||||
display: flex;
|
||||
text-align: center;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
margin: 0;
|
||||
padding: 1.5em;
|
||||
font-size: clamp(.5rem, 2.5vmin, 1.5rem);
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.keyboard {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(20, minmax(auto, 1.50em));
|
||||
grid-auto-rows: 4em;
|
||||
gap: .25em;
|
||||
justify-content: center;
|
||||
margin-top: 2em; /* ADDED: Fixed spacing from grid */
|
||||
html {
|
||||
min-height: 100%;
|
||||
}
|
||||
|
||||
.key{
|
||||
font-size: inherit;
|
||||
grid-column: span 2;
|
||||
border: none;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: hsl(
|
||||
var(--hue, 200),
|
||||
var(--saturation, 1%),
|
||||
calc(var(--lightness-offset, 0%) + var(--lightness, 51%))
|
||||
);
|
||||
color: rgb(255, 255, 255);
|
||||
fill: white;
|
||||
text-transform: uppercase;
|
||||
border-radius: .25em;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
.key.large{
|
||||
grid-column: span 3;
|
||||
}
|
||||
.key > svg {
|
||||
width: 1.70em;
|
||||
height: 1.70em;
|
||||
}
|
||||
.key:hover, .key:focus{
|
||||
--lightness-offset: 10%;
|
||||
body {
|
||||
min-height: 100vh;
|
||||
margin: 0;
|
||||
background:
|
||||
radial-gradient(circle at 12% 0%, oklch(88% 0.065 45 / 0.35), transparent 34rem),
|
||||
var(--bg);
|
||||
color: var(--fg);
|
||||
font-family: var(--font-body);
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.key.wrong {
|
||||
--lightness: 23%;
|
||||
}
|
||||
.key.wrong-position{
|
||||
--hue: 49;
|
||||
--saturation: 51%;
|
||||
--lightness: 47%;
|
||||
body.dark-theme {
|
||||
--bg: oklch(18% 0.018 50);
|
||||
--surface: oklch(24% 0.018 50);
|
||||
--fg: oklch(96% 0.014 70);
|
||||
--muted: oklch(76% 0.014 70);
|
||||
--border: oklch(33% 0.018 50);
|
||||
--tile: oklch(26% 0.018 50);
|
||||
--key: oklch(34% 0.018 50);
|
||||
--shadow: 0 24px 80px oklch(8% 0.01 50 / 0.38);
|
||||
}
|
||||
|
||||
.key.correct{
|
||||
--hue: 115;
|
||||
--saturation: 29%;
|
||||
--lightness: 43%;
|
||||
button,
|
||||
a {
|
||||
font: inherit;
|
||||
}
|
||||
|
||||
.guess-grid{
|
||||
display: grid;
|
||||
justify-content: center;
|
||||
align-content: center;
|
||||
/* flex: 1; */ /* REMOVED: This was causing the large spacing */
|
||||
grid-template-columns: repeat(5, 4em);
|
||||
grid-template-rows: repeat(6, 4em);
|
||||
gap: .25em;
|
||||
margin: 2em auto 5em auto; /* CHANGED: Added top margin and made it centered */
|
||||
.app-shell {
|
||||
width: min(1120px, calc(100% - 32px));
|
||||
min-height: 100vh;
|
||||
margin: 0 auto;
|
||||
padding: 24px 0 32px;
|
||||
}
|
||||
|
||||
.tile{
|
||||
font-size: 2em;
|
||||
color: rgb(158, 155, 155);
|
||||
border: .05em solid hsl(240, 3%, 14%);
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
user-select: none;
|
||||
transition: transform 250ms linear;
|
||||
transition: transform 250ms linear;
|
||||
.topbar,
|
||||
.game-card,
|
||||
.stats-card {
|
||||
border: 1px solid var(--border);
|
||||
background: color-mix(in oklch, var(--surface) 90%, transparent);
|
||||
box-shadow: 0 0 0 1px color-mix(in oklch, var(--surface) 70%, transparent);
|
||||
}
|
||||
|
||||
.topbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
min-height: 68px;
|
||||
padding: 10px 12px;
|
||||
border-radius: 20px;
|
||||
backdrop-filter: blur(18px);
|
||||
}
|
||||
|
||||
.brand,
|
||||
.actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.brand {
|
||||
gap: 12px;
|
||||
color: inherit;
|
||||
text-align: start;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.brand-mark {
|
||||
display: grid;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
place-items: center;
|
||||
border-radius: 14px;
|
||||
background: var(--fg);
|
||||
color: var(--surface);
|
||||
font-family: var(--font-display);
|
||||
font-size: 1.35rem;
|
||||
}
|
||||
|
||||
.brand strong {
|
||||
display: block;
|
||||
font-family: var(--font-display);
|
||||
font-size: 1.15rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.brand small,
|
||||
.deck,
|
||||
.status-row,
|
||||
.alert,
|
||||
.definition-alert {
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.actions {
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.icon-button,
|
||||
.button {
|
||||
min-width: 44px;
|
||||
min-height: 44px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 14px;
|
||||
background: var(--surface);
|
||||
color: var(--fg);
|
||||
cursor: pointer;
|
||||
text-decoration: none;
|
||||
transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease;
|
||||
}
|
||||
|
||||
.icon-button {
|
||||
display: inline-grid;
|
||||
place-items: center;
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
|
||||
.icon-button:hover,
|
||||
.button:hover {
|
||||
transform: translateY(-1px);
|
||||
border-color: color-mix(in oklch, var(--accent), var(--border) 45%);
|
||||
}
|
||||
|
||||
.game-card {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(280px, 0.9fr) minmax(320px, 1.1fr);
|
||||
gap: clamp(20px, 4vw, 56px);
|
||||
margin-top: 18px;
|
||||
padding: clamp(20px, 4vw, 48px);
|
||||
border-radius: 32px;
|
||||
box-shadow: var(--shadow);
|
||||
}
|
||||
|
||||
.hero-panel {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
.eyebrow {
|
||||
margin: 0 0 12px;
|
||||
color: var(--accent);
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
h1,
|
||||
h2 {
|
||||
margin: 0;
|
||||
font-family: var(--font-display);
|
||||
font-weight: 500;
|
||||
line-height: 1.05;
|
||||
}
|
||||
|
||||
h1 {
|
||||
max-width: 9ch;
|
||||
font-size: clamp(3rem, 7vw, 5.9rem);
|
||||
}
|
||||
|
||||
h2 {
|
||||
font-size: clamp(2rem, 4vw, 3rem);
|
||||
}
|
||||
|
||||
.deck {
|
||||
max-width: 34rem;
|
||||
margin: 22px 0 0;
|
||||
font-size: clamp(1rem, 1.4vw, 1.2rem);
|
||||
line-height: 1.65;
|
||||
}
|
||||
|
||||
.board-panel {
|
||||
position: relative;
|
||||
display: grid;
|
||||
justify-items: center;
|
||||
gap: 18px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.status-row {
|
||||
display: flex;
|
||||
width: min(100%, 430px);
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 12px;
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.pill {
|
||||
padding: 6px 10px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 999px;
|
||||
color: var(--fg);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.guess-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, minmax(44px, 68px));
|
||||
grid-template-rows: repeat(6, minmax(44px, 68px));
|
||||
gap: 8px;
|
||||
inline-size: min(100%, 372px);
|
||||
aspect-ratio: 5 / 6;
|
||||
}
|
||||
|
||||
.tile {
|
||||
display: grid;
|
||||
place-items: center;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 14px;
|
||||
background: var(--tile);
|
||||
color: var(--fg);
|
||||
font-size: clamp(1.35rem, 5vw, 2rem);
|
||||
font-weight: 800;
|
||||
text-transform: uppercase;
|
||||
user-select: none;
|
||||
transition: transform 250ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
|
||||
}
|
||||
|
||||
.tile[data-state="active"] {
|
||||
border-color: hsl(240, 1%, 18%);
|
||||
|
||||
border-color: color-mix(in oklch, var(--accent), var(--fg) 25%);
|
||||
box-shadow: inset 0 0 0 1px color-mix(in oklch, var(--accent), transparent 60%);
|
||||
}
|
||||
|
||||
.tile[data-state="wrong"] {
|
||||
border: none;
|
||||
background-color: hsl(240, 12%, 24%);
|
||||
.tile[data-state="wrong"],
|
||||
.key.wrong {
|
||||
background: var(--absent);
|
||||
border-color: var(--absent);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.tile[data-state="wrong-position"] {
|
||||
border: none;
|
||||
background-color: hsl(49, 51%, 47%);
|
||||
.tile[data-state="wrong-position"],
|
||||
.key.wrong-position {
|
||||
background: var(--present);
|
||||
border-color: var(--present);
|
||||
color: var(--fg);
|
||||
}
|
||||
|
||||
.tile[data-state="correct"],
|
||||
.key.correct {
|
||||
background: var(--correct);
|
||||
border-color: var(--correct);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.tile[data-state="correct"] {
|
||||
border: none;
|
||||
background-color: hsl(115, 31%, 48%);
|
||||
color: white;
|
||||
.tile.flip {
|
||||
transform: rotateX(90deg);
|
||||
}
|
||||
.tile.shake{
|
||||
animation:shake 250ms ease-in-out;
|
||||
|
||||
.tile.shake {
|
||||
animation: shake 250ms ease-in-out;
|
||||
}
|
||||
|
||||
.tile.dance {
|
||||
animation: dance 500ms ease-in-out;
|
||||
}
|
||||
|
||||
.tile.flip {
|
||||
transform: rotateX(90deg);
|
||||
.keyboard {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(20, minmax(0, 1fr));
|
||||
gap: 6px;
|
||||
width: min(100%, 560px);
|
||||
touch-action: manipulation;
|
||||
}
|
||||
|
||||
@keyframes shake {
|
||||
10% {
|
||||
transform: translateX(-5%);
|
||||
}
|
||||
30% {
|
||||
transform: translateX(5%);
|
||||
}
|
||||
50% {
|
||||
transform: translateX(-7.5%);
|
||||
}
|
||||
70% {
|
||||
transform: translateX(7.5%);
|
||||
}
|
||||
90% {
|
||||
transform: translateX(-5%);
|
||||
}
|
||||
100% {
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
@keyframes dance {
|
||||
20% {
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
40% {
|
||||
transform: translateY(5%);
|
||||
}
|
||||
60% {
|
||||
transform: translateY(-25%);
|
||||
}
|
||||
80% {
|
||||
transform: translateY(2.5%);
|
||||
}
|
||||
90% {
|
||||
transform: translateY(-5%);
|
||||
}
|
||||
100% {
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.alert-container{
|
||||
position: fixed;
|
||||
top: 17vh;
|
||||
left: 50vw;
|
||||
transform: translateX(-50%);
|
||||
z-index: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
.alert{
|
||||
pointer-events: none;
|
||||
background-color: hsl(204, 7%, 85%);
|
||||
padding: .55em;
|
||||
border-radius: .25em;
|
||||
opacity: 1;
|
||||
transition: opacity 500ms ease-in-out;
|
||||
margin-bottom: .5em;
|
||||
}
|
||||
|
||||
.alert:last-child{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.alert.hide{
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
.img-banner{
|
||||
width: auto ;
|
||||
max-width: 50% ;
|
||||
height: auto ;
|
||||
}
|
||||
|
||||
|
||||
.theme-change{
|
||||
position: absolute;
|
||||
top: 2.5rem;
|
||||
display: flex;
|
||||
color: rgb(202, 181, 181);
|
||||
font-size: 1.2rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.theme-change:hover{
|
||||
color: rgb(150, 141, 141)
|
||||
}
|
||||
|
||||
body.dark-theme{
|
||||
background-color: hsl(0, 0%, 8%);
|
||||
font:white;
|
||||
display: flex;
|
||||
text-align: center;
|
||||
flex-direction: column;
|
||||
min-height: 100vh;
|
||||
margin: 0;
|
||||
padding: 1em;
|
||||
font-size: clamp(.5rem, 2.5vmin, 1.5rem);
|
||||
}
|
||||
|
||||
.share-stats{
|
||||
position: absolute;
|
||||
top: 4.5rem;
|
||||
display: flex;
|
||||
color: rgb(202, 181, 181);
|
||||
font-size: 1.2rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
.share-stats:hover{
|
||||
color: rgb(150, 141, 141)
|
||||
}
|
||||
.setting-page{
|
||||
position: absolute;
|
||||
top: 6.5rem;
|
||||
display: flex;
|
||||
color: rgb(202, 181, 181);
|
||||
font-size: 1.2rem;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.setting-page:hover{
|
||||
color: rgb(150, 141, 141)
|
||||
}
|
||||
/* Definition Alert Styles */
|
||||
.definition-alert {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
color: white;
|
||||
padding: 20px;
|
||||
.key {
|
||||
grid-column: span 2;
|
||||
min-height: 48px;
|
||||
padding: 0;
|
||||
border: 1px solid color-mix(in oklch, var(--border), var(--fg) 5%);
|
||||
border-radius: 12px;
|
||||
max-width: 400px;
|
||||
margin: 0 auto 10px;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
backdrop-filter: blur(10px);
|
||||
background: var(--key);
|
||||
color: var(--fg);
|
||||
font-size: clamp(0.8rem, 2vw, 1rem);
|
||||
font-weight: 800;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
text-align: left;
|
||||
line-height: 1.6;
|
||||
font-size: 14px;
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
.definition-alert:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
|
||||
.key.large {
|
||||
grid-column: span 3;
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
|
||||
.win-definition {
|
||||
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
|
||||
border-color: rgba(79, 172, 254, 0.5);
|
||||
.key.space {
|
||||
grid-column: span 1;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.lose-definition {
|
||||
background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
|
||||
border-color: rgba(250, 112, 154, 0.5);
|
||||
.key svg {
|
||||
width: 1.35rem;
|
||||
height: 1.35rem;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
.key:hover,
|
||||
.key:focus-visible {
|
||||
outline: none;
|
||||
transform: translateY(-1px);
|
||||
border-color: var(--accent);
|
||||
}
|
||||
|
||||
.alert-container {
|
||||
position: fixed;
|
||||
inset-block-start: 96px;
|
||||
inset-inline: 16px;
|
||||
z-index: 10;
|
||||
display: grid;
|
||||
justify-items: center;
|
||||
gap: 8px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.alert {
|
||||
max-width: min(440px, calc(100vw - 32px));
|
||||
padding: 12px 16px;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 14px;
|
||||
background: var(--surface);
|
||||
box-shadow: var(--shadow);
|
||||
color: var(--fg);
|
||||
line-height: 1.45;
|
||||
opacity: 1;
|
||||
transition: opacity 400ms ease, transform 400ms ease;
|
||||
}
|
||||
|
||||
.alert.hide {
|
||||
opacity: 0;
|
||||
transform: translateY(-6px);
|
||||
}
|
||||
|
||||
.definition-alert {
|
||||
pointer-events: auto;
|
||||
width: min(440px, calc(100vw - 32px));
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
.definition-alert strong {
|
||||
font-weight: 700;
|
||||
font-size: 16px;
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
margin-bottom: 6px;
|
||||
color: var(--fg);
|
||||
font-family: var(--font-display);
|
||||
font-size: 1.2rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.definition-alert::before {
|
||||
content: "💡 Click to dismiss";
|
||||
position: absolute;
|
||||
top: 5px;
|
||||
right: 10px;
|
||||
font-size: 10px;
|
||||
opacity: 0.7;
|
||||
.definition-alert::after {
|
||||
display: block;
|
||||
margin-top: 10px;
|
||||
color: var(--muted);
|
||||
content: "Click to dismiss";
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
/* Dark theme adjustments */
|
||||
.dark-theme .definition-alert {
|
||||
border-color: rgba(255, 255, 255, 0.1);
|
||||
.stats-modal {
|
||||
width: min(520px, calc(100vw - 32px));
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 24px;
|
||||
background: transparent;
|
||||
color: var(--fg);
|
||||
}
|
||||
|
||||
/* Mobile responsiveness */
|
||||
@media (max-width: 380px) {
|
||||
.definition-alert {
|
||||
max-width: 90%;
|
||||
font-size: 13px;
|
||||
padding: 15px;
|
||||
.stats-modal::backdrop {
|
||||
background: oklch(18% 0.018 50 / 0.45);
|
||||
backdrop-filter: blur(4px);
|
||||
}
|
||||
|
||||
.stats-card {
|
||||
padding: 22px;
|
||||
border-radius: 24px;
|
||||
text-align: start;
|
||||
}
|
||||
|
||||
.modal-head,
|
||||
.modal-actions,
|
||||
.stat-item,
|
||||
.guess-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.modal-head,
|
||||
.modal-actions {
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
}
|
||||
|
||||
.close-button {
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.stats-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr);
|
||||
gap: 10px;
|
||||
margin: 22px 0;
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
min-height: 82px;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 16px;
|
||||
background: var(--bg);
|
||||
}
|
||||
|
||||
.stat-item strong {
|
||||
font-family: var(--font-display);
|
||||
font-size: 2rem;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.stat-item span {
|
||||
color: var(--muted);
|
||||
font-size: 0.78rem;
|
||||
}
|
||||
|
||||
.guess-bars {
|
||||
display: grid;
|
||||
gap: 8px;
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
|
||||
.guess-bar {
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.guess-bar-label {
|
||||
width: 1.5rem;
|
||||
color: var(--muted);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.guess-bar-fill {
|
||||
min-width: 28px;
|
||||
height: 26px;
|
||||
padding-inline-end: 8px;
|
||||
border-radius: 8px;
|
||||
background: color-mix(in oklch, var(--accent), var(--border) 40%);
|
||||
color: white;
|
||||
text-align: end;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 800;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
.button {
|
||||
padding: 0 16px;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.button.primary {
|
||||
background: var(--accent);
|
||||
color: white;
|
||||
}
|
||||
|
||||
.button.secondary {
|
||||
background: var(--key);
|
||||
}
|
||||
|
||||
@keyframes shake {
|
||||
10%, 90% { transform: translateX(-4%); }
|
||||
30%, 70% { transform: translateX(5%); }
|
||||
50% { transform: translateX(-7%); }
|
||||
}
|
||||
|
||||
@keyframes dance {
|
||||
20% { transform: translateY(-45%); }
|
||||
40% { transform: translateY(4%); }
|
||||
60% { transform: translateY(-20%); }
|
||||
80% { transform: translateY(2%); }
|
||||
100% { transform: translateY(0); }
|
||||
}
|
||||
|
||||
@media (max-width: 780px) {
|
||||
.app-shell {
|
||||
width: min(100% - 20px, 600px);
|
||||
padding-top: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
.game-card {
|
||||
grid-template-columns: 1fr;
|
||||
padding: 18px;
|
||||
border-radius: 24px;
|
||||
}
|
||||
|
||||
.hero-panel {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
h1,
|
||||
.deck {
|
||||
margin-inline: auto;
|
||||
}
|
||||
|
||||
.deck {
|
||||
margin-top: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 460px) {
|
||||
.brand small {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.topbar {
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.actions {
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.icon-button {
|
||||
min-width: 40px;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
.guess-grid {
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.tile {
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.keyboard {
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.key {
|
||||
min-height: 44px;
|
||||
border-radius: 9px;
|
||||
}
|
||||
|
||||
.stats-grid {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
}
|
||||
|
||||
17
IMPROVEMENTS.md
Normal file
17
IMPROVEMENTS.md
Normal file
@ -0,0 +1,17 @@
|
||||
# Fancy Wordle Improvements
|
||||
|
||||
Implemented:
|
||||
- Modern responsive game shell while preserving the static HTML/CSS/JS architecture.
|
||||
- Warm-soft visual system with cream surfaces, gentle radii, and restrained accent use.
|
||||
- Generated board and keyboard from data instead of hardcoding repeated markup.
|
||||
- Correct Wordle scoring for repeated letters.
|
||||
- Preserved dark mode, keyboard input, word-list fetches, dictionary validation, win sound, confetti, definition lookup, and the original love-link shortcut.
|
||||
- Added a working stats/share dialog using localStorage.
|
||||
- Improved accessibility with semantic buttons, labels, live alerts, visible focus states, and 44px touch targets.
|
||||
|
||||
Good next features:
|
||||
- Hard mode that forces revealed hints into later guesses.
|
||||
- Daily challenge mode alongside the current unlimited mode.
|
||||
- Reduced-motion preference for flip, dance, and confetti animations.
|
||||
- Offline definition fallback for the target word list.
|
||||
- Importable custom word packs for classroom or party play.
|
||||
76
fancy-wordle-modern.html
Normal file
76
fancy-wordle-modern.html
Normal file
@ -0,0 +1,76 @@
|
||||
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="theme-color" content="#f7efe6">
|
||||
<title>Fancy Wordle</title>
|
||||
<link rel="stylesheet" href="CSS/styles.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/@tsparticles/confetti@3.0.3/tsparticles.confetti.bundle.min.js"></script>
|
||||
<script src="word-data.js?v=4" defer></script>
|
||||
<script src="script.js?v=4" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="app-shell">
|
||||
<header class="topbar" aria-label="Game controls">
|
||||
<a class="brand" href="#" aria-label="Restart Fancy Wordle">
|
||||
<span class="brand-mark">W</span>
|
||||
<span>
|
||||
<strong>Fancy Wordle</strong>
|
||||
<small>Non-stop five-letter play</small>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="actions" aria-label="Quick actions">
|
||||
<button class="icon-button" type="button" id="theme-button" aria-label="Toggle dark mode" title="Toggle theme">
|
||||
<span aria-hidden="true">◐</span>
|
||||
</button>
|
||||
<button class="icon-button" type="button" id="Stats-button" aria-label="Open stats and share" title="Stats and share">
|
||||
<span aria-hidden="true">↗</span>
|
||||
</button>
|
||||
<a class="icon-button" href="https://www.youtube.com/watch?v=UkOKCWDJ4iA" target="_blank" rel="noopener noreferrer" aria-label="Open the original love note" title="Original love note">
|
||||
<span aria-hidden="true">♡</span>
|
||||
</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main class="game-card">
|
||||
<section class="hero-panel" aria-labelledby="game-title">
|
||||
<p class="eyebrow">Daily pace optional</p>
|
||||
<h1 id="game-title">Guess the word in six tries.</h1>
|
||||
<p class="deck">Play as many rounds as you want. Valid words reveal with smooth flips, warm feedback, confetti, sound, and a definition at the end.</p>
|
||||
</section>
|
||||
|
||||
<section class="board-panel" aria-label="Wordle game board">
|
||||
<div class="status-row">
|
||||
<span id="round-status">Loading word lists…</span>
|
||||
<span class="pill" id="tries-status">0 / 6</span>
|
||||
</div>
|
||||
|
||||
<div class="alert-container" data-alert-container aria-live="polite" aria-atomic="true"></div>
|
||||
<div data-guess-grid class="guess-grid" aria-label="Guess grid"></div>
|
||||
<div data-keyboard class="keyboard" aria-label="Keyboard"></div>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<dialog class="stats-modal" id="stats-modal" aria-labelledby="stats-title">
|
||||
<form method="dialog" class="stats-card">
|
||||
<div class="modal-head">
|
||||
<div>
|
||||
<p class="eyebrow">Progress</p>
|
||||
<h2 id="stats-title">Game stats</h2>
|
||||
</div>
|
||||
<button class="icon-button close-button" type="submit" aria-label="Close stats">×</button>
|
||||
</div>
|
||||
<div class="stats-grid" id="stats-grid"></div>
|
||||
<div class="guess-bars" id="guess-bars" aria-label="Guess distribution"></div>
|
||||
<menu class="modal-actions">
|
||||
<button type="button" class="button secondary" id="reset-stats">Reset stats</button>
|
||||
<button type="button" class="button primary" id="share-results">Share result</button>
|
||||
</menu>
|
||||
</form>
|
||||
</dialog>
|
||||
</body>
|
||||
</html>
|
||||
185
index.html
185
index.html
@ -1,110 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/boxicons@latest/css/boxicons.min.css">
|
||||
<link rel="stylesheet" href="CSS/styles.css">
|
||||
<link rel="stylesheet" href="path/to/font-awesome/css/font-awesome.min.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/@tsparticles/confetti@3.0.3/tsparticles.confetti.bundle.min.js"></script>
|
||||
<script src="script.js" defer></script>
|
||||
<title>Wordle for Sara</title>
|
||||
</head>
|
||||
<body>
|
||||
<section class="darkmode section">
|
||||
<p>
|
||||
<a href="#"onclick="window.location.reload(true);">
|
||||
<img class="img-banner" src="img/wordle.png" alt="wordle">
|
||||
<hr style="width:25%;">
|
||||
</a>
|
||||
</p>
|
||||
</section>
|
||||
<section class="icons section">
|
||||
<div class="icons__container bd-grid">
|
||||
<i class='bx bx-moon theme-change' title="Theme" id="theme-button"></i>
|
||||
</div>
|
||||
<div class="icons__container bd-grid">
|
||||
<i class='bx bx-share-alt share-stats' title="Stats" id="Stats-button"></i>
|
||||
</div>
|
||||
<div class="icons__container bd-grid">
|
||||
<a href="https://www.youtube.com/watch?v=UkOKCWDJ4iA" target="_blank" rel="noopener noreferrer">
|
||||
<i class='bx bxs-heart setting-page' title="I love You" id="Setting-button"></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
</section>
|
||||
<div class="alert-container" data-alert-container></div>
|
||||
<div data-guess-grid class="guess-grid">
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
<div class="tile"></div>
|
||||
</div>
|
||||
<div data-keyboard class="keyboard">
|
||||
<button class="key" data-key="Q">Q</button>
|
||||
<button class="key" data-key="W">W</button>
|
||||
<button class="key" data-key="E">E</button>
|
||||
<button class="key" data-key="R">R</button>
|
||||
<button class="key" data-key="T">T</button>
|
||||
<button class="key" data-key="Y">Y</button>
|
||||
<button class="key" data-key="U">U</button>
|
||||
<button class="key" data-key="I">I</button>
|
||||
<button class="key" data-key="O">O</button>
|
||||
<button class="key" data-key="P">P</button>
|
||||
<div class="space"></div>
|
||||
<button class="key" data-key="A">A</button>
|
||||
<button class="key" data-key="S">S</button>
|
||||
<button class="key" data-key="D">D</button>
|
||||
<button class="key" data-key="F">F</button>
|
||||
<button class="key" data-key="G">G</button>
|
||||
<button class="key" data-key="H">H</button>
|
||||
<button class="key" data-key="J">J</button>
|
||||
<button class="key" data-key="K">K</button>
|
||||
<button class="key" data-key="L">L</button>
|
||||
<div class="space"></div>
|
||||
<button data-enter class="key large">Enter</button>
|
||||
<button class="key" data-key="Z">Z</button>
|
||||
<button class="key" data-key="X">X</button>
|
||||
<button class="key" data-key="C">C</button>
|
||||
<button class="key" data-key="V">V</button>
|
||||
<button class="key" data-key="B">B</button>
|
||||
<button class="key" data-key="N">N</button>
|
||||
<button class="key" data-key="M">M</button>
|
||||
<button data-delete class="key large">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
|
||||
<path fill="var(--color-tone-1)"
|
||||
d="M22 3H7c-.69 0-1.23.35-1.59.88L0 12l5.41 8.11c.36.53.9.89 1.59.89h15c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H7.07L2.4 12l4.66-7H22v14zm-11.59-2L14 13.41 17.59 17 19 15.59 15.41 12 19 8.41 17.59 7 14 10.59 10.41 7 9 8.41 12.59 12 9 15.59z">
|
||||
</path>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta name="theme-color" content="#f7efe6">
|
||||
<title>Fancy Wordle</title>
|
||||
<link rel="stylesheet" href="CSS/styles.css">
|
||||
<script src="https://cdn.jsdelivr.net/npm/@tsparticles/confetti@3.0.3/tsparticles.confetti.bundle.min.js"></script>
|
||||
<script src="word-data.js?v=5" defer></script>
|
||||
<script src="script.js?v=5" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="app-shell">
|
||||
<header class="topbar" aria-label="Game controls">
|
||||
<a class="brand" href="#" aria-label="Restart Fancy Wordle">
|
||||
<span class="brand-mark">W</span>
|
||||
<span>
|
||||
<strong>Fancy Wordle</strong>
|
||||
<small>Non-stop five-letter play</small>
|
||||
</span>
|
||||
</a>
|
||||
|
||||
<nav class="actions" aria-label="Quick actions">
|
||||
<button class="icon-button" type="button" id="theme-button" aria-label="Toggle dark mode" title="Toggle theme">
|
||||
<span aria-hidden="true">◐</span>
|
||||
</button>
|
||||
<button class="icon-button" type="button" id="Stats-button" aria-label="Open stats and share" title="Stats and share">
|
||||
<span aria-hidden="true">↗</span>
|
||||
</button>
|
||||
<a class="icon-button" href="https://www.youtube.com/watch?v=UkOKCWDJ4iA" target="_blank" rel="noopener noreferrer" aria-label="Open the original love note" title="Original love note">
|
||||
<span aria-hidden="true">♡</span>
|
||||
</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<main class="game-card">
|
||||
<section class="hero-panel" aria-labelledby="game-title">
|
||||
<p class="eyebrow">Daily pace optional</p>
|
||||
<h1 id="game-title">Guess the word in six tries.</h1>
|
||||
<p class="deck">Play as many rounds as you want. Valid words reveal with smooth flips, warm feedback, confetti, sound, and a definition at the end.</p>
|
||||
</section>
|
||||
|
||||
<section class="board-panel" aria-label="Wordle game board">
|
||||
<div class="status-row">
|
||||
<span id="round-status">Loading word lists…</span>
|
||||
<span class="pill" id="tries-status">0 / 6</span>
|
||||
</div>
|
||||
|
||||
<div class="alert-container" data-alert-container aria-live="polite" aria-atomic="true"></div>
|
||||
<div data-guess-grid class="guess-grid" aria-label="Guess grid"></div>
|
||||
<div data-keyboard class="keyboard" aria-label="Keyboard"></div>
|
||||
</section>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<dialog class="stats-modal" id="stats-modal" aria-labelledby="stats-title">
|
||||
<form method="dialog" class="stats-card">
|
||||
<div class="modal-head">
|
||||
<div>
|
||||
<p class="eyebrow">Progress</p>
|
||||
<h2 id="stats-title">Game stats</h2>
|
||||
</div>
|
||||
<button class="icon-button close-button" type="submit" aria-label="Close stats">×</button>
|
||||
</div>
|
||||
<div class="stats-grid" id="stats-grid"></div>
|
||||
<div class="guess-bars" id="guess-bars" aria-label="Guess distribution"></div>
|
||||
<menu class="modal-actions">
|
||||
<button type="button" class="button secondary" id="reset-stats">Reset stats</button>
|
||||
<button type="button" class="button primary" id="share-results">Share result</button>
|
||||
</menu>
|
||||
</form>
|
||||
</dialog>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
1
word-data.js
Normal file
1
word-data.js
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user