-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlan_manager.html
More file actions
355 lines (304 loc) · 13.6 KB
/
Plan_manager.html
File metadata and controls
355 lines (304 loc) · 13.6 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
<!DOCTYPE html>
<html>
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Bootstrap CSS -->
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="plan_manager.css">
<link rel="icon" type="파비콘/png" href="image/파비콘.png">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<title>Plan-Manager</title>
<script>
function showCategory() {
// 모든 FAQ 섹션을 숨김
let sections = document.querySelectorAll('.faq-section');
sections.forEach(section => section.style.display = 'none');
// 선택된 카테고리의 FAQ 섹션을 표시
let selectedCategory = document.getElementById('category-select').value;
let selectedSection = document.getElementById(selectedCategory);
if (selectedSection) {
selectedSection.style.display = 'block';
}
}
// 페이지 로드 시 기본적으로 '일반' 카테고리 보이기
window.onload = function () {
showCategory();
};
function searchFAQ(category) {
let searchInput = document.getElementById(category + '-search').value.toLowerCase(); // 검색 입력값
let faqList = document.getElementById(category + '-list'); // 해당 분야의 FAQ 리스트
let faqItems = faqList.getElementsByClassName('faq-item'); // FAQ 항목들
// 각 FAQ 항목을 검색어와 비교
for (let i = 0; i < faqItems.length; i++) {
let itemText = faqItems[i].textContent || faqItems[i].innerText; // 질문과 답변 텍스트
if (itemText.toLowerCase().indexOf(searchInput) > -1) {
faqItems[i].style.display = ''; // 검색어가 포함된 항목은 보이게
} else {
faqItems[i].style.display = 'none'; // 검색어가 포함되지 않은 항목은 숨김
}
}
}
// 질문 옆 버튼 클릭 시 답변 토글
document.addEventListener('DOMContentLoaded', () => {
const toggleButtons = document.querySelectorAll('.toggle-btn');
toggleButtons.forEach(button => {
button.addEventListener('click', () => {
const faqItem = button.closest('.faq-item'); // 버튼이 포함된 FAQ 항목
const answer = faqItem.querySelector('.faq-answer'); // 해당 항목의 답변
if (answer.style.display === 'block') {
// 답변 숨기기
answer.style.display = 'none';
button.textContent = '+'; // 버튼 텍스트 변경
} else {
// 답변 보이기
answer.style.display = 'block';
button.textContent = '-'; // 버튼 텍스트 변경
}
});
});
});
const content = [
{ title: "공지사항 ", url: "events.html" },
{ title: "자료집", url: "resources.html" },
{ title: "FAQ 페이지", url: "FAQ_Board.html" },
{ title: "홈페이지", url: "index.html" },
{ title: "소모임 소개", url: "club.html" },
{ title: "운영국", url: "team/team_1.html" },
{ title: "홍보국", url: "team/team_2.html" },
{ title: "기획국", url: "team/team_3.html" },
{ title: "Plan_manager", url: "Plan_manager.html" },
];
function searchContent() {
const query = document.getElementById('search-bar').value.toLowerCase();
const resultsContainer = document.getElementById('search-results');
resultsContainer.innerHTML = '';
if (query.trim() === '') {
resultsContainer.style.display = 'none';
return;
}
const results = content.filter(item => item.title.toLowerCase().includes(query));
if (results.length > 0) {
resultsContainer.style.display = 'block';
resultsContainer.innerHTML = results.map(item =>
`<p><a href="${item.url}" style="text-decoration: none; color: black;">${item.title}</a></p>`
).join('');
} else {
resultsContainer.style.display = 'block';
resultsContainer.innerHTML = '<p>검색 결과가 없습니다.</p>';
}
// 3초 후 검색 결과 숨기기
setTimeout(() => {
resultsContainer.style.display = 'none';
}, 1000);
}
document.addEventListener('DOMContentLoaded', () => {
const searchBar = document.getElementById('search-bar');
searchBar.addEventListener('keydown', (event) => {
if (event.key === 'Enter') {
event.preventDefault(); // 기본 동작 방지
searchContent();
}
});
});
</script>
</head>
<body>
<!-- 헤더 -->
<header>
<div class="logo">
<a href="index.html"> <!-- 이미지를 링크로 감싸기 -->
<img src="image/광운대학교.png" alt="Kwangwoon University Logo">
</a>
<h1>컴퓨터정보공학부 학생회</h1>
</div>
<div class="search-container">
<input type="text" id="search-bar" placeholder="검색...">
<span class="search-icon" onclick="searchContent()">⌕</span>
<nav class="menu-links">
<a href="index.html">홈페이지</a>
<a href="resources.html">자료집</a>
<a href="events.html">공지사항</a>
<a href="FAQ_Board.html">FAQ</a>
</nav>
<div id="search-results"></div>
</div>
</header>
<!-- 사이드바 -->
<div class="side-bar">
<div class="links">
<ul>
<li><a href="login.html" style="color:white; text-decoration:none;">로그아웃</a></li>
<li><a href="index.html" style="color:white; text-decoration:none;">홈페이지</a></li>
<li><a href="resources.html" style="color:white; text-decoration:none;">자료집</a></li>
<li><a href="events.html" style="color:white; text-decoration:none;">공지사항</a></li>
<li><a href="club.html" style="color:white; text-decoration:none;">소모임 소개</a></li>
<li><a href="introduce_2.html" style="color:white; text-decoration:none;">학과 소개</a></li>
<li><a href="FAQ_Board.html" style="color:white; text-decoration:none;">FAQ</a></li>
<li><a href="Plan_manager.html" style="color:white; text-decoration:none;">Plan Manager</a></li>
</ul>
</div>
<div class="footer-links">
<a href="https://www.kw.ac.kr" target="_blank">광운대학교 홈페이지</a>
<a href="https://sw.kw.ac.kr" target="_blank">인융대 홈페이지</a>
</div>
</div>
<nav class="navbar bg-body-tertiary">
<div class="container">
<span class="navbar-brand mb-0 h1">
<i class="bi bi-card-checklist"></i>
나만의 Plan-Manager</span>
여러분만의 계획을 설정하고 완료 시 표시가 가능한 Planmanager입니다.<br>
각 계획마다 우선 순위를 부여할 수 있으므로 입력할 계획 옆에 체크박스로 표시한 후 계획을 등록하세요 !
</div>
</nav>
<div class="container">
<div class="d-flex align-items-center my-1"><!--Top, Botoom Margin is my-1-->>
<input type="text" class="form-control" id="plan-input" placeholder="Enter a plan here"><!-- 입력받는 곳-->
<div class="btn-group ms-2" role="group" aria-label="Priority selection"><!--우선순위 선택하는 곳-->
<input type="checkbox" class="btn-check" id="priority-high" autocomplete="off">
<label class="btn btn-outline-danger" for="priority-high">High</label>
<input type="checkbox" class="btn-check" id="priority-medium" autocomplete="off">
<label class="btn btn-outline-warning" for="priority-medium">Medium</label>
<input type="checkbox" class="btn-check" id="priority-low" autocomplete="off">
<label class="btn btn-outline-success" for="priority-low">Low</label>
</div>
<button type="button" id="add-btn" class="btn btn-primary ms-1 text-nowrap">
<i class="bi bi-plus"></i>
Add
</button>
</div>
<!--Todo, Done-->
<div class="d-flex">
<div class="flex-grow-1 rounded-2 p-2 me-1 w-50">
<h3>Plans</h3>
<div id="plan-list"></div>
</div>
<div class="flex-grow-1 rounded-2 p-2 w-50">
<h3>Done</h3>
<div id="done-list"></div>
</div>
</div>
<!-- 푸터 -->
<footer>
<div class="footer-left"></div>
<div class="footer-right">
<!-- 첫 번째 아이콘: 카카오톡 -->
<div class="icon-wrapper">
<a href="https://open.kakao.com/o/gDFOk91g" target="_blank">
<img src="image/메세지.png" alt="카카오톡 아이콘" class="footer-icon"
style="width: 60px; height: 50px; transition: transform 0.2s ease;">
</a>
<div class="tooltip">카카오톡 채팅방으로 이동합니다.</div>
</div>
<div class="icon-wrapper">
<a href="https://www.instagram.com/kw_cie/" target="_blank">
<img src="image/인스타그램.png" alt="인스타그램 아이콘" class="footer-icon"
style="width: 60px; height: 50px; transition: transform 0.2s ease;">
</a>
<div class="tooltip">인스타그램 페이지로 이동합니다.</div>
</div>
<!-- 텍스트 영역 -->
<div class="text">
<p>김재용(회장): 010-5651-4415</p>
<p>최우진(부회장): 010-4907-7802</p>
</div>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
<script>
/* JS Code */
const Type = { // Object
Todo: 1,
Done: 2,
};
const PriorityColors = {//우선순위 색상
High: "#FBB4AE",
Medium: "#FFFFCC",
Low: "#CCEBC5"
};
let plans = [];//저장된 plan을 담는 배열
function loadPlans() {
let lastPlans = localStorage.getItem("plans");
if (!lastPlans) return;
plans = JSON.parse(lastPlans);
plans.forEach(p => {
addToList(p);
});
}
function savePlans() {
localStorage.setItem("plans", JSON.stringify(plans));
}
//리스트에 계획 추가
function addToList(plan) {
let div = document.createElement("div");
div.className = "plan p-1 rounded-2 ps-2 d-flex align-items-center";
div.style.backgroundColor = plan.color;//우선순위에 맞춰서 배경색 설정
let span = document.createElement("span");
span.classList.add("me-auto");
span.textContent = plan.text;
div.appendChild(span);
if (plan.type === Type.Todo) {
//완료버튼 생성
let buttonDone = document.createElement("button");
buttonDone.classList.add("btn", "btn-sm", "btn-success", "me-1");
buttonDone.innerHTML = '<i class="bi bi-check"></i>';
div.appendChild(buttonDone);
//완료버튼 클릭 시, Done으로 이동
buttonDone.addEventListener("click", () => {
div.remove();//현재 항목을 Plans에서 제거
plan.type = Type.Done;//상태를 Done으로 변경
plans = plans.filter(p => p !== plan);//Plans 배열에서 제거
plans.push(plan);//Done 항목에 추가
savePlans();
addToList(plan);//Done 리스트에 추가
});
}
//삭제버튼 생성
let buttonRemove = document.createElement("button");
buttonRemove.classList.add("btn", "btn-sm", "btn-danger");
let iElem = document.createElement("i");
iElem.classList.add("bi", "bi-x");
buttonRemove.appendChild(iElem);
div.appendChild(buttonRemove);
//삭제버튼 클릭 시 발생하는 이벤트
buttonRemove.addEventListener("click", () => {
div.remove();//화면에서 제거
plans = plans.filter(p => p !== plan);//plans 배열에서 제거
savePlans();
});
//상태에 따라 Todo or Done 리스트에 추가
let list = document.querySelector(plan.type === Type.Todo ? "#plan-list" : "#done-list");
list.appendChild(div);
}
let addBtn = document.querySelector("#add-btn");
addBtn.addEventListener("click", () => {
let input = document.querySelector("#plan-input");
let text = input.value;
if (!text.length) return;
//우선순위 확인 및 색상 설정
let color = "";
if (document.querySelector("#priority-high").checked) color = PriorityColors.High;
else if (document.querySelector("#priority-medium").checked) color = PriorityColors.Medium;
else if (document.querySelector("#priority-low").checked) color = PriorityColors.Low;
let plan = {//새 계획 객체 생성
text: text,
color: color,
type: Type.Todo
};
plans.push(plan);
savePlans();
addToList(plan);
input.value = "";//입력 초기화
//우선순위 초기화
document.querySelectorAll(".btn-check").forEach(btn => btn.checked = false);
});
window.addEventListener("load", () => {
loadPlans();
});
</script>
</body>
</html>