-
Notifications
You must be signed in to change notification settings - Fork 46
/
index.html
114 lines (110 loc) · 4.06 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Calculator</title>
<link rel="stylesheet" href="base-styles.css">
<link class="styles" rel="stylesheet" href="css/beetlejuice.css">
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script src="index.js"></script>
</head>
<body>
<div id="calculator">
<div class="result"><span>0</span></div>
<div class="button" data-value="C">C</div>
<div class="button" data-value="+/-">+/-</div>
<div class="button" data-value="%">%</div>
<div class="button" data-value="÷">÷</div>
<div class="button" data-value="7">7</div>
<div class="button" data-value="8">8</div>
<div class="button" data-value="9">9</div>
<div class="button" data-value="x">x</div>
<div class="button" data-value="4">4</div>
<div class="button" data-value="5">5</div>
<div class="button" data-value="6">6</div>
<div class="button" data-value="-">-</div>
<div class="button" data-value="1">1</div>
<div class="button" data-value="2">2</div>
<div class="button" data-value="3">3</div>
<div class="button" data-value="+">+</div>
<div class="button" data-value="0">0</div>
<div class="button" data-value=".">.</div>
<div class="button" data-value="=">=</div>
</div>
<button class="switch">see another style</button>
<script>
$(function() {
// === Do NOT change the code above. ===
// Add your stylesheets to this array.
// Each stylesheet should be on its own line to avoid conflicts.
// Don't forget to add a comma at the end of the previously last item.
var styles = ["index.css",
"shelley.css",
"halloween.css",
"roysung.css",
"winter.css",
"kyren.css",
"material.css",
"index-blackred.css",
"royal.css",
"index2.css",
"ariq.css",
"blueindex.css",
"autumn_colors.css",
"bw.css",
"ios-theme.css",
"nix.css",
"space.css",
"dark.css",
"midnight_blue.css",
"blueish.css",
"weirdo.css",
"monokai.css",
"pretty.css",
"flat.css",
"neonlight.css",
"turquoise.css",
"plain_gray.css",
"withHover.css",
"turquoise.css",
"melisa.css",
"glow.css",
"hacktoberfest.css",
"green-calc.css",
"neonlight.css",
"mac.css",
"mystyle.css",
"jeffhowstyles.css",
"shauna.css",
"spooky.css",
"miui.css",
"christmas.css",
"rosy.css",
"tri.css",
"github.css",
"cartoon.css",
"Solarized.css",
"jjaxx.css",
"beetlejuice.css"
];
// === Do NOT change the code below. ===
// https://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array
function shuffleArray(array) {
for (var i = array.length - 1; i > 0; i--) {
var j = Math.floor(Math.random() * (i + 1));
var temp = array[i];
array[i] = array[j];
array[j] = temp;
}
}
// perform the shuffle
shuffleArray( styles );
var index = 0;
$(".switch").click(function() {
$(".styles").attr("href", "css/"+styles[(index++)%styles.length]+"");
});
});
</script>
</body>
</html>