SolarumAsteridion commited on
Commit
77dec4f
·
verified ·
1 Parent(s): 56fd759

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +21 -13
index.html CHANGED
@@ -19,7 +19,6 @@
19
  * { margin: 0; padding: 0; box-sizing: border-box; }
20
 
21
  body {
22
- /* Added a slight radial gradient for depth */
23
  background: radial-gradient(circle at center, #161618 0%, #050506 100%);
24
  color: #fff;
25
  font-family: 'Space Grotesk', sans-serif;
@@ -28,7 +27,6 @@
28
  overflow-x: hidden;
29
  }
30
 
31
- /* Subtle dot overlay remains for texture */
32
  body::before {
33
  content: "";
34
  position: fixed;
@@ -77,7 +75,6 @@
77
  box-shadow: 0 0 20px var(--glow);
78
  }
79
 
80
- /* Grid with high spacing */
81
  .exams-grid {
82
  display: grid;
83
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
@@ -86,13 +83,11 @@
86
  perspective: 1000px;
87
  }
88
 
89
- /* 4x3 Rectangular Card */
90
  .brushed-plate {
91
  position: relative;
92
  background: rgba(13, 13, 15, 0.8);
93
  border: 1px solid var(--etch);
94
  padding: 45px;
95
- /* Smoother transition for a "lil bit" of movement */
96
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), border-color 0.3s, box-shadow 0.3s;
97
  cursor: pointer;
98
  aspect-ratio: 4 / 3;
@@ -108,7 +103,6 @@
108
  box-shadow: 0 15px 40px rgba(0,0,0,0.7), 0 0 10px var(--glow);
109
  }
110
 
111
- /* Flat content (No float) */
112
  .card-content {
113
  height: 100%;
114
  display: flex;
@@ -159,7 +153,6 @@
159
  }
