-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubject.html
More file actions
272 lines (241 loc) · 10.3 KB
/
subject.html
File metadata and controls
272 lines (241 loc) · 10.3 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
<!DOCTYPE html>
<html lang="vi">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Slidify - Trình chiếu Slide</title>
<!-- Đã cập nhật đường dẫn file CSS -->
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/subject.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">
<link rel="icon" href="images/favicon.png" type="image/x-icon">
<!-- 1. Tích hợp CSS của Driver.js -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/driver.js@1.0.1/dist/driver.css"/>
<style>
/* CSS cho nút Help/Tour */
.tour-btn {
position: fixed;
bottom: 20px;
right: 20px;
background-color: #fff;
border: 1px solid #ddd;
color: #333;
width: 50px;
height: 50px;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
z-index: 999;
font-size: 24px;
transition: transform 0.2s, background-color 0.2s;
}
.tour-btn:hover {
transform: scale(1.1);
background-color: #f8f9fa;
}
/* Tùy chỉnh giao diện Popover của Driver.js */
.driver-popover.driverjs-theme {
background-color: #fff;
color: #333;
border-radius: 8px;
padding: 15px;
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.driver-popover.driverjs-theme .driver-popover-title {
font-size: 18px;
font-weight: 700;
margin-bottom: 8px;
color: #000;
}
.driver-popover.driverjs-theme .driver-popover-description {
font-size: 14px;
line-height: 1.5;
color: #555;
}
.driver-popover.driverjs-theme button {
background-color: #007bff; /* Màu chủ đạo */
color: #fff;
text-shadow: none;
border: none;
border-radius: 4px;
padding: 6px 12px;
}
</style>
</head>
<body>
<!-- === SIDEBAR CHÍNH (BÊN TRÁI) - CÓ HEADER VÀ NÚT ĐÓNG === -->
<nav id="left-sidebar" class="sidebar left-sidebar">
<div class="sidebar-header">
<div class="sidebar-logo-container">
<img src="images/logo.png" alt="Slidify Logo" class="logo">
</div>
<button id="close-left-sidebar-btn" class="close-sidebar-btn">
<i class="fas fa-times"></i>
</button>
</div>
<a href="index.html">Trang Chủ</a>
<a href="#">Giới Thiệu</a>
</nav>
<!-- === LỚP PHỦ (OVERLAY) === -->
<div id="overlay"></div>
<!-- Header của bạn sẽ được nạp vào đây -->
<header id="header-placeholder"></header>
<!-- 2. Nút kích hoạt lại Tour -->
<div class="tour-btn" id="restart-tour" title="Hướng dẫn sử dụng">❓</div>
<div class="main-container">
<!-- Khu vực hiển thị slide chính -->
<main class="slide-viewer">
<!-- BÊN TRONG thẻ <main class="slide-viewer"> -->
<!-- === KHU VỰC ĐIỀU KHIỂN SLIDE (TIÊU ĐỀ + ZOOM) === -->
<div class="slide-controls">
<h1 id="slide-title" style="text-align: center;"> </h1>
<div class="zoom-controls">
<button class="zoom-btn" data-zoom="0.25">25%</button>
<button class="zoom-btn" data-zoom="0.5">50%</button>
<button class="zoom-btn" data-zoom="0.75">75%</button>
<button class="zoom-btn active" data-zoom="1">100%</button>
</div>
</div>
<!-- === CONTAINER MỚI CHO ẢNH === -->
<div class="slide-image-container">
<img id="slide-image" src="" alt="Hình ảnh slide">
</div>
<!-- === CÁC NÚT ĐIỀU HƯỚNG TRƯỚC/SAU === -->
<div class="slide-nav-buttons">
<button id="prev-slide-btn" class="slide-nav-btn">
<i class="fas fa-arrow-left"></i> Trang trước
</button>
<button id="next-slide-btn" class="slide-nav-btn">
Trang sau <i class="fas fa-arrow-right"></i>
</button>
</div>
</main>
<!-- === NÚT BẤM MỚI - CHỈ HIỆN TRÊN MOBILE === -->
<button id="toggle-toc-btn" class="toggle-toc-btn">Hiện Mục lục khóa học</button>
<!-- Thanh mục lục bên phải -->
<!-- === SIDEBAR MỤC LỤC (BÊN PHẢI) - CÓ HEADER VÀ NÚT ĐÓNG === -->
<aside class="slide-sidebar">
<div class="sidebar-header">
<h2>Nội dung khóa học</h2>
<button id="close-right-sidebar-btn" class="close-sidebar-btn">
<i class="fas fa-times"></i>
</button>
</div>
<div id="slide-navigation-container">
<!-- Danh sách slide được tạo tự động -->
</div>
</aside>
</div>
<!-- Khu vực ghi chú và giải thích bên dưới (phần này vẫn là duy nhất cho index.html) -->
<section class="notes-section">
<!-- Cột 1: Ghi chú slide -->
<div id="notes-column" class="notes-content-column">
<h3 class="notes-heading">Dịch Slide</h3>
<p id="slide-notes-content"></p>
</div>
<!-- Cột 2: Thuật ngữ liên quan -->
<div id="terms-column" class="notes-content-column">
<h3 class="notes-heading">Giải thích Thuật Ngữ </h3>
<dl id="slide-terms-content"></dl>
</div>
</section>
<!-- Vùng chứa cho footer -->
<footer id="footer-placeholder"></footer>
<!-- Đã cập nhật đường dẫn các file JS -->
<script src="js/data.js"></script>
<script src="js/main.js"></script>
<script src="js/script.js"></script>
<!-- 3. Tích hợp Script của Driver.js -->
<script src="https://cdn.jsdelivr.net/npm/driver.js@1.0.1/dist/driver.js.iife.js"></script>
<script>
document.addEventListener('DOMContentLoaded', () => {
// Khởi tạo tour sau khi trang đã load xong
// Delay nhẹ 1s để đảm bảo ảnh và dữ liệu từ js/script.js đã render xong
setTimeout(() => {
initSubjectTour();
}, 1000);
});
function initSubjectTour() {
const driver = window.driver.js.driver;
const driverObj = driver({
showProgress: true,
animate: true,
doneBtnText: 'Đã hiểu',
nextBtnText: 'Tiếp theo',
prevBtnText: 'Quay lại',
popoverClass: 'driverjs-theme',
steps: [
{
element: '.slide-image-container',
popover: {
title: 'Màn hình chiếu',
description: 'Nội dung bài giảng sẽ hiển thị chính ở đây.',
side: "bottom",
align: 'center'
}
},
{
element: '.zoom-controls',
popover: {
title: 'Thu phóng',
description: 'Bạn có thể phóng to hoặc thu nhỏ slide để xem rõ hơn.',
side: "bottom",
align: 'center'
}
},
{
element: '.slide-nav-buttons',
popover: {
title: 'Điều hướng',
description: 'Sử dụng các nút này để chuyển slide. Bạn cũng có thể dùng phím mũi tên Trái/Phải trên bàn phím.',
side: "top",
align: 'center'
}
},
{
element: '.notes-section',
popover: {
title: 'Ghi chú & Thuật ngữ',
description: 'Bản dịch chi tiết và giải thích các thuật ngữ khó của slide hiện tại sẽ nằm ở đây.',
side: "top",
align: 'center'
}
},
{
element: '.slide-sidebar',
popover: {
title: 'Mục lục',
description: 'Danh sách toàn bộ các slide trong chương. Bấm vào tiêu đề để nhảy nhanh đến slide đó.',
side: "left",
align: 'center'
}
},
{
element: '#restart-tour',
popover: {
title: 'Hỗ trợ',
description: 'Bấm vào đây nếu bạn muốn xem lại hướng dẫn này.',
side: "left",
align: 'center'
}
}
]
});
// Logic tự động chạy lần đầu cho trang subject
// Dùng key khác với trang chủ để không bị trùng lặp
const hasSeenSubjectTour = localStorage.getItem('hasSeenSubjectTour');
if (!hasSeenSubjectTour) {
driverObj.drive();
localStorage.setItem('hasSeenSubjectTour', 'true');
}
// Gán sự kiện cho nút ?
document.getElementById('restart-tour').addEventListener('click', () => {
driverObj.drive();
});
}
</script>
</body>
</html>