Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions site/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -1989,8 +1989,18 @@ function HomeIntro() {
software and carefully bounded prototype workflows.
</p>
<button className="qd-launch-button" type="button" onClick={openGame}>
<span aria-hidden="true">▶</span>
Play Quantum Devil
<span className="qd-launch-mascot" aria-hidden="true">
<span className="qd-launch-mascot-antenna" />
<span className="qd-launch-mascot-head">
<span className="qd-launch-mascot-eye" />
<span className="qd-launch-mascot-eye" />
</span>
<span className="qd-launch-mascot-body" />
</span>
<span className="qd-launch-copy">
<small>Experimental game</small>
<strong>Play Quantum Devil</strong>
</span>
</button>
</div>
<figure className="home-intro-visual">
Expand Down
4 changes: 4 additions & 0 deletions site/src/quantum-devil/QuantumDevilDialog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ export default function QuantumDevilDialog({ open, onClose }) {

<div className="qd-viewport" aria-label="Quantum Devil game canvas">
<div className="qd-game-host" ref={gameHostRef} />
<div className="qd-ascent-rail" aria-hidden="true">
<span>Top</span>
<i style={{ "--qd-altitude": `${status.altitude}%` }} />
</div>
{loading && <div className="qd-game-message">Preparing experiment...</div>}
{error && <div className="qd-game-message is-error">{error}</div>}
</div>
Expand Down
64 changes: 36 additions & 28 deletions site/src/quantum-devil/createQuantumDevilGame.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ class QuantumDevilScene extends Phaser.Scene {
this.createTower();
this.createPlayer();
this.createKeyboard();
this.createProgressRail();
this.configureCamera();
this.applyPhase(false);
this.emitState(true);
Expand Down Expand Up @@ -262,7 +261,7 @@ class QuantumDevilScene extends Phaser.Scene {
this.addPlatform(280, 2720, 220, 22, "crumble");
this.addPlatform(520, 2580, 220);
this.addPlatform(280, 2440, 220, 22, "crumble");
this.addPlatform(400, 2300, 650, 26, "checkpoint");
this.addPlatform(400, 2300, 430, 26, "checkpoint");

this.addPhasePlatform(180, 2160, 190, 0);
this.addPlatform(440, 2020, 190);
Expand Down Expand Up @@ -291,15 +290,13 @@ class QuantumDevilScene extends Phaser.Scene {
checkpoint: 0x123c43,
summit: 0x174f45,
};
const accent = kind === "checkpoint" ? 0x35e0b8 : kind === "crumble" ? 0xff6b8a : 0x5a8099;
const platform = this.add.rectangle(x, y, width, height, colors[kind] ?? colors.neutral, 1);
platform.setStrokeStyle(kind === "checkpoint" ? 2 : 1, kind === "checkpoint" ? 0x35e0b8 : 0x5a8099, 0.9);
platform.setStrokeStyle(kind === "checkpoint" ? 2 : 1, accent, 0.9);
platform.setData("kind", kind);
this.platforms.add(platform);
platform.body.updateFromGameObject();

if (kind === "crumble") {
this.add.rectangle(x, y - 7, width - 20, 2, 0xff6b8a, 0.42);
}
platform.setData("wallDetail", this.addWallFacade(x, y, width, height, accent, kind));
if (kind === "checkpoint") {
this.add.text(x, y - 28, "CHECKPOINT", {
color: "#35e0b8",
Expand All @@ -311,14 +308,39 @@ class QuantumDevilScene extends Phaser.Scene {
return platform;
}

addWallFacade(x, y, width, height, accent, kind = "neutral") {
const facadeDepth = kind === "checkpoint" ? 42 : 32;
const top = -height / 2;
const graphics = this.add.graphics().setPosition(x, y).setDepth(1);
graphics.fillStyle(kind === "checkpoint" ? 0x0d3035 : 0x102738, 0.94);
graphics.fillRect(-width / 2, top, width, facadeDepth);
graphics.fillStyle(0x050b12, 0.34);
graphics.fillRect(-width / 2, top + facadeDepth - 8, width, 8);
graphics.lineStyle(3, accent, kind === "crumble" ? 0.72 : 0.92);
graphics.lineBetween(-width / 2, top, width / 2, top);
graphics.lineStyle(1, 0x8ba2b5, 0.22);
graphics.lineBetween(-width / 2, top + 15, width / 2, top + 15);

const blockWidth = kind === "checkpoint" ? 72 : 58;
for (let offset = -width / 2 + blockWidth; offset < width / 2; offset += blockWidth) {
graphics.lineBetween(offset, top, offset, top + 15);
}
for (let offset = -width / 2 + blockWidth / 2; offset < width / 2; offset += blockWidth) {
graphics.lineBetween(offset, top + 15, offset, top + facadeDepth);
}
return graphics;
}

addPhasePlatform(x, y, width, requiredPhase, entangled = false) {
const color = requiredPhase === 0 ? 0x22d3ee : 0x8b5cf6;
const platform = this.add.rectangle(x, y, width, 20, color, 0.9);
platform.setStrokeStyle(2, color, 1);
platform.setData("kind", "phase");
this.platforms.add(platform);
platform.body.updateFromGameObject();
this.phasePlatforms.push({ platform, requiredPhase, color });
const detail = this.addWallFacade(x, y, width, 20, color, "phase");
platform.setData("wallDetail", detail);
this.phasePlatforms.push({ platform, detail, requiredPhase, color });

const label = entangled ? `E${requiredPhase}` : `|${requiredPhase}>`;
this.add.text(x, y - 25, label, {
Expand Down Expand Up @@ -411,21 +433,6 @@ class QuantumDevilScene extends Phaser.Scene {
});
}

createProgressRail() {
this.add.rectangle(GAME_WIDTH - 22, GAME_HEIGHT / 2, 3, GAME_HEIGHT - 84, 0x5a8099, 0.38)
.setScrollFactor(0)
.setDepth(30);
this.progressMarker = this.add.rectangle(GAME_WIDTH - 22, GAME_HEIGHT - 44, 10, 24, 0x22d3ee, 1)
.setScrollFactor(0)
.setDepth(31);
this.add.text(GAME_WIDTH - 22, 20, "TOP", {
color: "#8ba2b5",
fontFamily: "Roboto Mono, monospace",
fontSize: "8px",
resolution: 2,
}).setOrigin(0.5).setScrollFactor(0).setDepth(31);
}

configureCamera() {
this.cameras.main.setZoom(RENDER_SCALE);
this.cameras.main.setBounds(0, 0, GAME_WIDTH, WORLD_HEIGHT);
Expand All @@ -444,25 +451,29 @@ class QuantumDevilScene extends Phaser.Scene {

platform.setData("crumbling", true);
platform.setFillStyle(0xff4f78, 0.78);
const wallDetail = platform.getData("wallDetail");
wallDetail?.setAlpha(0.72);
this.time.delayedCall(900, () => {
this.tweens.add({
targets: platform,
targets: wallDetail ? [platform, wallDetail] : platform,
alpha: 0,
y: platform.y + 28,
duration: 230,
onComplete: () => {
platform.body.enable = false;
wallDetail?.destroy();
},
});
});
}

applyPhase(flash = true) {
this.phasePlatforms.forEach(({ platform, requiredPhase, color }) => {
this.phasePlatforms.forEach(({ platform, detail, requiredPhase, color }) => {
const active = requiredPhase === this.phase;
platform.body.enable = active;
platform.setFillStyle(color, active ? 0.92 : 0.1);
platform.setStrokeStyle(active ? 3 : 1, color, active ? 1 : 0.36);
detail.setAlpha(active ? 0.9 : 0.14);
});
if (flash) {
this.cameras.main.flash(90, this.phase ? 139 : 34, this.phase ? 92 : 211, this.phase ? 246 : 238, false);
Expand Down Expand Up @@ -721,9 +732,6 @@ class QuantumDevilScene extends Phaser.Scene {
this.playerGlow.setPosition(this.player.x, this.player.y).setAlpha(grounded ? 0.1 : 0.2);
this.updateZoneAndCheckpoint();

const progress = Phaser.Math.Clamp((START_Y - this.player.y) / (START_Y - 78), 0, 1);
this.progressMarker.y = GAME_HEIGHT - 44 - progress * (GAME_HEIGHT - 96);
this.progressMarker.setFillStyle(this.zoneIndex === 2 ? 0x35e0b8 : this.phase ? 0x8b5cf6 : 0x22d3ee, 1);
this.emitState();

this.wasGrounded = grounded;
Expand Down
158 changes: 152 additions & 6 deletions site/src/quantum-devil/quantum-devil.css
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
.qd-launch-button {
display: inline-flex;
width: fit-content;
min-height: 48px;
min-height: 68px;
align-items: center;
justify-content: center;
gap: 11px;
gap: 14px;
border: 1px solid #111827;
padding: 0 18px;
padding: 7px 20px 7px 10px;
background: #111827;
color: #fff;
cursor: pointer;
Expand All @@ -23,9 +23,117 @@
transform: translateY(-2px);
}

.qd-launch-button span {
color: #22d3ee;
font-size: 12px;
.qd-launch-copy {
display: grid;
gap: 2px;
text-align: left;
}

.qd-launch-copy small {
color: #8bdcf3;
font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 9px;
font-weight: 600;
letter-spacing: 0.08em;
text-transform: uppercase;
}

.qd-launch-copy strong {
color: #fff;
font-size: 14px;
}

.qd-launch-mascot {
position: relative;
display: block;
width: 48px;
height: 52px;
flex: 0 0 48px;
}

.qd-launch-mascot::before {
position: absolute;
top: 4px;
left: 4px;
width: 40px;
height: 40px;
border-radius: 50%;
background: rgba(34, 211, 238, 0.13);
box-shadow: 0 0 18px rgba(34, 211, 238, 0.28);
content: "";
}

.qd-launch-mascot-head {
position: absolute;
top: 9px;
left: 9px;
display: flex;
width: 30px;
height: 25px;
align-items: center;
justify-content: center;
gap: 5px;
border: 2px solid #22d3ee;
border-radius: 9px;
background: #07131d;
}

.qd-launch-mascot-eye {
width: 5px;
height: 7px;
border-radius: 3px;
background: #f8fafc;
box-shadow: inset 0 -2px #22d3ee;
}

.qd-launch-mascot-antenna {
position: absolute;
top: 2px;
left: 23px;
width: 2px;
height: 8px;
background: #8b5cf6;
}

.qd-launch-mascot-antenna::before {
position: absolute;
top: -2px;
left: -2px;
width: 6px;
height: 6px;
border-radius: 50%;
background: #8b5cf6;
content: "";
}

.qd-launch-mascot-body {
position: absolute;
top: 33px;
left: 15px;
width: 18px;
height: 15px;
border: 2px solid #8b5cf6;
border-radius: 5px;
background: #0b2230;
}

.qd-launch-mascot-body::before,
.qd-launch-mascot-body::after {
position: absolute;
bottom: -6px;
width: 7px;
height: 5px;
border-radius: 3px;
background: #f8fafc;
content: "";
}

.qd-launch-mascot-body::before {
left: -2px;
}

.qd-launch-mascot-body::after {
right: -2px;
}

.qd-dialog {
Expand Down Expand Up @@ -146,6 +254,44 @@
touch-action: none;
}

.qd-ascent-rail {
position: absolute;
top: 22px;
right: 14px;
bottom: 22px;
z-index: 3;
width: 4px;
pointer-events: none;
background: rgba(90, 128, 153, 0.54);
box-shadow: 0 0 0 1px rgba(3, 7, 11, 0.52);
}

.qd-ascent-rail span {
position: absolute;
top: -18px;
left: 50%;
color: #8ba2b5;
font-family: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 8px;
font-weight: 700;
line-height: 1;
text-transform: uppercase;
transform: translateX(-50%);
}

.qd-ascent-rail i {
position: absolute;
right: -4px;
bottom: var(--qd-altitude);
width: 12px;
height: 24px;
border: 2px solid #061019;
background: #22d3ee;
box-shadow: 0 0 14px rgba(34, 211, 238, 0.58);
transform: translateY(50%);
transition: bottom 180ms ease-out;
}

.qd-game-message {
position: absolute;
inset: 0;
Expand Down
13 changes: 10 additions & 3 deletions site/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -2287,23 +2287,30 @@ h3 {

.home-intro-grid {
display: grid;
grid-template-columns: minmax(0, 0.88fr) minmax(380px, 1.12fr);
gap: clamp(32px, 7vw, 84px);
grid-template-columns: minmax(0, 1fr) minmax(500px, 1fr);
gap: clamp(40px, 5vw, 64px);
width: min(var(--max), 100%);
margin: 0 auto;
align-items: center;
}

.home-intro-copy {
display: grid;
gap: 22px;
gap: 20px;
max-width: 560px;
}

.home-intro-copy h2 {
max-width: 560px;
text-wrap: balance;
}

.home-intro-copy .eyebrow {
margin-bottom: -4px;
}

.home-intro-copy p {
max-width: 540px;
color: #334155;
font-size: var(--type-lead);
line-height: 1.62;
Expand Down