Skip to content

Commit 4cadd6c

Browse files
Merge pull request #696 from Shital861/main
fix: invisible input text in coordinate-polar and derivative-calculator modals
2 parents 68ed8ef + 75a73b8 commit 4cadd6c

4 files changed

Lines changed: 114 additions & 0 deletions

File tree

web-app/css/styles.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,6 +2812,7 @@ body {
28122812
.modal-content {
28132813
padding: 1.5rem;
28142814
border-radius: 16px;
2815+
position: relative;
28152816
}
28162817
}
28172818

@@ -4191,6 +4192,12 @@ html[data-theme="dark"] body {
41914192
transition: background 0.18s ease, transform 0.18s ease;
41924193
}
41934194

4195+
[data-theme="dark"] .card-icon {
4196+
background: linear-gradient(145deg, rgba(40, 40, 40, 0.8), rgba(20, 20, 20, 0.9));
4197+
color: var(--footer-card-color);
4198+
box-shadow: inset 0 1px 0 rgba(252, 176, 91, 0.08);
4199+
border-color: rgba(252, 176, 91, 0.1);
4200+
41944201
.card-actions .btn-share {
41954202
background: rgba(128, 104, 85, 0.06);
41964203
color: var(--text-secondary);

web-app/js/projects.js

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,110 @@ function initFlames() {
11831183
`;
11841184
}
11851185

1186+
1187+
function showSequence() {
1188+
isPlayingSequence = true;
1189+
disableButtons(true);
1190+
displayContent.textContent = "Watch the sequence...";
1191+
1192+
let i = 0;
1193+
const playNextEmoji = () => {
1194+
if (i < sequence.length) {
1195+
const emoji = sequence[i];
1196+
const button = Array.from(emojiButtons).find(btn => btn.dataset.emoji === emoji);
1197+
1198+
if (button) {
1199+
button.classList.add('active');
1200+
setTimeout(() => {
1201+
button.classList.remove('active');
1202+
i++;
1203+
setTimeout(playNextEmoji, 500);
1204+
}, 600);
1205+
}
1206+
} else {
1207+
isPlayingSequence = false;
1208+
disableButtons(false);
1209+
userSequence = [];
1210+
gameActive = true;
1211+
displayContent.textContent = "Your turn! Click the emojis...";
1212+
instructionsDiv.textContent = `👆 Repeat the sequence (${sequence.length} steps)`;
1213+
}
1214+
};
1215+
1216+
playNextEmoji();
1217+
}
1218+
1219+
function startNewRound() {
1220+
const newEmoji = emojis[Math.floor(Math.random() * emojis.length)];
1221+
sequence.push(newEmoji);
1222+
userSequence = [];
1223+
1224+
sequenceLengthDisplay.textContent = sequence.length;
1225+
setTimeout(showSequence, 500);
1226+
}
1227+
1228+
function handleEmojiClick(emoji, button) {
1229+
if (isPlayingSequence || !gameActive) return;
1230+
1231+
userSequence.push(emoji);
1232+
button.classList.add('active');
1233+
1234+
setTimeout(() => {
1235+
button.classList.remove('active');
1236+
}, 300);
1237+
1238+
// Check if the emoji matches
1239+
if (userSequence[userSequence.length - 1] !== sequence[userSequence.length - 1]) {
1240+
gameOver();
1241+
return;
1242+
}
1243+
1244+
// Check if the entire sequence is correct
1245+
if (userSequence.length === sequence.length) {
1246+
score += level * 10;
1247+
scoreDisplay.textContent = score;
1248+
level++;
1249+
levelDisplay.textContent = level;
1250+
1251+
instructionsDiv.textContent = "✅ Correct! Get ready for the next round...";
1252+
gameActive = false;
1253+
setTimeout(startNewRound, 1500);
1254+
}
1255+
}
1256+
1257+
function gameOver() {
1258+
gameActive = false;
1259+
disableButtons(true);
1260+
instructionsDiv.textContent = `❌ Game Over! You reached Level ${level} with Score: ${score}`;
1261+
displayContent.textContent = `Final Score: ${score}`;
1262+
startBtn.textContent = "▶️ PLAY AGAIN";
1263+
}
1264+
1265+
function resetGame() {
1266+
sequence = [];
1267+
userSequence = [];
1268+
score = 0;
1269+
level = 1;
1270+
gameActive = false;
1271+
isPlayingSequence = false;
1272+
1273+
scoreDisplay.textContent = '0';
1274+
levelDisplay.textContent = '1';
1275+
sequenceLengthDisplay.textContent = '0';
1276+
instructionsDiv.textContent = "👇 Click START to begin the game!";
1277+
displayContent.textContent = "Ready to test your memory?";
1278+
startBtn.textContent = "▶️ START";
1279+
1280+
disableButtons(true);
1281+
}
1282+
1283+
startBtn.addEventListener('click', () => {
1284+
resetGame();
1285+
gameActive = true;
1286+
instructionsDiv.textContent = "Watch the sequence...";
1287+
startNewRound();
1288+
});
1289+
11861290
calculateBtn.addEventListener('click', calculateFlames);
11871291
name1Input.addEventListener('keypress', (e) => {
11881292
if (e.key === 'Enter') calculateFlames();

web-app/js/projects/coordinate-polar-transform.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,15 @@ function getCoordinatePolarTransformHTML() {
8585
outline:none;
8686
background-color:var(--bg-color);
8787
border:1px solid white;
88+
color: var(--text-color);
8889
}
8990
#cartesianY{
9091
padding:15px;
9192
border-radius:30px;
9293
outline:none;
9394
background-color:var(--bg-color);
9495
border:1px solid white;
96+
color: var(--text-color);
9597
}
9698
.btn-primary{
9799
padding:15px;

web-app/js/projects/derivative-calculator.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ function getDerivativeCalculatorHTML() {
7676
background-color:var(--bg-color);
7777
outline:none;
7878
border:1px solid white;
79+
color: var(--text-color);
7980
}
8081
button{
8182
padding:15px;

0 commit comments

Comments
 (0)