eaglelandsonce commited on
Commit
e5360fa
·
verified ·
1 Parent(s): 2342027

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +115 -45
index.html CHANGED
@@ -6,6 +6,7 @@
6
  <link rel="preconnect" href="https://fonts.gstatic.com" />
7
  <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;600&display=swap" rel="stylesheet">
8
  <style>
 
9
  body {
10
  font-family: 'Poppins', sans-serif;
11
  background: linear-gradient(120deg, #ade0f4, #f2cfff);
@@ -13,17 +14,35 @@
13
  display: flex;
14
  flex-direction: column;
15
  align-items: center;
16
- justify-content: center;
17
- padding: 20px;
 
 
 
 
 
18
  }
19
  #game-container {
20
  background: #ffffffcc;
21
  width: 90%;
22
  max-width: 600px;
 
23
  padding: 2rem;
24
  border-radius: 12px;
25
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
 
 
 
 
 
 
 
 
26
  text-align: center;
 
 
 
 
27
  }
28
  button {
29
  margin: 0.5rem;
@@ -34,71 +53,122 @@
34
  border-radius: 8px;
35
  background-color: #3498db;
36
  color: #fff;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  }
38
  </style>
39
  </head>
40
  <body>
 
 
41
  <div id="game-container">
42
- <h1>AI Big or Small Fact or Fiction</h1>
43
- <div id="statement">Loading...</div>
44
- <button onclick="checkAnswer(true)">Fact</button>
45
- <button onclick="checkAnswer(false)">Fiction</button>
 
 
 
 
 
 
 
46
  <div id="result"></div>
47
- <button id="next" onclick="nextStatement()" style="display:none;">Next</button>
 
 
 
 
48
  <div id="score"></div>
49
  </div>
50
 
51
  <script>
52
- const statements = [
53
  {text: "Small-scale AI projects usually deal with minimal inconsistency in data sources.", isFact: true, explanation: "Fact! Small projects typically handle fewer data sources, reducing complexity."},
54
  {text: "Large-scale AI projects have manageable storage needs.", isFact: false, explanation: "Fiction! Large-scale projects face significant storage, processing, and latency challenges."},
55
  {text: "Integration issues are minimal in large-scale AI projects.", isFact: false, explanation: "Fiction! Integration can be very complex due to frequent schema mismatches and synchronization issues."},
56
  {text: "Model complexity in small-scale AI projects is usually limited.", isFact: true, explanation: "Fact! Small projects generally involve simpler models with fewer requirements."},
57
- {text: "Infrastructure scalability is usually not an issue in large-scale AI projects.", isFact: false, explanation: "Fiction! Scalability is a significant challenge in large-scale AI."},
58
- {text: "Small-scale AI projects typically use advanced automated version control.", isFact: false, explanation: "Fiction! Small projects often have basic manual version control with infrequent deployments."},
59
- {text: "Large-scale AI projects often require complex monitoring for drift and bias.", isFact: true, explanation: "Fact! Large-scale deployments require robust monitoring systems to detect and handle issues like drift and bias."},
60
- {text: "Small AI teams typically handle end-to-end processes.", isFact: true, explanation: "Fact! Smaller teams usually manage the entire AI lifecycle themselves."},
61
- {text: "Cost management in large-scale AI projects is usually simple and predictable.", isFact: false, explanation: "Fiction! Cost management in large-scale AI involves many stakeholders and is more complex."},
62
- {text: "Risk exposure is higher in large-scale AI projects due to factors like downtime and data breaches.", isFact: true, explanation: "Fact! Larger AI projects face significant risks such as data breaches and scalability issues."}
63
  ];
64
 
65
- let currentStatement = 0;
66
  let score = 0;
67
 
68
- function shuffleArray(array) {
69
- return array.sort(() => Math.random() - 0.5);
70
- }
71
-
72
  function loadStatement() {
73
- document.getElementById("result").innerText = '';
74
- document.getElementById("next").style.display = 'none';
75
- document.getElementById("statement").innerText = statements[currentStatement].text;
76
- document.getElementById("score").innerText = `Score: ${score}/${statements.length}`;
 
 
77
  }
78
-
79
- function checkAnswer(guess) {
80
- const correct = statements[currentStatement].isFact;
81
- if (guess === correct) {
82
- document.getElementById("result").innerText = "Correct! " + statements[currentStatement].explanation;
83
- score++;
84
- } else {
85
- document.getElementById("result").innerText = "Incorrect! " + statements[currentStatement].explanation;
86
- }
87
- document.getElementById("next").style.display = 'inline-block';
88
- }
89
-
90
- function nextStatement() {
91
- currentStatement++;
92
- if (currentStatement < statements.length) {
93
- loadStatement();
94
- } else {
95
- document.getElementById("statement").innerText = `Game Over! Your final score: ${score}/${statements.length}`;
96
- document.getElementById("next").style.display = 'none';
97
- document.getElementById("result").innerText = "";
98
- }
99
  }
 
 
 
 
 
100
 
101
- statements.sort(() => Math.random() - 0.5);
102
  loadStatement();
103
  </script>
104
  </body>
 
6
  <link rel="preconnect" href="https://fonts.gstatic.com" />
7
  <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;600&display=swap" rel="stylesheet">
8
  <style>
9
+ * { margin: 0; padding: 0; box-sizing: border-box; }
10
  body {
11
  font-family: 'Poppins', sans-serif;
12
  background: linear-gradient(120deg, #ade0f4, #f2cfff);
 
14
  display: flex;
15
  flex-direction: column;
16
  align-items: center;
17
+ justify-content: flex-start;
18
+ }
19
+ h1 {
20
+ text-align: center;
21
+ margin-top: 2rem;
22
+ color: #333;
23
+ font-weight: 600;
24
  }
25
  #game-container {
26
  background: #ffffffcc;
27
  width: 90%;
28
  max-width: 600px;
29
+ margin: 2rem auto;
30
  padding: 2rem;
31
  border-radius: 12px;
32
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
33
+ display: flex;
34
+ flex-direction: column;
35
+ align-items: center;
36
+ }
37
+ #statement {
38
+ font-size: 1.3rem;
39
+ margin-bottom: 1rem;
40
+ min-height: 70px;
41
  text-align: center;
42
+ color: #444;
43
+ }
44
+ .btn-group {
45
+ margin: 1rem 0;
46
  }
