-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdaylight.js
45 lines (31 loc) · 1.18 KB
/
daylight.js
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
$(document).ready(function(){
$('#celestial').click(function() {
if ($('#celestial').hasClass('sun')) {
$('#celestial').removeClass('sun').addClass('moon');
} else {
// If it doesn't have the sun class, it must have the
// moon class already. We should remove moon and add sun.
$('#celestial').removeClass('moon').addClass('sun');
}
if ($('#sky').hasClass('day')) {
$('#sky').removeClass('day').addClass('night');
} else {
$('#sky').removeClass('night').addClass('day');
}
if ($('#moonspot1').hasClass('visible')) {
$('#moonspot1').removeClass('visible');
} else {
$('#moonspot1').addClass('visible');
}
if ($('#moonspot2').hasClass('visible')) {
$('#moonspot2').removeClass('visible');
} else {
$('#moonspot2').addClass('visible');
}
if ($('#moonspot3').hasClass('visible')) {
$('#moonspot3').removeClass('visible');
} else {
$('#moonspot3').addClass('visible');
}
});
});