Skip to content

Commit 7345b4a

Browse files
Merge branch 'main' into fix/project-content-unavailable
2 parents b7d546e + 28805bb commit 7345b4a

11 files changed

Lines changed: 1160 additions & 95 deletions
11.2 KB
Loading
Lines changed: 144 additions & 0 deletions
Loading
20.9 KB
Loading

web-app/games.html

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,14 @@
158158
>
159159
<div class="spinner"></div>
160160
</div>
161-
<div class="recent-searches-section" id="recentSearchesSection">
161+
<div class="recent-searches-section" id="dropdownRecentSearchesSection">
162162
<div class="dropdown-section-title recent-searches-header">
163163
<span class="recent-searches-heading">
164164
<i class="fas fa-history" aria-hidden="true"></i>
165165
Recent Searches
166166
</span>
167167
</div>
168-
<div class="recent-searches-chips" id="recentSearchesList" role="list"></div>
168+
<div class="recent-searches-chips" id="dropdownRecentSearchesList" role="list"></div>
169169
</div>
170170
<div
171171
class="results-section"
@@ -636,6 +636,25 @@ <h3>Sudoku Solver &amp; Game</h3>
636636
<p>Interactive Sudoku puzzle with levels and visual backtracking solver.</p>
637637
</div>
638638

639+
<div
640+
class="project-card"
641+
data-category="games"
642+
data-project="queens-logic-puzzle"
643+
>
644+
<img
645+
class="card-banner"
646+
src="assets/banners/queens-logic-puzzle.webp"
647+
alt="Queens Logic Puzzle"
648+
loading="lazy"
649+
/>
650+
<div class="card-actions">
651+
<button class="btn-play" aria-label="Play Queens Logic Puzzle">Try It</button>
652+
</div>
653+
654+
<h3>Queens Logic Puzzle</h3>
655+
<p>Place queens following row, column, region, and adjacency rules!</p>
656+
</div>
657+
639658

640659
<div
641660
class="project-card"
@@ -844,6 +863,7 @@ <h3>War Card Game</h3>
844863
<script defer src="js/projects/word-scramble.js"></script>
845864
<script defer src="js/projects/spot-the-difference.js"></script>
846865
<script defer src="js/projects/sudoku-game.js"></script>
866+
<script defer src="js/projects/queens-logic-puzzle.js"></script>
847867
<script defer src="js/projects/number-sliding-puzzle.js"></script>
848868
<script defer src="js/projects/chess.js"></script>
849869
<script defer src="js/projects/war-card-game.js"></script>

web-app/generate_banners.py

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,75 @@ def draw_die(ox, oy):
427427
x = gx_min + r * 80 + 40
428428
y = gy_min + c * 80 + 40
429429
v_draw.text((x, y), d, fill=color_accent, anchor="mm")
430+
elif "queens" in n_lower or "logic" in n_lower:
431+
# Draw colored irregular regions with queens - matching the reference design
432+
cx, cy = 400, 225
433+
434+
# Region colors inspired by the reference image (matching glassmorphism theme)
435+
region_colors_queens = [
436+
(219, 112, 147), # Pink/Magenta
437+
(70, 130, 180), # Steel Blue
438+
(144, 238, 144), # Light Green
439+
(255, 215, 0), # Gold/Yellow
440+
(186, 85, 211), # Medium Orchid
441+
(135, 206, 250) # Light Sky Blue
442+
]
443+
444+
# Define irregular regions (6 regions, roughly 6 cells each)
445+
# Each region is a list of (row, col) coordinates
446+
regions_map = {
447+
0: [(0, 0), (0, 1), (0, 2), (1, 0), (1, 1), (1, 2)], # Pink - top-left
448+
1: [(0, 3), (0, 4), (0, 5), (1, 3), (1, 4), (1, 5)], # Blue - top-right
449+
2: [(2, 0), (2, 1), (3, 0), (3, 1), (4, 0), (4, 1)], # Green - left
450+
3: [(2, 2), (2, 3), (3, 2), (3, 3), (4, 2), (4, 3)], # Gold - center
451+
4: [(2, 4), (2, 5), (3, 4), (3, 5), (4, 4), (4, 5)], # Purple - right
452+
5: [(5, 0), (5, 1), (5, 2), (5, 3), (5, 4), (5, 5)] # Light Blue - bottom
453+
}
454+
455+
grid_size = 6
456+
cell_w = 50
457+
cell_h = 50
458+
grid_x = cx - (grid_size * cell_w) // 2
459+
grid_y = cy - (grid_size * cell_h) // 2 + 20
460+
461+
# Draw each cell with region background
462+
for region_id, cells in regions_map.items():
463+
region_col = region_colors_queens[region_id]
464+
for r, c in cells:
465+
x = grid_x + c * cell_w
466+
y = grid_y + r * cell_h
467+
468+
# Draw filled cell with semi-transparent region color
469+
v_draw.rectangle(
470+
[x + 1, y + 1, x + cell_w - 1, y + cell_h - 1],
471+
fill=(*region_col, 100),
472+
outline=(*region_col, 150),
473+
width=2
474+
)
475+
476+
# Draw grid borders
477+
for r in range(grid_size + 1):
478+
v_draw.line([(grid_x, grid_y + r * cell_h), (grid_x + grid_size * cell_w, grid_y + r * cell_h)],
479+
fill=(255, 255, 255, 80), width=1)
480+
for c in range(grid_size + 1):
481+
v_draw.line([(grid_x + c * cell_w, grid_y), (grid_x + c * cell_w, grid_y + grid_size * cell_h)],
482+
fill=(255, 255, 255, 80), width=1)
483+
484+
# Place queens on some cells (solution-like pattern)
485+
queen_positions = [
486+
(0, 1, 0), # Region 0 (Pink)
487+
(1, 4, 1), # Region 1 (Blue)
488+
(2, 1, 2), # Region 2 (Green)
489+
(3, 3, 3), # Region 3 (Gold)
490+
(4, 4, 4), # Region 4 (Purple)
491+
(5, 2, 5) # Region 5 (Light Blue)
492+
]
493+
494+
for region_id, c, r in queen_positions:
495+
x = grid_x + c * cell_w + cell_w // 2
496+
y = grid_y + r * cell_h + cell_h // 2
497+
# Draw glowing queen crown emoji
498+
v_draw.text((x, y), "👑", fill=(255, 255, 255, 255), anchor="mm", font=font_subtitle)
430499
elif "blackjack" in n_lower:
431500
# Playing cards
432501
def draw_card(x, y, val):
@@ -513,6 +582,8 @@ def draw_o(ox, oy):
513582
v_draw.ellipse([cx-30, cy-30, cx+30, cy+30], outline=color_accent, width=3)
514583
v_draw.ellipse([cx-15, cy-15, cx+15, cy+15], outline=color_accent, width=2)
515584
v_draw.text((cx, cy), "AI", fill=color_accent, anchor="mm")
585+
# Add "REVERSE" text
586+
v_draw.text((400, 280), "REVERSE", fill=color_accent, anchor="mm", font=font_title)
516587
elif "unit converter" in n_lower:
517588
cx, cy = 400, 225
518589

