Daman07 commited on
Commit
a53d699
·
verified ·
1 Parent(s): 2ab7973

Tolong buatkan tampilan aplikasi mobile untuk Tampilan Daftar Kuis dan tampilan soal kuis yang diakses, gunakan bahasa dart(Flutter)

Browse files
Files changed (6) hide show
  1. README.md +8 -5
  2. components/footer.js +74 -0
  3. components/navbar.js +59 -0
  4. index.html +122 -19
  5. script.js +38 -0
  6. style.css +30 -18
README.md CHANGED
@@ -1,10 +1,13 @@
1
  ---
2
- title: Quizzy Flutter
3
- emoji: 🔥
4
- colorFrom: green
5
- colorTo: purple
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: Quizzy Flutter 📱
3
+ colorFrom: red
4
+ colorTo: green
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).
components/footer.js ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomFooter extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ .footer {
7
+ background-color: #ffffff;
8
+ border-top: 1px solid #e5e7eb;
9
+ padding: 2rem 0;
10
+ margin-top: 4rem;
11
+ }
12
+ .footer-container {
13
+ max-width: 1200px;
14
+ margin: 0 auto;
15
+ padding: 0 1rem;
16
+ display: grid;
17
+ grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
18
+ gap: 2rem;
19
+ }
20
+ .footer-title {
21
+ font-size: 1.125rem;
22
+ font-weight: 600;
23
+ color: #111827;
24
+ margin-bottom: 1rem;
25
+ }
26
+ .footer-links {
27
+ display: flex;
28
+ flex-direction: column;
29
+ gap: 0.75rem;
30
+ }
31
+ .footer-link {
32
+ color: #6b7280;
33
+ transition: color 0.2s;
34
+ }
35
+ .footer-link:hover {
36
+ color: #1e40af;
37
+ }
38
+ .copyright {
39
+ text-align: center;
40
+ margin-top: 3rem;
41
+ color: #9ca3af;
42
+ font-size: 0.875rem;
43
+ }
44
+ </style>
45
+ <footer class="footer">
46
+ <div class="footer-container">
47
+ <div>
48
+ <h3 class="footer-title">Quizzy</h3>
49
+ <p class="text-gray-600">Platform kuis interaktif untuk menguji pengetahuan Anda.</p>
50
+ </div>
51
+ <div>
52
+ <h3 class="footer-title">Navigasi</h3>
53
+ <div class="footer-links">
54
+ <a href="#" class="footer-link">Beranda</a>
55
+ <a href="#" class="footer-link">Kuis</a>
56
+ <a href="#" class="footer-link">Profil</a>
57
+ </div>
58
+ </div>
59
+ <div>
60
+ <h3 class="footer-title">Bantuan</h3>
61
+ <div class="footer-links">
62
+ <a href="#" class="footer-link">FAQ</a>
63
+ <a href="#" class="footer-link">Kontak</a>
64
+ <a href="#" class="footer-link">Privasi</a>
65
+ </div>
66
+ </div>
67
+ </div>
68
+ <p class="copyright">© 2023 Quizzy. All rights reserved.</p>
69
+ </footer>
70
+ `;
71
+ }
72
+ }
73
+
74
+ customElements.define('custom-footer', CustomFooter);
components/navbar.js ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class CustomNavbar extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ .navbar {
7
+ background-color: #ffffff;
8
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
9
+ padding: 1rem;
10
+ position: sticky;
11
+ top: 0;
12
+ z-index: 50;
13
+ }
14
+ .navbar-container {
15
+ display: flex;
16
+ justify-content: space-between;
17
+ align-items: center;
18
+ max-width: 1200px;
19
+ margin: 0 auto;
20
+ }
21
+ .logo {
22
+ font-size: 1.25rem;
23
+ font-weight: 700;
24
+ color: #1e40af;
25
+ }
26
+ .nav-links {
27
+ display: flex;
28
+ gap: 1.5rem;
29
+ }
30
+ .nav-link {
31
+ color: #4b5563;
32
+ font-weight: 500;
33
+ transition: color 0.2s;
34
+ }
35
+ .nav-link:hover {
36
+ color: #1e40af;
37
+ }
38
+ @media (max-width: 640px) {
39
+ .nav-links {
40
+ display: none;
41
+ }
42
+ }
43
+ </style>
44
+ <nav class="navbar">
45
+ <div class="navbar-container">
46
+ <a href="#" class="logo">Quizzy</a>
47
+ <div class="nav-links">
48
+ <a href="#" class="nav-link">Beranda</a>
49
+ <a href="#" class="nav-link">Kuis Saya</a>
50
+ <a href="#" class="nav-link">Profil</a>
51
+ </div>
52
+ <i data-feather="menu" class="md:hidden"></i>
53
+ </div>
54
+ </nav>
55
+ `;
56
+ }
57
+ }
58
+
59
+ customElements.define('custom-navbar', CustomNavbar);
index.html CHANGED
@@ -1,19 +1,122 @@
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>Quizzy Flutter</title>
7
+ <link rel="stylesheet" href="style.css">
8
+ <script src="https://cdn.tailwindcss.com"></script>
9
+ <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
10
+ <script src="https://unpkg.com/feather-icons"></script>
11
+ </head>
12
+ <body class="bg-gray-100">
13
+ <custom-navbar></custom-navbar>
14
+
15
+ <div class="container mx-auto px-4 py-8">
16
+ <!-- Quiz List Page (default view) -->
17
+ <div id="quiz-list-page">
18
+ <h1 class="text-3xl font-bold text-gray-800 mb-6">Daftar Kuis</h1>
19
+
20
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
21
+ <!-- Quiz Card 1 -->
22
+ <div class="bg-white rounded-xl shadow-md overflow-hidden transition-transform hover:scale-105">
23
+ <div class="p-6">
24
+ <div class="flex justify-between items-start">
25
+ <div>
26
+ <h2 class="text-xl font-semibold text-gray-800">Kuis Matematika</h2>
27
+ <p class="text-gray-600 mt-1">10 Pertanyaan</p>
28
+ </div>
29
+ <div class="bg-blue-100 text-blue-800 px-3 py-1 rounded-full text-xs font-medium">
30
+ Mudah
31
+ </div>
32
+ </div>
33
+ <p class="text-gray-500 mt-3">Tes pengetahuan matematika dasar Anda dengan kuis ini.</p>
34
+ <button onclick="showQuizPage()" class="mt-4 w-full bg-blue-500 hover:bg-blue-600 text-white py-2 px-4 rounded-lg transition-colors">
35
+ Mulai Kuis
36
+ </button>
37
+ </div>
38
+ </div>
39
+
40
+ <!-- Quiz Card 2 -->
41
+ <div class="bg-white rounded-xl shadow-md overflow-hidden transition-transform hover:scale-105">
42
+ <div class="p-6">
43
+ <div class="flex justify-between items-start">
44
+ <div>
45
+ <h2 class="text-xl font-semibold text-gray-800">Kuis Sejarah</h2>
46
+ <p class="text-gray-600 mt-1">15 Pertanyaan</p>
47
+ </div>
48
+ <div class="bg-yellow-100 text-yellow-800 px-3 py-1 rounded-full text-xs font-medium">
49
+ Sedang
50
+ </div>
51
+ </div>
52
+ <p class="text-gray-500 mt-3">Uji pengetahuan sejarah Indonesia Anda.</p>
53
+ <button onclick="showQuizPage()" class="mt-4 w-full bg-blue-500 hover:bg-blue-600 text-white py-2 px-4 rounded-lg transition-colors">
54
+ Mulai Kuis
55
+ </button>
56
+ </div>
57
+ </div>
58
+ </div>
59
+ </div>
60
+
61
+ <!-- Quiz Page (hidden by default) -->
62
+ <div id="quiz-page" class="hidden">
63
+ <div class="bg-white rounded-xl shadow-md p-6">
64
+ <!-- Quiz Header -->
65
+ <div class="flex justify-between items-center mb-6">
66
+ <button onclick="showQuizListPage()" class="text-blue-500 hover:text-blue-700">
67
+ <i data-feather="arrow-left"></i>
68
+ </button>
69
+ <div class="text-gray-600">
70
+ <span id="current-question">1</span>/10
71
+ </div>
72
+ <div class="w-8"></div> <!-- Spacer for balance -->
73
+ </div>
74
+
75
+ <!-- Progress Bar -->
76
+ <div class="w-full bg-gray-200 rounded-full h-2 mb-6">
77
+ <div class="bg-blue-500 h-2 rounded-full" style="width: 10%"></div>
78
+ </div>
79
+
80
+ <!-- Question -->
81
+ <h2 class="text-xl font-semibold text-gray-800 mb-4">Berapakah hasil dari 7 × 8?</h2>
82
+
83
+ <!-- Options -->
84
+ <div class="space-y-3">
85
+ <button class="w-full text-left p-4 rounded-lg border border-gray-300 hover:border-blue-500 transition-colors">
86
+ 54
87
+ </button>
88
+ <button class="w-full text-left p-4 rounded-lg border border-gray-300 hover:border-blue-500 transition-colors">
89
+ 56
90
+ </button>
91
+ <button class="w-full text-left p-4 rounded-lg border border-gray-300 hover:border-blue-500 transition-colors">
92
+ 58
93
+ </button>
94
+ <button class="w-full text-left p-4 rounded-lg border border-gray-300 hover:border-blue-500 transition-colors">
95
+ 60
96
+ </button>
97
+ </div>
98
+
99
+ <!-- Navigation -->
100
+ <div class="flex justify-between mt-6">
101
+ <button class="bg-gray-200 hover:bg-gray-300 text-gray-800 py-2 px-4 rounded-lg transition-colors">
102
+ Sebelumnya
103
+ </button>
104
+ <button class="bg-blue-500 hover:bg-blue-600 text-white py-2 px-4 rounded-lg transition-colors">
105
+ Selanjutnya
106
+ </button>
107
+ </div>
108
+ </div>
109
+ </div>
110
+ </div>
111
+
112
+ <custom-footer></custom-footer>
113
+
114
+ <script src="components/navbar.js"></script>
115
+ <script src="components/footer.js"></script>
116
+ <script src="script.js"></script>
117
+ <script>
118
+ feather.replace();
119
+ </script>
120
+ <script src="https://huggingface.co/deepsite/deepsite-badge.js"></script>
121
+ </body>
122
+ </html>
script.js ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ function showQuizPage() {
2
+ document.getElementById('quiz-list-page').classList.add('hidden');
3
+ document.getElementById('quiz-page').classList.remove('hidden');
4
+ document.getElementById('quiz-page').classList.add('animate-fade');
5
+ }
6
+
7
+ function showQuizListPage() {
8
+ document.getElementById('quiz-page').classList.add('hidden');
9
+ document.getElementById('quiz-list-page').classList.remove('hidden');
10
+ document.getElementById('quiz-list-page').classList.add('animate-fade');
11
+ }
12
+
13
+ // Sample quiz data
14
+ const quizData = [
15
+ {
16
+ id: 1,
17
+ title: "Kuis Matematika",
18
+ description: "Tes pengetahuan matematika dasar Anda dengan kuis ini.",
19
+ difficulty: "Mudah",
20
+ questionCount: 10
21
+ },
22
+ {
23
+ id: 2,
24
+ title: "Kuis Sejarah",
25
+ description: "Uji pengetahuan sejarah Indonesia Anda.",
26
+ difficulty: "Sedang",
27
+ questionCount: 15
28
+ }
29
+ ];
30
+
31
+ // Function to render quiz cards (could be expanded)
32
+ function renderQuizCards() {
33
+ // In a real app, this would dynamically create quiz cards from the data
34
+ }
35
+
36
+ document.addEventListener('DOMContentLoaded', function() {
37
+ renderQuizCards();
38
+ });
style.css CHANGED
@@ -1,28 +1,40 @@
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
  body {
2
+ font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
 
3
  }
4
 
5
+ .container {
6
+ max-width: 1200px;
 
7
  }
8
 
9
+ /* Animation for page transitions */
10
+ @keyframes fadeIn {
11
+ from { opacity: 0; transform: translateY(10px); }
12
+ to { opacity: 1; transform: translateY(0); }
 
13
  }
14
 
15
+ .animate-fade {
16
+ animation: fadeIn 0.3s ease-out forwards;
 
 
 
 
17
  }
18
 
19
+ /* Custom button styles */
20
+ .btn-primary {
21
+ background-color: #3b82f6;
22
+ color: white;
23
+ transition: all 0.2s ease;
24
  }
25
+
26
+ .btn-primary:hover {
27
+ background-color: #2563eb;
28
+ transform: translateY(-1px);
29
+ }
30
+
31
+ .btn-primary:active {
32
+ transform: translateY(0);
33
+ }
34
+
35
+ /* Responsive adjustments */
36
+ @media (max-width: 640px) {
37
+ .quiz-card {
38
+ width: 100%;
39
+ }
40
+ }