-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
81 lines (71 loc) · 1.44 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
<html>
<head>
<title>[ ☶ ]</title>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous"></script>
<style>
body {
background: #000;
transition: background 0.2s linear;
cursor: url(yinyang.png), auto;
}
#trigrams {
color: #f0f0f0;
font-size: 15em;
margin-top: -.4em;
transition: color 0.2s linear;
user-select: none;
}
#main {
height: 100%;
width: 100%;
/*cursor: pointer;*/
display: flex;
justify-content: center;
align-items: center;
}
</style>
</head>
<body>
<div id='main'>
<div id = 'trigrams'>☶</div>
</div>
</body>
<script>
var theme = 'black'
var trigrams = ['☰', '☱', '☲', '☳', '☴', '☵', '☶', '☷'];
$(function() {
$('#main').click(function(){
console.log('click')
if (theme === 'black') {
$('body').css('background', '#fff')
$('#trigrams').css('color', '#000')
theme = 'white'
} else {
$('body').css('background', '#000')
$('#trigrams').css('color', '#f0f0f0')
theme = 'black'
}
})
var x = 0
setInterval(function() {
if (x > 7) {
x = 0
}
$('#trigrams').fadeOut(function() {
$(this).text(trigrams[x]).fadeIn()
})
x++
}, 2000)
// var x = 0
// return setInterval(function() {
// if (x > 7) {
// x = 0
// }
// $('#trigrams').text(trigrams[x]).fadeIn()
// return x++
})
</script>
</html>