-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
515 lines (446 loc) · 16.4 KB
/
index.html
File metadata and controls
515 lines (446 loc) · 16.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AllOfUs - 대시보드</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
-webkit-font-smoothing: antialiased;
}
.header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 20px 40px;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20px);
margin-bottom: 30px;
border-radius: 20px;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}
.logo {
font-size: 28px;
font-weight: 600;
background: linear-gradient(135deg, #667eea, #764ba2);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.school-name {
font-size: 18px;
color: #666;
font-weight: 500;
}
.header-right {
display: flex;
gap: 12px;
align-items: center;
}
.header-btn {
padding: 10px 24px;
background: white;
border: 2px solid #e0e0e0;
border-radius: 12px;
cursor: pointer;
font-size: 14px;
font-weight: 500;
color: #333;
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
text-decoration: none;
display: inline-block;
border: none;
}
.header-btn:hover {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
border-color: transparent;
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}
.container {
max-width: 1400px;
margin: 0 auto;
}
.welcome-section {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20px);
border-radius: 24px;
padding: 50px;
margin-bottom: 30px;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}
.welcome-text {
font-size: 48px;
font-weight: 600;
color: #1d1d1f;
line-height: 1.3;
margin-bottom: 15px;
}
.welcome-text .highlight {
background: linear-gradient(135deg, #667eea, #764ba2);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.date-text {
font-size: 24px;
color: #666;
font-weight: 500;
}
.cards-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 20px;
}
.card {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(20px);
border-radius: 24px;
padding: 40px;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
border: 2px solid rgba(255, 255, 255, 0.5);
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
position: relative;
overflow: hidden;
cursor: pointer;
min-height: 280px;
display: flex;
flex-direction: column;
justify-content: space-between;
text-decoration: none;
}
.card::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
opacity: 0;
transition: opacity 0.4s ease;
}
.card:hover::before {
opacity: 1;
}
.card:hover {
transform: translateY(-8px);
box-shadow: 0 20px 60px rgba(102, 126, 234, 0.3);
border-color: rgba(102, 126, 234, 0.3);
}
.card-icon {
width: 60px;
height: 60px;
border-radius: 16px;
display: flex;
align-items: center;
justify-content: center;
font-size: 28px;
margin-bottom: 20px;
transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.card:hover .card-icon {
transform: scale(1.1) rotate(5deg);
}
.card-content {
position: relative;
z-index: 1;
}
.card-title {
font-size: 28px;
font-weight: 600;
color: #1d1d1f;
margin-bottom: 12px;
letter-spacing: -0.5px;
}
.card-subtitle {
font-size: 15px;
color: #86868b;
line-height: 1.5;
}
.card-footer {
display: flex;
align-items: center;
gap: 8px;
color: #667eea;
font-weight: 500;
font-size: 14px;
position: relative;
z-index: 1;
margin-top: 20px;
}
.card-footer::after {
content: '→';
transition: transform 0.3s ease;
}
.card:hover .card-footer::after {
transform: translateX(5px);
}
/* 각 카드별 색상 */
.card-seat .card-icon {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
}
.card-room .card-icon {
background: linear-gradient(135deg, #f093fb, #f5576c);
color: white;
}
.card-schedule .card-icon {
background: linear-gradient(135deg, #4facfe, #00f2fe);
color: white;
}
.card-study .card-icon {
background: linear-gradient(135deg, #43e97b, #38f9d7);
color: white;
}
.special-card {
position: relative;
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
}
.special-card .card-title,
.special-card .card-subtitle {
color: white;
}
.special-card .card-footer {
color: white;
}
.special-card::after {
content: '';
position: absolute;
top: -50%;
right: -50%;
width: 200%;
height: 200%;
background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { transform: scale(1); opacity: 0.5; }
50% { transform: scale(1.1); opacity: 0.8; }
}
.badge {
display: inline-block;
padding: 4px 12px;
background: rgba(102, 126, 234, 0.1);
color: #667eea;
border-radius: 20px;
font-size: 12px;
font-weight: 600;
margin-bottom: 12px;
}
.special-card .badge {
background: rgba(255, 255, 255, 0.2);
color: white;
}
@media (max-width: 1024px) {
.cards-grid {
grid-template-columns: 1fr;
}
}
@media (max-width: 768px) {
.header {
flex-direction: column;
gap: 15px;
text-align: center;
}
.welcome-section {
padding: 30px;
}
.welcome-text {
font-size: 32px;
}
.date-text {
font-size: 18px;
}
.card {
padding: 30px;
min-height: 240px;
}
.card-title {
font-size: 24px;
}
}
/* 로딩 애니메이션 */
.card {
animation: fadeInUp 0.6s ease-out backwards;
}
.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
</style>
</head>
<body>
<div class="header">
<div class="logo">AllOfUs</div>
<div class="school-name">경희고등학교</div>
<div class="header-right">
<a href="my-reservations.html" class="header-btn">최근기록</a>
<a href="login.html" class="header-btn" id="auth-link">로그인</a>
</div>
</div>
<div class="container">
<div class="welcome-section">
<h1 class="welcome-text" id="welcome-title">
요즘 학생들의<br>
<span class="highlight">필수템.</span>
</h1>
<p class="date-text" id="date-display">오늘은 11월 7일</p>
</div>
<div class="cards-grid">
<!-- 청운재 좌석 예약 -->
<div class="card card-seat" onclick="handleNavigation('bc.html')">
<div class="card-content">
<div class="card-icon">🎫</div>
<span class="badge">NEW</span>
<h2 class="card-title">청운재 좌석 예약</h2>
<p class="card-subtitle" id="seat-subtitle">로그인 해주세요.</p>
</div>
<div class="card-footer">지금 예약하기</div>
</div>
<!-- 교실 대여 -->
<div class="card card-room" onclick="handleNavigation('class.html')">
<div class="card-content">
<div class="card-icon">🏫</div>
<span class="badge">POPULAR</span>
<h2 class="card-title">교실 대여</h2>
<p class="card-subtitle" id="room-subtitle">로그인 해주세요.</p>
</div>
<div class="card-footer">예약 가능 교실 보기</div>
</div>
<!-- 수행평가 일정 -->
<div class="card card-schedule" onclick="handleNavigation('sh.html')">
<div class="card-content">
<div class="card-icon">📅</div>
<span class="badge">ESSENTIAL</span>
<h2 class="card-title">수행평가 일정</h2>
<p class="card-subtitle" id="assignment-subtitle">로그인 해주세요.</p>
</div>
<div class="card-footer">일정 확인하기</div>
</div>
<!-- 학습 계획 나누기 -->
<div class="card card-study special-card" onclick="handleNavigation('study.html')">
<div class="card-content">
<div class="card-icon">✨</div>
<span class="badge">HOT</span>
<h2 class="card-title">학습 계획 나누기</h2>
<p class="card-subtitle">친구들과 함께 효율적으로 공부하세요</p>
</div>
<div class="card-footer">계획 만들기</div>
</div>
</div>
</div>
<script type="module">
// Firebase 모듈 임포트
import { initializeApp, getApps } from "https://www.gstatic.com/firebasejs/9.0.0/firebase-app.js";
import { getAuth, onAuthStateChanged, signOut } from "https://www.gstatic.com/firebasejs/9.0.0/firebase-auth.js";
import { getDatabase, ref, get } from "https://www.gstatic.com/firebasejs/9.0.0/firebase-database.js";
// Firebase 설정
const firebaseConfig = {
apiKey: "AIzaSyD1HNrS-TcAUvmJvWJYowzIPbyIC1_sMjg",
authDomain: "hack-7974a.firebaseapp.com",
projectId: "hack-7974a",
storageBucket: "hack-7974a.firebasestorage.app",
messagingSenderId: "831807416935",
appId: "1:831807416935:web:461949fd6baa1510e042c2",
measurementId: "G-DKMJZBKLG2"
};
// Firebase 초기화
const app = getApps().length ? getApps()[0] : initializeApp(firebaseConfig);
const auth = getAuth(app);
const database = getDatabase(app);
let currentUser = null;
// 로그아웃 기능
function logout() {
signOut(auth).then(() => {
console.log("로그아웃 성공");
}).catch((error) => {
console.error("로그아웃 실패:", error);
});
}
// 사용자 데이터 로드
async function loadUserData(user) {
const userRef = ref(database, user.uid + '/username');
const snapshot = await get(userRef);
const welcomeTitle = document.getElementById('welcome-title');
if (snapshot.exists()) {
const username = snapshot.val();
welcomeTitle.innerHTML = `<span class="highlight">${username}</span>님,<br>학생들의<br>필수템,`;
} else {
welcomeTitle.innerHTML = `요즘 학생들의<br><span class="highlight">필수템,</span>`;
}
}
// 페이지 네비게이션 처리
window.handleNavigation = function(page) {
if (!currentUser) {
alert('로그인이 필요한 서비스입니다.\n로그인 페이지로 이동합니다.');
window.location.href = 'login.html';
return;
}
window.location.href = page;
};
// 동적 날짜 표시
(function updateDate() {
const today = new Date();
const month = today.getMonth() + 1;
const date = today.getDate();
const days = ['일요일', '월요일', '화요일', '수요일', '목요일', '금요일', '토요일'];
const dayName = days[today.getDay()];
document.getElementById('date-display').textContent =
`오늘은 ${month}월 ${date}일 ${dayName}`;
})();
// 인증 상태 감지 및 UI 업데이트
onAuthStateChanged(auth, (user) => {
currentUser = user;
const authLink = document.getElementById('auth-link');
const seatSubtitle = document.getElementById('seat-subtitle');
const roomSubtitle = document.getElementById('room-subtitle');
const assignmentSubtitle = document.getElementById('assignment-subtitle');
if (user) {
console.log("로그인 상태:", user.email);
loadUserData(user);
authLink.textContent = "로그아웃";
authLink.removeAttribute('href');
authLink.style.cursor = 'pointer';
authLink.onclick = logout;
seatSubtitle.textContent = "원하는 좌석을 미리 선택하고 편하게 즐기세요";
roomSubtitle.textContent = "동아리방, 세미나실 등 다양한 공간을 예약하세요";
assignmentSubtitle.textContent = "다가오는 수행평가를 한눈에 확인하세요";
} else {
console.log("로그아웃 상태");
currentUser = null;
authLink.textContent = "로그인";
authLink.setAttribute('href', 'login.html');
authLink.style.cursor = '';
authLink.onclick = null;
seatSubtitle.textContent = "로그인하고 청운재 좌석을 예약하세요";
roomSubtitle.textContent = "로그인하고 교실 예약 서비스를 이용하세요";
assignmentSubtitle.textContent = "로그인하고 나만의 학습 일정을 관리하세요";
document.getElementById('welcome-title').innerHTML =
'요즘 학생들의<br><span class="highlight">필수템.</span>';
}
});
</script>
</body>
</html>