magicciv/drafts/site-a/script.js
autocommit 5dfca4fdca ui(site): 💄 Update Site A styling and interactivity with new CSS and JavaScript logic
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-05-26 02:21:12 -07:00

64 lines
2.4 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Age of Dwarves Landing — Interactive AI Picker
const descriptions = {
learned: {
default: 'Neural net trained on 50k games vs MCTS'
},
scripted: {
ironhold: 'Ironhold: fortress-builder, walls up, feeds production',
blackhammer: 'Blackhammer: warmonger with personality',
goldvein: 'Goldvein: merchant, trades, counts gold',
deepforge: 'Deepforge: isolationist, goes tall, perfects craft',
runesmith: 'Runesmith: tech scholar, balanced play',
skyforge: 'Skyforge: tech rusher, spreads thin'
}
};
// Slot 1: Learned (default) or Scripted (rotate through clans)
document.querySelectorAll('input[name="slot1"]').forEach(radio => {
radio.addEventListener('change', (e) => {
const preview = document.getElementById('slot1-preview');
const clans = ['ironhold', 'blackhammer', 'goldvein', 'deepforge', 'runesmith', 'skyforge'];
if (e.target.value === 'learned') {
preview.textContent = descriptions.learned.default;
preview.className = 'picker-preview learned';
} else {
const clan = clans[Math.floor(Math.random() * clans.length)];
preview.textContent = descriptions.scripted[clan];
preview.className = 'picker-preview scripted';
}
});
});
// Slot 2: Scripted (default) or Learned
document.querySelectorAll('input[name="slot2"]').forEach(radio => {
radio.addEventListener('change', (e) => {
const preview = document.getElementById('slot2-preview');
const clans = ['ironhold', 'blackhammer', 'goldvein', 'deepforge', 'runesmith', 'skyforge'];
if (e.target.value === 'scripted') {
const clan = clans[Math.floor(Math.random() * clans.length)];
preview.textContent = descriptions.scripted[clan];
preview.className = 'picker-preview scripted';
} else {
preview.textContent = descriptions.learned.default;
preview.className = 'picker-preview learned';
}
});
});
// Slots 34: Scripted (default) or Learned
document.querySelectorAll('input[name="slots34"]').forEach(radio => {
radio.addEventListener('change', (e) => {
const preview = document.getElementById('slots34-preview');
if (e.target.value === 'learned') {
preview.textContent = 'Two learned nets: unpredictable chaos, novel strategies';
preview.className = 'picker-preview learned';
} else {
preview.textContent = 'Goldvein & Ironhold: traders and fortress-builders';
preview.className = 'picker-preview scripted';
}
});
});