|
|
|
@ -1232,79 +1232,92 @@ function getEnemyType(enemyId) { |
|
|
|
|
|
|
|
|
|
|
|
export function renderRelicSelection(root) { |
|
|
|
export function renderRelicSelection(root) { |
|
|
|
import("../data/relics.js").then(({ RELICS, START_RELIC_CHOICES }) => { |
|
|
|
import("../data/relics.js").then(({ RELICS, START_RELIC_CHOICES }) => { |
|
|
|
const relicChoices = START_RELIC_CHOICES.slice(0, 3); // Show first 3 relics
|
|
|
|
import("../data/messages.js").then(({ getAllMessages }) => { |
|
|
|
|
|
|
|
const relicChoices = START_RELIC_CHOICES.slice(0, 3); // Show first 3 relics
|
|
|
|
|
|
|
|
|
|
|
|
root.app.innerHTML = ` |
|
|
|
root.app.innerHTML = ` |
|
|
|
<div class="game-screen relic-select"> |
|
|
|
<div class="game-screen relic-select"> |
|
|
|
<div class="game-header"> |
|
|
|
<div class="game-header"> |
|
|
|
<div class="game-logo relic-title-logo"> |
|
|
|
<button class="messages-button" data-action="show-messages"> |
|
|
|
<svg width="600" height="240" viewBox="0 0 600 240" xmlns="http://www.w3.org/2000/svg"> |
|
|
|
Inbox |
|
|
|
<defs> |
|
|
|
<span class="message-count-badge">${getAllMessages().length}</span> |
|
|
|
|
|
|
|
</button> |
|
|
|
<linearGradient id="textGradient" x1="0%" y1="0%" x2="0%" y2="100%"> |
|
|
|
<div class="game-logo relic-title-logo"> |
|
|
|
<stop offset="0%" style="stop-color:#ffd700;stop-opacity:1" /> |
|
|
|
<svg width="600" height="240" viewBox="0 0 600 240" xmlns="http://www.w3.org/2000/svg"> |
|
|
|
<stop offset="100%" style="stop-color:#ff8c00;stop-opacity:1" /> |
|
|
|
<defs> |
|
|
|
</linearGradient> |
|
|
|
|
|
|
|
|
|
|
|
<linearGradient id="textGradient" x1="0%" y1="0%" x2="0%" y2="100%"> |
|
|
|
<filter id="glow" x="-50%" y="-50%" width="200%" height="200%"> |
|
|
|
<stop offset="0%" style="stop-color:#ffd700;stop-opacity:1" /> |
|
|
|
<feGaussianBlur stdDeviation="2" result="coloredBlur"/> |
|
|
|
<stop offset="100%" style="stop-color:#ff8c00;stop-opacity:1" /> |
|
|
|
<feMerge> |
|
|
|
</linearGradient> |
|
|
|
<feMergeNode in="coloredBlur"/> |
|
|
|
|
|
|
|
<feMergeNode in="SourceGraphic"/> |
|
|
|
<filter id="glow" x="-50%" y="-50%" width="200%" height="200%"> |
|
|
|
</feMerge> |
|
|
|
<feGaussianBlur stdDeviation="2" result="coloredBlur"/> |
|
|
|
</filter> |
|
|
|
<feMerge> |
|
|
|
|
|
|
|
<feMergeNode in="coloredBlur"/> |
|
|
|
<filter id="shadow" x="-50%" y="-50%" width="200%" height="200%"> |
|
|
|
<feMergeNode in="SourceGraphic"/> |
|
|
|
<feGaussianBlur in="SourceAlpha" stdDeviation="1"/> |
|
|
|
</feMerge> |
|
|
|
<feOffset dx="1" dy="1" result="offsetblur"/> |
|
|
|
</filter> |
|
|
|
<feComponentTransfer> |
|
|
|
|
|
|
|
<feFuncA type="linear" slope="0.3"/> |
|
|
|
<filter id="shadow" x="-50%" y="-50%" width="200%" height="200%"> |
|
|
|
</feComponentTransfer> |
|
|
|
<feGaussianBlur in="SourceAlpha" stdDeviation="1"/> |
|
|
|
<feMerge> |
|
|
|
<feOffset dx="1" dy="1" result="offsetblur"/> |
|
|
|
<feMergeNode/> |
|
|
|
<feComponentTransfer> |
|
|
|
<feMergeNode in="SourceGraphic"/> |
|
|
|
<feFuncA type="linear" slope="0.3"/> |
|
|
|
</feMerge> |
|
|
|
</feComponentTransfer> |
|
|
|
</filter> |
|
|
|
<feMerge> |
|
|
|
</defs> |
|
|
|
<feMergeNode/> |
|
|
|
|
|
|
|
<feMergeNode in="SourceGraphic"/> |
|
|
|
<text x="300" y="80" text-anchor="middle" font-family="'Kreon', serif" font-size="55" font-weight="700" fill="url(#textGradient)" filter="url(#glow)"> |
|
|
|
</feMerge> |
|
|
|
ThePrimeagen |
|
|
|
</filter> |
|
|
|
</text> |
|
|
|
</defs> |
|
|
|
|
|
|
|
|
|
|
|
<text x="300" y="170" text-anchor="middle" font-family="'Kreon', serif" font-size="85" font-weight="700" fill="url(#textGradient)" filter="url(#shadow) url(#glow)"> |
|
|
|
<text x="300" y="80" text-anchor="middle" font-family="'Kreon', serif" font-size="55" font-weight="700" fill="url(#textGradient)" filter="url(#glow)"> |
|
|
|
Spire |
|
|
|
ThePrimeagen |
|
|
|
</text> |
|
|
|
</text> |
|
|
|
</svg> |
|
|
|
|
|
|
|
</div> |
|
|
|
<text x="300" y="170" text-anchor="middle" font-family="'Kreon', serif" font-size="85" font-weight="700" fill="url(#textGradient)" filter="url(#shadow) url(#glow)"> |
|
|
|
<h1>Choose a Starting Relic</h1> |
|
|
|
Spire |
|
|
|
<p>Select one of the following relics to begin your run.</p> |
|
|
|
</text> |
|
|
|
</div> |
|
|
|
</svg> |
|
|
|
|
|
|
|
|
|
|
|
<div class="relic-options"> |
|
|
|
|
|
|
|
${relicChoices.map(relicId => { |
|
|
|
|
|
|
|
const relic = RELICS[relicId]; |
|
|
|
|
|
|
|
return ` |
|
|
|
|
|
|
|
<div class="relic-option" data-relic="${relicId}"> |
|
|
|
|
|
|
|
<div class="relic-portrait"> |
|
|
|
|
|
|
|
<div class="relic-icon">${getRelicArt(relicId, RELICS)}</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="relic-info"> |
|
|
|
|
|
|
|
<div class="relic-name">${relic.name}</div> |
|
|
|
|
|
|
|
<div class="relic-description">${relic.text}</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</div> |
|
|
|
`;
|
|
|
|
<h1>Choose a Starting Relic</h1> |
|
|
|
}).join("")} |
|
|
|
<p>Select one of the following relics to begin your run.</p> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
</div> |
|
|
|
<div class="relic-options"> |
|
|
|
`;
|
|
|
|
${relicChoices.map(relicId => { |
|
|
|
|
|
|
|
const relic = RELICS[relicId]; |
|
|
|
|
|
|
|
return ` |
|
|
|
|
|
|
|
<div class="relic-option" data-relic="${relicId}"> |
|
|
|
|
|
|
|
<div class="relic-portrait"> |
|
|
|
|
|
|
|
<div class="relic-icon">${getRelicArt(relicId, RELICS)}</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="relic-info"> |
|
|
|
|
|
|
|
<div class="relic-name">${relic.name}</div> |
|
|
|
|
|
|
|
<div class="relic-description">${relic.text}</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
}).join("")} |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
root.app.querySelectorAll("[data-relic]").forEach(btn => { |
|
|
|
</div> |
|
|
|
btn.addEventListener("click", () => { |
|
|
|
`;
|
|
|
|
const relicId = btn.dataset.relic; |
|
|
|
|
|
|
|
root.selectStartingRelic(relicId); |
|
|
|
// Set up relic selection event listeners
|
|
|
|
|
|
|
|
root.app.querySelectorAll("[data-relic]").forEach(btn => { |
|
|
|
|
|
|
|
btn.addEventListener("click", () => { |
|
|
|
|
|
|
|
const relicId = btn.dataset.relic; |
|
|
|
|
|
|
|
root.selectStartingRelic(relicId); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add Messages button event listener
|
|
|
|
|
|
|
|
const messagesBtn = root.app.querySelector("[data-action='show-messages']"); |
|
|
|
|
|
|
|
if (messagesBtn) { |
|
|
|
|
|
|
|
messagesBtn.addEventListener("click", () => showMessagesModal()); |
|
|
|
|
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
|