-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
102 lines (87 loc) · 4.47 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
<!DOCTYPE html>
<html data-bs-theme="dark">
<head>
<title>Note Taking App</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@900&family=Nanum+Pen+Script&family=Open+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,300;1,400;1,500;1,600;1,700;1,800&display=swap" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Fontawesome CDN -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
<link rel="stylesheet" href="./styles.css">
</head>
<body class="bg-transparent m-0 p-0" style="-webkit-app-region: drag; height: 700px; width: 100vw; overflow: hidden; z-index:-1;">
<div class="rounded shadow-lg container p-4" data-bs-theme="dark" style="z-index: 1;">
<div class="row">
<div class="">
<div class="d-flex justify-content-between mb-2 px-3">
<h1 class=" text-center d-inline-flex display-5">Note Taking App</h1>
<!-- Bootstrap Theme Switcher -->
<div class="theme-switcher d-inline-flex my-2" style="-webkit-app-region: no-drag">
<button id="theme-switcher" class="btn">
<i class="fas fa-sun"></i>
</button>
</div>
</div>
<div class="border-0 crd" style="-webkit-app-region: no-drag">
<div class="card-body">
<form id="note-form">
<div class="form-group mb-2">
<!-- hidden input field to store note id -->
<input type="hidden" id="hidden-input">
<input type="text" id="note" class="form-control" placeholder="Enter Note">
</div>
<div class="form-group">
<textarea type="text" id="extra-note" class="form-control" placeholder="Enter Extra Note"></textarea>
</div>
<button type="submit" id="submit-button" class="btn btn-sm mt-3 btn-outline-primary">Add</button>
<button type="reset" id="reset-button" class="btn btn-sm mt-3 btn-outline-secondary">Reset</button>
<span id="date-time-created" class="text-muted d-inline-flex float-end mt-3"></span>
</form>
<!-- List of Notes -->
<ul id="note-list" class="list-group mt-5">
</ul>
</div>
</div>
<!-- Delete confirmation modal -->
<div class="modal fade " id="delete-modal" tabindex="-1" aria-labelledby="delete-modal-label" aria-hidden="true">
<div class="modal-dialog modal-md modal-fullscreen-sm-down">
<div class="modal-content">
<div class="modal-header bg-danger text-white">
<h5 class="modal-title" id="delete-modal-label">Delete Note</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Are you sure you want to delete this note?
</div>
<div class="modal-footer">
<button type="button" id="cancel-button-cnfr" class="btn btn-secondary" data-bs-dismiss="modal">No</button>
<button type="button" id="delete-button-cnfr" class="btn btn-danger">Yes</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<script src="./renderer.js"></script>
<script>
// Theme switcher code
const themeSwitcher = document.getElementById('theme-switcher');
themeSwitcher.addEventListener('click', () => {
const html = document.querySelector('html');
const container = document.querySelector('.container');
if (html.dataset.bsTheme === 'light' || container.dataset.bsTheme === 'light') {
html.dataset.bsTheme = 'dark';
container.dataset.bsTheme = 'dark';
themeSwitcher.innerHTML = '<i class="fas fa-moon"></i>';
} else {
html.dataset.bsTheme = 'light';
container.dataset.bsTheme = 'light';
themeSwitcher.innerHTML = '<i class="fas fa-sun"></i>';
}
});
</script>
</body>
</html>