RefreshBytes commited on
Commit
9e01f6f
·
verified ·
1 Parent(s): 8931ac0

Please make a website for learning Japanese that is interactive with lots of animations that make it easy and not boring quickly using HTML, CSS, JS code.

Browse files
Files changed (8) hide show
  1. README.md +8 -5
  2. components/footer.js +93 -0
  3. components/navbar.js +153 -0
  4. index.html +147 -19
  5. lessons.html +99 -0
  6. quiz.html +195 -0
  7. script.js +131 -0
  8. style.css +93 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Nihongo Ninja Dojo
3
- emoji: ⚡
4
- colorFrom: indigo
5
- colorTo: red
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
1
  ---
2
+ title: Nihongo Ninja Dojo 🥷
3
+ colorFrom: gray
4
+ colorTo: pink
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://deepsite.hf.co).
components/footer.js ADDED
@@ -0,0 +1,93 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomFooter extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ footer {
7
+ background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
8
+ color: white;
9
+ padding: 3rem 2rem;
10
+ text-align: center;
11
+ margin-top: auto;
12
+ }
13
+ .footer-content {
14
+ max-width: 1200px;
15
+ margin: 0 auto;
16
+ }
17
+ .footer-links {
18
+ display: flex;
19
+ justify-content: center;
20
+ gap: 2rem;
21
+ margin-bottom: 2rem;
22
+ flex-wrap: wrap;
23
+ }
24
+ .footer-links a {
25
+ color: #cbd5e0;
26
+ text-decoration: none;
27
+ transition: color 0.3s ease;
28
+ }
29
+ .footer-links a:hover {
30
+ color: white;
31
+ }
32
+ .social-links {
33
+ display: flex;
34
+ justify-content: center;
35
+ gap: 1rem;
36
+ margin-bottom: 2rem;
37
+ }
38
+ .social-links a {
39
+ color: #cbd5e0;
40
+ transition: all 0.3s ease;
41
+ padding: 0.5rem;
42
+ border-radius: 50%;
43
+ background: rgba(255, 255, 255, 0.1);
44
+ width: 40px;
45
+ height: 40px;
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: center;
49
+ }
50
+ .social-links a:hover {
51
+ color: white;
52
+ background: rgba(255, 255, 255, 0.2);
53
+ transform: translateY(-2px);
54
+ }
55
+ .copyright {
56
+ color: #718096;
57
+ font-size: 0.875rem;
58
+ }
59
+ .ninja-message {
60
+ font-style: italic;
61
+ color: #ec4899;
62
+ margin-top: 1rem;
63
+ }
64
+ </style>
65
+ <footer>
66
+ <div class="footer-content">
67
+ <div class="social-links">
68
+ <a href="#"><i data-feather="twitter"></i></a>
69
+ <a href="#"><i data-feather="github"></i></a>
70
+ <a href="#"><i data-feather="instagram"></i></a>
71
+ </div>
72
+
73
+ <div class="footer-links">
74
+ <a href="/about.html">About</a>
75
+ <a href="/contact.html">Contact</a>
76
+ <a href="/privacy.html">Privacy</a>
77
+ <a href="/terms.html">Terms</a>
78
+ </div>
79
+
80
+ <p class="copyright">
81
+ &copy; 2024 Nihongo Ninja Dojo. All rights reserved.
82
+ </p>
83
+
84
+ <p class="ninja-message">
85
+ 頑張って!(Ganbatte! - Keep going!)
86
+ </p>
87
+ </div>
88
+ </footer>
89
+ `;
90
+ }
91
+ }
92
+
93
+ customElements.define('custom-footer', CustomFooter);
components/navbar.js ADDED
@@ -0,0 +1,153 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomNavbar extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ nav {
7
+ background: linear-gradient(135deg, rgba(217, 70, 239, 0.95) 0%, rgba(192, 38, 211, 0.95) 100%);
8
+ padding: 1rem 2rem;
9
+ display: flex;
10
+ justify-content: space-between;
11
+ align-items: center;
12
+ backdrop-filter: blur(10px);
13
+ position: fixed;
14
+ top: 0;
15
+ left: 0;
16
+ right: 0;
17
+ z-index: 1000;
18
+ box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
19
+ }
20
+ .logo {
21
+ color: white;
22
+ font-weight: bold;
23
+ font-size: 1.5rem;
24
+ display: flex;
25
+ align-items: center;
26
+ gap: 0.5rem;
27
+ }
28
+ .nav-links {
29
+ display: flex;
30
+ gap: 2rem;
31
+ list-style: none;
32
+ margin: 0;
33
+ padding: 0;
34
+ }
35
+ .nav-links a {
36
+ color: white;
37
+ text-decoration: none;
38
+ font-weight: 500;
39
+ padding: 0.5rem 1rem;
40
+ border-radius: 0.5rem;
41
+ transition: all 0.3s ease;
42
+ position: relative;
43
+ overflow: hidden;
44
+ }
45
+ .nav-links a::before {
46
+ content: '';
47
+ position: absolute;
48
+ bottom: 0;
49
+ left: 0;
50
+ width: 100%;
51
+ height: 2px;
52
+ background: white;
53
+ transform: scaleX(0);
54
+ transition: transform 0.3s ease;
55
+ }
56
+ .nav-links a:hover::before {
57
+ transform: scaleX(1);
58
+ }
59
+ .nav-links a:hover {
60
+ background: rgba(255, 255, 255, 0.1);
61
+ }
62
+ .mobile-menu-btn {
63
+ display: none;
64
+ background: none;
65
+ border: none;
66
+ color: white;
67
+ cursor: pointer;
68
+ }
69
+ @media (max-width: 768px) {
70
+ .mobile-menu-btn {
71
+ display: block;
72
+ }
73
+ .nav-links {
74
+ position: absolute;
75
+ top: 100%;
76
+ left: 0;
77
+ right: 0;
78
+ background: linear-gradient(135deg, rgba(217, 70, 239, 0.98) 0%, rgba(192, 38, 211, 0.98) 100%);
79
+ flex-direction: column;
80
+ padding: 1rem;
81
+ gap: 1rem;
82
+ transform: translateY(-10px);
83
+ opacity: 0;
84
+ visibility: hidden;
85
+ transition: all 0.3s ease;
86
+ }
87
+ .nav-links.active {
88
+ transform: translateY(0);
89
+ opacity: 1;
90
+ visibility: visible;
91
+ }
92
+ }
93
+ .user-profile {
94
+ display: flex;
95
+ align-items: center;
96
+ gap: 0.5rem;
97
+ color: white;
98
+ }
99
+ </style>
100
+ <nav>
101
+ <a href="/" class="logo">
102
+ <i data-feather="shield"></i>
103
+ Nihongo Ninja
104
+ </a>
105
+
106
+ <button class="mobile-menu-btn">
107
+ <i data-feather="menu"></i>
108
+ </button>
109
+
110
+ <ul class="nav-links">
111
+ <li><a href="/">Home</a></li>
112
+ <li><a href="/lessons.html">Lessons</a></li>
113
+ <li><a href="/quiz.html">Quiz</a></li>
114
+ <li><a href="/vocabulary.html">Vocabulary</a></li>
115
+ <li><a href="/profile.html">
116
+ <i data-feather="user" class="inline mr-1"></i>
117
+ Profile
118
+ </a></li>
119
+ </ul>
120
+
121
+ <div class="user-profile">
122
+ <i data-feather="star" class="text-yellow-300"></i>
123
+ </div>
124
+ </nav>
125
+ `;
126
+
127
+ // Mobile menu functionality
128
+ const mobileBtn = this.shadowRoot.querySelector('.mobile-menu-btn');
129
+ const navLinks = this.shadowRoot.querySelector('.nav-links');
130
+
131
+ mobileBtn.addEventListener('click', () => {
132
+ navLinks.classList.toggle('active');
133
+ const icon = mobileBtn.querySelector('i');
134
+ if (navLinks.classList.contains('active')) {
135
+ icon.setAttribute('data-feather', 'x');
136
+ } else {
137
+ icon.setAttribute('data-feather', 'menu');
138
+ }
139
+ feather.replace();
140
+ });
141
+
142
+ // Close mobile menu when clicking outside
143
+ document.addEventListener('click', (event) => {
144
+ if (!this.contains(event.target) && navLinks.classList.contains('active')) {
145
+ navLinks.classList.remove('active');
146
+ const icon = mobileBtn.querySelector('i');
147
+ icon.setAttribute('data-feather', 'menu');
148
+ feather.replace();
149
+ });
150
+ }
151
+ }
152
+
153
+ customElements.define('custom-navbar', CustomNavbar);
index.html CHANGED
@@ -1,19 +1,147 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Nihongo Ninja Dojo - Master Japanese with Fun!</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 src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.globe.min.js"></script>
13
+ </head>
14
+ <body class="min-h-screen flex flex-col">
15
+ <custom-navbar></custom-navbar>
16
+
17
+ <main class="flex-grow">
18
+ <!-- Hero Section with Vanta.js Animation -->
19
+ <section id="hero" class="relative h-screen flex items-center justify-center overflow-hidden">
20
+ <div class="absolute inset-0 z-0" id="vanta-bg"></div>
21
+ <div class="relative z-10 text-center text-white px-4">
22
+ <h1 class="text-5xl md:text-7xl font-bold mb-6 bg-gradient-to-r from-fuchsia-400 to-fuchsia-600 bg-clip-text text-transparent">
23
+ 日本語忍者道場
24
+ </h1>
25
+ <p class="text-xl md:text-2xl mb-8 max-w-2xl mx-auto">
26
+ Master Japanese like a ninja! Interactive lessons, games, and animations make learning addictive.
27
+ </p>
28
+ <div class="flex flex-col sm:flex-row gap-4 justify-center">
29
+ <a href="/lessons.html" class="bg-fuchsia-500 hover:bg-fuchsia-600 text-white px-8 py-4 rounded-full font-bold text-lg transition-all duration-300 transform hover:scale-105 shadow-lg">
30
+ <i data-feather="play" class="inline mr-2"></i>Start Learning
31
+ </a>
32
+ <a href="/quiz.html" class="border-2 border-white hover:bg-white hover:text-fuchsia-500 text-white px-8 py-4 rounded-full font-bold text-lg transition-all duration-300 transform hover:scale-105">
33
+ <i data-feather="award" class="inline mr-2"></i>Take Quiz
34
+ </a>
35
+ </div>
36
+ </div>
37
+ <div class="absolute bottom-10 left-1/2 transform -translate-x-1/2 animate-bounce">
38
+ <i data-feather="chevron-down" class="text-white text-2xl"></i>
39
+ </div>
40
+ </section>
41
+
42
+ <!-- Features Section -->
43
+ <section class="py-20 bg-gray-50">
44
+ <div class="container mx-auto px-4">
45
+ <h2 class="text-4xl font-bold text-center mb-16 text-gray-800">Why Learn with Ninja Dojo?</h2>
46
+ <div class="grid md:grid-cols-3 gap-8">
47
+ <div class="feature-card text-center p-8 bg-white rounded-2xl shadow-lg hover:shadow-2xl transition-all duration-500 transform hover:-translate-y-2">
48
+ <div class="w-20 h-20 mx-auto mb-6 bg-fuchsia-100 rounded-full flex items-center justify-center">
49
+ <i data-feather="zap" class="text-fuchsia-500 text-2xl"></i>
50
+ </div>
51
+ <h3 class="text-2xl font-bold mb-4 text-gray-800">Lightning Fast</h3>
52
+ <p class="text-gray-600">Learn vocabulary and grammar through rapid-fire interactive exercises.</p>
53
+ </div>
54
+ <div class="feature-card text-center p-8 bg-white rounded-2xl shadow-lg hover:shadow-2xl transition-all duration-500 transform hover:-translate-y-2">
55
+ <div class="w-20 h-20 mx-auto mb-6 bg-fuchsia-100 rounded-full flex items-center justify-center">
56
+ <i data-feather="gamepad" class="text-fuchsia-500 text-2xl"></i>
57
+ </div>
58
+ <h3 class="text-2xl font-bold mb-4 text-gray-800">Game-Based Learning</h3>
59
+ <p class="text-gray-600">Earn points, unlock levels, and compete with other ninjas!</p>
60
+ </div>
61
+ <div class="feature-card text-center p-8 bg-white rounded-2xl shadow-lg hover:shadow-2xl transition-all duration-500 transform hover:-translate-y-2">
62
+ <div class="w-20 h-20 mx-auto mb-6 bg-fuchsia-100 rounded-full flex items-center justify-center">
63
+ <i data-feather="trending-up" class="text-fuchsia-500 text-2xl"></i>
64
+ </div>
65
+ <h3 class="text-2xl font-bold mb-4 text-gray-800">Progress Tracking</h3>
66
+ <p class="text-gray-600">Watch your skills grow with detailed analytics and achievement badges.</p>
67
+ </div>
68
+ </div>
69
+ </div>
70
+ </section>
71
+
72
+ <!-- Quick Stats -->
73
+ <section class="py-16 bg-gradient-to-r from-fuchsia-500 to-purple-600 text-white">
74
+ <div class="container mx-auto px-4 text-center">
75
+ <div class="grid grid-cols-2 md:grid-cols-4 gap-8">
76
+ <div class="stat-item">
77
+ <div class="text-4xl font-bold mb-2" id="users-count">0</div>
78
+ <div class="text-fuchsia-100">Active Ninjas</div>
79
+ </div>
80
+ <div class="stat-item">
81
+ <div class="text-4xl font-bold mb-2" id="lessons-count">0</div>
82
+ <div class="text-fuchsia-100">Lessons</div>
83
+ </div>
84
+ <div class="stat-item">
85
+ <div class="text-4xl font-bold mb-2" id="words-count">0</div>
86
+ <div class="text-fuchsia-100">Vocabulary Words</div>
87
+ </div>
88
+ <div class="stat-item">
89
+ <div class="text-4xl font-bold mb-2" id="streak-count">0</div>
90
+ <div class="text-fuchsia-100">Day Streak</div>
91
+ </div>
92
+ </div>
93
+ </div>
94
+ </section>
95
+ </main>
96
+
97
+ <custom-footer></custom-footer>
98
+
99
+ <script src="components/navbar.js"></script>
100
+ <script src="components/footer.js"></script>
101
+ <script src="script.js"></script>
102
+ <script>
103
+ // Initialize Vanta.js background
104
+ VANTA.GLOBE({
105
+ el: "#vanta-bg",
106
+ mouseControls: true,
107
+ touchControls: true,
108
+ gyroControls: false,
109
+ minHeight: 200.00,
110
+ minWidth: 200.00,
111
+ scale: 1.00,
112
+ scaleMobile: 1.00,
113
+ color: 0xff00ff,
114
+ backgroundColor: 0x0,
115
+ size: 1.00
116
+ });
117
+
118
+ feather.replace();
119
+
120
+ // Animate stats counters
121
+ document.addEventListener('DOMContentLoaded', function() {
122
+ animateCounter('users-count', 12457, 2000);
123
+ animateCounter('lessons-count', 342, 1500);
124
+ animateCounter('words-count', 5289, 2500);
125
+ animateCounter('streak-count', 89, 1800);
126
+ });
127
+
128
+ function animateCounter(elementId, target, duration) {
129
+ const element = document.getElementById(elementId);
130
+ let start = 0;
131
+ const increment = target / (duration / 16);
132
+
133
+ function updateCounter() {
134
+ start += increment;
135
+ if (start < target) {
136
+ element.textContent = Math.floor(start);
137
+ requestAnimationFrame(updateCounter);
138
+ } else {
139
+ element.textContent = target;
140
+ }
141
+ }
142
+ updateCounter();
143
+ }
144
+ </script>
145
+ <script src="https://deepsite.hf.co/deepsite-badge.js"></script>
146
+ </body>
147
+ </html>
lessons.html ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Japanese Lessons - Nihongo Ninja Dojo</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
+ </head>
13
+ <body class="min-h-screen flex flex-col bg-gray-50">
14
+ <custom-navbar></custom-navbar>
15
+
16
+ <main class="flex-grow pt-20">
17
+ <div class="container mx-auto px-4 py-12">
18
+ <h1 class="text-4xl md:text-5xl font-bold text-center mb-4 text-gray-800">
19
+ Japanese Lessons
20
+ </h1>
21
+ <p class="text-center text-gray-600 mb-12 max-w-2xl mx-auto">
22
+ Master Japanese step by step with interactive lessons, animations, and real-time feedback.
23
+ </p>
24
+
25
+ <!-- Lesson Progress -->
26
+ <div class="max-w-4xl mx-auto mb-12">
27
+ <div class="bg-white rounded-2xl shadow-lg p-8">
28
+ <h2 class="text-2xl font-bold mb-6 text-gray-800">Your Progress</h2>
29
+ <div class="flex items-center justify-between mb-4">
30
+ <span class="text-gray-600">JLPT N5 Level</span>
31
+ <span class="text-fuchsia-500 font-bold">25% Complete</span>
32
+ </div>
33
+ <div class="w-full bg-gray-200 rounded-full h-4">
34
+ <div class="progress-fill bg-fuchsia-500 h-4 rounded-full" style="width: 25%"></div>
35
+ </div>
36
+ </div>
37
+
38
+ <!-- Lessons Grid -->
39
+ <div class="grid md:grid-cols-2 lg:grid-cols-3 gap-6 max-w-6xl mx-auto">
40
+ <!-- Lesson 1 -->
41
+ <div class="lesson-card interactive-card bg-white rounded-2xl shadow-lg p-6 hover:shadow-2xl transition-all duration-300">
42
+ <div class="w-16 h-16 mb-4 bg-fuchsia-100 rounded-full flex items-center justify-center">
43
+ <i data-feather="a" class="text-fuchsia-500 text-xl"></i>
44
+ </div>
45
+ <h3 class="text-xl font-bold mb-3 text-gray-800">Hiragana Basics</h3>
46
+ <p class="text-gray-600 mb-4">Learn the first Japanese alphabet with fun animations.</p>
47
+ <button class="w-full bg-fuchsia-500 hover:bg-fuchsia-600 text-white py-3 rounded-lg font-bold transition-all duration-300 transform hover:scale-105" onclick="startLesson(1)">
48
+ <i data-feather="play" class="inline mr-2"></i>Start Lesson
49
+ </button>
50
+ </div>
51
+
52
+ <!-- Lesson 2 -->
53
+ <div class="lesson-card interactive-card bg-white rounded-2xl shadow-lg p-6 hover:shadow-2xl transition-all duration-300">
54
+ <div class="w-16 h-16 mb-4 bg-fuchsia-100 rounded-full flex items-center justify-center">
55
+ <i data-feather="book" class="text-fuchsia-500 text-xl"></i>
56
+ </div>
57
+ <h3 class="text-xl font-bold mb-3 text-gray-800">Greetings</h3>
58
+ <p class="text-gray-600 mb-4">Master essential Japanese greetings and polite expressions.</p>
59
+ <button class="w-full bg-gray-300 text-gray-600 py-3 rounded-lg font-bold cursor-not-allowed">
60
+ <i data-feather="lock" class="inline mr-2"></i>Locked
61
+ </button>
62
+ </div>
63
+
64
+ <!-- Lesson 3 -->
65
+ <div class="lesson-card interactive-card bg-white rounded-2xl shadow-lg p-6 hover:shadow-2xl transition-all duration-300">
66
+ <div class="w-16 h-16 mb-4 bg-fuchsia-100 rounded-full flex items-center justify-center">
67
+ <i data-feather="users" class="text-fuchsia-500 text-xl"></i>
68
+ </div>
69
+ <h3 class="text-xl font-bold mb-3 text-gray-800">Numbers 1-10</h3>
70
+ <p class="text-gray-600 mb-4">Count like a native with interactive number games.</p>
71
+ <button class="w-full bg-gray-300 text-gray-600 py-3 rounded-lg font-bold cursor-not-allowed">
72
+ <i data-feather="lock" class="inline mr-2"></i>Locked
73
+ </button>
74
+ </div>
75
+ </div>
76
+ </div>
77
+ </main>
78
+
79
+ <custom-footer></custom-footer>
80
+
81
+ <script src="components/navbar.js"></script>
82
+ <script src="components/footer.js"></script>
83
+ <script src="script.js"></script>
84
+ <script>
85
+ feather.replace();
86
+
87
+ function startLesson(lessonId) {
88
+ // Show loading animation
89
+ const button = event.target;
90
+ const originalText = button.innerHTML;
91
+ button.innerHTML = '<div class="loading-dots">Starting</div>';
92
+
93
+ setTimeout(() => {
94
+ window.location.href = `/lesson-${lessonId}.html`;
95
+ }, 1500);
96
+ }
97
+ </script>
98
+ </body>
99
+ </html>
quiz.html ADDED
@@ -0,0 +1,195 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Japanese Quiz - Nihongo Ninja Dojo</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
+ </head>
13
+ <body class="min-h-screen flex flex-col bg-gray-50">
14
+ <custom-navbar></custom-navbar>
15
+
16
+ <main class="flex-grow pt-20">
17
+ <div class="container mx-auto px-4 py-12">
18
+ <h1 class="text-4xl md:text-5xl font-bold text-center mb-4 text-gray-800">
19
+ Japanese Quiz
20
+ </h1>
21
+ <p class="text-center text-gray-600 mb-12 max-w-2xl mx-auto">
22
+ Test your knowledge and earn ninja stars! Each correct answer brings you closer to mastery.
23
+ </p>
24
+
25
+ <!-- Quiz Categories -->
26
+ <div class="max-w-6xl mx-auto mb-12">
27
+ <div class="grid md:grid-cols-2 lg:grid-cols-4 gap-6">
28
+ <div class="quiz-category interactive-card bg-white rounded-2xl shadow-lg p-6 text-center hover:shadow-2xl transition-all duration-300 transform hover:scale-105">
29
+ <div class="w-20 h-20 mx-auto mb-4 bg-fuchsia-100 rounded-full flex items-center justify-center">
30
+ <i data-feather="a" class="text-fuchsia-500 text-2xl"></i>
31
+ </div>
32
+ <h3 class="text-lg font-bold text-gray-800">Hiragana</h3>
33
+ <p class="text-sm text-gray-600">46 characters</p>
34
+ </div>
35
+
36
+ <div class="quiz-category interactive-card bg-white rounded-2xl shadow-lg p-6 text-center hover:shadow-2xl transition-all duration-300">
37
+ <div class="w-20 h-20 mx-auto mb-4 bg-fuchsia-100 rounded-full flex items-center justify-center">
38
+ <i data-feather="hash" class="text-fuchsia-500 text-2xl"></i>
39
+ </div>
40
+ <h3 class="text-lg font-bold text-gray-800">Katakana</h3>
41
+ <p class="text-sm text-gray-600">46 characters</p>
42
+ </div>
43
+
44
+ <div class="quiz-category interactive-card bg-white rounded-2xl shadow-lg p-6 text-center hover:shadow-2xl transition-all duration-300">
45
+ <div class="w-20 h-20 mx-auto mb-4 bg-fuchsia-100 rounded-full flex items-center justify-center">
46
+ <i data-feather="users" class="text-fuchsia-500 text-2xl"></i>
47
+ </div>
48
+ <h3 class="text-lg font-bold text-gray-800">Vocabulary</h3>
49
+ <p class="text-sm text-gray-600">500+ words</p>
50
+ </div>
51
+
52
+ <div class="quiz-category interactive-card bg-white rounded-2xl shadow-lg p-6 text-center hover:shadow-2xl transition-all duration-300">
53
+ <div class="w-20 h-20 mx-auto mb-4 bg-fuchsia-100 rounded-full flex items-center justify-center">
54
+ <i data-feather="book" class="text-fuchsia-500 text-2xl"></i>
55
+ </div>
56
+ <h3 class="text-lg font-bold text-gray-800">Grammar</h3>
57
+ <p class="text-sm text-gray-600">Essential rules</p>
58
+ </div>
59
+ </div>
60
+
61
+ <!-- Active Quiz Section -->
62
+ <div class="max-w-4xl mx-auto bg-white rounded-2xl shadow-lg p-8">
63
+ <h2 class="text-2xl font-bold mb-6 text-gray-800">Quick Quiz Challenge</h2>
64
+ <div id="quiz-container" class="space-y-6">
65
+ <!-- Quiz questions will be dynamically loaded here -->
66
+ <div class="text-center py-12">
67
+ <i data-feather="help-circle" class="text-6xl text-gray-300 mb-4"></i>
68
+ <p class="text-gray-500">Select a quiz category to begin your challenge!</p>
69
+ <button onclick="startRandomQuiz()" class="mt-6 bg-fuchsia-500 hover:bg-fuchsia-600 text-white px-8 py-3 rounded-lg font-bold transition-all duration-300 transform hover:scale-105">
70
+ <i data-feather="shuffle" class="inline mr-2"></i>Random Quiz
71
+ </button>
72
+ </div>
73
+ </div>
74
+ </div>
75
+ </main>
76
+
77
+ <custom-footer></custom-footer>
78
+
79
+ <script src="components/navbar.js"></script>
80
+ <script src="components/footer.js"></script>
81
+ <script src="script.js"></script>
82
+ <script>
83
+ feather.replace();
84
+
85
+ const quizQuestions = [
86
+ {
87
+ question: "What does 'こんにちは' mean?",
88
+ options: ["Good morning", "Good afternoon", "Good night", "Thank you"],
89
+ correct: 1,
90
+ explanation: "こんにちは (Konnichiwa) means 'Good afternoon' or 'Hello'.",
91
+ type: "vocabulary"
92
+ },
93
+ {
94
+ question: "Which character is the Hiragana for 'a'?",
95
+ options: ["あ", "い", "う", "え"],
96
+ correct: 0,
97
+ explanation: "あ is the Hiragana character for the sound 'a'.",
98
+ type: "hiragana"
99
+ },
100
+ {
101
+ question: "How do you say 'Thank you' in Japanese?",
102
+ options: ["すみません", "ありがとう", "おはよう", "さようなら"],
103
+ correct: 1,
104
+ explanation: "ありがとう (Arigatou) means 'Thank you'.",
105
+ type: "vocabulary"
106
+ }
107
+ ];
108
+
109
+ let currentQuestion = 0;
110
+ let score = 0;
111
+
112
+ function startRandomQuiz() {
113
+ currentQuestion = 0;
114
+ score = 0;
115
+ loadQuestion();
116
+ }
117
+
118
+ function loadQuestion() {
119
+ const container = document.getElementById('quiz-container');
120
+ if (currentQuestion >= quizQuestions.length) {
121
+ showResults();
122
+ return;
123
+ }
124
+
125
+ const q = quizQuestions[currentQuestion];
126
+ container.innerHTML = `
127
+ <div class="bg-fuchsia-50 rounded-xl p-6 mb-6">
128
+ <h3 class="text-xl font-bold mb-4 text-gray-800">Question ${currentQuestion + 1}: ${q.question}</h3>
129
+ <div class="space-y-3">
130
+ ${q.options.map((option, index) => `
131
+ <button onclick="checkAnswer(${index})"
132
+ class="w-full text-left p-4 bg-white border-2 border-gray-200 rounded-lg hover:border-fuchsia-300 transition-all duration-300 quiz-option">
133
+ <span class="option-letter bg-gray-200 text-gray-700 w-8 h-8 rounded-full inline-flex items-center justify-center mr-3">
134
+ ${String.fromCharCode(65 + index)}
135
+ </span>
136
+ ${option}
137
+ </button>
138
+ `).join('')}
139
+ </div>
140
+ </div>
141
+ `;
142
+ }
143
+
144
+ function checkAnswer(selectedIndex) {
145
+ const q = quizQuestions[currentQuestion];
146
+ const buttons = document.querySelectorAll('.quiz-option');
147
+
148
+ buttons.forEach((button, index) => {
149
+ if (index === q.correct) {
150
+ button.classList.add('bg-green-100', 'border-green-400');
151
+ } else if (index === selectedIndex) {
152
+ button.classList.add('bg-red-100', 'border-red-400');
153
+ }
154
+ button.disabled = true;
155
+ });
156
+
157
+ if (selectedIndex === q.correct) {
158
+ score++;
159
+ createParticles(event.clientX, event.clientY);
160
+ }
161
+
162
+ setTimeout(() => {
163
+ currentQuestion++;
164
+ loadQuestion();
165
+ }, 2000);
166
+ }
167
+
168
+ function showResults() {
169
+ const container = document.getElementById('quiz-container');
170
+ const percentage = Math.round((score / quizQuestions.length) * 100);
171
+
172
+ container.innerHTML = `
173
+ <div class="text-center py-8">
174
+ <i data-feather="${percentage >= 70 ? 'award' : 'frown'}"
175
+ class="text-6xl ${percentage >= 70 ? 'text-yellow-400' : 'text-gray-400'} mb-4"></i>
176
+ <h3 class="text-2xl font-bold mb-4 text-gray-800">Quiz Complete!</h3>
177
+ <p class="text-4xl font-bold mb-2 ${percentage >= 70 ? 'text-green-500' : 'text-red-500'}">
178
+ ${score}/${quizQuestions.length}
179
+ </p>
180
+ <p class="text-gray-600 mb-6">You scored ${percentage}%</p>
181
+ <div class="flex gap-4 justify-center">
182
+ <button onclick="startRandomQuiz()" class="bg-fuchsia-500 hover:bg-fuchsia-600 text-white px-6 py-3 rounded-lg font-bold transition-all duration-300">
183
+ <i data-feather="refresh-cw" class="inline mr-2"></i>Try Again
184
+ </button>
185
+ <button onclick="window.location.href='/lessons.html'" class="border-2 border-gray-300 hover:border-fuchsia-500 text-gray-700 px-6 py-3 rounded-lg font-bold transition-all duration-300">
186
+ <i data-feather="book" class="inline mr-2"></i>More Lessons
187
+ </button>
188
+ </div>
189
+ `;
190
+
191
+ feather.replace();
192
+ }
193
+ </script>
194
+ </body>
195
+ </html>
script.js ADDED
@@ -0,0 +1,131 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // Shared JavaScript across all pages
2
+
3
+ // Scroll animation handler
4
+ document.addEventListener('DOMContentLoaded', function() {
5
+ const fadeElements = document.querySelectorAll('.fade-in');
6
+
7
+ const observer = new IntersectionObserver((entries) => {
8
+ entries.forEach(entry => {
9
+ if (entry.isIntersecting) {
10
+ entry.target.classList.add('visible');
11
+ }
12
+ });
13
+ }, { threshold: 0.1 });
14
+
15
+ fadeElements.forEach(element => {
16
+ observer.observe(element);
17
+ });
18
+ });
19
+
20
+ // Audio pronunciation function
21
+ function playJapaneseAudio(text) {
22
+ const utterance = new SpeechSynthesisUtterance(text);
23
+ utterance.lang = 'ja-JP';
24
+ utterance.rate = 0.8;
25
+ speechSynthesis.speak(utterance);
26
+ }
27
+
28
+ // Particle effect for correct answers
29
+ function createParticles(x, y, count = 20) {
30
+ for (let i = 0; i < count; i++) {
31
+ const particle = document.createElement('div');
32
+ particle.className = 'particle';
33
+ particle.style.left = `${x}px`;
34
+ particle.style.top = `${y}px`;
35
+
36
+ const angle = Math.random() * Math.PI * 2;
37
+ const velocity = 2 + Math.random() * 2;
38
+ const vx = Math.cos(angle) * velocity;
39
+ const vy = Math.sin(angle) * velocity;
40
+
41
+ document.body.appendChild(particle);
42
+
43
+ setTimeout(() => {
44
+ particle.style.transform = `translate(${vx * 100}px, ${vy * 100}px)`;
45
+ }, 10);
46
+
47
+ setTimeout(() => {
48
+ particle.remove();
49
+ }, 1000);
50
+ }
51
+ }
52
+
53
+ // Local storage for user progress
54
+ const userProgress = {
55
+ get: function(key) {
56
+ try {
57
+ return JSON.parse(localStorage.getItem(`ninja_${key}`)) || 0;
58
+ } catch {
59
+ return 0;
60
+ }
61
+ },
62
+
63
+ set: function(key, value) {
64
+ localStorage.setItem(`ninja_${key}`, JSON.stringify(value));
65
+ },
66
+
67
+ updateStreak: function() {
68
+ const today = new Date().toDateString();
69
+ const lastVisit = this.get('last_visit');
70
+
71
+ if (lastVisit !== today) {
72
+ const streak = this.get('streak') || 0;
73
+ const yesterday = new Date();
74
+ yesterday.setDate(yesterday.getDate() - 1);
75
+
76
+ if (lastVisit === yesterday.toDateString() || !lastVisit) {
77
+ this.set('streak', streak + 1);
78
+ } else {
79
+ this.set('streak', 1);
80
+ }
81
+
82
+ this.set('last_visit', today);
83
+ return this.get('streak');
84
+ }
85
+ };
86
+
87
+ // Typing animation for Japanese text
88
+ function typeJapaneseText(element, text, speed = 50) {
89
+ let i = 0;
90
+ element.textContent = '';
91
+
92
+ function type() {
93
+ if (i < text.length) {
94
+ element.textContent += text.charAt(i);
95
+ i++;
96
+ setTimeout(type, speed);
97
+ }
98
+ }
99
+ type();
100
+ }
101
+
102
+ // Shuffle array for quiz questions
103
+ function shuffleArray(array) {
104
+ const shuffled = [...array];
105
+ for (let i = shuffled.length - 1; i > 0; i--) {
106
+ const j = Math.floor(Math.random() * (i + 1));
107
+ [shuffled[i], shuffled[j]] = [shuffled[j], shuffled[i]];
108
+ }
109
+ return shuffled;
110
+ }
111
+
112
+ // API call to get Japanese vocabulary
113
+ async function getJapaneseVocabulary(level = 'n5') {
114
+ try {
115
+ // Using a free Japanese API
116
+ const response = await fetch(`https://jisho.org/api/v1/search/words?keyword=%23common&page=1`);
117
+ const data = await response.json();
118
+ return data.data || [];
119
+ } catch (error) {
120
+ console.error('Failed to fetch vocabulary:', error);
121
+ return [];
122
+ }
123
+ }
124
+
125
+ // Initialize app
126
+ document.addEventListener('DOMContentLoaded', function() {
127
+ // Update user streak
128
+ userProgress.updateStreak();
129
+
130
+ console.log('Nihongo Ninja Dojo loaded successfully!');
131
+ });
style.css CHANGED
@@ -1,28 +1,103 @@
 
 
 
1
  body {
2
- padding: 2rem;
3
- font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  }
5
 
6
- h1 {
7
- font-size: 16px;
8
- margin-top: 0;
9
  }
10
 
11
- p {
12
- color: rgb(107, 114, 128);
13
- font-size: 15px;
14
- margin-bottom: 10px;
15
- margin-top: 5px;
16
  }
17
 
18
- .card {
19
- max-width: 620px;
20
- margin: 0 auto;
21
- padding: 16px;
22
- border: 1px solid lightgray;
23
- border-radius: 16px;
24
  }
25
 
26
- .card p:last-child {
27
- margin-bottom: 0;
 
28
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /* Shared styles across all pages */
2
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
3
+
4
  body {
5
+ font-family: 'Inter', sans-serif;
6
+ }
7
+
8
+ /* Custom animations */
9
+ @keyframes float {
10
+ 0%, 100% { transform: translateY(0px); }
11
+ 50% { transform: translateY(-20px); }
12
+ }
13
+
14
+ @keyframes pulse-glow {
15
+ 0%, 100% { box-shadow: 0 0 20px rgba(255, 0, 255, 0.3); }
16
+ 50% { box-shadow: 0 0 40px rgba(255, 0, 255, 0.6); }
17
+ }
18
+
19
+ .feature-card {
20
+ animation: float 6s ease-in-out infinite;
21
+ }
22
+
23
+ .feature-card:nth-child(2) {
24
+ animation-delay: 2s;
25
+ }
26
+
27
+ .feature-card:nth-child(3) {
28
+ animation-delay: 4s;
29
+ }
30
+
31
+ /* Interactive elements */
32
+ .interactive-card {
33
+ transition: all 0.3s ease;
34
+ cursor: pointer;
35
  }
36
 
37
+ .interactive-card:hover {
38
+ transform: scale(1.05);
39
+ animation: pulse-glow 2s infinite;
40
  }
41
 
42
+ /* Kanji stroke animation */
43
+ .kanji-path {
44
+ stroke-dasharray: 1000;
45
+ stroke-dashoffset: 1000;
46
+ animation: draw 3s ease-in-out infinite;
47
  }
48
 
49
+ @keyframes draw {
50
+ to {
51
+ stroke-dashoffset: 0;
52
+ }
 
 
53
  }
54
 
55
+ /* Loading animation */
56
+ .loading-dots {
57
+ display: inline-block;
58
  }
59
+
60
+ .loading-dots::after {
61
+ content: '...';
62
+ animation: dots 1.5s steps(4, end) infinite;
63
+ }
64
+
65
+ @keyframes dots {
66
+ 0%, 20% { color: rgba(0,0,0,0); }
67
+ 40% { color: rgba(0,0,0,1); }
68
+ 60% { color: rgba(0,0,0,1); }
69
+ 80%, 100% { color: rgba(0,0,0,0); }
70
+ }
71
+
72
+ /* Scroll animations */
73
+ .fade-in {
74
+ opacity: 0;
75
+ transform: translateY(30px);
76
+ transition: all 0.6s ease;
77
+ }
78
+
79
+ .fade-in.visible {
80
+ opacity: 1;
81
+ transform: translateY(0);
82
+ }
83
+
84
+ /* Progress bar animation */
85
+ .progress-fill {
86
+ transition: width 1s ease-in-out;
87
+ }
88
+
89
+ /* Particle animation for correct answers */
90
+ @keyframes celebrate {
91
+ 0% { transform: scale(0); opacity: 1; }
92
+ 50% { opacity: 1; }
93
+ 100% { transform: scale(1); opacity: 0; }
94
+ }
95
+
96
+ .particle {
97
+ position: absolute;
98
+ width: 8px;
99
+ height: 8px;
100
+ background: #ec4899;
101
+ border-radius: 50%;
102
+ animation: celebrate 1s ease-out forwards;
103
+ }