-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
235 lines (223 loc) ยท 7.47 KB
/
index.html
File metadata and controls
235 lines (223 loc) ยท 7.47 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Love Calculator โค๏ธ โ Calculate your love</title>
<meta name="description" content="A fun and romantic Love Calculator web app that calculates love score based on names.">
<meta name="keywords" content="Love Calculator, love score, What is love โค?, Love quotes, What is love in a relationship, Love romance, Best definition of love, Love you, I love you, love calculator, love calculator name, love calculator prank, love calculator by name and date of birth, calculated love meaning, calculator love test, calculator love test games, love test, love tester, love test quiz, love tester online, love test name, love test game, love test app, love test calculator, love tester free romantic app, name match, HTML CSS JavaScript">
<meta name="author" content="All Bayjid Bishwash (Bogglo)">
<meta property="og:title" content="Love Calculator โค๏ธ โ Calculate your love">
<meta property="og:description" content="Playful web app to calculate love score based on names.">
<meta property="og:image" content="images/screenshot.jpg">
<meta property="og:url" content="https://bogglo.github.io/">
<meta name="twitter:card" content="summary_large_image">
<link rel="icon" type="image/png" href="images/favicon.png">
<style>
body {
margin: 0;
padding: 0;
font-family: Arial, sans-serif;
color: white;
text-align: center;
overflow: hidden;
background: linear-gradient(120deg, #ff758c, #ff7eb3);
}
h1 {
margin-top: 20px;
font-size: 2em;
}
.container {
background: rgba(255, 255, 255, 0.15);
padding: 20px;
border-radius: 15px;
max-width: 400px;
margin: auto;
box-shadow: 0 0 20px rgba(255,255,255,0.2);
position: relative;
z-index: 2;
}
label {
display: block;
margin-bottom: 4px;
text-align: left;
margin-left: 5%;
color: #fff;
font-weight: 600;
letter-spacing: 0.5px;
}
input {
width: 90%;
padding: 12px;
margin: 8px 0;
border: none;
border-radius: 10px;
font-size: 18px;
outline: none;
color: #222;
background: rgba(255,255,255,0.90);
}
input:focus {
background: #fff;
box-shadow: 0 0 0 2px #ff758c88;
}
button {
padding: 12px 20px;
margin-top: 10px;
font-size: 18px;
border: none;
background: #b10030; /* Higher contrast */
color: #fff;
border-radius: 10px;
cursor: pointer;
transition: 0.3s;
width: 90%;
font-weight: 700;
box-shadow: 0 2px 8px rgba(0,0,0,0.07);
letter-spacing: 0.5px;
}
button:hover, button:focus {
background: #7a0020;
outline: 2px solid #fff;
outline-offset: 2px;
}
.result {
margin-top: 20px;
font-size: 1.4em;
font-weight: bold;
min-height: 40px;
transition: transform 0.3s ease-in-out;
color: #fff;
text-shadow: 0 1px 4px #b10030a0;
}
.result.animate {
transform: scale(1.2);
}
.heart {
font-size: 40px;
animation: heartbeat 1s infinite;
filter: drop-shadow(0 1px 4px #b1003080);
}
@keyframes heartbeat {
0% { transform: scale(1); }
25% { transform: scale(1.2); }
50% { transform: scale(1); }
75% { transform: scale(1.2); }
100% { transform: scale(1); }
}
.floating-heart {
position: absolute;
color: rgba(255, 255, 255, 0.8);
animation: floatUp linear infinite;
font-size: 20px;
z-index: 1;
user-select: none;
pointer-events: none;
}
@keyframes floatUp {
0% { transform: translateY(100vh) scale(0.5); opacity: 1; }
100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}
/* Footer styles and animation */
.footer-link {
position: fixed;
bottom: 10px;
width: 100%;
text-align: center;
font-size: 14px;
z-index: 10;
pointer-events: none;
}
.footer-link a {
color: #fff;
text-decoration: none;
padding: 8px 16px;
background: rgba(255, 255, 255, 0.2);
border-radius: 20px;
animation: pulse 2s infinite;
transition: background 0.3s;
pointer-events: auto;
}
.footer-link a:hover, .footer-link a:focus {
background: rgba(255, 255, 255, 0.4);
outline: 2px solid #fff;
outline-offset: 2px;
}
@keyframes pulse {
0% { transform: scale(1); opacity: 0.8; }
50% { transform: scale(1.1); opacity: 1; }
100% { transform: scale(1); opacity: 0.8; }
}
/* For better accessibility, allow keyboard navigation for button and links */
button:focus, a:focus {
outline: 2px solid #fff;
outline-offset: 2px;
}
</style>
</head>
<body>
<h1>โค๏ธ Love Calculator โค๏ธ</h1>
<div class="container">
<label for="name1">Your Name:</label>
<input type="text" id="name1" placeholder="Enter your name" autocomplete="off" aria-label="Your name">
<label for="name2">Partner's Name:</label>
<input type="text" id="name2" placeholder="Enter your partner's name" autocomplete="off" aria-label="Partner's name">
<button onclick="calculateLove()" id="calculateBtn" aria-label="Calculate love score">Calculate</button>
<div class="result" id="result" aria-live="polite"></div>
<div class="heart" aria-hidden="true">๐</div>
</div>
<script>
// Floating hearts background
function createHearts() {
const heart = document.createElement('div');
heart.classList.add('floating-heart');
heart.style.left = Math.random() * 100 + 'vw';
heart.style.animationDuration = (Math.random() * 3 + 3) + 's';
heart.innerHTML = 'โค๏ธ';
document.body.appendChild(heart);
setTimeout(() => heart.remove(), 6000);
}
setInterval(createHearts, 300);
// Love calculation logic
function nameToNumber(str) {
let sum = 0;
for (let i = 0; i < str.length; i++) {
sum += str.charCodeAt(i);
}
return sum;
}
function calculateLove() {
const name1 = document.getElementById("name1").value.trim().toLowerCase();
const name2 = document.getElementById("name2").value.trim().toLowerCase();
const result = document.getElementById("result");
if (name1 === "" || name2 === "") {
result.innerHTML = "Please enter both names! ๐";
return;
}
let fixedValue = (nameToNumber(name1 + name2) % 101);
let currentValue = 0;
let interval = setInterval(() => {
currentValue++;
result.classList.add("animate");
result.innerHTML = `๐ Love Score: ${currentValue}%`;
setTimeout(() => result.classList.remove("animate"), 200);
if (currentValue >= fixedValue) {
clearInterval(interval);
result.innerHTML = `๐ Love Score between ${name1} & ${name2} is ${fixedValue}% โค๏ธ`;
}
}, 30);
}
// Keyboard accessibility: Enter key triggers calculation
document.getElementById("name2").addEventListener("keypress", function(event) {
if (event.key === "Enter") {
event.preventDefault();
document.getElementById("calculateBtn").click();
}
});
</script>
<!-- Footer with animated link -->
<footer class="footer-link">
<a href="https://bogglo.github.io/memory-game/" target="_blank" rel="noopener">๐ฎ Play Memory Game</a>
</footer>
</body>
</html>