Skip to content

Commit 617813d

Browse files
Copilot0xrinegade
andcommitted
Add accessibility improvements, hero section, category icons, and visual polish
Co-authored-by: 0xrinegade <[email protected]>
1 parent 4682417 commit 617813d

File tree

3 files changed

+119
-5
lines changed

3 files changed

+119
-5
lines changed

app.js

Lines changed: 40 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,44 @@ let likes = new Map();
66
let learningPaths = [];
77
let searchDebounceTimer = null;
88

9+
// Category icon mapping
10+
function getCategoryIcon(category) {
11+
const iconMap = {
12+
'AI': '🤖',
13+
'BLOCKCHAIN': '⛓️',
14+
'SOLANA': '◎',
15+
'ETHEREUM': '⟠',
16+
'REACT': '⚛️',
17+
'RUST': '🦀',
18+
'PYTHON': '🐍',
19+
'JAVASCRIPT': '📜',
20+
'TYPESCRIPT': '💙',
21+
'GO': '🐹',
22+
'DATABASE': '🗄️',
23+
'WEB': '🌐',
24+
'MOBILE': '📱',
25+
'SECURITY': '🔒',
26+
'DEVOPS': '🚀',
27+
'TESTING': '✅',
28+
'GAMING': '🎮',
29+
'MACHINE LEARNING': '🧠',
30+
'NLP': '💬',
31+
'COMPUTER VISION': '👁️',
32+
'DATA': '📊',
33+
'CLOUD': '☁️'
34+
};
35+
36+
// Try to match category with icon map
37+
const upperCategory = category.toUpperCase();
38+
for (const [key, icon] of Object.entries(iconMap)) {
39+
if (upperCategory.includes(key)) {
40+
return icon;
41+
}
42+
}
43+
44+
return '📦'; // Default icon
45+
}
46+
947
// Load from localStorage
1048
function loadFromStorage() {
1149
const saved = localStorage.getItem('awesome-stargazer-data');
@@ -159,11 +197,12 @@ function renderRepos(repos) {
159197
const isBookmarked = bookmarks.has(repo.id);
160198
const likeCount = likes.get(repo.id) || 0;
161199
const isLiked = likeCount > 0;
200+
const categoryIcon = getCategoryIcon(repo.category);
162201

163202
return `
164203
<div class="repo-card" data-repo-id="${repo.id}">
165204
<div class="repo-header">
166-
<div class="repo-icon">📦</div>
205+
<div class="repo-icon">${categoryIcon}</div>
167206
<div class="repo-info">
168207
<a href="${repo.url}" class="repo-name" target="_blank" rel="noopener">${repo.name}</a>
169208
<div class="repo-category">${repo.category}</div>

index.html

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>⭐</text></svg>">
1010
</head>
1111
<body class="dark-mode">
12+
<!-- Skip to content for accessibility -->
13+
<a href="#main-content" class="skip-to-content">Skip to main content</a>
14+
1215
<!-- Header -->
1316
<header class="header">
1417
<div class="container header-content">
@@ -57,10 +60,16 @@ <h1 class="site-title">Awesome Stargazer</h1>
5760
</header>
5861

5962
<!-- Main Content -->
60-
<main class="main-content">
63+
<main class="main-content" id="main-content">
6164
<!-- Explorer Tab -->
6265
<div class="tab-content active" id="explorer-tab">
6366
<div class="container">
67+
<!-- Hero Section -->
68+
<div class="hero-section">
69+
<h1 class="hero-title">Discover Amazing GitHub Repositories</h1>
70+
<p class="hero-subtitle">Explore 59,000+ curated repositories across 575 categories</p>
71+
</div>
72+
6473
<div class="search-section">
6574
<div class="search-wrapper">
6675
<svg class="search-icon" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
@@ -72,8 +81,9 @@ <h1 class="site-title">Awesome Stargazer</h1>
7281
class="search-input"
7382
placeholder="Search repositories by name, topic, language, or description..."
7483
autocomplete="off"
84+
aria-label="Search repositories"
7585
>
76-
<button class="search-clear hidden" id="search-clear" title="Clear search (Esc)">
86+
<button class="search-clear hidden" id="search-clear" title="Clear search (Esc)" aria-label="Clear search">
7787
<svg width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
7888
<path d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path>
7989
</svg>

styles.css

Lines changed: 67 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
--bg-overlay: rgba(13, 17, 23, 0.8);
66
--border-default: #30363d;
77
--border-muted: #21262d;
8-
--text-primary: #c9d1d9;
8+
--text-primary: #e6edf3;
99
--text-secondary: #8b949e;
1010
--text-link: #58a6ff;
1111
--text-link-hover: #79c0ff;
@@ -48,6 +48,24 @@ html {
4848
scroll-behavior: smooth;
4949
}
5050

51+
/* Skip to content link for accessibility */
52+
.skip-to-content {
53+
position: absolute;
54+
top: -40px;
55+
left: 0;
56+
background: var(--accent-primary);
57+
color: white;
58+
padding: 8px 16px;
59+
text-decoration: none;
60+
border-radius: 0 0 6px 0;
61+
z-index: 1000;
62+
font-weight: 500;
63+
}
64+
65+
.skip-to-content:focus {
66+
top: 0;
67+
}
68+
5169
body {
5270
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif;
5371
background: var(--bg-primary);
@@ -185,6 +203,29 @@ body {
185203
to { opacity: 1; transform: translateY(0); }
186204
}
187205

206+
/* Hero Section */
207+
.hero-section {
208+
text-align: center;
209+
padding: 48px 24px 32px;
210+
animation: fadeIn 0.6s ease;
211+
}
212+
213+
.hero-title {
214+
font-size: 36px;
215+
font-weight: 700;
216+
background: linear-gradient(135deg, var(--text-primary), var(--text-link));
217+
-webkit-background-clip: text;
218+
-webkit-text-fill-color: transparent;
219+
background-clip: text;
220+
margin-bottom: 12px;
221+
}
222+
223+
.hero-subtitle {
224+
font-size: 18px;
225+
color: var(--text-secondary);
226+
font-weight: 400;
227+
}
228+
188229
/* Search Section */
189230
.search-section {
190231
margin-bottom: 24px;
@@ -222,6 +263,10 @@ body {
222263
box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
223264
}
224265

266+
.search-input:not(:placeholder-shown) {
267+
background: var(--bg-tertiary);
268+
}
269+
225270
.search-clear {
226271
position: absolute;
227272
right: 12px;
@@ -381,17 +426,29 @@ kbd {
381426
overflow: hidden;
382427
text-overflow: ellipsis;
383428
white-space: nowrap;
429+
transition: color 0.2s ease;
384430
}
385431

386432
.repo-name:hover {
387433
color: var(--text-link-hover);
388-
text-decoration: underline;
434+
}
435+
436+
.repo-name:focus {
437+
outline: 2px solid var(--text-link);
438+
outline-offset: 2px;
439+
border-radius: 3px;
389440
}
390441

391442
.repo-category {
392443
font-size: 12px;
393444
color: var(--text-secondary);
394445
margin-top: 2px;
446+
display: inline-block;
447+
padding: 2px 8px;
448+
background: var(--bg-tertiary);
449+
border-radius: 12px;
450+
border: 1px solid var(--border-muted);
451+
font-weight: 500;
395452
}
396453

397454
.repo-description {
@@ -1116,4 +1173,12 @@ kbd {
11161173
.toast {
11171174
min-width: auto;
11181175
}
1176+
1177+
.hero-title {
1178+
font-size: 28px;
1179+
}
1180+
1181+
.hero-subtitle {
1182+
font-size: 16px;
1183+
}
11191184
}

0 commit comments

Comments
 (0)