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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Sam's Favorites - Printable Game Cards 📝</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
|
9 |
+
<style>
|
10 |
+
body {
|
11 |
+
font-family: 'Inter', sans-serif;
|
12 |
+
background-color: #f0f4f8; /* Light blue-gray background */
|
13 |
+
}
|
14 |
+
.game-title {
|
15 |
+
color: #3730a3; /* Indigo-800 */
|
16 |
+
}
|
17 |
+
.question-card {
|
18 |
+
background-color: #ffffff;
|
19 |
+
border-radius: 12px; /* Slightly less rounded */
|
20 |
+
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* Tailwind shadow-md */
|
21 |
+
page-break-inside: avoid; /* Avoid breaking cards across printed pages */
|
22 |
+
}
|
23 |
+
.question-text-strong {
|
24 |
+
color: #4338ca; /* Indigo-700 */
|
25 |
+
}
|
26 |
+
.answer-label {
|
27 |
+
color: #3f3f46; /* Zinc-700 */
|
28 |
+
}
|
29 |
+
input[type="text"].answer-input {
|
30 |
+
border: 1px solid #d1d5db; /* Gray-300 */
|
31 |
+
padding: 0.5rem 0.75rem; /* p-2 px-3 */
|
32 |
+
border-radius: 0.375rem; /* rounded-md */
|
33 |
+
width: 100%;
|
34 |
+
box-sizing: border-box;
|
35 |
+
}
|
36 |
+
input[type="text"].answer-input:focus {
|
37 |
+
outline: none;
|
38 |
+
border-color: #4f46e5; /* Indigo-600 */
|
39 |
+
box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.3);
|
40 |
+
}
|
41 |
+
.correct-answer-section {
|
42 |
+
background-color: #f0fdf4; /* Green-50 */
|
43 |
+
border-left: 4px solid #22c55e; /* Green-500 */
|
44 |
+
padding: 0.5rem 0.75rem;
|
45 |
+
border-radius: 0.25rem; /* rounded-sm */
|
46 |
+
}
|
47 |
+
.correct-answer-text {
|
48 |
+
color: #15803d; /* Green-700 */
|
49 |
+
}
|
50 |
+
.btn-toggle-answers {
|
51 |
+
background-color: #4f46e5; /* Indigo-600 */
|
52 |
+
color: white;
|
53 |
+
transition: background-color 0.3s ease;
|
54 |
+
}
|
55 |
+
.btn-toggle-answers:hover {
|
56 |
+
background-color: #4338ca; /* Indigo-700 */
|
57 |
+
}
|
58 |
+
.bonus-prompt-text {
|
59 |
+
color: #6d28d9; /* Violet-700 */
|
60 |
+
}
|
61 |
+
|
62 |
+
/* Initially hide answer sections */
|
63 |
+
.correct-answer-container.hidden-answers .correct-answer-section {
|
64 |
+
display: none;
|
65 |
+
}
|
66 |
+
|
67 |
+
/* Print-specific styles */
|
68 |
+
@media print {
|
69 |
+
body {
|
70 |
+
background-color: #ffffff; /* White background for printing */
|
71 |
+
-webkit-print-color-adjust: exact; /* Ensures colors print in Chrome/Safari */
|
72 |
+
print-color-adjust: exact; /* Standard */
|
73 |
+
}
|
74 |
+
.btn-toggle-answers, .print-hide {
|
75 |
+
display: none !important; /* Hide buttons and other non-print elements */
|
76 |
+
}
|
77 |
+
.question-card {
|
78 |
+
box-shadow: none; /* Remove shadow for printing */
|
79 |
+
border: 1px solid #e5e7eb; /* Light border for cards */
|
80 |
+
margin-bottom: 1rem; /* Space between cards on print */
|
81 |
+
}
|
82 |
+
.correct-answer-section {
|
83 |
+
display: block !important; /* Always show answers when printing */
|
84 |
+
background-color: #f9fafb !important; /* Lighter bg for print */
|
85 |
+
border-left: 2px solid #6b7280 !important; /* Gray border for print */
|
86 |
+
padding: 0.25rem 0.5rem;
|
87 |
+
}
|
88 |
+
.correct-answer-text {
|
89 |
+
color: #1f2937 !important; /* Darker text for print */
|
90 |
+
}
|
91 |
+
input[type="text"].answer-input {
|
92 |
+
border-bottom: 1px solid #9ca3af; /* Underline style for print */
|
93 |
+
border-top: none;
|
94 |
+
border-left: none;
|
95 |
+
border-right: none;
|
96 |
+
border-radius: 0;
|
97 |
+
padding-left: 0;
|
98 |
+
padding-right: 0;
|
99 |
+
}
|
100 |
+
input[type="text"].answer-input::placeholder {
|
101 |
+
color: transparent; /* Hide placeholder on print */
|
102 |
+
}
|
103 |
+
.cards-container-grid {
|
104 |
+
grid-template-columns: repeat(1, minmax(0, 1fr)) !important; /* Single column for print */
|
105 |
+
}
|
106 |
+
.page-container {
|
107 |
+
padding: 0.5in !important; /* Adjust print margins */
|
108 |
+
max-width: 100% !important;
|
109 |
+
}
|
110 |
+
.game-title, .footer-text {
|
111 |
+
text-align: center;
|
112 |
+
}
|
113 |
+
}
|
114 |
+
</style>
|
115 |
+
</head>
|
116 |
+
<body class="p-4 sm:p-6 md:p-8">
|
117 |
+
|
118 |
+
<div id="pageContainer" class="page-container max-w-5xl mx-auto">
|
119 |
+
<header class="text-center mb-8">
|
120 |
+
<h1 class="game-title text-3xl sm:text-4xl font-bold">Sam's Favorites Challenge!</h1> <!-- Emoji removed from title -->
|
121 |
+
<p class="text-gray-600 mt-2">How well do you know Sam? Fill in the answers below!</p>
|
122 |
+
</header>
|
123 |
+
|
124 |
+
<div class="text-center mb-8 print-hide">
|
125 |
+
<button id="toggleAnswersBtn" class="btn-toggle-answers py-2 px-6 rounded-lg font-semibold text-lg">
|
126 |
+
Reveal Answers
|
127 |
+
</button>
|
128 |
+
</div>
|
129 |
+
|
130 |
+
<div id="cardsContainer" class="correct-answer-container hidden-answers cards-container-grid grid grid-cols-1 md:grid-cols-2 gap-6">
|
131 |
+
<!-- Question cards will be injected here by JavaScript -->
|
132 |
+
</div>
|
133 |
+
|
134 |
+
<footer class="mt-12 text-center footer-text">
|
135 |
+
<p class="text-xs text-gray-500">© 2024 Fun Times Inc.</p> <!-- Emoji removed from footer -->
|
136 |
+
</footer>
|
137 |
+
</div>
|
138 |
+
|
139 |
+
<script>
|
140 |
+
const gameData = [
|
141 |
+
// emoji property removed from all objects
|
142 |
+
{ question: "Name Sam's all time favorite musical group?", answer: "Beastie Boys" },
|
143 |
+
{ question: "What is Sam's favorite game?", answer: "Scrabble" },
|
144 |
+
{ question: "In her 20's, Sam lived briefly in which two states?", answer: "California and Oregon", alternatives: ["Oregon and California"] },
|
145 |
+
{ question: "Name Sam's longest Employer.", answer: "Target", alternatives: ["Target Corporation"] },
|
146 |
+
{ question: "Sam holds a BA degree in _____, and Masters degree in _____?", answer: "BA in English Literature and Masters in Library Science", alternatives: ["English Literature and Library Science", "English Lit and Library Science", "BA English Literature Masters Library Science"] },
|
147 |
+
{ question: "What is Sam's biggest fear?", answer: "Spiders" },
|
148 |
+
{ question: "Name the first National Park that Sam and Aaron travelled to.", answer: "Yellowstone National Park", alternatives: ["Yellowstone"] },
|
149 |
+
{ question: "Sam and her BFF have matching tattoos which is the title of a song. What is the Paul McCartney song?", answer: "Let It Be" },
|
150 |
+
{ question: "What animal would Sam like to have as an indoor pet?", answer: "A cat", alternatives: ["Cat", "Cats"] },
|
151 |
+
{ question: "If Sam won $1000 shopping spree at the store of her choice, which store would it be?", answer: "A local bookstore", alternatives: ["Bookstore", "Local Bookstore", "A bookstore"], bonusPrompt: "Bonus: Why would she choose this store?", bonusAnswer: "To support local business and her love for reading" }
|
152 |
+
];
|
153 |
+
|
154 |
+
const cardsContainerEl = document.getElementById('cardsContainer');
|
155 |
+
const toggleAnswersBtn = document.getElementById('toggleAnswersBtn');
|
156 |
+
|
157 |
+
function renderCards() {
|
158 |
+
cardsContainerEl.innerHTML = ''; // Clear existing cards
|
159 |
+
|
160 |
+
gameData.forEach((item, index) => {
|
161 |
+
const card = document.createElement('div');
|
162 |
+
card.className = 'question-card p-5 sm:p-6 flex flex-col';
|
163 |
+
|
164 |
+
let mainAnswerHTML = '';
|
165 |
+
if (Array.isArray(item.answer)) {
|
166 |
+
mainAnswerHTML = item.answer.join(' / ');
|
167 |
+
} else {
|
168 |
+
mainAnswerHTML = item.answer;
|
169 |
+
}
|
170 |
+
|
171 |
+
// Emoji span removed from this template literal
|
172 |
+
let cardInnerHTML = `
|
173 |
+
<div class="flex-grow">
|
174 |
+
<h3 class="text-lg font-semibold question-text-strong mb-2">
|
175 |
+
<span class="question-number">${index + 1}.</span>
|
176 |
+
${item.question}
|
177 |
+
</h3>
|
178 |
+
<div class="mb-3 mt-3">
|
179 |
+
<label for="answer-${index}" class="block text-sm font-medium answer-label mb-1">Your Answer:</label>
|
180 |
+
<input type="text" id="answer-${index}" name="answer-${index}" class="answer-input w-full" placeholder="Type your answer here...">
|
181 |
+
</div>
|
182 |
+
</div>
|
183 |
+
<div class="correct-answer-section mt-auto">
|
184 |
+
<p class="text-xs font-medium text-gray-600">Correct Answer:</p>
|
185 |
+
<p class="correct-answer-text font-semibold">${mainAnswerHTML}</p>
|
186 |
+
</div>
|
187 |
+
`;
|
188 |
+
|
189 |
+
if (item.bonusPrompt) {
|
190 |
+
// Emoji span removed from this template literal as well
|
191 |
+
cardInnerHTML = `
|
192 |
+
<div class="flex-grow">
|
193 |
+
<h3 class="text-lg font-semibold question-text-strong mb-2">
|
194 |
+
<span class="question-number">${index + 1}.</span>
|
195 |
+
${item.question}
|
196 |
+
</h3>
|
197 |
+
<div class="mb-3 mt-3">
|
198 |
+
<label for="answer-main-${index}" class="block text-sm font-medium answer-label mb-1">Your Answer (Main):</label>
|
199 |
+
<input type="text" id="answer-main-${index}" name="answer-main-${index}" class="answer-input w-full" placeholder="Main answer...">
|
200 |
+
</div>
|
201 |
+
<p class="text-sm font-semibold bonus-prompt-text mt-4 mb-1">${item.bonusPrompt}</p>
|
202 |
+
<div class="mb-3">
|
203 |
+
<label for="answer-bonus-${index}" class="block text-sm font-medium answer-label mb-1">Your Answer (Bonus):</label>
|
204 |
+
<input type="text" id="answer-bonus-${index}" name="answer-bonus-${index}" class="answer-input w-full" placeholder="Bonus answer...">
|
205 |
+
</div>
|
206 |
+
</div>
|
207 |
+
<div class="mt-auto">
|
208 |
+
<div class="correct-answer-section mb-2">
|
209 |
+
<p class="text-xs font-medium text-gray-600">Correct Answer (Main):</p>
|
210 |
+
<p class="correct-answer-text font-semibold">${mainAnswerHTML}</p>
|
211 |
+
</div>
|
212 |
+
<div class="correct-answer-section">
|
213 |
+
<p class="text-xs font-medium text-gray-600">Correct Answer (Bonus):</p>
|
214 |
+
<p class="correct-answer-text font-semibold">${item.bonusAnswer}</p>
|
215 |
+
</div>
|
216 |
+
</div>
|
217 |
+
`;
|
218 |
+
}
|
219 |
+
card.innerHTML = cardInnerHTML;
|
220 |
+
cardsContainerEl.appendChild(card);
|
221 |
+
});
|
222 |
+
}
|
223 |
+
|
224 |
+
toggleAnswersBtn.addEventListener('click', () => {
|
225 |
+
cardsContainerEl.classList.toggle('hidden-answers');
|
226 |
+
if (cardsContainerEl.classList.contains('hidden-answers')) {
|
227 |
+
toggleAnswersBtn.textContent = 'Reveal Answers';
|
228 |
+
} else {
|
229 |
+
toggleAnswersBtn.textContent = 'Hide Answers';
|
230 |
+
}
|
231 |
+
});
|
232 |
+
|
233 |
+
// Initial render of cards
|
234 |
+
renderCards();
|
235 |
+
</script>
|
236 |
+
</body>
|
237 |
</html>
|