Generate a modern web app landing + dashboard UI for an app called "PySQL Labs" — a Python + SQL interactive learning platform with hands-on labs and interview-style drills. Create a polished, developer-focused, slightly playful but professional design.
Browse filesTop-level layout:
- Hero section (full-width): App name "PySQL Labs", short tagline "Hands-on Python & SQL labs with auto-grading and interview drills", primary CTA "Start Free Lab" and secondary CTA "Try Interview Mode".
- Prominent visual: split-screen mock (left: code editor with output; right: SQL results grid) or an animated device frame showing both editors.
Key UI modules on the landing page:
1. Feature grid with 4 cards:
- Interactive Python Lab (editor, run + tests)
- SQL Sandbox (seeded DB viewer, run query)
- Auto-grader & Feedback (instant scoring)
- Interview Simulator (timed mock interviews)
Each card: icon, short description, small CTA "Try sample".
2. How it works (3-step horizontal flow):
- Select a lab or problem
- Write and run code / query
- Get instant feedback & progress tracking
3. Example problems carousel (compact cards):
- Python: "Even or Odd" — filter list; "First Prime" — find first prime
- SQL: "Find employee" — select by name; "Merge two lists" — union/join sample
Each card shows difficulty, estimated time, and a one-line prompt.
4. Dashboard preview section:
- Left: progress summary (level, badges, streak)
- Middle: "Continue Lab" card with small code snippet preview and test status
- Right: "Interview Mode" card: timer and next question preview
5. SQL Lab mini UI component:
- Table browser (employees sample), SQL editor, Run button, results grid, "Reset DB" small button.
6. Python Lab mini UI component:
- Editor pane, console output pane, visible testcases list with pass/fail badges, Hints toggle.
7. Footer: links to Docs, Cheat-sheets, Contact, Privacy, and small copy: "For educational use only."
Design constraints & visual tone:
- Clean developer-friendly typography, monospaced for code snippets.
- Use a modern dashboard aesthetic: subtle gradients, card shadows, soft rounded corners.
- Action colors: a primary color for CTAs and a secondary accent for badges; keep palette professional (no neon).
- Micro-interactions: hover on cards, subtle run button animation, progress bar fills.
- Responsive: layout adapts to tablet and mobile (stacked sections).
Deliverables: produce a landing + logged-in dashboard layout with modular components described above, ready to iterate into a working app design. Provide clean spacing, clear CTA hierarchy, and distinct lab/editor visual treatments so the design reads as an interactive coding/SQL platform.
- README.md +7 -4
- components/dashboard.js +164 -0
- components/feature-card.js +103 -0
- components/footer.js +105 -0
- components/navbar.js +115 -0
- components/problem-card.js +137 -0
- components/python-lab.js +193 -0
- components/sql-lab.js +158 -0
- components/step.js +75 -0
- index.html +285 -19
- script.js +209 -0
- style.css +120 -18
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
|
| 4 |
-
colorFrom: red
|
| 5 |
colorTo: red
|
|
|
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: PySQL Playground - Interactive Python & SQL Labs 👨💻
|
| 3 |
+
colorFrom: purple
|
|
|
|
| 4 |
colorTo: red
|
| 5 |
+
emoji: 🐳
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://huggingface.co/deepsite).
|
|
@@ -0,0 +1,164 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomDashboard extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
:host {
|
| 7 |
+
display: block;
|
| 8 |
+
}
|
| 9 |
+
.dashboard-container {
|
| 10 |
+
background: rgba(31, 41, 55, 0.7);
|
| 11 |
+
border-radius: 1.5rem;
|
| 12 |
+
padding: 2rem;
|
| 13 |
+
border: 1px solid rgba(55, 65, 81, 0.3);
|
| 14 |
+
}
|
| 15 |
+
.progress-bar {
|
| 16 |
+
height: 0.75rem;
|
| 17 |
+
border-radius: 9999px;
|
| 18 |
+
background: rgba(55, 65, 81, 0.5);
|
| 19 |
+
overflow: hidden;
|
| 20 |
+
}
|
| 21 |
+
.progress-fill {
|
| 22 |
+
height: 100%;
|
| 23 |
+
border-radius: 9999px;
|
| 24 |
+
background: linear-gradient(90deg, #22c55e, #d946ef);
|
| 25 |
+
transition: width 1s ease-in-out;
|
| 26 |
+
}
|
| 27 |
+
.badge {
|
| 28 |
+
display: inline-flex;
|
| 29 |
+
align-items: center;
|
| 30 |
+
padding: 0.25rem 0.75rem;
|
| 31 |
+
border-radius: 9999px;
|
| 32 |
+
font-size: 0.75rem;
|
| 33 |
+
font-weight: 600;
|
| 34 |
+
}
|
| 35 |
+
.interview-timer {
|
| 36 |
+
font-family: 'JetBrains Mono', monospace;
|
| 37 |
+
font-size: 1.875rem;
|
| 38 |
+
font-weight: bold;
|
| 39 |
+
}
|
| 40 |
+
</style>
|
| 41 |
+
<div class="dashboard-container">
|
| 42 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-8">
|
| 43 |
+
<!-- Left: Progress Summary -->
|
| 44 |
+
<div class="space-y-6">
|
| 45 |
+
<div>
|
| 46 |
+
<h3 class="text-lg font-semibold mb-3">Your Progress</h3>
|
| 47 |
+
<div class="bg-gray-800/50 rounded-xl p-4">
|
| 48 |
+
<div class="flex items-center justify-between mb-4">
|
| 49 |
+
<div>
|
| 50 |
+
<div class="text-2xl font-bold">Level 12</div>
|
| 51 |
+
<div class="text-gray-400">Python & SQL Expert</div>
|
| 52 |
+
</div>
|
| 53 |
+
<div class="space-y-4">
|
| 54 |
+
<div>
|
| 55 |
+
<div class="flex justify-between text-sm mb-1">
|
| 56 |
+
<span>Python Mastery</span>
|
| 57 |
+
<span>85%</span>
|
| 58 |
+
</div>
|
| 59 |
+
<div class="progress-bar">
|
| 60 |
+
<div class="progress-fill" style="width: 85%"></div>
|
| 61 |
+
</div>
|
| 62 |
+
<div>
|
| 63 |
+
<div class="flex justify-between text-sm mb-1">
|
| 64 |
+
<span>SQL Skills</span>
|
| 65 |
+
<span>78%</span>
|
| 66 |
+
</div>
|
| 67 |
+
<div class="progress-bar">
|
| 68 |
+
<div class="progress-fill" style="width: 78%"></div>
|
| 69 |
+
</div>
|
| 70 |
+
</div>
|
| 71 |
+
<div class="mt-4">
|
| 72 |
+
<div class="flex space-x-3">
|
| 73 |
+
<div class="badge bg-primary/10 text-primary">
|
| 74 |
+
<i data-feather="star" class="w-3 h-3 mr-2"></i>
|
| 75 |
+
3 Badges
|
| 76 |
+
</div>
|
| 77 |
+
<div class="badge bg-secondary/10 text-secondary">
|
| 78 |
+
<i data-feather="flame" class="w-3 h-3 mr-2"></i>
|
| 79 |
+
Streak: 14 days
|
| 80 |
+
</div>
|
| 81 |
+
</div>
|
| 82 |
+
</div>
|
| 83 |
+
</div>
|
| 84 |
+
|
| 85 |
+
<!-- Middle: Continue Lab -->
|
| 86 |
+
<div class="space-y-6">
|
| 87 |
+
<h3 class="text-lg font-semibold">Continue Learning</h3>
|
| 88 |
+
<div class="bg-gray-800/70 rounded-xl p-4 border border-gray-700">
|
| 89 |
+
<div class="flex items-center justify-between mb-3">
|
| 90 |
+
<span class="text-sm text-gray-400">Last active lab</span>
|
| 91 |
+
<div class="badge bg-green-500/10 text-green-500">
|
| 92 |
+
<i data-feather="play-circle" class="w-4 h-4 mr-2"></i>
|
| 93 |
+
Continue Lab
|
| 94 |
+
</div>
|
| 95 |
+
</div>
|
| 96 |
+
|
| 97 |
+
<div class="space-y-4">
|
| 98 |
+
<div class="bg-gray-900 rounded-lg p-3 font-mono text-sm">
|
| 99 |
+
def find_first_prime(nums):
|
| 100 |
+
for num in nums:
|
| 101 |
+
if is_prime(num):
|
| 102 |
+
return num
|
| 103 |
+
return None
|
| 104 |
+
</div>
|
| 105 |
+
|
| 106 |
+
<div class="flex items-center justify-between">
|
| 107 |
+
<div class="text-sm text-gray-300">Find First Prime</div>
|
| 108 |
+
<div class="flex items-center">
|
| 109 |
+
<div class="w-2 h-2 rounded-full bg-green-500 mr-2"></div>
|
| 110 |
+
<span class="text-sm">Tests: 4/5 passed</span>
|
| 111 |
+
</div>
|
| 112 |
+
</div>
|
| 113 |
+
</div>
|
| 114 |
+
</div>
|
| 115 |
+
|
| 116 |
+
<!-- Right: Interview Mode -->
|
| 117 |
+
<div class="space-y-6">
|
| 118 |
+
<h3 class="text-lg font-semibold">Interview Mode</h3>
|
| 119 |
+
<div class="bg-gray-800/70 rounded-xl p-4 border border-gray-700">
|
| 120 |
+
<div class="interview-timer text-center mb-4" id="interview-timer">
|
| 121 |
+
30:00
|
| 122 |
+
</div>
|
| 123 |
+
|
| 124 |
+
<div class="space-y-4">
|
| 125 |
+
<div>
|
| 126 |
+
<div class="text-sm text-gray-400 mb-2">Next Question</div>
|
| 127 |
+
|
| 128 |
+
<div class="bg-gray-900 rounded-lg p-4">
|
| 129 |
+
<div class="font-mono text-sm mb-3">
|
| 130 |
+
# SQL: Find duplicate emails
|
| 131 |
+
# Time limit: 10 minutes
|
| 132 |
+
</div>
|
| 133 |
+
|
| 134 |
+
<button class="w-full py-3 bg-gradient-to-r from-secondary to-secondary/80 hover:from-secondary/90 hover:to-secondary text-white font-semibold rounded-lg transition-all">
|
| 135 |
+
<i data-feather="zap" class="w-4 h-4 mr-2"></i>
|
| 136 |
+
Start Interview
|
| 137 |
+
</button>
|
| 138 |
+
</div>
|
| 139 |
+
</div>
|
| 140 |
+
</div>
|
| 141 |
+
</div>
|
| 142 |
+
|
| 143 |
+
<div class="mt-8 grid grid-cols-2 gap-4">
|
| 144 |
+
<div class="text-center p-4 bg-gray-800/50 rounded-xl">
|
| 145 |
+
<div class="text-3xl font-bold mb-2">142</div>
|
| 146 |
+
<div class="text-sm text-gray-400">Problems Solved</div>
|
| 147 |
+
</div>
|
| 148 |
+
<div class="text-center p-4 bg-gray-800/50 rounded-xl">
|
| 149 |
+
<div class="text-3xl font-bold mb-2">87%</div>
|
| 150 |
+
<div class="text-sm text-gray-400">Success Rate</div>
|
| 151 |
+
</div>
|
| 152 |
+
</div>
|
| 153 |
+
</div>
|
| 154 |
+
`;
|
| 155 |
+
|
| 156 |
+
setTimeout(() => {
|
| 157 |
+
if (typeof feather !== 'undefined') {
|
| 158 |
+
feather.replace();
|
| 159 |
+
}
|
| 160 |
+
}, 100);
|
| 161 |
+
}
|
| 162 |
+
}
|
| 163 |
+
|
| 164 |
+
customElements.define('custom-dashboard', CustomDashboard);
|
|
@@ -0,0 +1,103 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomFeatureCard extends HTMLElement {
|
| 2 |
+
constructor() {
|
| 3 |
+
super();
|
| 4 |
+
this.icon = this.getAttribute('icon') || 'code';
|
| 5 |
+
this.title = this.getAttribute('title') || 'Feature';
|
| 6 |
+
this.description = this.getAttribute('description') || 'Description';
|
| 7 |
+
this.ctaText = this.getAttribute('cta-text') || 'Try Now';
|
| 8 |
+
this.color = this.getAttribute('color') || 'primary';
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
connectedCallback() {
|
| 12 |
+
this.attachShadow({ mode: 'open' });
|
| 13 |
+
this.shadowRoot.innerHTML = `
|
| 14 |
+
<style>
|
| 15 |
+
:host {
|
| 16 |
+
display: block;
|
| 17 |
+
}
|
| 18 |
+
.feature-card {
|
| 19 |
+
background: linear-gradient(145deg, rgba(31, 41, 55, 0.8), rgba(17, 24, 39, 0.8));
|
| 20 |
+
border: 1px solid rgba(55, 65, 81, 0.3);
|
| 21 |
+
border-radius: 1rem;
|
| 22 |
+
padding: 1.5rem;
|
| 23 |
+
transition: all 0.3s ease;
|
| 24 |
+
height: 100%;
|
| 25 |
+
}
|
| 26 |
+
.feature-card:hover {
|
| 27 |
+
transform: translateY(-5px);
|
| 28 |
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
|
| 29 |
+
border-color: rgba(34, 197, 94, 0.5);
|
| 30 |
+
}
|
| 31 |
+
.icon-container {
|
| 32 |
+
width: 3.5rem;
|
| 33 |
+
height: 3.5rem;
|
| 34 |
+
border-radius: 0.75rem;
|
| 35 |
+
display: flex;
|
| 36 |
+
align-items: center;
|
| 37 |
+
justify-content: center;
|
| 38 |
+
margin-bottom: 1rem;
|
| 39 |
+
}
|
| 40 |
+
.primary-icon {
|
| 41 |
+
background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
|
| 42 |
+
}
|
| 43 |
+
.secondary-icon {
|
| 44 |
+
background: linear-gradient(135deg, rgba(217, 70, 239, 0.15), rgba(217, 70, 239, 0.05));
|
| 45 |
+
}
|
| 46 |
+
.primary-text {
|
| 47 |
+
color: #22c55e;
|
| 48 |
+
}
|
| 49 |
+
.secondary-text {
|
| 50 |
+
color: #d946ef;
|
| 51 |
+
}
|
| 52 |
+
h3 {
|
| 53 |
+
font-size: 1.25rem;
|
| 54 |
+
font-weight: 600;
|
| 55 |
+
margin-bottom: 0.75rem;
|
| 56 |
+
}
|
| 57 |
+
p {
|
| 58 |
+
color: #d1d5db;
|
| 59 |
+
margin-bottom: 1rem;
|
| 60 |
+
line-height: 1.5;
|
| 61 |
+
}
|
| 62 |
+
.cta-button {
|
| 63 |
+
display: inline-flex;
|
| 64 |
+
align-items: center;
|
| 65 |
+
padding: 0.5rem 1rem;
|
| 66 |
+
border-radius: 0.5rem;
|
| 67 |
+
font-weight: 500;
|
| 68 |
+
transition: all 0.2s ease;
|
| 69 |
+
}
|
| 70 |
+
.primary-cta {
|
| 71 |
+
background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
|
| 72 |
+
color: #22c55e;
|
| 73 |
+
}
|
| 74 |
+
.secondary-cta {
|
| 75 |
+
background: linear-gradient(135deg, rgba(217, 70, 239, 0.15), rgba(217, 70, 239, 0.05));
|
| 76 |
+
color: #d946ef;
|
| 77 |
+
}
|
| 78 |
+
.cta-button:hover {
|
| 79 |
+
transform: translateX(3px);
|
| 80 |
+
}
|
| 81 |
+
</style>
|
| 82 |
+
<div class="feature-card fade-in hover-lift">
|
| 83 |
+
<div class="icon-container ${this.color === 'primary' ? 'primary-icon' : 'secondary-icon'}">
|
| 84 |
+
<i data-feather="${this.icon}" class="w-6 h-6 ${this.color === 'primary' ? 'primary-text' : 'secondary-text'}"></i>
|
| 85 |
+
</div>
|
| 86 |
+
<h3>${this.title}</h3>
|
| 87 |
+
<p>${this.description}</p>
|
| 88 |
+
<a href="#try-sample" class="cta-button ${this.color === 'primary' ? 'primary-cta' : 'secondary-cta'}">
|
| 89 |
+
<i data-feather="arrow-right" class="w-4 h-4 mr-2"></i>
|
| 90 |
+
${this.ctaText}
|
| 91 |
+
</a>
|
| 92 |
+
</div>
|
| 93 |
+
`;
|
| 94 |
+
|
| 95 |
+
setTimeout(() => {
|
| 96 |
+
if (typeof feather !== 'undefined') {
|
| 97 |
+
feather.replace();
|
| 98 |
+
}
|
| 99 |
+
}, 100);
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
customElements.define('custom-feature-card', CustomFeatureCard);
|
|
@@ -0,0 +1,105 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomFooter extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
:host {
|
| 7 |
+
display: block;
|
| 8 |
+
}
|
| 9 |
+
.footer-container {
|
| 10 |
+
background: rgba(17, 24, 39, 0.95);
|
| 11 |
+
border-top: 1px solid rgba(55, 65, 81, 0.3);
|
| 12 |
+
}
|
| 13 |
+
.footer-link {
|
| 14 |
+
color: #9ca3af;
|
| 15 |
+
transition: color 0.3s ease;
|
| 16 |
+
}
|
| 17 |
+
.footer-link:hover {
|
| 18 |
+
color: #22c55e;
|
| 19 |
+
}
|
| 20 |
+
</style>
|
| 21 |
+
<footer class="footer-container">
|
| 22 |
+
<div class="container mx-auto px-6 py-12">
|
| 23 |
+
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
|
| 24 |
+
<!-- Brand -->
|
| 25 |
+
<div>
|
| 26 |
+
<div class="flex items-center space-x-3 mb-4">
|
| 27 |
+
<div class="w-10 h-10 rounded-xl bg-gradient-to-r from-primary to-secondary flex items-center justify-center">
|
| 28 |
+
<i data-feather="cpu" class="w-6 h-6 text-gray-900"></i>
|
| 29 |
+
</div>
|
| 30 |
+
<span class="text-xl font-bold">PySQL Labs</span>
|
| 31 |
+
</div>
|
| 32 |
+
<p class="text-gray-400 text-sm">
|
| 33 |
+
Interactive platform for mastering Python and SQL through hands-on labs and interview simulations.
|
| 34 |
+
</p>
|
| 35 |
+
</div>
|
| 36 |
+
|
| 37 |
+
<!-- Quick Links -->
|
| 38 |
+
<div>
|
| 39 |
+
<h4 class="text-lg font-semibold mb-4">Quick Links</h4>
|
| 40 |
+
<ul class="space-y-3">
|
| 41 |
+
<li><a href="#docs" class="footer-link">Documentation</a></li>
|
| 42 |
+
<li><a href="#cheatsheets" class="footer-link">Cheat Sheets</a></li>
|
| 43 |
+
<li><a href="#api" class="footer-link">API Reference</a></li>
|
| 44 |
+
<li><a href="#tutorials" class="footer-link">Video Tutorials</a></li>
|
| 45 |
+
</ul>
|
| 46 |
+
</div>
|
| 47 |
+
|
| 48 |
+
<!-- Resources -->
|
| 49 |
+
<div>
|
| 50 |
+
<h4 class="text-lg font-semibold mb-4">Resources</h4>
|
| 51 |
+
<ul class="space-y-3">
|
| 52 |
+
<li><a href="#blog" class="footer-link">Developer Blog</a></li>
|
| 53 |
+
<li><a href="#community" class="footer-link">Community Forum</a></li>
|
| 54 |
+
<li><a href="#webinars" class="footer-link">Live Webinars</a></li>
|
| 55 |
+
<li><a href="#github" class="footer-link">GitHub Repo</a></li>
|
| 56 |
+
<li><a href="#roadmap" class="footer-link">Product Roadmap</a></li>
|
| 57 |
+
</ul>
|
| 58 |
+
</div>
|
| 59 |
+
|
| 60 |
+
<!-- Legal -->
|
| 61 |
+
<div>
|
| 62 |
+
<h4 class="text-lg font-semibold mb-4">Legal</h4>
|
| 63 |
+
<ul class="space-y-3">
|
| 64 |
+
<li><a href="#privacy" class="footer-link">Privacy Policy</a></li>
|
| 65 |
+
<li><a href="#terms" class="footer-link">Terms of Service</a></li>
|
| 66 |
+
<li><a href="#cookies" class="footer-link">Cookie Policy</a></li>
|
| 67 |
+
<li><a href="#security" class="footer-link">Security</a></li>
|
| 68 |
+
<li><a href="#contact" class="footer-link">Contact Us</a></li>
|
| 69 |
+
</ul>
|
| 70 |
+
</div>
|
| 71 |
+
</div>
|
| 72 |
+
|
| 73 |
+
<div class="border-t border-gray-800 mt-8 pt-8">
|
| 74 |
+
<div class="flex flex-col md:flex-row justify-between items-center">
|
| 75 |
+
<div class="text-gray-500 text-sm mb-4 md:mb-0">
|
| 76 |
+
© ${new Date().getFullYear()} PySQL Labs. For educational use only.
|
| 77 |
+
</div>
|
| 78 |
+
<div class="flex space-x-6">
|
| 79 |
+
<a href="#twitter" aria-label="Twitter">
|
| 80 |
+
<i data-feather="twitter" class="w-5 h-5 text-gray-400 hover:text-primary transition-colors">
|
| 81 |
+
</a>
|
| 82 |
+
<a href="#github" aria-label="GitHub">
|
| 83 |
+
<i data-feather="github" class="w-5 h-5 text-gray-400 hover:text-primary transition-colors">
|
| 84 |
+
</a>
|
| 85 |
+
<a href="#linkedin" aria-label="LinkedIn">
|
| 86 |
+
<i data-feather="linkedin" class="w-5 h-5 text-gray-400 hover:text-primary transition-colors">
|
| 87 |
+
</a>
|
| 88 |
+
<a href="#discord" aria-label="Discord">
|
| 89 |
+
<i data-feather="message-circle" class="w-5 h-5 text-gray-400 hover:text-primary transition-colors">
|
| 90 |
+
</a>
|
| 91 |
+
</div>
|
| 92 |
+
</div>
|
| 93 |
+
</div>
|
| 94 |
+
</footer>
|
| 95 |
+
`;
|
| 96 |
+
|
| 97 |
+
setTimeout(() => {
|
| 98 |
+
if (typeof feather !== 'undefined') {
|
| 99 |
+
feather.replace();
|
| 100 |
+
}
|
| 101 |
+
}, 100);
|
| 102 |
+
}
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
customElements.define('custom-footer', CustomFooter);
|
|
@@ -0,0 +1,115 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomNavbar extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
:host {
|
| 7 |
+
display: block;
|
| 8 |
+
width: 100%;
|
| 9 |
+
position: sticky;
|
| 10 |
+
top: 0;
|
| 11 |
+
z-index: 50;
|
| 12 |
+
}
|
| 13 |
+
.nav-container {
|
| 14 |
+
background: rgba(17, 24, 39, 0.95);
|
| 15 |
+
backdrop-filter: blur(10px);
|
| 16 |
+
border-bottom: 1px solid rgba(55, 65, 81, 0.3);
|
| 17 |
+
}
|
| 18 |
+
.nav-link {
|
| 19 |
+
position: relative;
|
| 20 |
+
transition: color 0.3s ease;
|
| 21 |
+
}
|
| 22 |
+
.nav-link:hover {
|
| 23 |
+
color: #22c55e;
|
| 24 |
+
}
|
| 25 |
+
.nav-link::after {
|
| 26 |
+
content: '';
|
| 27 |
+
position: absolute;
|
| 28 |
+
width: 0;
|
| 29 |
+
height: 2px;
|
| 30 |
+
bottom: -2px;
|
| 31 |
+
left: 0;
|
| 32 |
+
background: linear-gradient(90deg, #22c55e, #d946ef);
|
| 33 |
+
transition: width 0.3s ease;
|
| 34 |
+
}
|
| 35 |
+
.nav-link:hover::after {
|
| 36 |
+
width: 100%;
|
| 37 |
+
}
|
| 38 |
+
@media (max-width: 768px) {
|
| 39 |
+
.mobile-menu {
|
| 40 |
+
animation: slideDown 0.3s ease-out;
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
@keyframes slideDown {
|
| 44 |
+
from {
|
| 45 |
+
opacity: 0;
|
| 46 |
+
transform: translateY(-10px);
|
| 47 |
+
}
|
| 48 |
+
to {
|
| 49 |
+
opacity: 1;
|
| 50 |
+
transform: translateY(0);
|
| 51 |
+
}
|
| 52 |
+
}
|
| 53 |
+
</style>
|
| 54 |
+
<nav class="nav-container">
|
| 55 |
+
<div class="container mx-auto px-6 py-4">
|
| 56 |
+
<div class="flex items-center justify-between">
|
| 57 |
+
<!-- Logo -->
|
| 58 |
+
<a href="/" class="flex items-center space-x-3">
|
| 59 |
+
<div class="w-8 h-8 rounded-lg bg-gradient-to-r from-primary to-secondary flex items-center justify-center">
|
| 60 |
+
<i data-feather="cpu" class="w-5 h-5 text-gray-900"></i>
|
| 61 |
+
</div>
|
| 62 |
+
<span class="text-xl font-bold">PySQL Labs</span>
|
| 63 |
+
</a>
|
| 64 |
+
|
| 65 |
+
<!-- Desktop Menu -->
|
| 66 |
+
<div class="hidden md:flex items-center space-x-8">
|
| 67 |
+
<a href="#features" class="nav-link">Features</a>
|
| 68 |
+
<a href="#how-it-works" class="nav-link">How It Works</a>
|
| 69 |
+
<a href="#challenges" class="nav-link">Challenges</a>
|
| 70 |
+
<a href="#dashboard" class="nav-link">Dashboard</a>
|
| 71 |
+
<a href="#login" class="px-4 py-2 bg-gray-800 hover:bg-gray-700 rounded-lg transition-colors">
|
| 72 |
+
Log In
|
| 73 |
+
</a>
|
| 74 |
+
<a href="#signup" class="px-4 py-2 bg-gradient-to-r from-primary to-primary/80 hover:from-primary/90 hover:to-primary text-gray-900 font-semibold rounded-lg transition-all">
|
| 75 |
+
Sign Up Free
|
| 76 |
+
</a>
|
| 77 |
+
<button id="dark-mode-toggle" class="p-2 rounded-lg bg-gray-800 hover:bg-gray-700">
|
| 78 |
+
<i data-feather="sun" class="w-5 h-5"></i>
|
| 79 |
+
</button>
|
| 80 |
+
</div>
|
| 81 |
+
|
| 82 |
+
<!-- Mobile Menu Button -->
|
| 83 |
+
<button data-menu-toggle class="md:hidden p-2 rounded-lg bg-gray-800 hover:bg-gray-700">
|
| 84 |
+
<i data-feather="menu" class="w-6 h-6"></i>
|
| 85 |
+
</button>
|
| 86 |
+
</div>
|
| 87 |
+
|
| 88 |
+
<!-- Mobile Menu -->
|
| 89 |
+
<div id="mobile-menu" class="hidden md:hidden px-6 pb-4">
|
| 90 |
+
<div class="flex flex-col space-y-4">
|
| 91 |
+
<a href="#features" class="nav-link py-2">Features</a>
|
| 92 |
+
<a href="#how-it-works" class="nav-link py-2">How It Works</a>
|
| 93 |
+
<a href="#challenges" class="nav-link py-2">Challenges</a>
|
| 94 |
+
<a href="#dashboard" class="nav-link py-2">Dashboard</a>
|
| 95 |
+
<div class="pt-4 border-t border-gray-700">
|
| 96 |
+
<a href="#login" class="block py-2">Log In</a>
|
| 97 |
+
<a href="#signup" class="block px-4 py-2 bg-gradient-to-r from-primary to-primary/80 text-gray-900 font-semibold rounded-lg">
|
| 98 |
+
Sign Up Free
|
| 99 |
+
</a>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
</div>
|
| 103 |
+
</nav>
|
| 104 |
+
`;
|
| 105 |
+
|
| 106 |
+
// Initialize Feather Icons in shadow DOM
|
| 107 |
+
setTimeout(() => {
|
| 108 |
+
if (typeof feather !== 'undefined') {
|
| 109 |
+
feather.replace();
|
| 110 |
+
}
|
| 111 |
+
}, 100);
|
| 112 |
+
}
|
| 113 |
+
}
|
| 114 |
+
|
| 115 |
+
customElements.define('custom-navbar', CustomNavbar);
|
|
@@ -0,0 +1,137 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomProblemCard extends HTMLElement {
|
| 2 |
+
constructor() {
|
| 3 |
+
super();
|
| 4 |
+
this.title = this.getAttribute('title') || 'Challenge';
|
| 5 |
+
this.language = this.getAttribute('language') || 'Python';
|
| 6 |
+
this.difficulty = this.getAttribute('difficulty') || 'Easy';
|
| 7 |
+
this.time = this.getAttribute('time') || '15 min';
|
| 8 |
+
this.description = this.getAttribute('description') || 'Description';
|
| 9 |
+
this.status = this.getAttribute('status') || 'free';
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
connectedCallback() {
|
| 13 |
+
this.attachShadow({ mode: 'open' });
|
| 14 |
+
this.shadowRoot.innerHTML = `
|
| 15 |
+
<style>
|
| 16 |
+
:host {
|
| 17 |
+
display: block;
|
| 18 |
+
}
|
| 19 |
+
.problem-card {
|
| 20 |
+
background: rgba(31, 41, 55, 0.7);
|
| 21 |
+
border: 1px solid rgba(55, 65, 81, 0.3);
|
| 22 |
+
border-radius: 1rem;
|
| 23 |
+
padding: 1.5rem;
|
| 24 |
+
transition: all 0.3s ease;
|
| 25 |
+
height: 100%;
|
| 26 |
+
position: relative;
|
| 27 |
+
overflow: hidden;
|
| 28 |
+
}
|
| 29 |
+
.problem-card::before {
|
| 30 |
+
content: '';
|
| 31 |
+
position: absolute;
|
| 32 |
+
top: 0;
|
| 33 |
+
left: 0;
|
| 34 |
+
right: 0;
|
| 35 |
+
height: 3px;
|
| 36 |
+
background: linear-gradient(90deg, #22c55e, #d946ef);
|
| 37 |
+
opacity: 0;
|
| 38 |
+
transition: opacity 0.3s ease;
|
| 39 |
+
}
|
| 40 |
+
.problem-card:hover::before {
|
| 41 |
+
opacity: 1;
|
| 42 |
+
}
|
| 43 |
+
.language-badge {
|
| 44 |
+
display: inline-block;
|
| 45 |
+
padding: 0.25rem 0.75rem;
|
| 46 |
+
border-radius: 9999px;
|
| 47 |
+
font-size: 0.75rem;
|
| 48 |
+
font-weight: 600;
|
| 49 |
+
}
|
| 50 |
+
.python-badge {
|
| 51 |
+
background: rgba(34, 197, 94, 0.15);
|
| 52 |
+
color: #22c55e;
|
| 53 |
+
}
|
| 54 |
+
.sql-badge {
|
| 55 |
+
background: rgba(217, 70, 239, 0.15);
|
| 56 |
+
color: #d946ef;
|
| 57 |
+
}
|
| 58 |
+
.difficulty-badge {
|
| 59 |
+
display: inline-flex;
|
| 60 |
+
align-items: center;
|
| 61 |
+
padding: 0.25rem 0.75rem;
|
| 62 |
+
border-radius: 9999px;
|
| 63 |
+
font-size: 0.75rem;
|
| 64 |
+
font-weight: 600;
|
| 65 |
+
}
|
| 66 |
+
.difficulty-easy {
|
| 67 |
+
background: rgba(34, 197, 94, 0.1);
|
| 68 |
+
border: 1px solid rgba(34, 197, 94, 0.3);
|
| 69 |
+
color: #22c55e;
|
| 70 |
+
}
|
| 71 |
+
.difficulty-medium {
|
| 72 |
+
background: rgba(245, 158, 11, 0.1);
|
| 73 |
+
border: 1px solid rgba(245, 158, 11, 0.3);
|
| 74 |
+
color: #f59e0b;
|
| 75 |
+
}
|
| 76 |
+
.status-ribbon {
|
| 77 |
+
position: absolute;
|
| 78 |
+
top: 0;
|
| 79 |
+
right: 0;
|
| 80 |
+
padding: 0.25rem 1rem;
|
| 81 |
+
font-size: 0.75rem;
|
| 82 |
+
font-weight: 600;
|
| 83 |
+
border-radius: 0.375rem 1rem 0.375rem 0.375rem;
|
| 84 |
+
font-size: 0.75rem;
|
| 85 |
+
}
|
| 86 |
+
.status-free {
|
| 87 |
+
background: rgba(34, 197, 94, 0.2);
|
| 88 |
+
color: #22c55e;
|
| 89 |
+
}
|
| 90 |
+
.status-premium {
|
| 91 |
+
background: rgba(217, 70, 239, 0.2);
|
| 92 |
+
color: #d946ef;
|
| 93 |
+
}
|
| 94 |
+
.hover-lift:hover {
|
| 95 |
+
transform: translateY(-3px);
|
| 96 |
+
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
|
| 97 |
+
}
|
| 98 |
+
</style>
|
| 99 |
+
<div class="problem-card fade-in hover-lift">
|
| 100 |
+
${this.status !== 'free' ?
|
| 101 |
+
`<div class="status-ribbon ${this.status === 'premium' ? 'status-premium' : ''}">
|
| 102 |
+
${this.status.toUpperCase()}
|
| 103 |
+
</div>` : ''}
|
| 104 |
+
|
| 105 |
+
<div class="flex justify-between items-start mb-4">
|
| 106 |
+
<div class="language-badge ${this.language === 'Python' ? 'python-badge' : 'sql-badge'}">
|
| 107 |
+
${this.language}
|
| 108 |
+
</div>
|
| 109 |
+
</div>
|
| 110 |
+
|
| 111 |
+
<h3 class="text-xl font-bold mb-3">${this.title}</h3>
|
| 112 |
+
|
| 113 |
+
<p class="text-gray-300 mb-6">${this.description}</p>
|
| 114 |
+
|
| 115 |
+
<div class="flex justify-between items-center">
|
| 116 |
+
<div class="flex items-center">
|
| 117 |
+
<div class="difficulty-badge ${this.difficulty.toLowerCase() === 'easy' ? 'difficulty-easy' : 'difficulty-medium'}">
|
| 118 |
+
${this.difficulty}
|
| 119 |
+
</div>
|
| 120 |
+
<div class="text-gray-400 text-sm flex items-center">
|
| 121 |
+
<i data-feather="clock" class="w-4 h-4 mr-1"></i>
|
| 122 |
+
${this.time}
|
| 123 |
+
</div>
|
| 124 |
+
</div>
|
| 125 |
+
</div>
|
| 126 |
+
</div>
|
| 127 |
+
`;
|
| 128 |
+
|
| 129 |
+
setTimeout(() => {
|
| 130 |
+
if (typeof feather !== 'undefined') {
|
| 131 |
+
feather.replace();
|
| 132 |
+
}
|
| 133 |
+
}, 100);
|
| 134 |
+
}
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
customElements.define('custom-problem-card', CustomProblemCard);
|
|
@@ -0,0 +1,193 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomPythonLab extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
:host {
|
| 7 |
+
display: block;
|
| 8 |
+
}
|
| 9 |
+
.python-lab {
|
| 10 |
+
background: rgba(31, 41, 55, 0.8);
|
| 11 |
+
border-radius: 1rem;
|
| 12 |
+
overflow: hidden;
|
| 13 |
+
border: 1px solid rgba(55, 65, 81, 0.5);
|
| 14 |
+
}
|
| 15 |
+
.editor-container {
|
| 16 |
+
background: #1a202c;
|
| 17 |
+
padding: 1.5rem;
|
| 18 |
+
}
|
| 19 |
+
.code-editor {
|
| 20 |
+
background: transparent;
|
| 21 |
+
color: #e2e8f0;
|
| 22 |
+
font-family: 'JetBrains Mono', monospace;
|
| 23 |
+
font-size: 0.875rem;
|
| 24 |
+
line-height: 1.5;
|
| 25 |
+
}
|
| 26 |
+
.console-output {
|
| 27 |
+
background: rgba(17, 24, 39, 0.9);
|
| 28 |
+
color: #e2e8f0;
|
| 29 |
+
font-family: 'JetBrains Mono', monospace;
|
| 30 |
+
font-size: 0.875rem;
|
| 31 |
+
line-height: 1.5;
|
| 32 |
+
}
|
| 33 |
+
.test-case {
|
| 34 |
+
padding: 0.75rem;
|
| 35 |
+
border-radius: 0.5rem;
|
| 36 |
+
margin-bottom: 0.5rem;
|
| 37 |
+
}
|
| 38 |
+
.test-pass {
|
| 39 |
+
color: #22c55e;
|
| 40 |
+
border: 1px solid rgba(34, 197, 94, 0.3);
|
| 41 |
+
}
|
| 42 |
+
.test-fail {
|
| 43 |
+
color: #ef4444;
|
| 44 |
+
border: 1px solid rgba(239, 68, 68, 0.3);
|
| 45 |
+
}
|
| 46 |
+
.hints-toggle {
|
| 47 |
+
background: rgba(217, 70, 239, 0.1);
|
| 48 |
+
}
|
| 49 |
+
.hint-content {
|
| 50 |
+
background: rgba(17, 24, 39, 0.9);
|
| 51 |
+
}
|
| 52 |
+
.badge-pass {
|
| 53 |
+
background: rgba(34, 197, 94, 0.1);
|
| 54 |
+
border: 1px solid rgba(34, 197, 94, 0.3);
|
| 55 |
+
}
|
| 56 |
+
.badge-fail {
|
| 57 |
+
background: rgba(239, 68, 68, 0.1);
|
| 58 |
+
color: #ef4444;
|
| 59 |
+
border: 1px solid rgba(239, 68, 68, 0.3);
|
| 60 |
+
}
|
| 61 |
+
</style>
|
| 62 |
+
<div class="python-lab">
|
| 63 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 p-6">
|
| 64 |
+
<!-- Left: Editor -->
|
| 65 |
+
<div class="lg:col-span-2">
|
| 66 |
+
<div class="editor-container rounded-xl mb-6">
|
| 67 |
+
<div class="flex items-center justify-between mb-4">
|
| 68 |
+
<div class="flex items-center">
|
| 69 |
+
<i data-feather="code" class="w-5 h-5 text-primary mr-3"></i>
|
| 70 |
+
<h3 class="text-lg font-semibold">Python Editor</h3>
|
| 71 |
+
</div>
|
| 72 |
+
<div class="flex space-x-2">
|
| 73 |
+
<div class="w-3 h-3 rounded-full bg-red-500"></div>
|
| 74 |
+
<div class="w-3 h-3 rounded-full bg-yellow-500"></div>
|
| 75 |
+
<div class="w-3 h-3 rounded-full bg-green-500"></div>
|
| 76 |
+
</div>
|
| 77 |
+
</div>
|
| 78 |
+
|
| 79 |
+
<div class="code-editor">
|
| 80 |
+
<pre id="python-editor">
|
| 81 |
+
def find_first_prime(nums):
|
| 82 |
+
"""Return the first prime number in a list."""
|
| 83 |
+
for num in nums:
|
| 84 |
+
if num < 2:
|
| 85 |
+
continue
|
| 86 |
+
is_prime = True
|
| 87 |
+
for i in range(2, int(num**0.5) + 1):
|
| 88 |
+
if num % i == 0:
|
| 89 |
+
is_prime = False
|
| 90 |
+
break
|
| 91 |
+
if is_prime:
|
| 92 |
+
return num
|
| 93 |
+
return None
|
| 94 |
+
|
| 95 |
+
# Test cases
|
| 96 |
+
print(find_first_prime([4, 6, 7, 8, 9, 10, 11]) # Should return 7
|
| 97 |
+
print(find_first_prime([1, 2, 3, 4, 5]) # Should return 2
|
| 98 |
+
print(find_first_prime([4, 6, 8, 10])) # Should return None
|
| 99 |
+
</pre>
|
| 100 |
+
</div>
|
| 101 |
+
</div>
|
| 102 |
+
|
| 103 |
+
<div class="flex space-x-4 mb-6">
|
| 104 |
+
<button id="run-btn" class="px-6 py-3 bg-gradient-to-r from-primary to-primary/80 hover:from-primary/90 hover:to-primary text-gray-900 font-semibold rounded-lg transition-all">
|
| 105 |
+
<i data-feather="play" class="w-4 h-4 mr-2"></i>
|
| 106 |
+
Run Code
|
| 107 |
+
</button>
|
| 108 |
+
<button id="hints-toggle" class="px-6 py-3 bg-gray-800 hover:bg-gray-700 border border-gray-700 font-semibold rounded-lg transition-all">
|
| 109 |
+
<i data-feather="help-circle" class="w-4 h-4 mr-2"></i>
|
| 110 |
+
Show Hints
|
| 111 |
+
</button>
|
| 112 |
+
</div>
|
| 113 |
+
</div>
|
| 114 |
+
|
| 115 |
+
<!-- Right: Console & Tests -->
|
| 116 |
+
<div class="space-y-6">
|
| 117 |
+
<div class="console-output rounded-xl p-4">
|
| 118 |
+
<div class="text-sm font-medium mb-2">Console Output</div>
|
| 119 |
+
<div id="python-output" class="font-mono text-sm">
|
| 120 |
+
Click "Run Code" to see output...
|
| 121 |
+
</div>
|
| 122 |
+
</div>
|
| 123 |
+
|
| 124 |
+
<div class="hints-toggle rounded-xl p-4 hidden">
|
| 125 |
+
<div class="text-sm font-medium mb-2">Hints</div>
|
| 126 |
+
<div class="hint-content p-3 rounded-lg">
|
| 127 |
+
<ul class="space-y-2 text-sm">
|
| 128 |
+
<li class="flex items-center">
|
| 129 |
+
<i data-feather="info" class="w-4 h-4 mr-2 text-primary"></i>
|
| 130 |
+
Remember that 0 and 1 are not prime numbers.</li>
|
| 131 |
+
<li class="flex items-center">
|
| 132 |
+
<i data-feather="info" class="w-4 h-4 mr-2 text-primary"></i>
|
| 133 |
+
The Sieve of Eratosthenes is efficient for finding primes in a range.</li>
|
| 134 |
+
<li class="flex items-center">
|
| 135 |
+
<i data-feather="info" class="w-4 h-4 mr-2 text-primary"></i>
|
| 136 |
+
Try breaking the problem into smaller functions.</li>
|
| 137 |
+
</ul>
|
| 138 |
+
</div>
|
| 139 |
+
</div>
|
| 140 |
+
|
| 141 |
+
<div class="test-cases space-y-3">
|
| 142 |
+
<div class="text-sm font-medium">Test Cases</div>
|
| 143 |
+
|
| 144 |
+
<div class="test-case test-pass flex items-center justify-between">
|
| 145 |
+
<span>First prime in [4, 6, 7, 8, 9, 10, 11]</div>
|
| 146 |
+
<div class="badge-pass px-3 py-1 rounded-full text-xs">
|
| 147 |
+
PASS
|
| 148 |
+
</div>
|
| 149 |
+
</div>
|
| 150 |
+
|
| 151 |
+
<div class="test-case test-pass flex items-center justify-between">
|
| 152 |
+
<span>First prime in [1, 2, 3, 4, 5]</div>
|
| 153 |
+
<div class="badge-pass px-3 py-1 rounded-full text-xs">
|
| 154 |
+
PASS
|
| 155 |
+
</div>
|
| 156 |
+
</div>
|
| 157 |
+
|
| 158 |
+
<div class="test-case test-pass flex items-center justify-between">
|
| 159 |
+
<span>Handles empty list</span>
|
| 160 |
+
<div class="badge-pass px-3 py-1 rounded-full text-xs">
|
| 161 |
+
PASS
|
| 162 |
+
</div>
|
| 163 |
+
</div>
|
| 164 |
+
|
| 165 |
+
<div class="test-case test-fail flex items-center justify-between">
|
| 166 |
+
<span>First prime in large list</span>
|
| 167 |
+
<div class="badge-fail px-3 py-1 rounded-full text-xs">
|
| 168 |
+
FAIL
|
| 169 |
+
</div>
|
| 170 |
+
</div>
|
| 171 |
+
|
| 172 |
+
<div class="test-case test-pass flex items-center justify-between">
|
| 173 |
+
<span>Returns None if no prime</span>
|
| 174 |
+
<div class="badge-pass px-3 py-1 rounded-full text-xs">
|
| 175 |
+
PASS
|
| 176 |
+
</div>
|
| 177 |
+
</div>
|
| 178 |
+
</div>
|
| 179 |
+
</div>
|
| 180 |
+
</div>
|
| 181 |
+
</div>
|
| 182 |
+
</div>
|
| 183 |
+
`;
|
| 184 |
+
|
| 185 |
+
setTimeout(() => {
|
| 186 |
+
if (typeof feather !== 'undefined') {
|
| 187 |
+
feather.replace();
|
| 188 |
+
}
|
| 189 |
+
}, 100);
|
| 190 |
+
}
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
customElements.define('custom-python-lab', CustomPythonLab);
|
|
@@ -0,0 +1,158 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomSqlLab extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
:host {
|
| 7 |
+
display: block;
|
| 8 |
+
}
|
| 9 |
+
.sql-lab {
|
| 10 |
+
background: rgba(31, 41, 55, 0.8);
|
| 11 |
+
border-radius: 1rem;
|
| 12 |
+
overflow: hidden;
|
| 13 |
+
border: 1px solid rgba(55, 65, 81, 0.5);
|
| 14 |
+
}
|
| 15 |
+
.table-browser {
|
| 16 |
+
background: rgba(17, 24, 39, 0.9);
|
| 17 |
+
padding: 1.5rem;
|
| 18 |
+
}
|
| 19 |
+
.sql-editor {
|
| 20 |
+
background: #1a202c;
|
| 21 |
+
border-radius: 0.5rem;
|
| 22 |
+
padding: 1rem;
|
| 23 |
+
font-family: 'JetBrains Mono', monospace;
|
| 24 |
+
font-size: 0.875rem;
|
| 25 |
+
line-height: 1.5;
|
| 26 |
+
color: #e2e8f0;
|
| 27 |
+
}
|
| 28 |
+
.run-button {
|
| 29 |
+
background: linear-gradient(135deg, #22c55e, #22c55e/80);
|
| 30 |
+
color: #111827;
|
| 31 |
+
font-weight: 600;
|
| 32 |
+
padding: 0.75rem 1.5rem;
|
| 33 |
+
border-radius: 0.5rem;
|
| 34 |
+
transition: all 0.3s ease;
|
| 35 |
+
}
|
| 36 |
+
.run-button:hover {
|
| 37 |
+
transform: scale(1.05);
|
| 38 |
+
box-shadow: 0 10px 15px -3px rgba(34, 197, 94, 0.4);
|
| 39 |
+
}
|
| 40 |
+
.results-grid {
|
| 41 |
+
background: rgba(17, 24, 39, 0.9);
|
| 42 |
+
}
|
| 43 |
+
.reset-button {
|
| 44 |
+
background: rgba(239, 68, 68, 0.1);
|
| 45 |
+
color: #ef4444;
|
| 46 |
+
border: 1px solid rgba(239, 68, 68, 0.3);
|
| 47 |
+
padding: 0.5rem 1rem;
|
| 48 |
+
border-radius: 0.375rem;
|
| 49 |
+
font-size: 0.75rem;
|
| 50 |
+
font-weight: 600;
|
| 51 |
+
}
|
| 52 |
+
.table-row:hover {
|
| 53 |
+
background: rgba(55, 65, 81, 0.3);
|
| 54 |
+
}
|
| 55 |
+
</style>
|
| 56 |
+
<div class="sql-lab">
|
| 57 |
+
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6 p-6">
|
| 58 |
+
<!-- Left: Table Browser -->
|
| 59 |
+
<div class="table-browser rounded-xl">
|
| 60 |
+
<div class="flex items-center mb-4">
|
| 61 |
+
<i data-feather="database" class="w-5 h-5 text-secondary mr-3"></i>
|
| 62 |
+
<h3 class="text-lg font-semibold">Employees Database</h3>
|
| 63 |
+
</div>
|
| 64 |
+
|
| 65 |
+
<div class="overflow-x-auto">
|
| 66 |
+
<table class="w-full text-sm">
|
| 67 |
+
<thead>
|
| 68 |
+
<tr class="border-b border-gray-700">
|
| 69 |
+
<th class="pb-3 text-left">Table</th>
|
| 70 |
+
<th class="pb-3 text-left">Rows</th>
|
| 71 |
+
<th class="pb-3 text-left">Preview</th>
|
| 72 |
+
</tr>
|
| 73 |
+
</thead>
|
| 74 |
+
<tbody>
|
| 75 |
+
<tr class="table-row border-b border-gray-800">
|
| 76 |
+
<td class="py-3 font-medium">employees</td>
|
| 77 |
+
<td class="py-3">500</td>
|
| 78 |
+
<td class="py-3">
|
| 79 |
+
<button class="view-table-btn p-1 rounded hover:bg-gray-800">
|
| 80 |
+
<i data-feather="eye" class="w-4 h-4 text-gray-400"></i>
|
| 81 |
+
</td>
|
| 82 |
+
</tr>
|
| 83 |
+
<tr class="table-row border-b border-gray-800">
|
| 84 |
+
<td class="py-3 font-medium">departments</td>
|
| 85 |
+
<td class="py-3">10</td>
|
| 86 |
+
<td class="py-3">
|
| 87 |
+
<button class="view-table-btn p-1 rounded hover:bg-gray-800">
|
| 88 |
+
<i data-feather="eye" class="w-4 h-4 text-gray-400"></i>
|
| 89 |
+
</td>
|
| 90 |
+
</tr>
|
| 91 |
+
<tr class="table-row">
|
| 92 |
+
<td class="py-3 font-medium">salaries</td>
|
| 93 |
+
<td class="py-3">500</td>
|
| 94 |
+
<td class="py-3">
|
| 95 |
+
<button class="view-table-btn p-1 rounded hover:bg-gray-800">
|
| 96 |
+
<i data-feather="eye" class="w-4 h-4 text-gray-400"></i>
|
| 97 |
+
</td>
|
| 98 |
+
</tr>
|
| 99 |
+
</tbody>
|
| 100 |
+
</table>
|
| 101 |
+
</div>
|
| 102 |
+
</div>
|
| 103 |
+
</div>
|
| 104 |
+
|
| 105 |
+
<!-- Middle: SQL Editor -->
|
| 106 |
+
<div class="space-y-6">
|
| 107 |
+
<div class="sql-editor">
|
| 108 |
+
SELECT id, name, department<br>
|
| 109 |
+
FROM employees<br>
|
| 110 |
+
WHERE department = 'Engineering'<br>
|
| 111 |
+
ORDER BY name ASC<br>
|
| 112 |
+
LIMIT 10;
|
| 113 |
+
</div>
|
| 114 |
+
|
| 115 |
+
<div class="flex space-x-4">
|
| 116 |
+
<button id="sql-run-btn" class="run-button flex items-center">
|
| 117 |
+
<i data-feather="play" class="w-4 h-4 mr-2"></i>
|
| 118 |
+
Run Query
|
| 119 |
+
</button>
|
| 120 |
+
<button class="reset-button flex items-center text-sm">
|
| 121 |
+
<i data-feather="refresh-cw" class="w-4 h-4 mr-2"></i>
|
| 122 |
+
Reset DB
|
| 123 |
+
</button>
|
| 124 |
+
</div>
|
| 125 |
+
</div>
|
| 126 |
+
|
| 127 |
+
<!-- Right: Results Grid -->
|
| 128 |
+
<div class="results-grid rounded-xl p-4">
|
| 129 |
+
<div class="flex items-center justify-between mb-4">
|
| 130 |
+
<div class="text-gray-300">Query Results</div>
|
| 131 |
+
<div class="text-xs text-gray-400">Click "Run Query" to see results</div>
|
| 132 |
+
</div>
|
| 133 |
+
|
| 134 |
+
<div id="sql-results" class="text-gray-400 text-sm">
|
| 135 |
+
Results will appear here...
|
| 136 |
+
</div>
|
| 137 |
+
</div>
|
| 138 |
+
</div>
|
| 139 |
+
</div>
|
| 140 |
+
|
| 141 |
+
<div class="p-6 bg-gray-900/50 border-t border-gray-800">
|
| 142 |
+
<div class="text-sm text-gray-300 mb-2">Sample Query:</div>
|
| 143 |
+
<div class="font-mono text-xs text-gray-400">
|
| 144 |
+
-- Find all employees in Engineering department
|
| 145 |
+
</div>
|
| 146 |
+
</div>
|
| 147 |
+
</div>
|
| 148 |
+
`;
|
| 149 |
+
|
| 150 |
+
setTimeout(() => {
|
| 151 |
+
if (typeof feather !== 'undefined') {
|
| 152 |
+
feather.replace();
|
| 153 |
+
}
|
| 154 |
+
}, 100);
|
| 155 |
+
}
|
| 156 |
+
}
|
| 157 |
+
|
| 158 |
+
customElements.define('custom-sql-lab', CustomSqlLab);
|
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomStep extends HTMLElement {
|
| 2 |
+
constructor() {
|
| 3 |
+
super();
|
| 4 |
+
this.number = this.getAttribute('number') || '1';
|
| 5 |
+
this.icon = this.getAttribute('icon') || 'check';
|
| 6 |
+
this.title = this.getAttribute('title') || 'Step';
|
| 7 |
+
this.description = this.getAttribute('description') || 'Description';
|
| 8 |
+
this.delay = this.getAttribute('delay') || '0';
|
| 9 |
+
}
|
| 10 |
+
|
| 11 |
+
connectedCallback() {
|
| 12 |
+
this.attachShadow({ mode: 'open' });
|
| 13 |
+
this.shadowRoot.innerHTML = `
|
| 14 |
+
<style>
|
| 15 |
+
:host {
|
| 16 |
+
display: block;
|
| 17 |
+
animation-delay: ${this.delay}ms;
|
| 18 |
+
}
|
| 19 |
+
.step-card {
|
| 20 |
+
text-align: center;
|
| 21 |
+
padding: 1.5rem;
|
| 22 |
+
opacity: 0;
|
| 23 |
+
animation: fadeIn 0.5s ease-out ${this.delay}ms forwards;
|
| 24 |
+
}
|
| 25 |
+
@keyframes fadeIn {
|
| 26 |
+
to {
|
| 27 |
+
opacity: 1;
|
| 28 |
+
}
|
| 29 |
+
}
|
| 30 |
+
.step-number {
|
| 31 |
+
width: 4rem;
|
| 32 |
+
height: 4rem;
|
| 33 |
+
margin: 0 auto 1.5rem;
|
| 34 |
+
border-radius: 50%;
|
| 35 |
+
display: flex;
|
| 36 |
+
align-items: center;
|
| 37 |
+
justify-content: center;
|
| 38 |
+
font-weight: bold;
|
| 39 |
+
font-size: 1.5rem;
|
| 40 |
+
background: linear-gradient(135deg, #22c55e, #d946ef);
|
| 41 |
+
color: white;
|
| 42 |
+
font-size: 1.875rem;
|
| 43 |
+
}
|
| 44 |
+
.step-icon {
|
| 45 |
+
width: 1.5rem;
|
| 46 |
+
height: 1.5rem;
|
| 47 |
+
color: white;
|
| 48 |
+
}
|
| 49 |
+
h3 {
|
| 50 |
+
font-size: 1.5rem;
|
| 51 |
+
font-weight: 600;
|
| 52 |
+
margin-bottom: 0.75rem;
|
| 53 |
+
}
|
| 54 |
+
p {
|
| 55 |
+
color: #9ca3af;
|
| 56 |
+
}
|
| 57 |
+
</style>
|
| 58 |
+
<div class="step-card">
|
| 59 |
+
<div class="step-number">
|
| 60 |
+
<i data-feather="${this.icon}" class="step-icon"></i>
|
| 61 |
+
</div>
|
| 62 |
+
<h3>${this.title}</h3>
|
| 63 |
+
<p>${this.description}</p>
|
| 64 |
+
</div>
|
| 65 |
+
`;
|
| 66 |
+
|
| 67 |
+
setTimeout(() => {
|
| 68 |
+
if (typeof feather !== 'undefined') {
|
| 69 |
+
feather.replace();
|
| 70 |
+
}
|
| 71 |
+
}, 100);
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
customElements.define('custom-step', CustomStep);
|
|
@@ -1,19 +1,285 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en" class="dark">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>PySQL Labs - Interactive Python & SQL Learning Platform</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="/static/favicon.ico">
|
| 8 |
+
<link rel="stylesheet" href="style.css">
|
| 9 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 10 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 11 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 12 |
+
<script>
|
| 13 |
+
tailwind.config = {
|
| 14 |
+
darkMode: 'class',
|
| 15 |
+
theme: {
|
| 16 |
+
extend: {
|
| 17 |
+
colors: {
|
| 18 |
+
primary: '#22c55e', /* lime-500 */
|
| 19 |
+
secondary: '#d946ef' /* fuchsia-500 */
|
| 20 |
+
},
|
| 21 |
+
fontFamily: {
|
| 22 |
+
'mono': ['JetBrains Mono', 'Monaco', 'Courier New', 'monospace'],
|
| 23 |
+
'sans': ['Inter', 'system-ui', 'sans-serif']
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
}
|
| 27 |
+
}
|
| 28 |
+
</script>
|
| 29 |
+
<style>
|
| 30 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@300;400;500&display=swap');
|
| 31 |
+
</style>
|
| 32 |
+
</head>
|
| 33 |
+
<body class="bg-gray-900 text-gray-100 font-sans min-h-screen">
|
| 34 |
+
<!-- Navigation -->
|
| 35 |
+
<custom-navbar></custom-navbar>
|
| 36 |
+
|
| 37 |
+
<!-- Hero Section -->
|
| 38 |
+
<section class="relative overflow-hidden">
|
| 39 |
+
<div class="absolute inset-0 bg-gradient-to-br from-gray-800 via-gray-900 to-black"></div>
|
| 40 |
+
<div class="relative container mx-auto px-6 py-20 md:py-32">
|
| 41 |
+
<div class="flex flex-col lg:flex-row items-center justify-between gap-12">
|
| 42 |
+
<div class="lg:w-1/2">
|
| 43 |
+
<div class="mb-6 inline-flex items-center px-4 py-2 rounded-full bg-gradient-to-r from-primary/20 to-secondary/20 border border-primary/30">
|
| 44 |
+
<i data-feather="zap" class="w-4 h-4 text-primary mr-2"></i>
|
| 45 |
+
<span class="text-sm font-medium">Interactive Learning Platform</span>
|
| 46 |
+
</div>
|
| 47 |
+
<h1 class="text-5xl md:text-7xl font-bold mb-6 leading-tight">
|
| 48 |
+
PySQL <span class="text-transparent bg-clip-text bg-gradient-to-r from-primary to-secondary">Labs</span>
|
| 49 |
+
</h1>
|
| 50 |
+
<p class="text-xl text-gray-300 mb-8 max-w-2xl">
|
| 51 |
+
Hands-on Python & SQL labs with auto-grading and interview drills. Master data skills through interactive coding challenges and realistic interview simulations.
|
| 52 |
+
</p>
|
| 53 |
+
<div class="flex flex-col sm:flex-row gap-4">
|
| 54 |
+
<a href="#dashboard" class="px-8 py-4 bg-gradient-to-r from-primary to-primary/80 hover:from-primary/90 hover:to-primary text-gray-900 font-semibold rounded-lg shadow-lg hover:shadow-xl transition-all duration-300 flex items-center justify-center">
|
| 55 |
+
<i data-feather="play-circle" class="w-5 h-5 mr-2"></i>
|
| 56 |
+
Start Free Lab
|
| 57 |
+
</a>
|
| 58 |
+
<a href="#interview-mode" class="px-8 py-4 bg-gray-800 hover:bg-gray-700 border border-gray-700 font-semibold rounded-lg transition-all duration-300 flex items-center justify-center">
|
| 59 |
+
<i data-feather="clock" class="w-5 h-5 mr-2"></i>
|
| 60 |
+
Try Interview Mode
|
| 61 |
+
</a>
|
| 62 |
+
</div>
|
| 63 |
+
</div>
|
| 64 |
+
<div class="lg:w-1/2 relative">
|
| 65 |
+
<div class="relative bg-gray-800 rounded-2xl p-6 shadow-2xl border border-gray-700">
|
| 66 |
+
<!-- Mock Editor Split Screen -->
|
| 67 |
+
<div class="flex flex-col md:flex-row gap-4">
|
| 68 |
+
<!-- Python Editor Mock -->
|
| 69 |
+
<div class="md:w-1/2 bg-gray-900 rounded-xl p-4 border border-gray-700">
|
| 70 |
+
<div class="flex items-center justify-between mb-3">
|
| 71 |
+
<div class="flex items-center">
|
| 72 |
+
<div class="w-3 h-3 rounded-full bg-red-500 mr-2"></div>
|
| 73 |
+
<div class="w-3 h-3 rounded-full bg-yellow-500 mr-2"></div>
|
| 74 |
+
<div class="w-3 h-3 rounded-full bg-green-500"></div>
|
| 75 |
+
</div>
|
| 76 |
+
<span class="text-xs text-gray-400 font-mono">lab.py</span>
|
| 77 |
+
</div>
|
| 78 |
+
<div class="space-y-2">
|
| 79 |
+
<div class="h-4 bg-gray-800 rounded w-3/4"></div>
|
| 80 |
+
<div class="h-4 bg-gray-800 rounded w-full"></div>
|
| 81 |
+
<div class="h-4 bg-primary/30 rounded w-1/2"></div>
|
| 82 |
+
<div class="h-4 bg-gray-800 rounded w-5/6"></div>
|
| 83 |
+
<div class="h-4 bg-gray-800 rounded w-full"></div>
|
| 84 |
+
</div>
|
| 85 |
+
<div class="mt-4 p-2 bg-gray-800 rounded text-xs font-mono text-green-400">
|
| 86 |
+
> Tests passed: 3/5
|
| 87 |
+
</div>
|
| 88 |
+
</div>
|
| 89 |
+
<!-- SQL Results Mock -->
|
| 90 |
+
<div class="md:w-1/2 bg-gray-900 rounded-xl p-4 border border-gray-700">
|
| 91 |
+
<div class="flex items-center justify-between mb-3">
|
| 92 |
+
<div class="flex items-center">
|
| 93 |
+
<i data-feather="database" class="w-4 h-4 text-secondary mr-2"></i>
|
| 94 |
+
<span class="text-xs text-gray-300">employees</span>
|
| 95 |
+
</div>
|
| 96 |
+
<span class="text-xs text-gray-400 font-mono">results.csv</span>
|
| 97 |
+
</div>
|
| 98 |
+
<div class="overflow-x-auto">
|
| 99 |
+
<table class="w-full text-xs">
|
| 100 |
+
<thead>
|
| 101 |
+
<tr class="border-b border-gray-700">
|
| 102 |
+
<th class="pb-2 text-left">id</th>
|
| 103 |
+
<th class="pb-2 text-left">name</th>
|
| 104 |
+
<th class="pb-2 text-left">dept</th>
|
| 105 |
+
</tr>
|
| 106 |
+
</thead>
|
| 107 |
+
<tbody>
|
| 108 |
+
<tr><td class="py-1">101</td><td class="py-1">Alice</td><td class="py-1">Engineering</td></tr>
|
| 109 |
+
<tr><td class="py-1">102</td><td class="py-1">Bob</td><td class="py-1">Sales</td></tr>
|
| 110 |
+
<tr><td class="py-1">103</td><td class="py-1">Charlie</td><td class="py-1">Marketing</td></tr>
|
| 111 |
+
</tbody>
|
| 112 |
+
</table>
|
| 113 |
+
</div>
|
| 114 |
+
</div>
|
| 115 |
+
</div>
|
| 116 |
+
<div class="absolute -top-3 -right-3">
|
| 117 |
+
<div class="bg-gradient-to-r from-primary to-secondary text-white text-xs font-bold px-3 py-1 rounded-full">
|
| 118 |
+
LIVE PREVIEW
|
| 119 |
+
</div>
|
| 120 |
+
</div>
|
| 121 |
+
</div>
|
| 122 |
+
</div>
|
| 123 |
+
</div>
|
| 124 |
+
</div>
|
| 125 |
+
</section>
|
| 126 |
+
|
| 127 |
+
<!-- Features Grid -->
|
| 128 |
+
<section class="py-20 bg-gray-800/50">
|
| 129 |
+
<div class="container mx-auto px-6">
|
| 130 |
+
<h2 class="text-3xl md:text-4xl font-bold text-center mb-12">Everything You Need to Master Python & SQL</h2>
|
| 131 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8">
|
| 132 |
+
<custom-feature-card
|
| 133 |
+
icon="code"
|
| 134 |
+
title="Interactive Python Lab"
|
| 135 |
+
description="Write, run, and test Python code with real-time feedback. Our environment supports all core Python libraries."
|
| 136 |
+
cta-text="Try sample"
|
| 137 |
+
color="primary">
|
| 138 |
+
</custom-feature-card>
|
| 139 |
+
<custom-feature-card
|
| 140 |
+
icon="database"
|
| 141 |
+
title="SQL Sandbox"
|
| 142 |
+
description="Practice SQL queries on realistic datasets. Includes schema browser, query history, and visual result sets."
|
| 143 |
+
cta-text="Try sample"
|
| 144 |
+
color="secondary">
|
| 145 |
+
</custom-feature-card>
|
| 146 |
+
<custom-feature-card
|
| 147 |
+
icon="check-circle"
|
| 148 |
+
title="Auto-grader & Feedback"
|
| 149 |
+
description="Get instant scoring on your solutions. Detailed feedback helps you understand edge cases and optimize your code."
|
| 150 |
+
cta-text="Try sample"
|
| 151 |
+
color="primary">
|
| 152 |
+
</custom-feature-card>
|
| 153 |
+
<custom-feature-card
|
| 154 |
+
icon="clock"
|
| 155 |
+
title="Interview Simulator"
|
| 156 |
+
description="Timed mock interviews with real FAANG-style questions. Track performance metrics and identify areas for improvement."
|
| 157 |
+
cta-text="Try sample"
|
| 158 |
+
color="secondary">
|
| 159 |
+
</custom-feature-card>
|
| 160 |
+
</div>
|
| 161 |
+
</div>
|
| 162 |
+
</section>
|
| 163 |
+
|
| 164 |
+
<!-- How It Works -->
|
| 165 |
+
<section class="py-20">
|
| 166 |
+
<div class="container mx-auto px-6">
|
| 167 |
+
<h2 class="text-3xl md:text-4xl font-bold text-center mb-12">How PySQL Labs Works</h2>
|
| 168 |
+
<div class="flex flex-col lg:flex-row items-center justify-between gap-8">
|
| 169 |
+
<custom-step
|
| 170 |
+
number="1"
|
| 171 |
+
icon="search"
|
| 172 |
+
title="Select a Lab"
|
| 173 |
+
description="Choose from hundreds of Python and SQL problems, categorized by difficulty and topic."
|
| 174 |
+
delay="100">
|
| 175 |
+
</custom-step>
|
| 176 |
+
<div class="hidden lg:block">
|
| 177 |
+
<div class="w-32 h-1 bg-gradient-to-r from-primary to-secondary rounded-full"></div>
|
| 178 |
+
</div>
|
| 179 |
+
<custom-step
|
| 180 |
+
number="2"
|
| 181 |
+
icon="edit"
|
| 182 |
+
title="Write & Run Code"
|
| 183 |
+
description="Use our integrated editor to write solutions. Run code instantly and see output in real-time."
|
| 184 |
+
delay="200">
|
| 185 |
+
</custom-step>
|
| 186 |
+
<div class="hidden lg:block">
|
| 187 |
+
<div class="w-32 h-1 bg-gradient-to-r from-primary to-secondary rounded-full"></div>
|
| 188 |
+
</div>
|
| 189 |
+
<custom-step
|
| 190 |
+
number="3"
|
| 191 |
+
icon="bar-chart-2"
|
| 192 |
+
title="Track Progress"
|
| 193 |
+
description="Monitor your learning journey with detailed analytics, badges, and streak tracking."
|
| 194 |
+
delay="300">
|
| 195 |
+
</custom-step>
|
| 196 |
+
</div>
|
| 197 |
+
</div>
|
| 198 |
+
</section>
|
| 199 |
+
|
| 200 |
+
<!-- Example Problems Carousel -->
|
| 201 |
+
<section class="py-20 bg-gray-800/50">
|
| 202 |
+
<div class="container mx-auto px-6">
|
| 203 |
+
<h2 class="text-3xl md:text-4xl font-bold text-center mb-12">Example Challenges</h2>
|
| 204 |
+
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
|
| 205 |
+
<custom-problem-card
|
| 206 |
+
title="Even or Odd Filter"
|
| 207 |
+
language="Python"
|
| 208 |
+
difficulty="Easy"
|
| 209 |
+
time="15 min"
|
| 210 |
+
description="Filter a list to keep only even numbers using list comprehension."
|
| 211 |
+
status="free">
|
| 212 |
+
</custom-problem-card>
|
| 213 |
+
<custom-problem-card
|
| 214 |
+
title="First Prime Number"
|
| 215 |
+
language="Python"
|
| 216 |
+
difficulty="Medium"
|
| 217 |
+
time="25 min"
|
| 218 |
+
description="Find the first prime number in a given list of integers."
|
| 219 |
+
status="free">
|
| 220 |
+
</custom-problem-card>
|
| 221 |
+
<custom-problem-card
|
| 222 |
+
title="Employee Finder"
|
| 223 |
+
language="SQL"
|
| 224 |
+
difficulty="Easy"
|
| 225 |
+
time="10 min"
|
| 226 |
+
description="Select employee details by name from the employees table."
|
| 227 |
+
status="free">
|
| 228 |
+
</custom-problem-card>
|
| 229 |
+
<custom-problem-card
|
| 230 |
+
title="Department Join"
|
| 231 |
+
language="SQL"
|
| 232 |
+
difficulty="Medium"
|
| 233 |
+
time="20 min"
|
| 234 |
+
description="Merge two tables using JOIN to show employee-department relationships."
|
| 235 |
+
status="premium">
|
| 236 |
+
</custom-problem-card>
|
| 237 |
+
</div>
|
| 238 |
+
</div>
|
| 239 |
+
</section>
|
| 240 |
+
|
| 241 |
+
<!-- Dashboard Preview -->
|
| 242 |
+
<section id="dashboard" class="py-20">
|
| 243 |
+
<div class="container mx-auto px-6">
|
| 244 |
+
<h2 class="text-3xl md:text-4xl font-bold text-center mb-12">Interactive Dashboard Preview</h2>
|
| 245 |
+
<custom-dashboard></custom-dashboard>
|
| 246 |
+
</div>
|
| 247 |
+
</section>
|
| 248 |
+
|
| 249 |
+
<!-- SQL Lab Mini UI -->
|
| 250 |
+
<section class="py-20 bg-gray-800/50">
|
| 251 |
+
<div class="container mx-auto px-6">
|
| 252 |
+
<h2 class="text-3xl md:text-4xl font-bold text-center mb-12">Try Our SQL Sandbox</h2>
|
| 253 |
+
<custom-sql-lab></custom-sql-lab>
|
| 254 |
+
</div>
|
| 255 |
+
</section>
|
| 256 |
+
|
| 257 |
+
<!-- Python Lab Mini UI -->
|
| 258 |
+
<section class="py-20">
|
| 259 |
+
<div class="container mx-auto px-6">
|
| 260 |
+
<h2 class="text-3xl md:text-4xl font-bold text-center mb-12">Python Lab Environment</h2>
|
| 261 |
+
<custom-python-lab></custom-python-lab>
|
| 262 |
+
</div>
|
| 263 |
+
</section>
|
| 264 |
+
|
| 265 |
+
<!-- Footer -->
|
| 266 |
+
<custom-footer></custom-footer>
|
| 267 |
+
|
| 268 |
+
<!-- Web Components Scripts -->
|
| 269 |
+
<script src="components/navbar.js"></script>
|
| 270 |
+
<script src="components/feature-card.js"></script>
|
| 271 |
+
<script src="components/step.js"></script>
|
| 272 |
+
<script src="components/problem-card.js"></script>
|
| 273 |
+
<script src="components/dashboard.js"></script>
|
| 274 |
+
<script src="components/sql-lab.js"></script>
|
| 275 |
+
<script src="components/python-lab.js"></script>
|
| 276 |
+
<script src="components/footer.js"></script>
|
| 277 |
+
|
| 278 |
+
<!-- Main Script -->
|
| 279 |
+
<script src="script.js"></script>
|
| 280 |
+
<script>
|
| 281 |
+
feather.replace();
|
| 282 |
+
</script>
|
| 283 |
+
<script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
|
| 284 |
+
</body>
|
| 285 |
+
</html>
|
|
@@ -0,0 +1,209 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// PySQL Labs - Main JavaScript
|
| 2 |
+
|
| 3 |
+
document.addEventListener('DOMContentLoaded', function() {
|
| 4 |
+
// Initialize Feather Icons
|
| 5 |
+
if (typeof feather !== 'undefined') {
|
| 6 |
+
feather.replace();
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
// Mobile Menu Toggle (for navbar component)
|
| 10 |
+
document.addEventListener('click', function(e) {
|
| 11 |
+
if (e.target.closest('[data-menu-toggle]')) {
|
| 12 |
+
const menu = document.getElementById('mobile-menu');
|
| 13 |
+
if (menu) {
|
| 14 |
+
menu.classList.toggle('hidden');
|
| 15 |
+
}
|
| 16 |
+
});
|
| 17 |
+
|
| 18 |
+
// Code Execution Simulation
|
| 19 |
+
function simulateCodeExecution(editorId, outputId) {
|
| 20 |
+
const runBtn = document.getElementById('run-btn');
|
| 21 |
+
const editor = document.getElementById(editorId);
|
| 22 |
+
const output = document.getElementById(outputId);
|
| 23 |
+
|
| 24 |
+
if (runBtn && editor && output) {
|
| 25 |
+
runBtn.addEventListener('click', function() {
|
| 26 |
+
// Show loading state
|
| 27 |
+
runBtn.innerHTML = '<i data-feather="loader" class="w-4 h-4 animate-spin mr-2"></i>Running...';
|
| 28 |
+
feather.replace();
|
| 29 |
+
|
| 30 |
+
runBtn.disabled = true;
|
| 31 |
+
output.innerHTML = '<div class="text-gray-400 animate-pulse">Executing code...</div>';
|
| 32 |
+
|
| 33 |
+
// Simulate API call delay
|
| 34 |
+
setTimeout(() => {
|
| 35 |
+
// Simulated output
|
| 36 |
+
output.innerHTML = `
|
| 37 |
+
<div class="text-green-400 font-mono text-sm">
|
| 38 |
+
> Code executed successfully!<br>
|
| 39 |
+
> Tests passed: 4/4<br>
|
| 40 |
+
> Execution time: 0.8s
|
| 41 |
+
</div>`;
|
| 42 |
+
|
| 43 |
+
// Reset button
|
| 44 |
+
runBtn.innerHTML = '<i data-feather="play" class="w-4 h-4 mr-2"></i>Run Code';
|
| 45 |
+
feather.replace();
|
| 46 |
+
runBtn.disabled = false;
|
| 47 |
+
}, 1500);
|
| 48 |
+
}
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
|
| 52 |
+
// Carousel functionality for problem cards
|
| 53 |
+
function initProblemCarousel() {
|
| 54 |
+
const carousel = document.querySelector('.problems-carousel');
|
| 55 |
+
if (!carousel) return;
|
| 56 |
+
|
| 57 |
+
const cards = carousel.querySelectorAll('.problem-card');
|
| 58 |
+
let currentIndex = 0;
|
| 59 |
+
|
| 60 |
+
function showCard(index) {
|
| 61 |
+
cards.forEach((card, i) => {
|
| 62 |
+
card.classList.toggle('active', i === index);
|
| 63 |
+
card.classList.toggle('opacity-50', i !== index);
|
| 64 |
+
}
|
| 65 |
+
|
| 66 |
+
// Auto-rotate every 5 seconds
|
| 67 |
+
setInterval(() => {
|
| 68 |
+
currentIndex = (currentIndex + 1) % cards.length;
|
| 69 |
+
showCard(currentIndex);
|
| 70 |
+
}, 5000);
|
| 71 |
+
|
| 72 |
+
showCard(0);
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
// SQL Query Execution Simulation
|
| 76 |
+
function simulateSQLExecution() {
|
| 77 |
+
const sqlRunBtn = document.getElementById('sql-run-btn');
|
| 78 |
+
const sqlResults = document.getElementById('sql-results');
|
| 79 |
+
|
| 80 |
+
if (sqlRunBtn && sqlResults) {
|
| 81 |
+
sqlRunBtn.addEventListener('click', function() {
|
| 82 |
+
sqlRunBtn.innerHTML = '<i data-feather="loader" class="w-4 h-4 animate-spin mr-2"></i>Executing...';
|
| 83 |
+
feather.replace();
|
| 84 |
+
sqlRunBtn.disabled = true;
|
| 85 |
+
|
| 86 |
+
setTimeout(() => {
|
| 87 |
+
sqlResults.innerHTML = `
|
| 88 |
+
<table class="w-full text-sm">
|
| 89 |
+
<thead>
|
| 90 |
+
<tr class="border-b border-gray-700">
|
| 91 |
+
<th class="py-2 text-left">id</th>
|
| 92 |
+
<th class="py-2 text-left">name</th>
|
| 93 |
+
<th class="py-2 text-left">department</th>
|
| 94 |
+
<th class="py-2 text-left">salary</th>
|
| 95 |
+
</tr>
|
| 96 |
+
</thead>
|
| 97 |
+
<tbody>
|
| 98 |
+
<tr class="border-b border-gray-800">
|
| 99 |
+
<td class="py-2">101</td>
|
| 100 |
+
<td class="py-2">Alice Chen</td>
|
| 101 |
+
<td class="py-2">Engineering</td>
|
| 102 |
+
<td class="py-2">$95,000</td>
|
| 103 |
+
</tr>
|
| 104 |
+
<tr class="border-b border-gray-800">
|
| 105 |
+
<td class="py-2">102</td>
|
| 106 |
+
<td class="py-2">Bob Johnson</td>
|
| 107 |
+
<td class="py-2">Sales</td>
|
| 108 |
+
<td class="py-2">$85,500</td>
|
| 109 |
+
</tr>
|
| 110 |
+
<tr>
|
| 111 |
+
<td class="py-2">103</td>
|
| 112 |
+
<td class="py-2">Charlie Brown</td>
|
| 113 |
+
<td class="py-2">Marketing</td>
|
| 114 |
+
<td class="py-2">$78,000</td>
|
| 115 |
+
</tr>
|
| 116 |
+
</tbody>
|
| 117 |
+
</table>
|
| 118 |
+
<div class="mt-3 text-xs text-gray-400">
|
| 119 |
+
3 rows returned. Execution time: 0.2s
|
| 120 |
+
</div>`;
|
| 121 |
+
|
| 122 |
+
sqlRunBtn.innerHTML = '<i data-feather="play" class="w-4 h-4 mr-2"></i>Run Query';
|
| 123 |
+
feather.replace();
|
| 124 |
+
sqlRunBtn.disabled = false;
|
| 125 |
+
}, 1000);
|
| 126 |
+
});
|
| 127 |
+
}
|
| 128 |
+
}
|
| 129 |
+
|
| 130 |
+
// Interview Timer Simulation
|
| 131 |
+
function initInterviewTimer() {
|
| 132 |
+
const timerElement = document.getElementById('interview-timer');
|
| 133 |
+
if (!timerElement) return;
|
| 134 |
+
|
| 135 |
+
let timeLeft = 1800; // 30 minutes in seconds
|
| 136 |
+
|
| 137 |
+
function updateTimer() {
|
| 138 |
+
const minutes = Math.floor(timeLeft / 60);
|
| 139 |
+
const seconds = timeLeft % 60;
|
| 140 |
+
|
| 141 |
+
timerElement.textContent =
|
| 142 |
+
`${minutes.toString().padStart(2, '0')}:${seconds.toString().padStart(2, '0')}';
|
| 143 |
+
|
| 144 |
+
if (timeLeft > 0) {
|
| 145 |
+
timeLeft--;
|
| 146 |
+
}
|
| 147 |
+
}
|
| 148 |
+
|
| 149 |
+
// Update every second
|
| 150 |
+
setInterval(updateTimer, 1000);
|
| 151 |
+
updateTimer(); // Initial call
|
| 152 |
+
}
|
| 153 |
+
|
| 154 |
+
// Initialize all features
|
| 155 |
+
setTimeout(() => {
|
| 156 |
+
simulateCodeExecution('python-editor', 'python-output');
|
| 157 |
+
simulateSQLExecution();
|
| 158 |
+
initProblemCarousel();
|
| 159 |
+
initInterviewTimer();
|
| 160 |
+
}, 500);
|
| 161 |
+
|
| 162 |
+
// Dark mode toggle (if needed)
|
| 163 |
+
const darkModeToggle = document.getElementById('dark-mode-toggle');
|
| 164 |
+
if (darkModeToggle) {
|
| 165 |
+
darkModeToggle.addEventListener('click', function() {
|
| 166 |
+
document.documentElement.classList.toggle('dark');
|
| 167 |
+
const icon = this.querySelector('i');
|
| 168 |
+
if (document.documentElement.classList.contains('dark')) {
|
| 169 |
+
icon.setAttribute('data-feather', 'moon');
|
| 170 |
+
feather.replace();
|
| 171 |
+
}
|
| 172 |
+
}
|
| 173 |
+
|
| 174 |
+
// Add keyboard shortcuts for better UX
|
| 175 |
+
document.addEventListener('keydown', function(e) {
|
| 176 |
+
// Ctrl+Enter to run code (when editor is focused)
|
| 177 |
+
if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') {
|
| 178 |
+
const activeRunBtn = document.querySelector('#run-btn:not([disabled]), #sql-run-btn:not([disabled])');
|
| 179 |
+
if (activeRunBtn) {
|
| 180 |
+
e.preventDefault();
|
| 181 |
+
activeRunBtn.click();
|
| 182 |
+
}
|
| 183 |
+
}
|
| 184 |
+
});
|
| 185 |
+
|
| 186 |
+
// Tooltip initialization
|
| 187 |
+
const tooltipTriggers = document.querySelectorAll('[data-tooltip]');
|
| 188 |
+
tooltipTriggers.forEach(trigger => {
|
| 189 |
+
trigger.addEventListener('mouseenter', function() {
|
| 190 |
+
const tooltipText = this.getAttribute('data-tooltip');
|
| 191 |
+
if (tooltipText) {
|
| 192 |
+
const tooltip = document.createElement('div');
|
| 193 |
+
tooltip.className = 'absolute z-50 px-3 py-2 text-sm font-medium bg-gray-800 rounded-lg shadow-sm opacity-0 invisible transition-opacity duration-300';
|
| 194 |
+
tooltip.textContent = tooltipText;
|
| 195 |
+
this.appendChild(tooltip);
|
| 196 |
+
|
| 197 |
+
// Show tooltip
|
| 198 |
+
setTimeout(() => {
|
| 199 |
+
tooltip.classList.remove('opacity-0', 'invisible');
|
| 200 |
+
tooltip.classList.add('opacity-100');
|
| 201 |
+
}, 100);
|
| 202 |
+
|
| 203 |
+
this.addEventListener('mouseleave', function() {
|
| 204 |
+
tooltip.remove();
|
| 205 |
+
}, { once: true });
|
| 206 |
+
}
|
| 207 |
+
});
|
| 208 |
+
});
|
| 209 |
+
});
|
|
@@ -1,28 +1,130 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
body {
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
}
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
}
|
| 10 |
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
font-size: 15px;
|
| 14 |
-
margin-bottom: 10px;
|
| 15 |
-
margin-top: 5px;
|
| 16 |
}
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
border-radius: 16px;
|
| 24 |
}
|
| 25 |
|
| 26 |
-
|
| 27 |
-
|
|
|
|
| 28 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/* PySQL Labs - Global Styles */
|
| 2 |
+
:root {
|
| 3 |
+
--color-primary: #22c55e;
|
| 4 |
+
--color-secondary: #d946ef;
|
| 5 |
+
--color-dark: #111827;
|
| 6 |
+
--color-light: #f9fafb;
|
| 7 |
+
}
|
| 8 |
+
|
| 9 |
+
* {
|
| 10 |
+
margin: 0;
|
| 11 |
+
padding: 0;
|
| 12 |
+
box-sizing: border-box;
|
| 13 |
+
}
|
| 14 |
+
|
| 15 |
body {
|
| 16 |
+
font-family: 'Inter', system-ui, sans-serif;
|
| 17 |
+
background-color: #111827;
|
| 18 |
+
color: #f9fafb;
|
| 19 |
+
overflow-x: hidden;
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
/* Custom Scrollbar */
|
| 23 |
+
::-webkit-scrollbar {
|
| 24 |
+
width: 10px;
|
| 25 |
+
}
|
| 26 |
+
|
| 27 |
+
::-webkit-scrollbar-track {
|
| 28 |
+
background: #1f2937;
|
| 29 |
}
|
| 30 |
|
| 31 |
+
::-webkit-scrollbar-thumb {
|
| 32 |
+
background: #374151;
|
| 33 |
+
border-radius: 5px;
|
| 34 |
}
|
| 35 |
|
| 36 |
+
::-webkit-scrollbar-thumb:hover {
|
| 37 |
+
background: #4b5563;
|
|
|
|
|
|
|
|
|
|
| 38 |
}
|
| 39 |
|
| 40 |
+
/* Code Editor Styling */
|
| 41 |
+
.code-editor {
|
| 42 |
+
font-family: 'JetBrains Mono', Monaco, 'Courier New', monospace;
|
| 43 |
+
font-size: 14px;
|
| 44 |
+
line-height: 1.5;
|
|
|
|
| 45 |
}
|
| 46 |
|
| 47 |
+
/* Button Animations */
|
| 48 |
+
.btn-pulse {
|
| 49 |
+
animation: pulse 2s infinite;
|
| 50 |
}
|
| 51 |
+
|
| 52 |
+
@keyframes pulse {
|
| 53 |
+
0% {
|
| 54 |
+
box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
|
| 55 |
+
}
|
| 56 |
+
70% {
|
| 57 |
+
box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
|
| 58 |
+
}
|
| 59 |
+
100% {
|
| 60 |
+
box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
|
| 61 |
+
}
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
/* Card Hover Effects */
|
| 65 |
+
.hover-lift {
|
| 66 |
+
transition: transform 0.3s ease, box-shadow 0.3s ease;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
.hover-lift:hover {
|
| 70 |
+
transform: translateY(-5px);
|
| 71 |
+
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
/* Gradient Text */
|
| 75 |
+
.gradient-text {
|
| 76 |
+
background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
|
| 77 |
+
-webkit-background-clip: text;
|
| 78 |
+
-webkit-text-fill-color: transparent;
|
| 79 |
+
background-clip: text;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
/* Progress Bar Animation */
|
| 83 |
+
.progress-fill {
|
| 84 |
+
transition: width 0.5s ease-in-out;
|
| 85 |
+
}
|
| 86 |
+
|
| 87 |
+
/* Fade In Animation */
|
| 88 |
+
.fade-in {
|
| 89 |
+
animation: fadeIn 0.5s ease-out;
|
| 90 |
+
}
|
| 91 |
+
|
| 92 |
+
@keyframes fadeIn {
|
| 93 |
+
from {
|
| 94 |
+
opacity: 0;
|
| 95 |
+
transform: translateY(20px);
|
| 96 |
+
}
|
| 97 |
+
to {
|
| 98 |
+
opacity: 1;
|
| 99 |
+
transform: translateY(0);
|
| 100 |
+
}
|
| 101 |
+
}
|
| 102 |
+
|
| 103 |
+
/* Typewriter Effect */
|
| 104 |
+
.typewriter {
|
| 105 |
+
overflow: hidden;
|
| 106 |
+
border-right: .15em solid var(--color-primary);
|
| 107 |
+
white-space: nowrap;
|
| 108 |
+
animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
@keyframes typing {
|
| 112 |
+
from { width: 0 }
|
| 113 |
+
to { width: 100% }
|
| 114 |
+
}
|
| 115 |
+
|
| 116 |
+
@keyframes blink-caret {
|
| 117 |
+
from, to { border-color: transparent }
|
| 118 |
+
50% { border-color: var(--color-primary) }
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
/* Responsive Adjustments */
|
| 122 |
+
@media (max-width: 768px) {
|
| 123 |
+
.stack-mobile {
|
| 124 |
+
flex-direction: column;
|
| 125 |
+
}
|
| 126 |
+
|
| 127 |
+
.text-mobile-center {
|
| 128 |
+
text-align: center;
|
| 129 |
+
}
|
| 130 |
+
}
|