@@ -670,6 +741,37 @@ def draw_o(ox, oy):
670741
for x, y in [(430, 160), (340, 280), (460, 280)]:
671742
v_draw.line([(x-6, y-6), (x+6, y+6)], fill=color_accent_dim, width=2)
672743
v_draw.line([(x+6, y-6), (x-6, y+6)], fill=color_accent_dim, width=2)
744+
elif "sorting" in n_lower or "visualizer" in n_lower:
745+
# Sorting bars visualization
746+
cx, cy = 400, 225
747+
# Draw sorting bars
748+
bar_values = [30, 50, 20, 80, 40, 60, 10, 70, 35, 55, 25, 75]
749+
bar_width = 30
750+
total_width = len(bar_values) * (bar_width + 6)
751+
start_x = cx - total_width // 2
752+
for i, val in enumerate(bar_values):
753+
x = start_x + i * (bar_width + 6)
754+
height = val * 1.2
755+
y = cy + 60 - height
756+
# Different colors for different heights
757+
if val > 60:
758+
color = (239, 68, 68) # Red for tall
759+
elif val > 35:
760+
color = (245, 158, 11) # Yellow for medium
761+
else:
762+
color = (16, 185, 129) # Green for short
763+
v_draw.rounded_rectangle(
764+
[x, y, x + bar_width, cy + 60],
765+
radius=4,
766+
fill=color,
767+
outline=color_accent_dim,
768+
width=1
769+
)
770+
# Add sorting arrows
771+
v_draw.line([(cx - 100, cy - 80), (cx + 100, cy - 80)], fill=color_accent, width=2)
772+
v_draw.polygon([(cx + 100, cy - 85), (cx + 115, cy - 80), (cx + 100, cy - 75)], fill=color_accent)
773+
# Text
774+
v_draw.text((400, 300), "SORTING", fill=color_accent, anchor="mm", font=font_title)
673775
else:
674776
# Default nice abstract waves
675777
points = []
@@ -736,7 +838,7 @@ def draw_o(ox, oy):
736838
("Chess Game", "games", "chess.webp"),
737839
("Number Sliding Puzzle", "games", "number-sliding-puzzle.webp"),
738840
("War Card Game", "games", "war-card-game.webp"),
739-
("Minesweeper", "games", "minesweeper.webp"),
841+
("Queens Logic Puzzle", "games", "queens-logic-puzzle.webp"),
740842

741843
# MATH
742844
("AP/GP/AGP/HP Recognizer", "math", "progression-recognizer.webp"),

0 commit comments

Comments
 (0)