Spaces:
Running
If something's missing why it's not showing anything in the preview, check this other code.
Browse files<!DOCTYPE html>
<html lang="en" class="h-full" data-theme="light">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>TKQuest</title>
<!-- Tailwind -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- daisyUI -->
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.12.10/dist/full.min.css" rel="stylesheet" type="text/css" />
<!-- Font -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Inter', sans-serif;
overflow: hidden; /* Prevent body scroll */
}
/* Ensure main area takes full viewport height and scrolls */
#main-app-view main {
height: 100vh; /* Full viewport height */
overflow-y: auto; /* Allow main area to scroll independently */
/* Add padding-left matching sidebar width */
padding-left: 16rem; /* Initial padding for w-64 sidebar */
transition: padding-left 0.3s ease-in-out; /* Smooth transition for padding */
width: 100%; /* Ensure main takes full width relative to its container */
}
/* Style for collapsed sidebar state - applied to body */
body.sidebar-collapsed #main-app-view main {
padding-left: 4rem; /* Padding for collapsed w-16 sidebar */
}
/* Keep sidebar fixed and full height */
#main-app-view aside {
position: fixed;
top: 0;
left: 0;
height: 100vh;
z-index: 30; /* Ensure sidebar is above main content scrollbar but below modals */
}
/* Custom Theme Overrides */
:root[data-theme="light"] {
--p: #436bd9; /* royal-blue-600 */
--pc: #ffffff; /* text on primary buttons */
--s: #9ec2f2; /* royal-blue-300 */
--sc: #1d264e; /* text on secondary buttons */
--a: #70a1ea; /* royal-blue-400 */
--ac: #1d264e; /* text on accent buttons */
--n: #293b7f; /* royal-blue-900 */
--nc: #ffffff;
--b1: #ffffff; /* base-100 (white) */
--b2: #f1f5fd; /* royal-blue-50 (light bg) */
--b3: #dfeafa; /* royal-blue-100 (lighter bg) */
--bc: #000000; /* base-content (black text) */
--in: #70a1ea;
--su: #4ade80; /* Use DaisyUI success color */
--wa: #facc15;
--er: #f43f5e;
/* Custom class for blue text */
.text-primary-blue {
color: var(--p);
}
}
/* Custom style for active sidebar link */
#sidebar-menu li.active > a {
background-color: var(--b2); /* royal-blue-50 */
color: var(--p); /* royal-blue-600 */
}
#sidebar-menu li.active > a svg {
stroke: var(--p); /* royal-blue-600 */
}
/* Ensure dropdowns have high z-index */
.dropdown-content {
z-index: 50 !important;
background-color: var(--b1) !important; /* Force white background */
}
/* Custom class for content cards */
.content-card {
background-color: var(--b1);
border-radius: 0.5rem; /* 8px */
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
transition: all 0.2s ease-in-out;
}
/* Floating User Info Box */
#floating-user-info {
position: fixed;
top: 1.5rem; /* Adjust as needed */
right: 1.5rem; /* Adjust as needed */
z-index: 40; /* Below dropdowns, above most content */
}
/* Ensure modals scroll internally */
.modal-box {
max-height: 85vh;
overflow-y: auto;
}
/* --- Custom Progress Bar Styles --- */
.progress-bar-container {
width: 100%;
background-color: var(--b3); /* Light background for the track */
border-radius: 9999px; /* Fully rounded */
height: 1rem; /* 16px - slightly thicker */
overflow: hidden; /* Ensure fill stays inside */
position: relative; /* For potential future text overlay */
box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); /* Inner shadow for depth */
}
.progress-bar-fill {
background: linear-gradient(to right, #4ade80, #16a34a); /* Adjusted green gradient (using DaisyUI success) */
height: 100%;
border-radius: 9999px;
width: 0%; /* Start at 0 */
transition: width 0.6s cubic-bezier(0.68, -0.55, 0.27, 1.55); /* Bouncy animation */
/* Add subtle stripes for visual interest */
background-image: linear-gradient(
45deg,
rgba(255, 255, 255, .15) 25%,
transparent 25%,
transparent 50%,
rgba(255, 255, 255, .15) 50%,
rgba(255, 255, 255, .15) 75%,
transparent 75%,
transparent
);
background-size: 1rem 1rem; /* Stripe size */
}
/* Style for the temporary Dev button */
#dev-switch-role-btn {
/* Positioned relative to the header */
z-index: 100; /* Ensure it's clickable */
}
</style>
</head>
<body class="h-full bg-base-300"> <!-- Add sidebar-collapsed class dynamically -->
<!-- App Container -->
<div id="app" class="min-h-full">
<!-- 1. Authentication View (Login/Register) -->
<div id="auth-view" class="hidden min-h-screen flex items-center justify-center p-4">
<div class="card w-full max-w-md bg-base-100 shadow-xl">
<div class="card-body">
<div role="tablist" class="tabs tabs-lifted tabs-lg">
<!-- Login Tab -->
<input type="radio" name="auth_tabs" role="tab" class="tab" aria-label="Login" checked />
<div role="tabpanel" class="tab-content bg-base-100 rounded-box p-6">
<h2 class="text-2xl font-bold mb-6 text-center text-primary-blue">Log In to TKQuest</h2>
<form id="login-form-element" class="space-y-4">
<div class="form-control">
<label class="label"><span class="label-text">Email</span></label>
<input type="email" id="login-email" required class="input input-bordered w-full">
</div>
<div class="form-control">
<label class="label"><span class="label-text">Password</span></label>
<input type="password" id="login-password" required class="input input-bordered w-full">
</div>
<p id="login-error" class="text-error text-sm hidden"></p>
<button type="submit" class="btn btn-primary w-full">Log In</button>
</form>
</div>
<!-- Register Tab -->
<input type="radio" name="auth_tabs" role="tab" class="tab" aria-label="Register" />
<div role="tabpanel" class="tab-content bg-base-100 rounded-box p-6">
<h2 class="text-2xl font-bold mb-6 text-center text-primary-blue">Create Student Account</h2>
<form id="register-form-element" class="space-y-4">
<div class="form-control">
<label class="label"><span class="label-text">Full Name</span></label>
<input type="text" id="register-name" required class="input input-bordered w-full">
</div>
<div class="form-control">
<label class="label"><span class="label-text">Email</span></label>
<input type="email" id="register-email" required class="input input-bordered w-full">
</div>
<div class="form-control">
<label class="label"><span class="label-text">Password (min. 6 characters)</span></label>
<input type="password" id="register-password" required minlength="6" class="input input-bordered w-full">
</div>
<input type="hidden" id="register-role" value="student">
<div class="form-control" id="belt-level-field">
<label class="label"><span class="label-text">Current Belt Level</span></label>
<select id="register-belt" class="select select-bordered w-full">
<option value="White" selected>White</option>
<option value="Yellow">Yellow</option>
<option value="Blue">Blue</option>
<option value="Red">Red</option>
<option value="Brown">Brown</option>
</select>
</div>
<p id="register-error" class="text-error text-sm hidden"></p>
<button type="submit" class="btn btn-primary w-full">Register</button>
</form>
</div>
</div>
</div>
</div>
</div>
<!-- 2. Main App View -->
<div id="main-app-view" class="hidden h-scr
- components/footer.js +23 -0
- components/navbar.js +43 -0
- index.html +2 -2
- script.js +4 -5
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomFooter extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
footer {
|
| 7 |
+
background-color: #f1f5fd;
|
| 8 |
+
padding: 1rem;
|
| 9 |
+
text-align: center;
|
| 10 |
+
margin-top: 2rem;
|
| 11 |
+
}
|
| 12 |
+
p {
|
| 13 |
+
margin: 0;
|
| 14 |
+
color: #436bd9;
|
| 15 |
+
}
|
| 16 |
+
</style>
|
| 17 |
+
<footer>
|
| 18 |
+
<p>© 2023 TKQuest. All rights reserved.</p>
|
| 19 |
+
</footer>
|
| 20 |
+
`;
|
| 21 |
+
}
|
| 22 |
+
}
|
| 23 |
+
customElements.define('custom-footer', CustomFooter);
|
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomNavbar extends HTMLElement {
|
| 2 |
+
connectedCallback() {
|
| 3 |
+
this.attachShadow({ mode: 'open' });
|
| 4 |
+
this.shadowRoot.innerHTML = `
|
| 5 |
+
<style>
|
| 6 |
+
nav {
|
| 7 |
+
background-color: #436bd9;
|
| 8 |
+
color: white;
|
| 9 |
+
padding: 1rem;
|
| 10 |
+
display: flex;
|
| 11 |
+
justify-content: space-between;
|
| 12 |
+
align-items: center;
|
| 13 |
+
}
|
| 14 |
+
.logo {
|
| 15 |
+
font-size: 1.5rem;
|
| 16 |
+
font-weight: bold;
|
| 17 |
+
}
|
| 18 |
+
ul {
|
| 19 |
+
display: flex;
|
| 20 |
+
list-style: none;
|
| 21 |
+
gap: 1rem;
|
| 22 |
+
}
|
| 23 |
+
a {
|
| 24 |
+
color: white;
|
| 25 |
+
text-decoration: none;
|
| 26 |
+
padding: 0.5rem;
|
| 27 |
+
border-radius: 4px;
|
| 28 |
+
}
|
| 29 |
+
a:hover {
|
| 30 |
+
background-color: rgba(255,255,255,0.2);
|
| 31 |
+
}
|
| 32 |
+
</style>
|
| 33 |
+
<nav>
|
| 34 |
+
<div class="logo">TKQuest</div>
|
| 35 |
+
<ul>
|
| 36 |
+
<li><a href="/">Home</a></li>
|
| 37 |
+
<li><a href="/about.html">About</a></li>
|
| 38 |
+
</ul>
|
| 39 |
+
</nav>
|
| 40 |
+
`;
|
| 41 |
+
}
|
| 42 |
+
}
|
| 43 |
+
customElements.define('custom-navbar', CustomNavbar);
|
|
@@ -514,9 +514,9 @@
|
|
| 514 |
/* Firebase imports and initialization remain the same */
|
| 515 |
/* ... */
|
| 516 |
</script>
|
| 517 |
-
|
| 518 |
<!-- Main Application Script -->
|
| 519 |
<script src="script.js"></script>
|
| 520 |
-
<script src="
|
|
|
|
| 521 |
</body>
|
| 522 |
</html>
|
|
|
|
| 514 |
/* Firebase imports and initialization remain the same */
|
| 515 |
/* ... */
|
| 516 |
</script>
|
|
|
|
| 517 |
<!-- Main Application Script -->
|
| 518 |
<script src="script.js"></script>
|
| 519 |
+
<script src="components/navbar.js"></script>
|
| 520 |
+
<script src="components/footer.js"></script>
|
| 521 |
</body>
|
| 522 |
</html>
|
|
@@ -1,14 +1,13 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
const firebaseConfig = {
|
| 3 |
apiKey: "AIzaSyDKL-6WhEMKBEeWepYlYEMf3QiHwFNgkSk",
|
| 4 |
authDomain: "yonggi-students.firebaseapp.com",
|
| 5 |
projectId: "yonggi-students",
|
| 6 |
-
storageBucket: "yonggi-students.
|
| 7 |
messagingSenderId: "140729683331",
|
| 8 |
-
appId: "1:140729683331:web:4c644c61c01eea78e2bab6"
|
| 9 |
-
measurementId: "G-91792F11MH"
|
| 10 |
};
|
| 11 |
-
|
| 12 |
// Initialize Firebase
|
| 13 |
const app = firebase.initializeApp(firebaseConfig);
|
| 14 |
const auth = firebase.auth();
|
|
|
|
| 1 |
+
|
| 2 |
+
// Initialize Firebase
|
| 3 |
const firebaseConfig = {
|
| 4 |
apiKey: "AIzaSyDKL-6WhEMKBEeWepYlYEMf3QiHwFNgkSk",
|
| 5 |
authDomain: "yonggi-students.firebaseapp.com",
|
| 6 |
projectId: "yonggi-students",
|
| 7 |
+
storageBucket: "yonggi-students.appspot.com",
|
| 8 |
messagingSenderId: "140729683331",
|
| 9 |
+
appId: "1:140729683331:web:4c644c61c01eea78e2bab6"
|
|
|
|
| 10 |
};
|
|
|
|
| 11 |
// Initialize Firebase
|
| 12 |
const app = firebase.initializeApp(firebaseConfig);
|
| 13 |
const auth = firebase.auth();
|