47
  button {
48
  margin: 0.5rem;
 
53
  border-radius: 8px;
54
  background-color: #3498db;
55
  color: #fff;
56
+ transition: background-color 0.3s ease, transform 0.2s ease;
57
+ }
58
+ button:hover {
59
+ background-color: #2980b9;
60
+ transform: translateY(-2px);
61
+ }
62
+ #result {
63
+ margin-top: 1rem;
64
+ padding: 1rem;
65
+ border-radius: 4px;
66
+ font-weight: 600;
67
+ text-align: center;
68
+ width: 100%;
69
+ display: none;
70
+ }
71
+ #result.correct {
72
+ background-color: #d4edda;
73
+ color: #155724;
74
+ display: block;
75
+ }
76
+ #result.incorrect {
77
+ background-color: #f8d7da;
78
+ color: #721c24;
79
+ display: block;
80
+ }
81
+ #explanation {
82
+ margin-top: 0.5rem;
83
+ padding: 1rem;
84
+ background-color: #f9f9f9;
85
+ color: #555;
86
+ display: none;
87
+ border-radius: 4px;
88
+ }
89
+ .progress-container {
90
+ width: 100%;
91
+ background-color: #eeeeee;
92
+ border-radius: 50px;
93
+ overflow: hidden;
94
+ margin: 1rem 0;
95
+ }
96
+ .progress-bar {
97
+ height: 16px;
98
+ background-color: #3498db;
99
+ width: 0%;
100
+ transition: width 0.3s ease;
101
+ }
102
+ #score {
103
+ margin-top: 1rem;
104
+ font-weight: 600;
105
+ color: #333;
106
  }
