-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathValentines.html
117 lines (101 loc) · 3.5 KB
/
Valentines.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
<!DOCTYPE html>
<html>
<head>
<style>
html, body {
background: white;
height: 100vh;
width: 100vw;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
padding: 0;
margin: 0;
overflow: hidden;
}
.main-app {
position: relative;
background: rgba(233, 151, 253, 0.95);
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
height: 100%;
width: 100%;
}
.cute-text {
margin: 20px;
position: relative;
background: transparent;
display: flex;
justify-content: center;
align-items: center;
text-align: center;
font-weight: 600;
font-size: 2rem;
color: rgba(255,255,255,0.9);
font-family: 'Courier New', Courier, monospace;
}
.bholder input {
appearance: none;
border: none;
padding: 25px;
font-size: 24px;
border-radius: 12px;
color: white;
transition: all 0.4s ease-in;
font-family: 'Courier New', Courier, monospace;
}
#tak {
background: rgba(80,210,100,0.8);
}
#nie {
background: rgba(250,80,100,0.4);
}
#nie:hover {
background: rgba(250,80,100,0.9);
transform: scale(0.5);
}
#tak:hover {
background: rgba(80,210,100,0.8);
transform: scale(2);
}
</style>
</head>
<body>
<div class="main-app">
<div class="cute-text">will u be my valentine?</div>
<div class="bholder">
<input type="submit" value="Yes" id="tak"/>
<input type="submit" value="No" id="nie"/>
</div>
</div>
<script>
const takBtn = document.getElementById('tak');
const nieBtn = document.getElementById('nie');
const cuteText = document.getElementsByClassName('cute-text')[0];
let counter = 0;
takBtn.addEventListener('click', function() {
cuteText.innerText = "<3";
this.style.transform = 'scale(' + (this.style.transform === '' ? 2 : parseFloat(this.style.transform.replace('scale(', '').replace(')', '')) + 1) + ')';
nieBtn.style.transform = 'scale(' + (nieBtn.style.transform === '' ? 0.5 : Math.max(parseFloat(nieBtn.style.transform.replace('scale(', '').replace(')', '')) - 0.5, 0.5)) + ')';
});
nieBtn.addEventListener('click', function() {
counter++;
if (counter === 1) {
console.log("Its one!")
cuteText.innerText = "pls be my valentine :(";
}
else if (counter === 3) {
console.log("Its three!")
cuteText.innerText = "last chance <3";
nieBtn.style.display = "none";
}
this.style.transform = 'scale(' + (this.style.transform === '' ? 0.5 : Math.max(parseFloat(this.style.transform.replace('scale(', '').replace(')', '')) - 0.5, 0.5)) + ')';
takBtn.style.transform = 'scale(' + (takBtn.style.transform === '' ? 2 : parseFloat(takBtn.style.transform.replace('scale(', '').replace(')', '')) + 1) + ')';
console.log(counter);
});
</script>
</body>
</html>