-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
358 lines (279 loc) · 14.4 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/x-icon" href="/src/asset/favicon.ico">
<link rel="stylesheet" href="/main.css" />
<script defer src="https://kit.fontawesome.com/ba324e01bb.js" crossorigin="anonymous"></script>
<script defer src="https://cdnjs.cloudflare.com/ajax/libs/html2pdf.js/0.10.1/html2pdf.bundle.min.js" integrity="sha512-GsLlZN/3F2ErC5ifS5QtgpiJtWd43JWSuIgh7mbzZ8zBps+dvLusV+eNQATqgA/HdeKFVgA5v3S/cIrLF7QnIg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!-- <script type="module" src="./src/index.js"></script> -->
<script defer src="./dist/main.js"></script>
<title>Note app test</title>
</head>
<body ondragstart="return false;">
<div class="toolbar tool">
<section>
<div class="item-box" title="undo" id="undo"><i class="fa-solid fa-rotate-left icon"></i></div>
<div class="item-box" title="redo" id="redo"><i class="fa-solid fa-rotate-right icon"></i></div>
<!-- <div ><img style="transform: translate(0, 2px);" src="/src/asset/fly logo.svg" alt="fly" width="30px"></div> -->
</section>
<div class="s-line"></div>
<section>
<div class="item-box h1" title="heading" id="h1"><i class="fa-solid fa-h icon"></i></div>
<div class="item-box h3" title="heading 3" ><img src="/src/asset/h3.svg" id="h3" alt="h3-icon" width="20"></div>
<div class="item-box paragraph" title="paragraph" id="paragraph"><i class="fa-solid fa-p icon"></i></div>
</section>
<div class="s-line"></div>
<section>
<div class="item-box bold" title="bold" id="bold"><i class="fa-solid fa-bold icon"></i></div>
<div class="item-box italic" title="italic" id="italic"><i class="fa-solid fa-italic icon"></i></div>
</section>
<div class="s-line"></div>
<section>
<div class="item-box" title="align-left" id="align-left"><i class="fa-solid fa-align-left icon"></i></div>
<div class="item-box" title="align-center" id="align-center"><i class="fa-solid fa-align-center icon"></i></div>
<div class="item-box" title="align-right" id="align-right"><i class="fa-solid fa-align-right icon"></i></div>
<div class="item-box" title="align-full" id="align-full"><i class="fa-solid fa-align-justify icon"></i></div>
</section>
<div class="s-line"></div>
<section>
<div class="item-box" title="ul" id="ul"><i class="fa-solid fa-list-ul icon"></i></div>
<div class="item-box" title="ol" id="ol"><img src="/src/asset/ol.svg" alt="ol-icon" id="ol-icon" width="13.5"></div>
</section>
<div class="s-line"></div>
<section>
<div class="item-box" title="add link" id="link"><i class="fa-solid fa-link icon"></i></div>
<div class="item-box" title="add image" id="image"><i class="fa-regular fa-image icon"></i></div>
</section>
<div class="s-line"></div>
<section>
<div class="item-box" title="color" id="color"><img src="/src/asset/text-color.svg" alt="text-color" id="text-color" width="11"></div>
<div class="item-box" title="bg-color" id="bg-color"><img src="/src/asset/back-color.svg" alt="text-back-color" id="back-color" width="15"></div>
</section>
<div class="s-line"></div>
<section>
<div class="item-box" title="fullscreen" id="expand-container"><i id="expand" class="fa-solid fa-expand"></i></div>
</section>
</div>
<div class="grab-container">
<p class="grab-me">Drag me</p> <div class="triangle"></div>
</div>
<div class="side-tool tool" >
<section><div title="add card" class="item-box" id="btn"><img src="/src/asset/add-button.svg" id="add-btn" alt="add-button-icon" width="15"></div></section>
<section><div title="copy" class="item-box side-copy" ><i class="fa-solid side-copy fa-copy icon"></i></div></section>
<section><div title="delete" class="item-box side-delete"><i class="fa-solid side-delete fa-trash icon"></i></div></section>
<section><div title="setting" class="item-box" id="setting"><i class="fa-solid fa-gear icon"></i></div></section>
</div>
<div class="setting-container">
<div class="setting-modal">
<i class="fa-solid fa-xmark" id="close"></i>
<div class="setting-content-top">
<div class="profile">
<div class="profile-picture">
<img src="/src/asset/profile-pic.svg" id="profile" alt="profile" width="60">
</div>
<p><strong id="profile-name"></strong></p>
</div>
<div class="horizontal-line"></div>
</div>
<div class="setting-content-bot">
<p class="title">SETTING</p>
<div class="wrapper" id="to-pdf">
<i class="fa-solid fa-file-arrow-down"></i>
<p class="content" id="download-pdf">Download PDF <span class="loader-fix"><span class="loader"></span></span></p>
</div>
<div class="wrapper"><i class="fa-solid fa-moon"></i><p class="content">Dark mode</p>
<div class="switch"><div class="switch-button"></div></div>
</div>
<div class="wrapper">
<i class="fa-solid fa-address-book" style="font-size: 16px;"></i>
<p class="content" style="padding-left: 4px;transform: translateY(0);">Contact me</p>
</div>
<div class="wrapper" id="log-out" >
<i class="fa-solid fa-right-from-bracket"></i>
<p class="content" style="padding-left: 2px;">Log out</p>
</div>
</div>
</div>
</div>
<div class="add-link-pop">
<input type="text" class="input-link" id="input-link">
<button class="add-link-btn" id="add-link-btn">Add Link</button>
</div>
<div class="add-link-pop image">
<input type="text" class="input-link" id="input-image">
<button class="add-link-btn" id="add-image-btn">Add Image</button>
</div>
<div class="color-palette">
<div class="item-box color-item" style="background-color: #a5805e;" ></div>
<div class="item-box color-item" style="background-color: #688fad;" ></div>
<div class="item-box color-item" style="background-color: #68aa94;" ></div>
<div class="item-box color-item" style="background-color: #db9b1d;" ></div>
<div class="item-box color-item" style="background-color: #8e5555;" ></div>
<div class="item-box color-item" style="background-color: #4e6d89;" ></div>
<div class="item-box color-item" style="background-color: #5a9363;" ></div>
<div class="item-box color-item" style="background-color: #dd5845;" ></div>
<div class="item-box color-item" style="background-color: #ce8282;" ></div>
<div class="item-box color-item" style="background-color: #5baabc;" ></div>
<div class="item-box color-item" style="background-color: #6ed363;" ></div>
<div class="item-box color-item" style="background-color: #e1e54a;" ></div>
<div class="item-box color-item" data-clear="true">
<div class="hypen"></div>
</div>
<div ><input type="color" class="color-input" id="col-inp"></div>
</div>
<div class="color-palette-bg">
<div class="item-box color-item-bg" style="background-color: #a5805e;" ></div>
<div class="item-box color-item-bg" style="background-color: #688fad;" ></div>
<div class="item-box color-item-bg" style="background-color: #68aa94;" ></div>
<div class="item-box color-item-bg" style="background-color: #db9b1d;" ></div>
<div class="item-box color-item-bg" style="background-color: #8e5555;" ></div>
<div class="item-box color-item-bg" style="background-color: #4e6d89;" ></div>
<div class="item-box color-item-bg" style="background-color: #5a9363;" ></div>
<div class="item-box color-item-bg" style="background-color: #dd5845;" ></div>
<div class="item-box color-item-bg" style="background-color: #ce8282;" ></div>
<div class="item-box color-item-bg" style="background-color: #5baabc;" ></div>
<div class="item-box color-item-bg" style="background-color: #6ed363;" ></div>
<div class="item-box color-item-bg" style="background-color: #e1e54a;" ></div>
<div class="item-box color-item-bg" data-clear="true">
<div class="hypen"></div>
</div>
<div ><input type="color" class="color-input" id="col-inp-back"></div>
</div>
<div class="container" id="container">
<div class="box" style="left: 30%;top: 30%;width: 250px;" spellcheck="false">
<h1 style="text-align: center;">Welcome</h1>
<p style="text-align: center;">
Drag and drop + button to add card.
</p>
<hr class="hr">
<h3>Update: </h3>
<ul>
<li>Undo & redo</li>
<li>Download pdf (not supported in firefox)</li>
<li>Detect text style</li>
<li>Add link</li>
<li>Add image</li>
<li>Add lock, unlock, and unlock-all</li>
<li>Copy more than one</li>
<li>Add authentication</li>
<li>Save to cloud</li>
<li>Add room</li>
<li>Fix some bug</li>
</ul>
</div>
</div>
<div id="context-menu">
<div class="menu" id="copy">Copy <span>Ctrl + Shift + C</span></div>
<div class="menu" id="paste">Paste <span>Ctrl + Shift + V</span></div>
<div style="border-bottom: .5px solid #d4d4d4;margin: 8px 8px;"></div>
<div class="menu" id="delete">Delete <span>Delete</span></div>
<div class="menu" id="lock">Lock <span>Ctrl + L</span></div>
<div class="menu" id="unlock">Unlock <span></span></div>
</div>
<div id="document-context-menu">
<div class="document-menu" id="d-select-all">Select all <span>Ctrl + A</span></div>
<div class="document-menu" id="d-paste">Paste <span>Ctrl + Shift + V</span></div>
<div style="border-bottom: .5px solid #d4d4d4;margin: 8px 8px;"></div>
<div class="document-menu" id="save">Save <span id="triangle-save"></span><div>
<p>room 1</p>
<p>room 2</p>
<p>room 3</p>
<p>room 4</p>
</div></div>
<div class="document-menu" id="load">Load <span id="triangle-load"></span><div>
<p>room 1</p>
<p>room 2</p>
<p>room 3</p>
<p>room 4</p>
</div> </div>
<div id="load-hr" style="border-bottom: .5px solid #d4d4d4;margin: 8px 8px;"></div>
<div class="document-menu" id="context-undo">Undo <span>Ctrl + Z</span></div>
<div class="document-menu" id="context-redo">Redo <span>Ctrl + Y</span></div>
<div class="document-menu" id="unlock-all">Unlock-all <span>Ctrl + Shift + L</span></div>
</div>
<div id="select-drag"></div>
<!-- ########### script ########## -->
<script >
const container = document.getElementById("container");
const pName = document.getElementById("profile-name")
const pPicture = document.getElementById("profile")
const save = document.getElementById("save")
const load = document.getElementById("load")
const loadHr = document.getElementById("load-hr")
if (localStorage.getItem("container") != null) {
container.innerHTML = localStorage.getItem("container");
}
if (localStorage.getItem("username") != null) {
save.style.display = "block"
load.style.display = "block"
loadHr.style.display = "block"
pPicture.setAttribute("src", localStorage.getItem("photo-url"))
pName.innerHTML = localStorage.getItem("username")
pName.style.cursor = "default"
} else {
pPicture.setAttribute("src", "/src/asset/profile-pic.svg")
pName.innerHTML = "Sign In"
}
sessionStorage.setItem("before", "[]")
</script>
<!-- ========================================================================================= -->
<script defer type="module">
import { sendDb } from "./src/js/transferData.js"
import { signInWithPopup, GoogleAuthProvider, getAuth, signOut } from "https://www.gstatic.com/firebasejs/9.14.0/firebase-auth.js";
import { initializeApp } from "https://www.gstatic.com/firebasejs/9.14.0/firebase-app.js";
const firebaseConfig = {
apiKey: "AIzaSyBv6B0SK9i8RPaxEAl8xEvUGvB5sCKqYJE",
authDomain: "crested-century-358414.firebaseapp.com",
projectId: "crested-century-358414",
storageBucket: "crested-century-358414.appspot.com",
};
const provider = new GoogleAuthProvider();
const app = initializeApp(firebaseConfig);
const auth = getAuth(app);
function signIn() {
if (localStorage.getItem("username") != null) return
signInWithPopup(auth, provider)
.then((result) => {
const user = result.user;
sendDb(user.uid, user.displayName, container.innerHTML)
save.style.display = "block"
load.style.display = "block"
loadHr.style.display = "block"
localStorage.setItem("uid", user.uid)
localStorage.setItem("username", user.displayName)
localStorage.setItem("photo-url", user.photoURL)
pName.innerHTML = user.displayName
pName.style.cursor = "default"
pPicture.setAttribute("src", user.photoURL)
})
}
function logOut() {
signOut(auth).then(() => {
save.style.display = "none"
load.style.display = "none"
loadHr.style.display = "none"
localStorage.removeItem("username")
localStorage.removeItem("uid")
localStorage.removeItem("photo-url")
pName.innerHTML = "Sign In"
pName.style.cursor = "pointer"
if (localStorage.getItem("clicked") == "false") {
pPicture.setAttribute("src", "/src/asset/profile-dark.svg")
} else if (localStorage.getItem("clicked") == "true"){
pPicture.setAttribute("src", "/src/asset/profile-pic.svg")
}
})
}
const profileName = document.getElementById('profile-name')
profileName.addEventListener('click', signIn)
const out = document.getElementById('log-out')
out.addEventListener('click', logOut)
// if (localStorage.getItem("uid") != null) {
// setInterval(() => updateDb(localStorage.getItem("uid"), container.innerHTML), 1000 * 60)
// }
</script>
</body>
</html>