-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfavorite.html
More file actions
216 lines (198 loc) · 7.36 KB
/
favorite.html
File metadata and controls
216 lines (198 loc) · 7.36 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Favorite Quotes</title>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<style>
body, html {
height: 100%;
margin: 0;
font-family: Arial, Helvetica, sans-serif;
overflow-x: hidden;
}
#quolit{
color: aliceblue
}
#align{
text-align: center;
font-size: xxx-large;
background-color: rgb(74, 104, 135);
backdrop-filter: blur(10px);
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
margin-bottom: 50px;
border-radius: 10px;
color: rgb(252, 253, 255);
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}
.card{
border-radius: 20px;
background-color: rgba(225, 225, 225, 0.8)
}
#btn{
border-radius: 20px;
}
#bg {
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: -1;
background: linear-gradient(45deg, #01F596, #00D7BC,#00BDDC);
background-size: 300% 300%;
animation: gradientAnimation 8s ease infinite;
background-repeat: no-repeat;
}
@keyframes gradientAnimation {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
#nav {
font-size: x-large;
background: linear-gradient(45deg, #34495e, #2c3e50);
color: white;
padding: 10px 0;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease-in-out;
}
#nav .nav-link {
color: #ecf0f1;
margin: 0 15px;
font-weight: 500;
letter-spacing: 1px;
text-transform: uppercase;
transition: color 0.3s ease, transform 0.3s ease;
}
#nav .nav-link:hover {
color: #f1c40f;
transform: scale(1.04);
}
#nav .navbar-toggler-icon {
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(255, 255, 255, 0.7)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='3' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}
#nav .dropdown-menu {
background: rgba(44, 62, 80, 0.9);
border: none;
border-radius: 10px;
}
#nav .dropdown-menu .dropdown-item {
color: #ecf0f1;
transition: background 0.3s, color 0.3s;
}
#nav .dropdown-menu .dropdown-item:hover {
background: #f1c40f;
color: #2c3e50;
}
#nav .badge-danger {
background-color: #e74c3c;
font-size: 0.8rem;
margin-left: 5px;
}
#nav img:hover {
transform: scale(1.1);
transition: transform 0.3s ease-in-out;
}
@keyframes popIn {
0% {
opacity: 0;
transform: scale(0.8);
}
100% {
opacity: 1;
transform: scale(1);
}
}
.pop-in {
animation: popIn 1.5s ease forwards;
}
.card:hover{
transform:scale(1.05);
}
.card{
transition: all .45s ease;
}
</style>
</head>
<body class="d-flex flex-column min-vh-100" id="bg">
<nav class="navbar navbar-expand-sm fixed-top" id="nav">
<div class="container-fluid">
<div class="d-flex align-items-center">
<a href="main.html"><img src="data/logo1.png" alt="Logo" style="height: 40px; border-radius: 10px; width: 100px;"></a>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavCenter">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse justify-content-end" id="navbarNavCenter">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link" href="index.html" id="quolit">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" href="favorite.html" target="_blank" id="quolit">Favorite</a>
</li>
<li class="nav-item">
<a class="nav-link" href="main.html" target="_blank" id="quolit">Quolit</a>
</li>
</ul>
</div>
<div class="navbar-collapse justify-content-end" id="navbarNavRight">
<ul class="navbar-nav">
<li class="nav-item">
<div class="btn-group dropleft notifications d-none d-md-block" style="margin-top: 5px;">
<button type="button" class="btn btn-warning dropdown-toggle" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" onclick="generateRandomQuotes()">
Notifications <span class="badge badge-danger">3</span>
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton" id="quoteDropdown">
</div>
</div>
</li>
</ul>
</div>
</div>
</nav>
<br><br>
<div class="container mt-5">
<h1 class="text-center mb-5" id="align">Your Favorite Quotes</h1>
<div id="favorite-quotes-container" class="row">
</div>
<script>
let favQuotes = JSON.parse(localStorage.getItem('favQuotes')) || [];
let container = document.getElementById('favorite-quotes-container');
function removeQuote(index) {
favQuotes.splice(index, 1);
localStorage.setItem('favQuotes', JSON.stringify(favQuotes));
renderQuotes();
}
function renderQuotes() {
container.innerHTML = ''; // Clear the container
favQuotes.forEach((quote, index) => {
let quoteDiv = document.createElement('div');
quoteDiv.classList.add('col-md-6', 'mb-4' , 'pop-in');
let quoteCard = `
<div class="card">
<div class="card-body">
<p class="card-text">${quote}</p>
<button class="btn btn-danger" id="btn" onclick="removeQuote(${index})">Remove</button>
</div>
</div>
`;
quoteDiv.innerHTML = quoteCard;
container.appendChild(quoteDiv);
});
}
renderQuotes();
</script>
<script src="main.js"></script>
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</body>
</html>