generated from ztimson/template
Fixed minor prod issues
All checks were successful
Build and publish / Build Container (push) Successful in 1m27s
All checks were successful
Build and publish / Build Container (push) Successful in 1m27s
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
cursor: url('/cursor.png'), auto !important;
|
||||
cursor: url('/assets/cursor.png'), auto !important;
|
||||
}
|
||||
|
||||
html, body {
|
||||
@@ -42,6 +42,7 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="game"></div>
|
||||
<jukebox-component id="jukebox"></jukebox-component>
|
||||
<llm-component id="llm"></llm-component>
|
||||
|
||||
|
||||
@@ -21,17 +21,12 @@ class JukeboxComponent extends HTMLElement {
|
||||
}
|
||||
|
||||
disconnectedCallback() {
|
||||
// Cleanup listeners when component is removed
|
||||
if(this.unsubscribeWorld) this.unsubscribeWorld();
|
||||
}
|
||||
|
||||
setupAPIListeners() {
|
||||
// Listen for world loaded events to auto-load music 🎧
|
||||
this.unsubscribeWorld = this.api.on('world:loaded', (data) => {
|
||||
console.log('🎵 Jukebox detected world loaded:', data.theme.name);
|
||||
if (data.theme?.music) {
|
||||
this.loadMusic(data.theme.music, data.theme);
|
||||
}
|
||||
if(data.theme?.music) this.loadMusic(data.theme.music, data.theme);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -39,6 +34,11 @@ class JukeboxComponent extends HTMLElement {
|
||||
this.shadowRoot.innerHTML = `
|
||||
<style>
|
||||
:host { display: block; }
|
||||
#simple-mute-btn {
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
}
|
||||
.audio-controls {
|
||||
position: fixed;
|
||||
display: flex;
|
||||
@@ -89,7 +89,6 @@ class JukeboxComponent extends HTMLElement {
|
||||
background: var(--button-bg, #6366f1);
|
||||
border: 2px solid var(--dialogue-border, #000);
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
font-size: 20px;
|
||||
box-shadow: 0 3px 0 var(--button-shadow, #4338ca);
|
||||
transition: transform 0.1s;
|
||||
@@ -144,7 +143,6 @@ class JukeboxComponent extends HTMLElement {
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
this.shadowRoot.getElementById('simple-mute-btn').addEventListener('click', () => this.toggleMute());
|
||||
this.shadowRoot.getElementById('mute-btn').addEventListener('click', () => this.toggleMute());
|
||||
this.shadowRoot.getElementById('prev-btn').addEventListener('click', () => this.previousTrack());
|
||||
@@ -155,7 +153,7 @@ class JukeboxComponent extends HTMLElement {
|
||||
if (!musicConfig) return;
|
||||
|
||||
this.theme = theme;
|
||||
this.isPlaylistMode = Array.isArray(musicConfig) && musicConfig.length > 1;
|
||||
this.isPlaylistMode = Array.isArray(musicConfig);
|
||||
this.playlist = Array.isArray(musicConfig) ? musicConfig : [musicConfig];
|
||||
this.currentTrackIndex = 0;
|
||||
|
||||
|
||||
@@ -94,7 +94,6 @@ class LlmComponent extends HTMLElement {
|
||||
}
|
||||
|
||||
.dialogue-header {
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
padding: 12px 20px;
|
||||
background: var(--dialogue-header-bg, #fff);
|
||||
@@ -126,7 +125,6 @@ class LlmComponent extends HTMLElement {
|
||||
font-family: 'Courier New', monospace;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 3px 0 var(--button-shadow, #2a5a9a);
|
||||
display: flex;
|
||||
@@ -347,7 +345,6 @@ class LlmComponent extends HTMLElement {
|
||||
background: #e74c3c;
|
||||
border: none;
|
||||
color: #fff;
|
||||
cursor: pointer;
|
||||
padding: 2px 6px;
|
||||
border-radius: 3px;
|
||||
font-size: 12px;
|
||||
@@ -408,7 +405,6 @@ class LlmComponent extends HTMLElement {
|
||||
font-family: 'Courier New', monospace;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
box-shadow: 0 3px 0 var(--button-shadow, #2a5a9a);
|
||||
transition: background 0.2s;
|
||||
|
||||
@@ -190,7 +190,6 @@ class Game {
|
||||
this.otherPlayers = new Map();
|
||||
this.isMoving = false;
|
||||
this.dialogue = null;
|
||||
this.audioManager = null;
|
||||
this.keys = {};
|
||||
|
||||
// Use global singleton 🌍
|
||||
@@ -215,7 +214,6 @@ class Game {
|
||||
},
|
||||
|
||||
onCurrentPlayers: (players) => {
|
||||
console.log('👥 Current players:', players);
|
||||
players.forEach(player => {
|
||||
if (player.socketId !== this.api.worldSocket.id) {
|
||||
this.addOtherPlayer(player);
|
||||
@@ -224,7 +222,6 @@ class Game {
|
||||
},
|
||||
|
||||
onPlayerJoined: (player) => {
|
||||
console.log('👋 Player joined:', player.name);
|
||||
this.addOtherPlayer(player);
|
||||
},
|
||||
|
||||
@@ -236,7 +233,6 @@ class Game {
|
||||
},
|
||||
|
||||
onPlayerLeft: (data) => {
|
||||
console.log('👋 Player left:', data.socketId);
|
||||
const sprite = this.otherPlayers.get(data.socketId);
|
||||
if (sprite) {
|
||||
this.app.stage.removeChild(sprite);
|
||||
@@ -297,7 +293,7 @@ class Game {
|
||||
resolution: window.devicePixelRatio || 1,
|
||||
autoDensity: true
|
||||
});
|
||||
document.body.appendChild(this.app.view);
|
||||
document.getElementById('game').appendChild(this.app.view);
|
||||
|
||||
const tiles = new PIXI.Container();
|
||||
this.app.stage.addChild(tiles);
|
||||
|
||||
@@ -6,10 +6,7 @@
|
||||
"image": "/assets/background.jpg",
|
||||
"style": "cover"
|
||||
},
|
||||
"music": [
|
||||
"/assets/mystery_acorns.mp3",
|
||||
"/assets/crunchy_leaves.mp3"
|
||||
],
|
||||
"music": "/assets/music.mp3",
|
||||
"colors": {
|
||||
"tileTop": "#7a5a8c",
|
||||
"tileSide": "#4a2d5a",
|
||||
|
||||
Reference in New Issue
Block a user