Skip to content

Commit 3fd712a

Browse files
Merge branch 'main' of github.com:DJSaunders1997/GPTeasers
2 parents 934ac70 + 0d35a3b commit 3fd712a

8 files changed

Lines changed: 1144 additions & 150 deletions

File tree

frontend/index.html

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@
44
<meta charset="UTF-8" />
55
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
8+
<meta http-equiv="Pragma" content="no-cache" />
9+
<meta http-equiv="Expires" content="0" />
710
<title>GPTeasers Quiz App</title>
811
<link
912
rel="icon"
1013
href="static/flavicon.png"
1114
type="image/png"
1215
sizes="32x32"
1316
/>
14-
<link rel="stylesheet" href="static/styles.css" />
17+
<link rel="stylesheet" href="static/styles.css?v=20251221" />
1518
<!-- Google tag (gtag.js) -->
1619
<script
1720
async
@@ -33,11 +36,16 @@
3336
<div class="navbar-brand">
3437
<h1>GPTeasers 🧠💡</h1>
3538
</div>
36-
<ul class="navbar-links">
39+
<div class="navbar-toggle" id="navbar-toggle">
40+
<span></span>
41+
<span></span>
42+
<span></span>
43+
</div>
44+
<ul class="navbar-links" id="navbar-links">
3745
<li><a href="index.html">Home</a></li>
38-
<li><a href="readme.html">README</a></li>
3946
<li><a href="https://github.com/DJSaunders1997/GPTeasers">Github Repo</a></li>
4047
<li><a href="mailto:DJSaunders1997@gmail.com">Contact</a></li>
48+
<li><a href="readme.html">README</a></li>
4149
</ul>
4250
</nav>
4351
<h1>GPTeasers 🧠💡</h1>
@@ -80,7 +88,7 @@ <h1>GPTeasers 🧠💡</h1>
8088
</select>
8189
</div>
8290

83-
<button id="fetchQuizButton">Fetch Quiz Data</button>
91+
<button id="fetchQuizButton">Generate AI Quiz </button>
8492
</section>
8593

8694
<section id="quizSection">
@@ -134,10 +142,10 @@ <h2></h2>
134142
</div>
135143
</template>
136144
</section>
145+
146+
<footer>Website by David Saunders.</footer>
137147
</main>
138148

139-
<footer>Website by David Saunders.</footer>
140-
141-
<script type="module" src="scripts/app.js"></script>
149+
<script type="module" src="scripts/app.js?v=20251220"></script>
142150
</body>
143151
</html>

frontend/scripts/app.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ class App {
1414
this.controller = new Controller(this.quiz);
1515
this.ui = new UI();
1616

17+
// Initialize mobile menu toggle
18+
this.initMobileMenu();
19+
1720
// Load supported models dynamically
1821
this.loadSupportedModels();
1922

@@ -48,6 +51,39 @@ class App {
4851
});
4952
}
5053

54+
/**
55+
* Initialize mobile menu toggle functionality
56+
*/
57+
initMobileMenu() {
58+
const navbarToggle = document.getElementById('navbar-toggle');
59+
const navbarLinks = document.getElementById('navbar-links');
60+
61+
if (navbarToggle && navbarLinks) {
62+
navbarToggle.addEventListener('click', () => {
63+
navbarLinks.classList.toggle('active');
64+
65+
// Add animation to hamburger menu
66+
navbarToggle.classList.toggle('active');
67+
});
68+
69+
// Close mobile menu when clicking on a link
70+
navbarLinks.querySelectorAll('a').forEach(link => {
71+
link.addEventListener('click', () => {
72+
navbarLinks.classList.remove('active');
73+
navbarToggle.classList.remove('active');
74+
});
75+
});
76+
77+
// Close mobile menu when clicking outside
78+
document.addEventListener('click', (event) => {
79+
if (!navbarToggle.contains(event.target) && !navbarLinks.contains(event.target)) {
80+
navbarLinks.classList.remove('active');
81+
navbarToggle.classList.remove('active');
82+
}
83+
});
84+
}
85+
}
86+
5187
async fetchQuizData() {
5288
// Get the topic and difficulty from the input field
5389
const topic = this.ui.getTopic();

frontend/scripts/controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class Controller {
120120
async callImageAPI(prompt) {
121121
console.log("Generating image for prompt:", prompt);
122122

123-
const encodedPrompt = encodeURIComponent(prompt + " Pixel art");
123+
const encodedPrompt = encodeURIComponent(prompt + " vibrant colors, modern aesthetic");
124124
const url = `${this.baseURLImage}?code=&prompt=${encodedPrompt}`;
125125
console.log(`Sending request to: ${url}`);
126126

0 commit comments

Comments
 (0)