jumping bug & spell check

This commit is contained in:
2026-05-10 00:03:20 +09:00
parent 261fd93ce5
commit 9f1f881a88
4 changed files with 40 additions and 24 deletions

View File

@@ -16,24 +16,27 @@
<style> <style>
.toast { .toast {
position: absolute; position: absolute;
bottom: 22px; top: 30px;
right: 18px; left: 50%;
width: 230px; transform: translateX(-50%);
padding: 10px 13px; width: 380px;
background: rgba(8, 8, 8, 0.88); padding: 5px 20px;
border-left: 3px solid; background: rgba(6, 6, 6, 0.60);
color: #ccc; border-bottom: 2px solid var(--accent);
color: rgba(255, 255, 255, 0.85);
font-family: 'Courier New', Courier, monospace; font-family: 'Courier New', Courier, monospace;
font-size: 12.5px; font-size: 13px;
line-height: 1.55; line-height: 1.5;
text-align: center;
letter-spacing: 0.02em;
pointer-events: none; pointer-events: none;
animation: toastIn 4.2s ease forwards; animation: toastIn 4.2s ease forwards;
z-index: 20; z-index: 20;
} }
@keyframes toastIn { @keyframes toastIn {
0% { opacity: 0; transform: translateX(14px); } 0% { opacity: 0; transform: translateX(-50%) translateY(-8px); }
12% { opacity: 1; transform: translateX(0); } 12% { opacity: 1; transform: translateX(-50%) translateY(0); }
78% { opacity: 1; } 78% { opacity: 1; }
100% { opacity: 0; } 100% { opacity: 0; }
} }

View File

@@ -21,6 +21,9 @@ export class Player {
this.collectedColors = []; // hex color strings this.collectedColors = []; // hex color strings
this.isInvincible = false; this.isInvincible = false;
this.invincibleTimer = 0; this.invincibleTimer = 0;
this._canJump = true;
this._peakReached = false;
} }
// called every frame from the game loop // called every frame from the game loop
@@ -36,11 +39,21 @@ export class Player {
this.sprite.vel.x *= 0.78; this.sprite.vel.x *= 0.78;
} }
const onGround = this.sprite.vel.y > -0.5 && this.sprite.vel.y < 1.5; const vel_y = this.sprite.vel.y;
if (keysDown.jump && onGround) { // Once clearly falling, mark that we've left the ground
if (vel_y > 2) this._peakReached = true;
// Landing: restore jump ability only after having fallen back down
if (this._peakReached && vel_y > -0.5 && vel_y < 1.5) {
this._canJump = true;
this._peakReached = false;
}
if (keysDown.jump && this._canJump) {
this.sprite.vel.y = -11; this.sprite.vel.y = -11;
keysDown.jump = false; // consume so it can't re-fire until the next keydown this._canJump = false;
keysDown.jump = false;
} }
// clamp to canvas left/right edges // clamp to canvas left/right edges

View File

