-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
131 lines (127 loc) · 4.61 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Kab Hai Holi?</title>
<link rel="icon" type="image/x-icon" href="icon.ico" />
<link href='https://fonts.googleapis.com/css?family=Raleway:400,500,600,700|Shadows+Into+Light' rel='stylesheet' type='text/css'>
<link href='shake.min.css' rel='stylesheet' type='text/css'>
<style>
* {
border: 0;
padding: 0;
margin: 0;
-webkit-font-smoothing: antialiased;
color: #fff;
outline: none;
font-family: 'Raleway';
}
body {
background: #E72B48;
z-index: 0;
}
#happyholi {
position: absolute;
padding: 30px;
right: 0;
bottom: 0;
font-family: 'Shadows Into Light';
font-size: 60px;
display: none;
}
.box {
font-size: 24px;
padding: 18px 30px;
overflow: hidden;
font-weight: 600;
position: absolute;
left: 50%;
top: 50%;
text-align: center;
min-width: 384px;
}
#button {
-webkit-transition: all 150ms ease;
-moz-transition: all 150ms ease;
-o-transition: all 150ms ease;
transition: all 150ms ease;
}
.button {
background: #1AB669;
z-index: 2;
border-bottom: 3px solid #0C7441;
cursor: pointer;
}
.button:hover {
transform: translateY(3px);
border-bottom: 0;
}
.answer {
color: #333333;
border-bottom: 0;
background: #FDD716;
}
.image {
position: absolute;
left: 50%;
top: 50px;
margin-left: -160px;
width: 320px;
height: 320px;
background: url('gabbar.jpg');
background-position: 50% 50%;
background-repeat: no-repeat;
background-size: cover;
border-radius: 50%;
border: 3px solid #fff;
}
</style>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-QXGY4F0KZE"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-QXGY4F0KZE');
</script>
</head>
<body>
<div class="image">
</div>
<div id="button" class="box button">
Arey, Holi kab hai? Kab hai holi?
</div>
<div id="happyholi">
Happy Holi!
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script type="text/javascript">
$('#button').css('marginLeft', '-' + $('#button').innerWidth()/2 + 'px');
$('#button').css('marginTop', '-' + $('#button').innerHeight()/2 + 'px');
$('#button').css('borderRadius', $('#button').innerHeight()/2 + 'px');
$('#button').click(function (e) {
var today = new Date();
var dd = today.getDate();
var mm = today.getMonth()+1; //January is 0!
var yyyy = today.getFullYear();
// Update these two lines every year!
var holiDate = 25;
var dateSuffix = 'th';
if (dd === holiDate + 1 && mm == 3) {
var answer = 'Holi kal thi. Kal thi Holi!';
} else if (dd === holiDate - 1 && mm == 3) {
var answer = 'Holi kal hai. Kal hai Holi!';
} else if (dd === holiDate && mm == 3) {
var answer = 'Holi hai aaj. Aaj hai Holi!';
} else {
var answer = 'March ' + holiDate + dateSuffix;
}
this.innerHTML = answer;
$('#button').addClass('answer');
$('#button').removeClass('button');
$('#happyholi').delay(300).fadeIn(600);
$('.image').addClass('shake shake-slow shake-constant');
});
</script>
</body>
</html>