The user wants a gamified developer enablement path. This should be an interactive, engaging experience that guides developers through learning and achievements with:
Let me create this comprehensive single-file HTML experience.
I'll create an immersive, game-like developer journey with animated badges, quests, and a reward system. This features:
html Copy code
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>DevQuest - Developer Enablement Path</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
:root {
--bg-dark: #0a0e17;
--bg-card: #131a2b;
--bg-card-hover: #1a2438;
--accent-gold: #f4b942;
--accent-cyan: #00d4ff;
--accent-green: #00ff88;
--accent-purple: #a855f7;
--accent-red: #ff4757;
--text-primary: #e8edf5;
--text-secondary: #7a8ba3;
--border-color: #2a3548;
}
body {
font-family: 'Segoe UI', system-ui, sans-serif;
background: var(--bg-dark);
color: var(--text-primary);
min-height: 100vh;
overflow-x: hidden;
}
#particle-canvas {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 0;
}
.app-container {
position: relative;
z-index: 1;
}
/* Header */
.header {
background: linear-gradient(180deg, rgba(10,14,23,0.98) 0%, rgba(10,14,23,0.9) 100%);
border-bottom: 1px solid var(--border-color);
padding: 1rem 2rem;
position: sticky;
top: 0;
z-index: 100;
backdrop-filter: blur(10px);
}
.header-content {
max-width: 1400px;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 1.8rem;
font-weight: 800;
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-gold));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
letter-spacing: -1px;
}
.player-stats {
display: flex;
align-items: center;
gap: 2rem;
}
.stat-item {
display: flex;
align-items: center;
gap: 0.5rem;
}
.stat-icon {
width: 24px;
height: 24px;
}
.xp-bar-container {
width: 200px;
}
.xp-label {
font-size: 0.75rem;
color: var(--text-secondary);
margin-bottom: 4px;
display: flex;
justify-content: space-between;
}
.xp-bar {
height: 8px;
background: var(--bg-card);
border-radius: 4px;
overflow: hidden;
}
.xp-fill {
height: 100%;
background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
border-radius: 4px;
transition: width 0.5s ease;
position: relative;
}
.xp-fill::after {
content: '';
position: absolute;
right: 0;
top: 0;
bottom: 0;
width: 20px;
background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4));
animation: xpShine 2s infinite;
}
@keyframes xpShine {
0%, 100% { opacity: 0; }
50% { opacity: 1; }
}
.level-badge {
background: linear-gradient(135deg, var(--accent-gold), #d49a2a);
padding: 0.3rem 0.8rem;
border-radius: 20px;
font-weight: 700;
font-size: 0.85rem;
color: #000;
}
/* Navigation Tabs */
.nav-tabs {
display: flex;
gap: 0.5rem;
padding: 0 2rem;
max-width: 1400px;
margin: 1.5rem auto 0;
}
.nav-tab {
padding: 0.8rem 1.5rem;
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 8px 8px 0 0;
color: var(--text-secondary);
cursor: pointer;
transition: all 0.3s ease;
font-weight: 500;
}
.nav-tab:hover {
background: var(--bg-card-hover);
color: var(--text-primary);
}
.nav-tab.active {
background: var(--bg-card-hover);
color: var(--accent-cyan);
border-bottom-color: var(--bg-card-hover);
}
/* Main Content */
.main-content {
max-width: 1400px;
margin: 0 auto;
padding: 2rem;
}
.tab-content {
display: none;
animation: fadeIn 0.4s ease;
}
.tab-content.active {
display: block;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(10px); }
to { opacity: 1; transform: translateY(0); }
}
/* Section Titles */
.section-title {
font-size: 1.5rem;
font-weight: 700;
margin-bottom: 1.5rem;
display: flex;
align-items: center;
gap: 0.75rem;
}
.section-title::before {
content: '';
width: 4px;
height: 24px;
background: linear-gradient(180deg, var(--accent-cyan), var(--accent-gold));
border-radius: 2px;
}
/* Badge Grid */
.badge-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
gap: 1.5rem;
margin-bottom: 3rem;
}
.badge-card {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 12px;
padding: 1.5rem;
text-align: center;
cursor: pointer;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.badge-card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 3px;
background: var(--tier-color, var(--border-color));
}
.badge-card:hover {
transform: translateY(-5px);
background: var(--bg-card-hover);
box-shadow: 0 10px 40px rgba(0, 212, 255, 0.1);
}
.badge-card.locked {
opacity: 0.5;
filter: grayscale(0.8);
}
.badge-card.unlocked {
--tier-color: var(--tier-bg);
}
.badge-card.unlocked::after {
content: '';
position: absolute;
inset: 0;
background: radial-gradient(circle at center, var(--tier-bg), transparent 70%);
opacity: 0.1;
}
.badge-icon {
width: 64px;
height: 64px;
margin: 0 auto 1rem;
position: relative;
}
.badge-icon svg {
width: 100%;
height: 100%;
}
.badge-icon .glow {
position: absolute;
inset: -10px;
background: radial-gradient(circle, var(--tier-bg, transparent) 0%, transparent 70%);
opacity: 0;
transition: opacity 0.3s;
animation: badgePulse 2s infinite;
}
.badge-card.unlocked:hover .glow {
opacity: 0.6;
}
@keyframes badgePulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.1); }
}
.badge-name {
font-weight: 600;
font-size: 0.9rem;
margin-bottom: 0.5rem;
}
.badge-tier {
font-size: 0.75rem;
text-transform: uppercase;
letter-spacing: 1px;
padding: 0.2rem 0.6rem;
border-radius: 10px;
display: inline-block;
}
.tier-bronze { --tier-bg: #cd7f32; color: #cd7f32; }
.tier-silver { --tier-bg: #c0c0c0; color: #c0c0c0; }
.tier-gold { --tier-bg: var(--accent-gold); color: var(--accent-gold); }
.tier-platinum { --tier-bg: #e5e4e2; color: #e5e4e2; }
.tier-legendary { --tier-bg: var(--accent-purple); color: var(--accent-purple); }
/* Quest Cards */
.quest-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
gap: 1.5rem;
}
.quest-card {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 16px;
padding: 1.5rem;
transition: all 0.3s ease;
position: relative;
}
.quest-card:hover {
transform: translateY(-3px);
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}
.quest-header {
display: flex;
justify-content: space-between;
align-items: flex-start;
margin-bottom: 1rem;
}
.quest-difficulty {
display: flex;
gap: 3px;
}
.difficulty-pip {
width: 8px;
height: 16px;
background: var(--border-color);
border-radius: 2px;
}
.quest-difficulty[data-level="1"] .pip-1 { background: var(--accent-green); }
.quest-difficulty[data-level="2"] .pip-1,
.quest-difficulty[data-level="2"] .pip-2 { background: var(--accent-cyan); }
.quest-difficulty[data-level="3"] .pip-1,
.quest-difficulty[data-level="3"] .pip-2,
.quest-difficulty[data-level="3"] .pip-3 { background: var(--accent-gold); }
.quest-difficulty[data-level="4"] .pip-1,
.quest-difficulty[data-level="4"] .pip-2,
.quest-difficulty[data-level="4"] .pip-3,
.quest-difficulty[data-level="4"] .pip-4 { background: var(--accent-purple); }
.quest-difficulty[data-level="5"] .pip-1,
.quest-difficulty[data-level="5"] .pip-2,
.quest-difficulty[data-level="5"] .pip-3,
.quest-difficulty[data-level="5"] .pip-4,
.quest-difficulty[data-level="5"] .pip-5 { background: var(--accent-red); }
.quest-xp {
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-green));
padding: 0.3rem 0.8rem;
border-radius: 20px;
font-weight: 700;
font-size: 0.8rem;
color: #000;
}
.quest-title {
font-size: 1.1rem;
font-weight: 600;
margin-bottom: 0.5rem;
}
.quest-description {
color: var(--text-secondary);
font-size: 0.9rem;
margin-bottom: 1rem;
line-height: 1.5;
}
.quest-progress {
margin-bottom: 1rem;
}
.quest-progress-label {
display: flex;
justify-content: space-between;
font-size: 0.8rem;
color: var(--text-secondary);
margin-bottom: 0.5rem;
}
.quest-progress-bar {
height: 6px;
background: var(--bg-dark);
border-radius: 3px;
overflow: hidden;
}
.quest-progress-fill {
height: 100%;
background: linear-gradient(90deg, var(--accent-cyan), var(--accent-gold));
border-radius: 3px;
transition: width 0.5s ease;
}
.quest-actions {
display: flex;
gap: 0.75rem;
}
.btn {
padding: 0.6rem 1.2rem;
border-radius: 8px;
font-weight: 600;
font-size: 0.85rem;
cursor: pointer;
transition: all 0.2s ease;
border: none;
flex: 1;
}
.btn-primary {
background: linear-gradient(135deg, var(--accent-cyan), #00a8cc);
color: #000;
}
.btn-primary:hover {
transform: scale(1.02);
box-shadow: 0 5px 20px rgba(0, 212, 255, 0.3);
}
.btn-secondary {
background: var(--bg-dark);
color: var(--text-primary);
border: 1px solid var(--border-color);
}
.btn-secondary:hover {
background: var(--border-color);
}
.btn:disabled {
opacity: 0.5;
cursor: not-allowed;
transform: none !important;
}
/* Skill Tree */
.skill-tree {
display: flex;
flex-direction: column;
gap: 2rem;
}
.skill-path {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 16px;
padding: 1.5rem;
}
.skill-path-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
}
.skill-path-title {
font-size: 1.2rem;
font-weight: 700;
}
.skill-path-progress {
font-size: 0.85rem;
color: var(--accent-cyan);
}
.skill-nodes {
display: flex;
gap: 1rem;
overflow-x: auto;
padding-bottom: 1rem;
}
.skill-node {
min-width: 140px;
background: var(--bg-dark);
border: 2px solid var(--border-color);
border-radius: 12px;
padding: 1rem;
text-align: center;
transition: all 0.3s ease;
position: relative;
}
.skill-node.completed {
border-color: var(--accent-green);
background: rgba(0, 255, 136, 0.05);
}
.skill-node.current {
border-color: var(--accent-cyan);
animation: currentNodePulse 2s infinite;
}
@keyframes currentNodePulse {
0%, 100% { box-shadow: 0 0 0 0 rgba(0, 212, 255, 0.4); }
50% { box-shadow: 0 0 20px 5px rgba(0, 212, 255, 0.2); }
}
.skill-node.locked {
opacity: 0.4;
}
.skill-node-icon {
width: 40px;
height: 40px;
margin: 0 auto 0.75rem;
background: var(--bg-card);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.skill-node-name {
font-weight: 600;
font-size: 0.85rem;
margin-bottom: 0.25rem;
}
.skill-node-xp {
font-size: 0.75rem;
color: var(--text-secondary);
}
/* Rewards Shop */
.rewards-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 1.5rem;
}
.reward-card {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 16px;
padding: 1.5rem;
text-align: center;
transition: all 0.3s ease;
}
.reward-card:hover {
transform: translateY(-5px);
box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}
.reward-icon {
width: 80px;
height: 80px;
margin: 0 auto 1rem;
background: linear-gradient(135deg, var(--bg-dark), var(--bg-card-hover));
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 2rem;
}
.reward-title {
font-weight: 700;
font-size: 1.1rem;
margin-bottom: 0.5rem;
}
.reward-description {
color: var(--text-secondary);
font-size: 0.85rem;
margin-bottom: 1rem;
line-height: 1.5;
}
.reward-cost {
display: inline-flex;
align-items: center;
gap: 0.5rem;
background: var(--bg-dark);
padding: 0.5rem 1rem;
border-radius: 20px;
font-weight: 600;
margin-bottom: 1rem;
}
.reward-cost svg {
color: var(--accent-gold);
}
/* Achievement Toast */
.achievement-toast {
position: fixed;
top: 100px;
right: 20px;
background: var(--bg-card);
border: 2px solid var(--accent-gold);
border-radius: 12px;
padding: 1rem 1.5rem;
display: flex;
align-items: center;
gap: 1rem;
transform: translateX(400px);
transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
z-index: 1000;
box-shadow: 0 10px 40px rgba(244, 185, 66, 0.3);
}
.achievement-toast.show {
transform: translateX(0);
}
.achievement-toast-icon {
width: 50px;
height: 50px;
background: linear-gradient(135deg, var(--accent-gold), #d49a2a);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
animation: achievementSpin 0.6s ease;
}
@keyframes achievementSpin {
from { transform: rotateY(180deg); }
to { transform: rotateY(0); }
}
.achievement-toast-content h4 {
color: var(--accent-gold);
font-size: 0.8rem;
text-transform: uppercase;
letter-spacing: 1px;
}
.achievement-toast-content p {
font-weight: 600;
}
/* Notification Badge */
.notification-badge {
position: absolute;
top: -5px;
right: -5px;
background: var(--accent-red);
color: white;
font-size: 0.7rem;
width: 18px;
height: 18px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-weight: 700;
}
/* Leaderboard */
.leaderboard {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 16px;
overflow: hidden;
}
.leaderboard-header {
background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(244, 185, 66, 0.1));
padding: 1rem 1.5rem;
font-weight: 700;
border-bottom: 1px solid var(--border-color);
}
.leaderboard-row {
display: flex;
align-items: center;
padding: 1rem 1.5rem;
border-bottom: 1px solid var(--border-color);
transition: background 0.2s;
}
.leaderboard-row:hover {
background: var(--bg-card-hover);
}
.leaderboard-row:last-child {
border-bottom: none;
}
.leaderboard-rank {
width: 40px;
font-weight: 700;
color: var(--text-secondary);
}
.leaderboard-rank.gold { color: #ffd700; }
.leaderboard-rank.silver { color: #c0c0c0; }
.leaderboard-rank.bronze { color: #cd7f32; }
.leaderboard-avatar {
width: 36px;
height: 36px;
background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
border-radius: 50%;
margin-right: 1rem;
}
.leaderboard-name {
flex: 1;
font-weight: 600;
}
.leaderboard-xp {
font-weight: 700;
color: var(--accent-cyan);
}
/* Modal */
.modal-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.8);
display: none;
align-items: center;
justify-content: center;
z-index: 1000;
backdrop-filter: blur(5px);
}
.modal-overlay.show {
display: flex;
}
.modal {
background: var(--bg-card);
border: 1px solid var(--border-color);
border-radius: 20px;
padding: 2rem;
max-width: 500px;
width: 90%;
animation: modalIn 0.3s ease;
}
@keyframes modalIn {
from { transform: scale(0.9); opacity: 0; }
to { transform: scale(1); opacity: 1; }
}
.modal-header {
text-align: center;
margin-bottom: 1.5rem;
}
.modal-badge-icon {
width: 100px;
height: 100px;
margin: 0 auto 1rem;
}
.modal-title {
font-size: 1.5rem;
font-weight: 700;
}
.modal-tier {
margin-top: 0.5rem;
}
.modal-description {
color: var(--text-secondary);
text-align: center;
margin-bottom: 1.5rem;
line-height: 1.6;
}
.modal-requirements {
background: var(--bg-dark);
border-radius: 12px;
padding: 1rem;
margin-bottom: 1.5rem;
}
.modal-requirements h4 {
font-size: 0.85rem;
color: var(--text-secondary);
margin-bottom: 0.75rem;
}
.requirement-item {
display: flex;
align-items: center;
gap: 0.5rem;
padding: 0.5rem 0;
border-bottom: 1px solid var(--border-color);
}
.requirement-item:last-child {
border-bottom: none;
}
.requirement-check {
color: var(--accent-green);
}
.requirement-check.incomplete {
color: var(--text-secondary);
}
.modal-close {
width: 100%;
}
/* Responsive */
@media (max-width: 768px) {
.header-content {
flex-direction: column;
gap: 1rem;
}
.player-stats {
flex-wrap: wrap;
justify-content: center;
}
.xp-bar-container {
width: 100%;
order: 3;
}
.nav-tabs {
overflow-x: auto;
padding: 0 1rem;
}
.main-content {
padding: 1rem;
}
.quest-grid {
grid-template-columns: 1fr;
}
.badge-grid {
grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
}
}
</style>
</head>
<body>
<canvas id="particle-canvas"></canvas>
<div class="app-container">
<header class="header">
<div class="header-content">
<div class="logo">DevQuest</div>
<div class="player-stats">
<div class="stat-item">
<span class="level-badge">Level 12</span>
</div>
<div class="stat-item xp-bar-container">
<div class="xp-label">
<span>Experience</span>
<span id="current-xp">2,450 / 3,000 XP</span>
</div>
<div class="xp-bar">
<div class="xp-fill" id="xp-fill" style="width: 82%"></div>
</div>
</div>
<div class="stat-item">
<svg class="stat-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="12" cy="12" r="10" fill="var(--accent-gold)" stroke="none"/>
<text x="12" y="16" text-anchor="middle" fill="#000" font-size="10" font-weight="bold" stroke="none">XP</text>
</svg>
<span id="total-xp">24,500</span>
</div>
<div class="stat-item">
<svg class="stat-icon" viewBox="0 0 24 24" fill="var(--accent-cyan)" stroke="none">
<polygon points="12,2 15,9 22,9 17,14 19,21 12,17 5,21 7,14 2,9 9,9"/>
</svg>
<span id="tokens-count">156</span>
</div>
</div>
</div>
</header>
<nav class="nav-tabs">
<div class="nav-tab active" data-tab="quests">Quests</div>
<div class="nav-tab" data-tab="badges">Badges</div>
<div class="nav-tab" data-tab="skills">Skill Paths</div>
<div class="nav-tab" data-tab="rewards">Rewards</div>
<div class="nav-tab" data-tab="leaderboard">Leaderboard</div>
</nav>
<main class="main-content">
<!-- Quests Tab -->
<div class="tab-content active" id="quests-tab">
<h2 class="section-title">Active Quests</h2>
<div class="quest-grid" id="quest-grid"></div>
</div>
<!-- Badges Tab -->
<div class="tab-content" id="badges-tab">
<h2 class="section-title">Badge Collection</h2>
<div class="badge-grid" id="badge-grid"></div>
</div>
<!-- Skills Tab -->
<div class="tab-content" id="skills-tab">
<h2 class="section-title">Skill Paths</h2>
<div class="skill-tree" id="skill-tree"></div>
</div>
<!-- Rewards Tab -->
<div class="tab-content" id="rewards-tab">
<h2 class="section-title">Reward Shop</h2>
<div class="rewards-grid" id="rewards-grid"></div>
</div>
<!-- Leaderboard Tab -->
<div class="tab-content" id="leaderboard-tab">
<h2 class="section-title">Top Developers</h2>
<div class="leaderboard" id="leaderboard"></div>
</div>
</main>
</div>
<!-- Achievement Toast -->
<div class="achievement-toast" id="achievement-toast">
<div class="achievement-toast-icon">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000" stroke-width="2">
<polygon points="12,2 15,9 22,9 17,14 19,21 12,17 5,21 7,14 2,9 9,9"/>
</svg>
</div>
<div class="achievement-toast-content">
<h4>Achievement Unlocked</h4>
<p id="achievement-text">First Steps</p>
</div>
</div>
<!-- Badge Modal -->
<div class="modal-overlay" id="badge-modal">
<div class="modal">
<div class="modal-header">
<div class="modal-badge-icon" id="modal-badge-icon"></div>
<h3 class="modal-title" id="modal-title">Badge Name</h3>
<div class="modal-tier" id="modal-tier"></div>
</div>
<p class="modal-description" id="modal-description">Badge description goes here.</p>
<div class="modal-requirements">
<h4>Requirements</h4>
<div id="modal-requirements-list"></div>
</div>
<button class="btn btn-primary modal-close" onclick="closeModal()">Close</button>
</div>
</div>
<script>
// Game Data
const gameState = {
level: 12,
currentXP: 2450,
xpToNext: 3000,
totalXP: 24500,
tokens: 156,
completedQuests: [],
unlockedBadges: ['first-commit', 'team-player', 'code-reviewer', 'bug-hunter', ci-master', 'api-wizard']
};
const quests = [
{
id: 'docker-setup',
title: 'Containerization Champion',
description: 'Set up a Docker development environment and containerize your first application.',
difficulty: 2,
xp: 500,
progress: 75,
status: 'active'
},
{
id: 'code-review',
title: 'Code Review Marathon',
description: 'Complete 10 meaningful code reviews for your team members.',
difficulty: 3,
xp: 800,
progress: 60,
status: 'active'
},
{
id: 'testing-hero',
title: 'Testing Hero',
description: 'Achieve 80% code coverage on your latest pull request.',
difficulty: 4,
xp: 1200,
progress: 45,
status: 'active'
},
{
id: 'documentation',
title: 'Documentation Master',
description: 'Write comprehensive API documentation for your microservice.',
difficulty: 2,
xp: 600,
progress: 100,
status: 'complete'
},
{
id: 'security-audit',
title: 'Security Guardian',
description: 'Pass security audit with zero critical vulnerabilities.',
difficulty: 5,
xp: 2000,
progress: 20,
status: 'active'
},
{
id: 'mentoring',
title: 'Knowledge Sharer',
description: 'Mentor a junior developer through their first major feature.',
difficulty: 3,
xp: 1000,
progress: 0,
status: 'locked'
}
];
const badges = [
{ id: 'first-commit', name: 'First Commit', tier: 'bronze', description: 'Made your first code commit', icon: 'git' },
{ id: 'team-player', name: 'Team Player', tier: 'silver', description: 'Collaborated on 10+ pull requests', icon: 'users' },
{ id: 'code-reviewer', name: 'Code Reviewer', tier: 'silver', description: 'Completed 25 code reviews', icon: 'eye' },
{ id: 'bug-hunter', name: 'Bug Hunter', tier: 'gold', description: 'Fixed 50 bugs in production', icon: 'bug' },
{ id: 'ci-master', name: 'CI Master', tier: 'gold', description: 'Set up CI/CD pipelines for 5 projects', icon: 'pipeline' },
{ id: 'api-wizard', name: 'API Wizard', tier: 'platinum', description: 'Designed and deployed 10 APIs', icon: 'api' },
{ id: 'cloud-architect', name: 'Cloud Architect', tier: 'legendary', description: 'Mastered cloud infrastructure', icon: 'cloud', locked: true },
{ id: 'security-expert', name: 'Security Expert', tier: 'legendary', description: 'Zero security incidents for 6 months', icon: 'shield', locked: true }
];
const skillPaths = [
{
name: 'Backend Development',
progress: 70,
nodes: [
{ name: 'Fundamentals', xp: 500, status: 'completed' },
{ name: 'APIs', xp: 750, status: 'completed' },
{ name: 'Databases', xp: 800, status: 'completed' },
{ name: 'Microservices', xp: 1000, status: 'current' },
{ name: 'Architecture', xp: 1500, status: 'locked' },
{ name: 'Mastery', xp: 2000, status: 'locked' }
]
},
{
name: 'DevOps Engineering',
progress: 45,
nodes: [
{ name: 'Linux Basics', xp: 400, status: 'completed' },
{ name: 'Docker', xp: 600, status: 'completed' },
{ name: 'Kubernetes', xp: 900, status: 'current' },
{ name: 'Terraform', xp: 1000, status: 'locked' },
{ name: 'GitOps', xp: 1200, status: 'locked' }
]
},
{
name: 'Frontend Mastery',
progress: 30,
nodes: [
{ name: 'HTML/CSS', xp: 300, status: 'completed' },
{ name: 'JavaScript', xp: 500, status: 'current' },
{ name: 'React', xp: 800, status: 'locked' },
{ name: 'Performance', xp: 1000, status: 'locked' }
]
}
];
const rewards = [
{ id: 'coffee', name: 'Coffee Voucher', description: 'Free premium coffee at the office cafe', cost: 50, icon: '☕' },
{ id: 'book', name: 'Tech Book', description: 'Any technical book of your choice', cost: 200, icon: '📚' },
{ id: 'course', name: 'Online Course', description: 'Access to any Udemy/Coursera course', cost: 500, icon: '🎓' },
{ id: 'conference', name: 'Conference Ticket', description: 'Ticket to a tech conference of choice', cost: 1500, icon: '🎪' },
{ id: 'gadget', name: 'Tech Gadget', description: 'Choose from keyboard, mouse, or headphones', cost: 2000, icon: '🎧' },
{ id: 'day-off', name: 'Bonus Day Off', description: 'An extra vacation day to recharge', cost: 3000, icon: '🏖️' }
];
const leaderboardData = [
{ rank: 1, name: 'Sarah Chen', xp: 45200 },
{ rank: 2, name: 'Alex Kumar', xp: 42100 },
{ rank: 3, name: 'Jordan Smith', xp: 38500 },
{ rank: 4, name: 'You', xp: 24500, isYou: true },
{ rank: 5, name: 'Mike Johnson', xp: 22100 },
{ rank: 6, name: 'Emma Davis', xp: 19800 },
{ rank: 7, name: 'Chris Lee', xp: 17600 }
];
// Particle System
const canvas = document.getElementById('particle-canvas');
const ctx = canvas.getContext('2d');
let particles = [];
function resizeCanvas() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
}
class Particle {
constructor() {
this.reset();
}
reset() {
this.x = Math.random() * canvas.width;
this.y = Math.random() * canvas.height;
this.size = Math.random() * 3 + 1;
this.speedX = (Math.random() - 0.5) * 0.5;
this.speedY = (Math.random() - 0.5) * 0.5;
this.opacity = Math.random() * 0.5 + 0.1;
this.color = ['#00d4ff', '#f4b942', '#00ff88', '#a855f7'][Math.floor(Math.random() * 4)];
this.symbol = ['</', '{}', '()', '[]', '//', '&&', '||', '=>'][Math.floor(Math.random() * 8)];
this.isSymbol = Math.random() > 0.7;
}
update() {
this.x += this.speedX;
this.y += this.speedY;
if (this.x < 0 || this.x > canvas.width) this.speedX *= -1;
if (this.y < 0 || this.y > canvas.height) this.speedY *= -1;
}
draw() {
ctx.save();
ctx.globalAlpha = this.opacity;
ctx.fillStyle = this.color;
if (this.isSymbol) {
ctx.font = `${this.size * 5}px monospace`;
ctx.fillText(this.symbol, this.x, this.y);
} else {
ctx.beginPath();
ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
ctx.fill();
}
ctx.restore();
}
}
function initParticles() {
particles = [];
const particleCount = Math.min(50, Math.floor(canvas.width * canvas.height / 20000));
for (let i = 0; i < particleCount; i++) {
particles.push(new Particle());
}
}
function animateParticles() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
particles.forEach(p => {
p.update();
p.draw();
});
requestAnimationFrame(animateParticles);
}
// Icon SVGs
function getIconSVG(type) {
const icons = {
git: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="18" cy="18" r="3"/><circle cx="6" cy="6" r="3"/>
<path d="M13 6h3a2 2 0 0 1 2 2v7"/><line x1="6" y1="9" x2="6" y2="21"/>
</svg>`,
users: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M17 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"/>
<circle cx="9" cy="7" r="4"/><path d="M23 21v-2a4 4 0 0 0-3-3.87"/>
<path d="M16 3.13a4 4 0 0 1 0 7.75"/>
</svg>`,
eye: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/>
<circle cx="12" cy="12" r="3"/>
</svg>`,
bug: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M8 2l1.88 1.88M14.12 3.88L16 2M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"/>
<path d="M12 20c-3.3 0-6-2.7-6-6v-3a6 6 0 0 1 12 0v3c0 3.3-2.7 6-6 6"/>
<path d="M12 20v-9M6.53 9C4.6 8.8 3 7.1 3 5M6 13H2M6 17l-2 2M17.47 9c1.93-.2 3.53-1.9 3.53-4M18 13h4M18 17l2 2"/>
</svg>`,
pipeline: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="2" y1="12" x2="6" y2="12"/><line x1="18" y1="12" x2="22" y2="12"/>
<path d="M6 8v8"/><path d="M18 8v8"/>
<rect x="6" y="6" width="12" height="12" rx="2"/>
<line x1="9" y1="10" x2="15" y2="10"/><line x1="9" y1="14" x2="15" y2="14"/>
</svg>`,
api: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"/>
<polyline points="22,6 12,13 2,6"/>
</svg>`,
cloud: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M18 10h-1.26A8 8 0 1 0 9 20h9a5 5 0 0 0 0-10z"/>
</svg>`,
shield: `<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
</svg>`
};
return icons[type] || icons.git;
}
// Render Functions
function renderQuests() {
const grid = document.getElementById('quest-grid');
grid.innerHTML = quests.map(quest => `
<div class="quest-card" data-id="${quest.id}">
<div class="quest-header">
<div class="quest-difficulty" data-level="${quest.difficulty}">
${'<div class="difficulty-pip"></div>'.repeat(5).split('').map((p, i) =>
p.replace('difficulty-pip', `difficulty-pip pip-${i+1}`)
).join('')}
</div>
<div class="quest-xp">+${quest.xp} XP</div>
</div>
<h3 class="quest-title">${quest.title}</h3>
<p class="quest-description">${quest.description}</p>
<div class="quest-progress">
<div class="quest-progress-label">
<span>Progress</span>
<span>${quest.progress}%</span>
</div>
<div class="quest-progress-bar">
<div class="quest-progress-fill" style="width: ${quest.progress}%"></div>
</div>
</div>
<div class="quest-actions">
${quest.status === 'complete'
? '<button class="btn btn-secondary" disabled>Completed</button>'
: quest.status === 'locked'
? '<button class="btn btn-secondary" disabled>Locked</button>'
: `<button class="btn btn-primary" onclick="workOnQuest('${quest.id}')">Continue Quest</button>
<button class="btn btn-secondary" onclick="abandonQuest('${quest.id}')">Abandon</button>`
}
</div>
</div>
`).join('');
}
function renderBadges() {
const grid = document.getElementById('badge-grid');
grid.innerHTML = badges.map(badge => {
const isUnlocked = gameState.unlockedBadges.includes(badge.id) && !badge.locked;
return `
<div class="badge-card ${isUnlocked ? 'unlocked' : 'locked'}"
onclick="showBadgeModal('${badge.id}')"
style="--tier-color: var(--tier-bg);">
<div class="badge-icon">
<div class="glow"></div>
${getIconSVG(badge.icon)}
</div>
<div class="badge-name">${badge.name}</div>
<div class="badge-tier tier-${badge.tier}">${badge.tier}</div>
</div>
`;
}).join('');
}
function renderSkillPaths() {
const tree = document.getElementById('skill-tree');
tree.innerHTML = skillPaths.map(path => `
<div class="skill-path">
<div class="skill-path-header">
<h3 class="skill-path-title">${path.name}</h3>
<span class="skill-path-progress">${path.progress}% Complete</span>
</div>
<div class="skill-nodes">
${path.nodes.map(node => `
<div class="skill-node ${node.status}">
<div class="skill-node-icon">
${node.status === 'completed'
? '<svg viewBox="0 0 24 24" fill="none" stroke="var(--accent-green)" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>'
: node.status === 'current'
? '<svg viewBox="0 0 24 24" fill="none" stroke="var(--accent-cyan)" stroke-width="2"><circle cx="12" cy="12" r="4"/></svg>'
: '<svg viewBox="0 0 24 24" fill="none" stroke="var(--text-secondary)" stroke-width="2"><circle cx="12" cy="12" r="4"/></svg>'
}
</div>
<div class="skill-node-name">${node.name}</div>
<div class="skill-node-xp">+${node.xp} XP</div>
</div>
`).join('')}
</div>
</div>
`).join('');
}
function renderRewards() {
const grid = document.getElementById('rewards-grid');
grid.innerHTML = rewards.map(reward => `
<div class="reward-card">
<div class="reward-icon">${reward.icon}</div>
<h3 class="reward-title">${reward.name}</h3>
<p class="reward-description">${reward.description}</p>
<div class="reward-cost">
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor">
<polygon points="12,2 15,9 22,9 17,14 19,21 12,17 5,21 7,14 2,9 9,9"/>
</svg>
${reward.cost} Tokens
</div>
<button class="btn ${gameState.tokens >= reward.cost ? 'btn-primary' : 'btn-secondary'}"
${gameState.tokens >= reward.cost ? '' : 'disabled'}
onclick="redeemReward('${reward.id}', ${reward.cost})">
${gameState.tokens >= reward.cost ? 'Redeem' : 'Not Enough Tokens'}
</button>
</div>
`).join('');
}
function renderLeaderboard() {
const board = document.getElementById('leaderboard');
board.innerHTML = `
<div class="leaderboard-header">Season Rankings</div>
${leaderboardData.map(entry => `
<div class="leaderboard-row" style="${entry.isYou ? 'background: rgba(0, 212, 255, 0.1);' : ''}">
<div class="leaderboard-rank ${entry.rank === 1 ? 'gold' : entry.rank === 2 ? 'silver' : entry.rank === 3 ? 'bronze' : ''}">
${entry.rank <= 3 ? ['🥇', '🥈', '🥉'][entry.rank - 1] : entry.rank}
</div>
<div class="leaderboard-avatar" style="${entry.isYou ? 'background: linear-gradient(135deg, var(--accent-cyan), var(--accent-gold));' : ''}"></div>
<div class="leaderboard-name">${entry.name}${entry.isYou ? ' (You)' : ''}</div>
<div class="leaderboard-xp">${entry.xp.toLocaleString()} XP</div>
</div>
`).join('')}
`;
}
// Interactive Functions
function workOnQuest(id) {
const quest = quests.find(q => q.id === id);
if (quest && quest.progress < 100) {
quest.progress = Math.min(100, quest.progress + 25);
renderQuests();
if (quest.progress === 100) {
showAchievement(`Quest Complete: ${quest.title}`);
addXP(quest.xp);
}
}
}
function abandonQuest(id) {
const index = quests.findIndex(q => q.id === id);
if (index > -1) {
quests.splice(index, 1);
renderQuests();
}
}
function addXP(amount) {
gameState.currentXP += amount;
gameState.totalXP += amount;
if (gameState.currentXP >= gameState.xpToNext) {
gameState.level++;
gameState.currentXP -= gameState.xpToNext;
gameState.xpToNext = Math.floor(gameState.xpToNext * 1.2);
showAchievement(`Level Up! You are now Level ${gameState.level}`);
}
updateStats();
}
function updateStats() {
document.querySelector('.level-badge').textContent = `Level ${gameState.level}`;
document.getElementById('current-xp').textContent = `${gameState.currentXP.toLocaleString()} / ${gameState.xpToNext.toLocaleString()} XP`;
document.getElementById('xp-fill').style.width = `${(gameState.currentXP / gameState.xpToNext) * 100}%`;
document.getElementById('total-xp').textContent = gameState.totalXP.toLocaleString();
document.getElementById('tokens-count').textContent = gameState.tokens;
}
function showBadgeModal(id) {
const badge = badges.find(b => b.id === id);
if (!badge) return;
const modal = document.getElementById('badge-modal');
const isUnlocked = gameState.unlockedBadges.includes(id) && !badge.locked;
document.getElementById('modal-badge-icon').innerHTML = getIconSVG(badge.icon);
document.getElementById('modal-title').textContent = badge.name;
document.getElementById('modal-tier').innerHTML = `<span class="badge-tier tier-${badge.tier}">${badge.tier}</span>`;
document.getElementById('modal-description').textContent = badge.description;
const requirements = [
{ text: 'Complete prerequisite badges', complete: isUnlocked },
{ text: 'Reach required level (10)', complete: gameState.level >= 10 },
{ text: 'Earn 20,000 total XP', complete: gameState.totalXP >= 20000 }
];
document.getElementById('modal-requirements-list').innerHTML = requirements.map(req => `
<div class="requirement-item">
<span class="requirement-check ${req.complete ? '' : 'incomplete'}">
${req.complete
? '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3"><polyline points="20 6 9 17 4 12"/></svg>'
: '<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="10"/></svg>'
}
</span>
<span>${req.text}</span>
</div>
`).join('');
modal.classList.add('show');
}
function closeModal() {
document.getElementById('badge-modal').classList.remove('show');
}
function redeemReward(id, cost) {
if (gameState.tokens >= cost) {
gameState.tokens -= cost;
updateStats();
showAchievement('Reward Redeemed Successfully!');
renderRewards();
}
}
function showAchievement(text) {
const toast = document.getElementById('achievement-toast');
document.getElementById('achievement-text').textContent = text;
toast.classList.add('show');
setTimeout(() => toast.classList.remove('show'), 3000);
}
// Tab Navigation
document.querySelectorAll('.nav-tab').forEach(tab => {
tab.addEventListener('click', () => {
document.querySelectorAll('.nav-tab').forEach(t => t.classList.remove('active'));
document.querySelectorAll('.tab-content').forEach(c => c.classList.remove('active'));
tab.classList.add('active');
document.getElementById(`${tab.dataset.tab}-tab`).classList.add('active');
});
});
// Close modal on outside click
document.getElementById('badge-modal').addEventListener('click', (e) => {
if (e.target.classList.contains('modal-overlay')) {
closeModal();
}
});
// Initialize
window.addEventListener('resize', () => {
resizeCanvas();
initParticles();
});
resizeCanvas();
initParticles();
animateParticles();
renderQuests();
renderBadges();
renderSkillPaths();
renderRewards();
renderLeaderboard();
</script>
</body>
</html>