word define
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Atlantean Love Matching Game</title>
<style>
#atlantean-game {
font-family: Arial, sans-serif;
background: #2e1a47 !important;
color: #ffffff !important;
padding: 5px;
margin: 0;
display: flex;
flex-direction: column;
align-items: center;
}
#atlantean-game h1 {
text-align: center;
font-size: 1.4em;
margin: 6px 0;
color: #9d4edd !important;
}
#atlantean-game #buttons {
display: grid;
grid-template-columns: repeat(14, 1fr);
gap: 1px;
margin: 5px auto;
width: 100%;
max-width: 600px;
}
#atlantean-game .button {
background: #9d4edd !important;
color: #2e1a47 !important;
border: none;
padding: 3px;
cursor: pointer;
font-size: clamp(7px, 1.4vw, 8px);
line-height: 1;
text-align: center;
border-radius: 2px;
aspect-ratio: 1 / 1;
}
#atlantean-game .button:disabled {
background: #4B5563 !important;
cursor: not-allowed;
}
#atlantean-game #game {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 1px;
margin: 6px auto;
width: 100%;
max-width: 600px;
}
#atlantean-game .card {
position: relative;
width: 100%;
aspect-ratio: 4 / 3;
perspective: 1000px;
cursor: pointer;
}
#atlantean-game .card-inner {
position: absolute;
width: 100%;
height: 100%;
transition: transform 0.6s;
transform-style: preserve-3d;
box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}
#atlantean-game .card.flipped .card-inner,
#atlantean-game .card.revealed .card-inner {
transform: rotateY(180deg);
}
#atlantean-game .card-front,
#atlantean-game .card-back {
position: absolute;
width: 100%;
height: 100%;
backface-visibility: hidden;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
padding: 8px;
box-sizing: border-box;
border-radius: 3px;
}
#atlantean-game .card-front {
background: #9d4edd !important;
color: #2e1a47 !important;
font-size: clamp(10px, 1.2vw, 12px);
font-weight: bold;
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M30 20 C15 5, 0 20, 0 40 C0 60, 15 75, 30 75 C45 75, 60 60, 60 40 C60 20, 45 5, 30 20" fill="%232e1a47" stroke="red" stroke-width="2"/><path d="M70 20 C55 5, 40 20, 40 40 C40 60, 55 75, 70 75 C85 75, 100 60, 100 40 C100 20, 85 5, 70 20" fill="%232e1a47" stroke="red" stroke-width="2"/><circle cx="50" cy="30" r="5" fill="white" opacity="0.8"/></svg>') !important;
background-size: 50% !important;
background-repeat: no-repeat !important;
background-position: center !important;
}
#atlantean-game .card-back {
background: #ffffff !important;
color: #2e1a47 !important;
transform: rotateY(180deg);
font-size: clamp(10px, 1.2vw, 12px);
font-weight: normal;
white-space: normal;
overflow-wrap: break-word;
max-height: 100%;
}
#atlantean-game .matched .card-inner {
transform: rotateY(180deg);
}
#atlantean-game #reveal-btn,
#atlantean-game #reference-btn,
#atlantean-game #reference #print-reference-btn {
margin: 5px;
background: #9d4edd !important;
color: #2e1a47 !important;
border: none;
padding: 4px 8px;
cursor: pointer;
font-size: 0.8em;
}
#atlantean-game #reference {
display: none;
width: 100%;
max-width: 600px;
margin: 10px auto;
padding: 5px;
background: #ffffff !important;
border-radius: 3px;
font-size: clamp(10px, 1.4vw, 12px);
color: #2e1a47 !important;
}
#atlantean-game #reference.show {
display: block;
}
#atlantean-game #reference ul {
list-style: none;
padding: 0;
margin: 0;
}
#atlantean-game #reference li {
margin: 2px 0;
}
@media (max-width: 768px) {
#atlantean-game #buttons,
#atlantean-game #game,
#atlantean-game #reference {
max-width: 90vw !important;
}
#atlantean-game .card-front {
font-size: clamp(9px, 1.0vw, 11px);
}
#atlantean-game .card-back {
font-size: clamp(9px, 1.0vw, 11px);
}
#atlantean-game .button {
font-size: clamp(6px, 1vw, 7px);
}
#atlantean-game #reference {
font-size: clamp(9px, 1.2vw, 10px);
}
}
@media print {
#atlantean-game #buttons,
#atlantean-game #game,
#atlantean-game #reveal-btn,
#atlantean-game #reference-btn {
display: none;
}
#atlantean-game {
background: white !important;
color: black !important;
}
#atlantean-game #reference {
display: block;
background: white !important;
color: black !important;
font-size: 9px;
}
#atlantean-game #reference #print-reference-btn {
display: none;
}
}
</style>
</head>
<body>
<div id="atlantean-game">
<h1>Atlantean Love Matching Game</h1>
<div id="buttons"></div>
<div id="game"></div>
<button id="reveal-btn">Show Answers</button>
<button id="reference-btn">Show Reference</button>
<div id="reference">
<button id="print-reference-btn">Print Reference</button>
<ul></ul>
</div>
</div>
<script>
// Puzzle sets for each button (using your three sets)
const puzzleSets = [
{
id: 1,
words: [
"ABASE", "ABASH", "AFFRONT", "ANTAGONIZE", "BELITTLE",
"BERATE", "CASTIGATE", "CHIDE", "DECRY", "DEFAME",
"DENIGRATE", "DENOUNCE", "DERIDE", "DISDAIN", "DISPARAGE",
"FLOUT", "HUMILIATE", "MALIGN", "MOCK", "REPROACH",
"REPROVE", "REVILE", "RIDICULE", "SCORN", "SLANDER"
],
definitions: [
"To lower in rank, prestige, or esteem",
"To destroy the self-confidence of",
"To insult openly",
"To provoke hostility",
"To speak slightingly of",
"To scold vehemently",
"To punish or criticize severely",
"To scold mildly",
"To depreciate publicly",
"To harm reputation by false statements",
"To attack reputation",
"To pronounce blameworthy publicly",
"To laugh at contemptuously",
"Feeling of contempt for inferiority",
"To depreciate by indirect means",
"To treat with contemptuous disregard",
"To make ashamed or embarrassed",
"To speak evil of",
"To treat with ridicule",
"Expression of disapproval",
"To correct gently",
"To subject to verbal abuse",
"Act of derision",
"Open dislike and disrespect",
"To utter false statements harming reputation"
]
},
{
id: 2,
words: [
"ABHORRENCE", "ACERBITY", "ACRIMONY", "AGONY", "ANGUISH",
"ANIMOSITY", "ANIMUS", "ANTIPATHY", "ANXIETY", "APPREHENSION",
"AVERSION", "BITTERNESS", "CHAGRIN", "CONTEMPT", "DESPAIR",
"DESPONDENCY", "DREAD", "ENMITY", "FEAR", "IRE",
"MALICE", "RANCOR", "RESENTMENT", "VEXATION", "WRATH"
],
definitions: [
"Intense hatred or disgust",
"Sharpness of tone or temper",
"Bitter and angry speech or behavior",
"Extreme physical or mental suffering",
"Severe emotional pain or torment",
"Strong hostility or hatred",
"Hostile feeling or ill will",
"A deep-seated dislike or opposition",
"Nervous unease or worry",
"Fearful expectation or anticipation",
"A strong dislike or unwillingness",
"Resentful cynicism or harshness",
"Distress from humiliation or disappointment",
"Deep disrespect or scorn",
"Loss of hope or complete hopelessness",
"State of low spirits from loss of hope",
"Fear of something expected to happen",
"Mutual hatred or hostility",
"An unpleasant emotion caused by threat",
"Intense anger or rage",
"Desire to cause harm or suffering",
"Deep, long-lasting resentment or hatred",
"Lingering anger over a wrong",
"Irritation or annoyance",
"Extreme anger, often vengeful"
]
},
{
// Add 137 more sets:
// {
// id: 4,
// words: ["WORD1", "WORD2", ..., "WORD25"],
// definitions: ["Definition for WORD1", ..., "Definition for WORD25"]
// },
];
let currentSet = 0;
let cards = [];
let selected = [];
let matched = new Set();
function initButtons() {
const btns = document.getElementById('buttons');
btns.innerHTML = '';
for (let i = 1; i <= 140; i++) {
const btn = document.createElement('button');
btn.className = 'button';
btn.textContent = i;
btn.setAttribute('aria-label', `Select puzzle ${i}`);
btn.onclick = () => {
if (i - 1 < puzzleSets.length) {
loadSet(i - 1);
} else {
console.warn(`Set ${i} not yet defined`);
alert(`Set ${i} not available. Add more word sets.`);
}
};
btns.appendChild(btn);
}
document.getElementById('reveal-btn').onclick = revealMatches;
document.getElementById('reference-btn').onclick = toggleReference;
document.getElementById('print-reference-btn').onclick = printReference;
loadSet(0);
}
function loadSet(index) {
currentSet = index;
matched.clear();
selected = [];
const set = puzzleSets[index];
if (!set || !set.words || set.words.length !== 25) {
console.error(`Invalid set at index ${index}`);
alert('Error: Invalid word set. Ensure 25 words per set.');
return;
}
const wordList = set.words;
const defList = set.definitions;
cards = [];
for (let j = 0; j < wordList.length; j++) {
cards.push({ type: 'word', value: wordList[j], id: j });
cards.push({ type: 'def', value: defList[j], id: j });
}
shuffle(cards);
renderGame();
renderReference();
}
function shuffle(array) {
for (let i = array.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[array[i], array[j]] = [array[j], array[i]];
}
}
function renderGame() {
const game = document.getElementById('game');
game.innerHTML = '';
if (cards.length !== 50) {
console.error(`Expected 50 cards, got ${cards.length}`);
alert('Error: Failed to load 50 cards.');
return;
}
cards.forEach((card, idx) => {
const div = document.createElement('div');
div.className = 'card';
div.dataset.idx = idx;
div.onclick = () => flipCard(idx);
const inner = document.createElement('div');
inner.className = 'card-inner';
const front = document.createElement('div');
front.className = 'card-front';
const back = document.createElement('div');
back.className = 'card-back';
back.textContent = card.value;
inner.appendChild(front);
inner.appendChild(back);
div.appendChild(inner);
game.appendChild(div);
});
}
function renderReference() {
const reference = document.getElementById('reference');
reference.innerHTML = '';
const set = puzzleSets[currentSet];
const printBtn = document.createElement('button');
printBtn.id = 'print-reference-btn';
printBtn.textContent = 'Print Reference';
printBtn.onclick = printReference;
const ul = document.createElement('ul');
for (let i = 0; i < set.words.length; i++) {
const li = document.createElement('li');
li.textContent = `${set.words[i]}: ${set.definitions[i]}`;
ul.appendChild(li);
}
reference.appendChild(printBtn);
reference.appendChild(ul);
}
function toggleReference() {
const reference = document.getElementById('reference');
reference.classList.toggle('show');
const btn = document.getElementById('reference-btn');
btn.textContent = reference.classList.contains('show') ? 'Hide Reference' : 'Show Reference';
}
function printReference() {
window.print();
}
function flipCard(idx) {
if (selected.length >= 2 || matched.has(idx)) return;
const card = document.querySelector(`.card[data-idx="${idx}"]`);
if (!card) {
console.error(`Card at index ${idx} not found`);
return;
}
card.className = 'card flipped';
selected.push({ idx, id: cards[idx].id, type: cards[idx].type });
if (selected.length === 2) {
setTimeout(checkMatch, 1000);
}
}
function checkMatch() {
const [first, second] = selected;
if (first.id === second.id && first.type !== second.type) {
matched.add(first.idx);
matched.add(second.idx);
const firstCard = document.querySelector(`.card[data-idx="${first.idx}"]`);
const secondCard = document.querySelector(`.card[data-idx="${second.idx}"]`);
firstCard.className = 'card matched';
secondCard.className = 'card matched';
if (matched.size === 50) {
alert('Congratulations! All matches found!');
}
} else {
document.querySelector(`.card[data-idx="${first.idx}"]`).className = 'card';
document.querySelector(`.card[data-idx="${second.idx}"]`).className = 'card';
}
selected = [];
}
function revealMatches() {
cards.forEach((card, idx) => {
const cardElement = document.querySelector(`.card[data-idx="${idx}"]`);
if (cardElement && !matched.has(idx)) {
cardElement.className = 'card revealed';
}
});
}
initButtons();
</script>
</body>
</html>
Comments
Post a Comment