107
  </style>
108
  </head>
109
  <body>
110
+ <h1>AI Big or Small Fact or Fiction</h1>
111
+
112
  <div id="game-container">
113
+ <div class="progress-container">
114
+ <div class="progress-bar" id="progress-bar"></div>
115
+ </div>
116
+
117
+ <div id="statement">Loading statement...</div>
118
+
119
+ <div class="btn-group">
120
+ <button onclick="guessFact()">Fact</button>
121
+ <button onclick="guessFiction()">Fiction</button>
122
+ </div>
123
+
124
  <div id="result"></div>
125
+ <div id="explanation"></div>
126
+
127
+ <button id="next-btn" style="display:none;" onclick="nextStatement()">Next</button>
128
+ <button id="restart-btn" style="display:none;" onclick="restartGame()">Restart</button>
129
+
130
  <div id="score"></div>
131
  </div>
132
 
133
  <script>
134
+ let statements = [
135
  {text: "Small-scale AI projects usually deal with minimal inconsistency in data sources.", isFact: true, explanation: "Fact! Small projects typically handle fewer data sources, reducing complexity."},
136
  {text: "Large-scale AI projects have manageable storage needs.", isFact: false, explanation: "Fiction! Large-scale projects face significant storage, processing, and latency challenges."},
137
  {text: "Integration issues are minimal in large-scale AI projects.", isFact: false, explanation: "Fiction! Integration can be very complex due to frequent schema mismatches and synchronization issues."},
138
  {text: "Model complexity in small-scale AI projects is usually limited.", isFact: true, explanation: "Fact! Small projects generally involve simpler models with fewer requirements."},
139
+ {text: "Infrastructure scalability is usually not an issue in large-scale AI projects.", isFact: false, explanation: "Fiction! Scalability is a significant challenge in large-scale AI."}
 
 
 
 
 
140
  ];
141
 
142
+ let currentIndex = 0;
143
  let score = 0;
144
 
145
+ function shuffleArray(array) { return array.sort(() => Math.random() - 0.5); }
 
 
 
146
  function loadStatement() {
147
+ document.getElementById("statement").innerText = statements[currentIndex].text;
148
+ document.getElementById("result").style.display = "none";
149
+ document.getElementById("explanation").style.display = "none";
150
+ document.getElementById("next-btn").style.display = "none";
151
+ updateProgressBar();
152
+ updateScore();
153
  }
154
+ function checkAnswer(userGuess) {
155
+ const correct = statements[currentIndex].isFact;
156
+ document.getElementById("result").innerText = userGuess === correct ? "Correct!" : "Incorrect!";
157
+ document.getElementById("result").className = userGuess === correct ? "correct" : "incorrect";
158
+ document.getElementById("result").style.display = "block";
159
+ document.getElementById("explanation").innerText = statements[currentIndex].explanation;
160
+ document.getElementById("explanation").style.display = "block";
161
+ if (userGuess === correct) score++;
162
+ document.getElementById("next-btn").style.display = "inline-block";
163
+ updateScore();
 
 
 
 
 
 
 
 
 
 
 
164
  }
165
+ function nextStatement() { currentIndex++; currentIndex < statements.length ? loadStatement() : endGame(); }
166
+ function updateScore() { document.getElementById("score").innerText = `Score: ${score}/${statements.length}`; }
167
+ function updateProgressBar() { document.getElementById("progress-bar").style.width = `${(currentIndex/statements.length)*100}%`; }
168
+ function endGame() { document.getElementById("statement").innerText = `Game Over! Final Score: ${score}/${statements.length}`; }
169
+ function restartGame() { currentIndex = 0; score = 0; shuffleArray(statements); loadStatement(); }
170
 
171
+ shuffleArray(statements);
172
  loadStatement();
173
  </script>
174
  </body>