160
  .del:hover { color: #ff4b2b; }
161
 
162
- /* Modals */
163
  .modal {
164
  display: none; position: fixed; inset: 0;
165
  background: rgba(0,0,0,0.95); z-index: 100;
@@ -245,6 +238,23 @@
245
  onValue(examsRef, (snapshot) => {
246
  const data = snapshot.val();
247
  dataStore = data ? Object.entries(data).map(([id, v]) => ({ id, ...v })) : [];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
248
  render();
249
  });
250
 
@@ -255,8 +265,9 @@
255
  const target = new Date(e.date); target.setHours(0,0,0,0);
256
  const diff = Math.ceil((target - now) / 86400000);
257
 
258
- let val = diff < 0 ? 'OK' : diff;
259
- let label = diff < 0 ? 'MISSION_COMPLETE' : (diff === 1 ? 'CYCLE_REMAINING' : 'CYCLES_REMAINING');
 
260
 
261
  return `
262
  <div class="brushed-plate" onmousemove="tilt(event, this)" onmouseleave="resetTilt(this)" onclick="showSyll('${e.id}')">
@@ -273,18 +284,14 @@
273
  }).join('');
274
  }
275
 
276
- // --- SUBTLE Tilt Logic ---
277
  window.tilt = (e, card) => {
278
  const rect = card.getBoundingClientRect();
279
  const x = e.clientX - rect.left;
280
  const y = e.clientY - rect.top;
281
  const centerX = rect.width / 2;
282
  const centerY = rect.height / 2;
283
-
284
- // Increased divisor (50 instead of 15) for very minimal movement
285
  const rotateX = (y - centerY) / 50;
286
  const rotateY = (centerX - x) / 50;
287
-
288
  card.style.transform = `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;
289
  };
290
 
@@ -296,6 +303,7 @@
296
 
297
  window.showSyll = (id) => {
298
  const e = dataStore.find(x => x.id === id);
 
299
  document.getElementById('syllTitle').innerText = `NODE_STREAM: ${e.name}`;
300
  document.getElementById('syllArea').value = e.syllabus || '';
301
  document.getElementById('syllId').value = id;
 
19
  * { margin: 0; padding: 0; box-sizing: border-box; }
20
 
21
  body {
 
22
  background: radial-gradient(circle at center, #161618 0%, #050506 100%);
23
  color: #fff;
24
  font-family: 'Space Grotesk', sans-serif;
 
27
  overflow-x: hidden;
28
  }
29
 
 
30
  body::before {
31
  content: "";
32
  position: fixed;
 
75
  box-shadow: 0 0 20px var(--glow);
76
  }
77
 
 
78
  .exams-grid {
79
  display: grid;
80
  grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
 
83
  perspective: 1000px;
84
  }
85
 
 
86
  .brushed-plate {
87
  position: relative;
88
  background: rgba(13, 13, 15, 0.8);
89
  border: 1px solid var(--etch);
90
  padding: 45px;
 
91
  transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), border-color 0.3s, box-shadow 0.3s;
92
  cursor: pointer;
93
  aspect-ratio: 4 / 3;
 
103
  box-shadow: 0 15px 40px rgba(0,0,0,0.7), 0 0 10px var(--glow);
104
  }
105
 
 
106
  .card-content {
107
  height: 100%;
108
  display: flex;
 
153
  }
154
  .del:hover { color: #ff4b2b; }
155
 
 
156
  .modal {
157
  display: none; position: fixed; inset: 0;
158
  background: rgba(0,0,0,0.95); z-index: 100;
 
238
  onValue(examsRef, (snapshot) => {
239
  const data = snapshot.val();
240
  dataStore = data ? Object.entries(data).map(([id, v]) => ({ id, ...v })) : [];
241
+
242
+ // --- AUTO DELETE LOGIC START ---
243
+ const today = new Date();
244
+ today.setHours(0,0,0,0); // Normalize 'today' to midnight
245
+
246
+ dataStore.forEach(exam => {
247
+ const examDate = new Date(exam.date);
248
+ examDate.setHours(0,0,0,0); // Normalize exam date to midnight
249
+
250
+ // If exam date is strictly LESS than today (meaning yesterday or older)
251
+ if (examDate.getTime() < today.getTime()) {
252
+ console.log(`Auto-deleting expired node: ${exam.name}`);
253
+ remove(ref(database, `exams/${exam.id}`));
254
+ }
255
+ });
256
+ // --- AUTO DELETE LOGIC END ---
257
+
258
  render();
259
  });
260
 
 
265
  const target = new Date(e.date); target.setHours(0,0,0,0);
266
  const diff = Math.ceil((target - now) / 86400000);
267
 
268
+ // Since auto-delete removes negatives, we just handle 0 (Today) and positives
269
+ let val = diff === 0 ? 'NOW' : diff;
270
+ let label = diff === 0 ? 'CRITICAL_EVENT' : (diff === 1 ? 'CYCLE_REMAINING' : 'CYCLES_REMAINING');
271
 
272
  return `
273
  <div class="brushed-plate" onmousemove="tilt(event, this)" onmouseleave="resetTilt(this)" onclick="showSyll('${e.id}')">
 
284
  }).join('');
285
  }
286
 
 
287
  window.tilt = (e, card) => {
288
  const rect = card.getBoundingClientRect();
289
  const x = e.clientX - rect.left;
290
  const y = e.clientY - rect.top;
291
  const centerX = rect.width / 2;
292
  const centerY = rect.height / 2;
 
 
293
  const rotateX = (y - centerY) / 50;
294
  const rotateY = (centerX - x) / 50;
 
295
  card.style.transform = `rotateX(${rotateX}deg) rotateY(${rotateY}deg)`;
296
  };
297
 
 
303
 
304
  window.showSyll = (id) => {
305
  const e = dataStore.find(x => x.id === id);
306
+ if (!e) return; // Prevent error if item was just auto-deleted
307
  document.getElementById('syllTitle').innerText = `NODE_STREAM: ${e.name}`;
308
  document.getElementById('syllArea').value = e.syllabus || '';
309
  document.getElementById('syllId').value = id;