update website with better performance and styles

This commit is contained in:
Frederik Spirgi
2026-10-07 10:56:35 +02:00
parent f34ef3b84c
commit 433bc8ee25
6 changed files with 1266 additions and 1369 deletions
+376 -477
View File
@@ -1,478 +1,377 @@
html, body {
margin: 0;
padding: 0;
height: 100%;
overflow-x: hidden;
background: linear-gradient(180deg, #8fc9f2 0%, #eef8ff 100%);
font-family: "Trebuchet MS", Verdana, sans-serif;
}
#welcome-screen {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
color: #fff;
display: flex;
justify-content: center;
align-items: center;
z-index: 10;
background-color: #B3C0CA;
opacity: 1;
transition: opacity 0.5s ease;
overflow: hidden;
}
#welcome-screen.hidden {
opacity: 0;
pointer-events: none;
}
#main-content {
opacity: 0;
visibility: hidden;
position: relative;
top: 0;
left: 0;
width: 100%;
height: auto;
background-color: #B3C0CA;
transition: opacity 0.5s ease;
display: flex;
flex-direction: column;
align-items: center;
padding: 20px;
color: #fff;
overflow-y: auto;
}
#main-content.visible {
opacity: 1;
visibility: visible;
transition: opacity 0.5s ease;
}
#welcome-content {
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
transition: background-color 0.5s ease;
}
#welcome-text {
color: white;
font-size: 24px;
margin-bottom: 20px;
text-align: center;
font-family: 'Pacifico', cursive;
}
#enter-button {
cursor: pointer;
width: 200px;
height: auto;
transition: transform 0.3s ease;
}
#enter-button:hover {
transform: scale(1.1);
}
#snow-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 1;
overflow: hidden;
}
.snowflake {
position: absolute;
top: -10px;
background-color: white;
border-radius: 50%;
opacity: 0.8;
pointer-events: none;
animation: fall linear infinite;
z-index: -1
}
.paused .snowflake {
animation-play-state: paused;
}
@keyframes fall {
to {
transform: translateY(100vh);
}
}
p {
font-size: 18px
}
.paused {
animation-play-state: paused;
}
.hidden {
display: none
}
.snowflake:nth-child(odd) {
animation-duration: 4s;
width: 10px;
height: 10px;
}
.snowflake:nth-child(even) {
animation-duration: 6s;
width: 8px;
height: 8px;
}
.content-section {
max-width: 900px;
margin: 20px auto;
padding: 20px;
background: #f9f9f9;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transition: transform 0.5s, opacity 3s;
opacity: 0;
transform: translateY(20px);
}
.content-section.visible {
transform: translateY(0);
opacity: 1;
}
h1, h2 {
text-align: center;
color: #333;
}
p {
text-align: center;
color: #555;
}
.content-section-top {
max-width: 900px;
margin: 20px auto;
padding: 20px;
background: #f9f9f9;
border-radius: 10px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transform: translateY(20px);
}
.content-section:nth-child(even) {
margin-left: auto;
margin-right: 50px;
}
.content-section:nth-child(odd) {
margin-right: auto;
margin-left: 50px;
}
@media (max-width: 768px) {
.content-section {
margin: 20px auto;
}
}
#game-container {
display: none;
position: relative;
width: 100%;
height: 100vh;
overflow: hidden;
background: #8fc9f2;
}
#game-canvas {
display: block;
width: 100%;
height: 100%;
}
.tutorial {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.8);
color: white;
display: flex;
align-items: center;
justify-content: center;
z-index: 1000;
}
.tutorial-content {
background: #333;
padding: 20px;
border-radius: 10px;
text-align: center;
max-width: 500px;
}
.tutorial-content button {
margin-top: 20px;
padding: 10px 20px;
font-size: 1rem;
color: white;
background: #007bff;
border: none;
border-radius: 5px;
cursor: pointer;
}
.tutorial.hidden {
display: none;
}
#block-info.hidden {
display: none;
}
#block-info {
background: rgba(248, 252, 255, 0.94);
border: 1px solid rgba(255, 255, 255, 0.72);
border-radius: 22px;
padding: 18px;
width: 280px;
text-align: center;
font-family: "Trebuchet MS", Verdana, sans-serif;
color: #102033;
font-size: 14px;
z-index: 10;
animation: fade-in 0.5s ease-out;
position: absolute;
box-shadow: 0 24px 60px rgba(9, 24, 43, 0.24);
backdrop-filter: blur(12px);
}
#block-info h1 {
margin: 0 0 8px;
color: #102033;
}
#block-info p {
margin: 0;
color: #496071;
line-height: 1.45;
}
@keyframes fade-in {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
#projects {
flex-direction: row;
justify-content: space-between;
align-items: stretch;
flex-wrap: wrap;
padding: 10px;
background-color: #5a322a;
height: 100%;
display: none
}
.project {
flex: 1;
margin: 10px;
padding: 10px;
background-color: white;
border-radius: 5px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
text-align: left;
overflow: hidden;
word-wrap: break-word;
}
.project h3 {
font-size: 1.5em;
margin-bottom: 0.5em;
}
.project-description {
font-size: 1em;
line-height: 1.4;
}
button {
margin-top: 10px;
padding: 10px 16px;
color: white;
background: #102033;
border: none;
cursor: pointer;
border-radius: 14px;
box-shadow: 0 10px 24px rgba(9, 24, 43, 0.16);
font-family: inherit;
transition: transform 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}
button:hover {
transform: translateY(-1px);
box-shadow: 0 14px 30px rgba(9, 24, 43, 0.22);
}
#turn-device-sideways {
display: none;
}
#mobile-controls {
position: fixed;
bottom: 14px;
width: 100%;
display: flex;
justify-content: center;
gap: 10px;
z-index: 20;
pointer-events: none;
}
#interact-character-button {
position: absolute;
bottom: 66px;
left: 50%;
transform: translateX(-50%);
background: #2f7dd3;
}
#interact-button,
#move-left-button,
#jump-button,
#move-right-button {
display: inline-block;
padding: 12px 18px;
font-size: 16px;
background: rgba(16, 32, 51, 0.88);
border: 1px solid rgba(255, 255, 255, 0.24);
backdrop-filter: blur(10px);
pointer-events: auto;
}
#mobile-controls button:active {
background-color: #2f7dd3;
transform: translateY(1px) scale(0.98);
}
#npc-dialog {
position: fixed;
top: 20px;
left: 50%;
transform: translateX(-50%);
width: 80%;
max-width: 600px;
background: rgba(248, 252, 255, 0.94);
padding: 24px;
border-radius: 26px;
border: 1px solid rgba(255, 255, 255, 0.72);
box-shadow: 0 30px 80px rgba(9, 24, 43, 0.28);
backdrop-filter: blur(16px);
z-index: 1000;
}
#npc-dialog p {
color: #102033;
line-height: 1.5;
}
#npc-dialog button {
width: 100%;
background: #102033;
}
@media (min-width: 768px) {
#mobile-controls {
display: none;
}
}
@media screen and (max-height: 480px) {
#welcome-text {
display: none;
}
#enter-button {
display: none;
}
#turn-device-sideways {
display: block;
}
}
.dark-mode {
filter: brightness(0.9);
}
.dark-mode a {
color: #BB86FC;
}
.dark-mode button {
background-color: #333;
color: #fff;
border-color: #444;
}
.dark-mode #welcome-screen {
background-color: #333;
}
.dark-mode #game-container {
background-color: #222;
}
.dark-mode .content-section,
.dark-mode .project {
background-color: #1e1e1e;
color: #fff;
}
.dark-mode-toggle {
position: fixed;
top: 20px;
right: 20px;
z-index: 1000;
background: black;
border: none;
font-size: 1.5rem;
cursor: pointer;
}
.dark-mode-toggle.dark-mode {
background: white;
}
.dark-mode body {
background-color: #000;
}
.dark-mode #main-content {
background-color: #000;
}
.dark-mode #welcome-screen {
background-color: #333;
:root {
color-scheme: light;
--ink: #182b3d;
--muted: #4a6071;
--paper: #eef6f8;
--panel: #f3f8f9;
--line: #547389;
--accent: #265d82;
}
* { box-sizing: border-box; }
html, body {
width: 100%;
min-height: 100%;
margin: 0;
}
body {
overflow: hidden;
background: #b9d9ed;
color: var(--ink);
font-family: "Courier New", monospace;
}
body.dark-mode {
color-scheme: dark;
--ink: #edf3f5;
--muted: #bdced7;
--paper: #1d2e3d;
--panel: #243747;
--line: #8ba8b9;
--accent: #a9d9ef;
background: #111d2a;
}
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, canvas:focus-visible {
outline: 3px solid #d48439;
outline-offset: 3px;
}
.hidden { display: none; }
.no-script {
position: fixed;
inset: 0;
z-index: 100;
display: grid;
place-content: center;
gap: 12px;
padding: 24px;
background: #e6f3fa;
color: #182b3d;
text-align: center;
}
.no-script a { color: #265d82; }
#welcome-screen {
position: fixed;
inset: 0;
z-index: 10;
display: grid;
place-items: center;
overflow-y: auto;
padding: 70px 22px 32px;
background:
radial-gradient(circle at 20% 18%, rgba(255,255,255,.56) 0 2px, transparent 3px),
radial-gradient(circle at 76% 32%, rgba(255,255,255,.55) 0 2px, transparent 3px),
linear-gradient(#91bfdc, #d9edf7 78%, #f5fafb);
transition: opacity .7s ease;
}
body.dark-mode #welcome-screen {
background:
radial-gradient(circle at 20% 18%, rgba(255,255,255,.48) 0 2px, transparent 3px),
radial-gradient(circle at 76% 32%, rgba(255,255,255,.42) 0 2px, transparent 3px),
linear-gradient(#152738, #304b60 78%, #627d8c);
}
#welcome-screen.hidden {
display: grid;
opacity: 0;
pointer-events: none;
}
#welcome-content {
transition: opacity .5s ease, transform .7s ease;
}
#welcome-screen.hidden #welcome-content {
opacity: 0;
transform: translateY(-14px);
}
#welcome-content {
width: min(620px, 100%);
text-align: center;
}
.welcome-penguin {
display: block;
width: clamp(96px, 15vw, 142px);
height: clamp(96px, 15vw, 142px);
margin: 0 auto 18px;
object-fit: contain;
image-rendering: pixelated;
}
.eyebrow {
margin: 0 0 12px;
font-size: .9rem;
font-weight: bold;
letter-spacing: .28em;
text-transform: uppercase;
}
#welcome-text {
margin: 0;
font-size: clamp(2.25rem, 6vw, 4.4rem);
font-weight: bold;
line-height: 1.08;
letter-spacing: -.055em;
}
.welcome-intro {
margin: 21px 0 28px;
color: var(--muted);
font-size: clamp(.94rem, 1.5vw, 1.08rem);
line-height: 1.6;
}
#enter-button {
min-width: 172px;
min-height: 54px;
padding: 9px 22px;
border: 3px solid #162b3c;
border-radius: 2px;
background: #244d69;
box-shadow: 5px 5px 0 #162b3c;
color: #fff;
font-size: 1.08rem;
font-weight: bold;
transition: transform .12s ease, box-shadow .12s ease;
}
#enter-button:hover {
transform: translate(2px, 2px);
box-shadow: 3px 3px 0 #162b3c;
}
#enter-button span { margin-left: 15px; }
.control-guide {
max-width: 520px;
margin: 34px auto 0;
padding-top: 16px;
border-top: 1px solid rgba(24,43,61,.4);
color: var(--muted);
font-size: .78rem;
line-height: 1.8;
}
.dark-mode-toggle {
position: fixed;
top: 14px;
right: 14px;
z-index: 40;
display: grid;
place-items: center;
width: 42px;
height: 42px;
padding: 0;
border: 2px solid var(--line);
border-radius: 2px;
background: var(--paper);
color: var(--ink);
}
.dark-mode-toggle:hover { background: var(--panel); }
.theme-icon { font-size: 1.4rem; line-height: 1; }
.theme-label {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
body.menu-open .dark-mode-toggle {
opacity: 0;
pointer-events: none;
}
#sound-toggle {
position: fixed;
bottom: 14px;
left: 14px;
z-index: 20;
display: none;
place-items: center;
width: 42px;
height: 42px;
padding: 0;
border: 2px solid var(--line);
border-radius: 2px;
background: var(--paper);
color: var(--ink);
font-size: 1.45rem;
}
body.game-started #sound-toggle { display: grid; }
#sound-toggle[hidden], body.menu-open #sound-toggle { display: none; }
#sound-toggle:hover { background: var(--panel); }
#sound-toggle[aria-pressed="false"]::after {
content: "";
position: absolute;
width: 29px;
height: 2px;
background: currentColor;
transform: rotate(-45deg);
}
#game-container {
position: relative;
display: none;
width: 100%;
height: 100vh;
height: 100dvh;
overflow: hidden;
background: #b4d8ed;
opacity: 0;
transition: opacity .75s ease;
}
#game-container.visible { opacity: 1; }
#game-canvas {
display: block;
width: 100%;
height: 100%;
touch-action: none;
}
#block-info {
position: absolute;
z-index: 5;
width: min(300px, calc(100vw - 30px));
padding: 16px;
border: 2px solid var(--line);
border-radius: 2px;
background: var(--panel);
color: var(--ink);
}
#block-info h1 { margin: 0 0 8px; font-size: 1.1rem; }
#block-info p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.5; }
body.menu-open #block-info { display: none; }
#projects { display: none; }
#snow-container {
position: fixed;
inset: 0;
z-index: 2;
overflow: hidden;
pointer-events: none;
}
body.menu-open #snow-container { display: none; }
.snowflake {
position: absolute;
top: -12px;
width: 6px;
height: 6px;
background: #fff;
opacity: .8;
animation: fall linear infinite;
}
.paused .snowflake { animation-play-state: paused; }
@keyframes fall { to { transform: translateY(110vh); } }
#npc-dialog {
position: fixed;
top: clamp(20px, 8vh, 80px);
left: 50%;
z-index: 30;
width: min(540px, calc(100vw - 30px));
max-height: calc(100dvh - 40px);
overflow-y: auto;
padding: 20px;
border: 3px solid var(--line);
border-radius: 2px;
background: var(--panel);
color: var(--ink);
transform: translateX(-50%);
}
.dialog-heading {
display: flex;
align-items: center;
justify-content: space-between;
gap: 14px;
font-size: 1.05rem;
font-weight: bold;
}
#npc-dialog-close {
width: 34px;
height: 34px;
border: 2px solid var(--line);
border-radius: 2px;
background: var(--paper);
color: var(--ink);
font-size: 1.3rem;
}
#npc-dialog-text {
margin: 18px 0 20px;
color: var(--muted);
font-size: .86rem;
line-height: 1.6;
}
#npc-dialog-content > button:not(#npc-dialog-close) {
display: block;
width: 100%;
min-height: 42px;
margin-top: 8px;
padding: 9px 12px;
border: 2px solid var(--line);
border-radius: 2px;
background: var(--paper);
color: var(--ink);
font-size: .82rem;
font-weight: bold;
text-align: left;
}
#npc-dialog-content > button:not(#npc-dialog-close):hover { background: var(--panel); }
.dialog-hint { margin: 17px 0 0; color: var(--muted); font-size: .72rem; }
#mobile-controls { display: none; }
@media (max-width: 767px) {
#welcome-screen { padding: 70px 20px 26px; }
#welcome-text { font-size: clamp(2.15rem, 11vw, 3.4rem); }
.control-guide { margin-top: 27px; font-size: .72rem; }
#sound-toggle { top: 14px; right: 64px; bottom: auto; left: auto; }
body.game-started #mobile-controls {
position: fixed;
right: 12px;
bottom: max(12px, env(safe-area-inset-bottom));
left: 12px;
z-index: 6;
display: flex;
align-items: end;
gap: 7px;
pointer-events: none;
}
#mobile-controls button {
display: grid;
place-items: center;
min-width: 52px;
height: 52px;
padding: 0 10px;
border: 2px solid #a4c1d2;
border-radius: 2px;
background: #18374d;
color: #fff;
font-size: 1.25rem;
font-weight: bold;
pointer-events: auto;
touch-action: none;
}
#mobile-controls button:active { background: #326789; }
#mobile-controls .hidden, body.menu-open #mobile-controls { display: none; }
#interact-button { margin-left: auto; font-size: .84rem !important; }
#interact-character-button {
position: absolute;
right: 0;
bottom: 61px;
background: #265d82 !important;
font-size: .84rem !important;
}
#npc-dialog { padding: 16px; }
}
@media (max-width: 390px) {
#mobile-controls button { min-width: 45px; height: 48px; }
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after {
animation-duration: .01ms !important;
transition-duration: .01ms !important;
}
.snowflake { display: none; }
}