@@ -38,7 +38,7 @@ export const LEVELS = [
'To feel intensely is not weakness. It is aliveness.', 'To feel intensely is not weakness. It is aliveness.',
'The heart has always beaten in red.', 'The heart has always beaten in red.',
], ],
completeQuote: 'Red is the color of being alive. It asks nothing of you except honesty. Red is rage, passion, urgency, and love; The most viceral emotion, it demands to be felt.', completeQuote: 'Red is the color of being alive. It asks nothing of you except honesty. Red is rage, passion, urgency, and love; The most visceral emotion, it demands to be felt.',
}, },
// ── LEVEL 2: AMBER ──────────────────────────────────────────────────────── // ── LEVEL 2: AMBER ────────────────────────────────────────────────────────
@@ -79,7 +79,7 @@ export const LEVELS = [
'You made something today. That matters.', 'You made something today. That matters.',
'You were built to connect and create.', 'You were built to connect and create.',
], ],
completeQuote: 'Orange reminds you that making things is an act of hope. It is the color of warmth, creativity, enthusiams, and connection. It is a choice to stay open. Let yourself be warm.', completeQuote: 'Orange reminds you that making things is an act of hope. It is the color of warmth, creativity, enthusiasm, and connection. It is a choice to stay open. Let yourself be warm.',
}, },
// ── LEVEL 3: YELLOW ─────────────────────────────────────────────────────── // ── LEVEL 3: YELLOW ───────────────────────────────────────────────────────
@@ -124,7 +124,7 @@ export const LEVELS = [
'Anxiety and curiosity live in the same color.', 'Anxiety and curiosity live in the same color.',
'Your mind runs fast because it cares deeply', 'Your mind runs fast because it cares deeply',
], ],
completeQuote: 'Yellow carries both hope and anxiety in equal measure. It is the color of joy but also of anxeity. Your nervous energy is not a flaw. It is the same thing as your intelligence, it goes hand in hand with your joy\'s .', completeQuote: 'Yellow carries both hope and anxiety in equal measure. It is the color of joy but also of anxiety. Your nervous energy is not a flaw. It is the same thing as your intelligence, it goes hand in hand with your joy.',
}, },
// ── LEVEL 4: GREEN ──────────────────────────────────────────────────────── // ── LEVEL 4: GREEN ────────────────────────────────────────────────────────
@@ -323,11 +323,11 @@ export const LEVELS = [
fragmentQuotes: [ fragmentQuotes: [
'Not everything needs an explanation.', 'Not everything needs an explanation.',
'Mystery is an invitation, not a threat.', 'Mystery is an invitation, not a threat.',
'Your contradictions are not flaws, ther are complexity.', 'Your contradictions are not flaws, they are complexity.',
'The unknown is not something to fix.', 'The unknown is not something to fix.',
'Transformation is always a little uncomfortable.', 'Transformation is always a little uncomfortable.',
], ],
completeQuote: 'Purple is the color of the in-betweens it represents mystery and intuition. Purple lives in the questions. You do not need everything figured out. Some things are only ever felt, never fully explained.', completeQuote: 'Purple is the color of the in-betweens, it represents mystery and intuition. Purple lives in the questions. You do not need everything figured out. Some things are only ever felt, never fully explained.',
}, },
// ── LEVEL 8: MAGENTA ────────────────────────────────────────────────────── // ── LEVEL 8: MAGENTA ──────────────────────────────────────────────────────
@@ -379,7 +379,7 @@ export const LEVELS = [
'Playfulness is not childishness, it is aliveness.', 'Playfulness is not childishness, it is aliveness.',
'You are allowed to bloom loudly.', 'You are allowed to bloom loudly.',
], ],
completeQuote: 'Magenta doesn\'t apologize for being bright. Magenta represents compassion, self-love, and softness. It aks you to be as gentel with youself as you are with the people you love the most.', completeQuote: 'Magenta doesn\'t apologize for being bright. Magenta represents compassion, self-love, and softness. It asks you to be as gentle with yourself as you are with the people you love the most.',
}, },
// ── LEVEL 9: BROWN ──────────────────────────────────────────────────────── // ── LEVEL 9: BROWN ────────────────────────────────────────────────────────
@@ -429,8 +429,8 @@ export const LEVELS = [
'Some things stay so that other things can move.', 'Some things stay so that other things can move.',
'Stability is essential.', 'Stability is essential.',
'The earth holds everything without complaint.', 'The earth holds everything without complaint.',
'Steadiness is a kind of strenght.', 'Steadiness is a kind of strength.',
'Your roors are not holding you back.', 'Your roots are not holding you back.',
], ],
completeQuote: 'Brown is groundedness and stability. It is the earth beneath everything, often overlooked but everything grows from it. It does not need to be seen to do its work.', completeQuote: 'Brown is groundedness and stability. It is the earth beneath everything, often overlooked but everything grows from it. It does not need to be seen to do its work.',
}, },

View File

@@ -5,7 +5,7 @@
<div class="screen"> <div class="screen">
<h1 class="title">color restored</h1> <h1 class="title">color restored</h1>
<p class="line1">every fragment found. every hue returned </p> <p class="line1">every fragment found. every hue returned </p>
<p class="line2">Go forth and expereince the world in full color.</p> <p class="line2">Go forth and experience the world in full color.</p>
<button on:click={() => push('/')}>back to home</button> <button on:click={() => push('/')}>back to home</button>
</div> </div>