-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjavascript.html
159 lines (138 loc) · 6.33 KB
/
javascript.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<!DOCTYPE html>
<html>
<script>
// Hi BBFC developers! To disable the site so it redirects to the under development page, uncomment the next line (remove "//" from the beginning) and commit your changes
//window.location.replace("https://bbfcgaming.github.io/GameDevelopment.html")
//Whenever you make a change, create a new release marking the version up 0.0.1 more
</script>
<!--
____ ____ ____________ ______ _
/ __ )/ __ )/ ____/ ____/ / ____/___ _____ ___ (_)___ ____ _
/ __ / __ / /_ / / / / __/ __ `/ __ `__ \/ / __ \/ __ `/
/ /_/ / /_/ / __/ / /___ / /_/ / /_/ / / / / / / / / / / /_/ /
/_____/_____/_/ \____/ \____/\__,_/_/ /_/ /_/_/_/ /_/\__, /
/____/
-->
<head>
<script src="https://code.jquery.com/jquery-1.10.2.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-129128356-2"></script>
<script type="text/javascript" src="cookieconsent.js"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-129128356-2');
</script>
<title>HTML5 Games - BBFC Gaming</title>
<link rel = "stylesheet"
type = "text/css"
href = "stylesheet.css" />
</head>
<body>
<div id="title">
<center><iframe id="banner" src="banner.html" height="50px" width="100%" frameBorder="0"></iframe></center>
<center><img style="width:100%; " src='image/bbfc.png' ondblclick='eastereggcode();'></center>
</div>
<hr>
<!--Buttons-->
<div id="buttons">
<a href="nojs.html" class="buttons-link">No JavaScript?</a>
</div>
<script>
$(function(){
$("#buttons").load("buttons.html");
});
</script>
<br>
<br>
<br>
<hr>
<br>
<div id="javascriptbuttons">
New Games:
<hr>
</div>
<div style="border: 2px solid olive;">
<h3>Clicker</h3>
<br>
HTML5 Clicker
<br>
<br>
<font color="white">
<button onclick='window.open("clicker.html")'>GO!</button>
</font>
<br>
<br>
</div>
<br>
<br>
<div class="theme-switch-wrapper">
<label class="theme-switch" for="checkbox">
<input type="checkbox" id="checkbox" />
<div class="slider round"></div>
</label>
Enable Light Mode
</div>
<br>
<br>
<footer>
<center><iframe id="copy" src="copyright.html" frameBorder="0"></iframe></center>
<a href="http://www.w3.org/html/logo/">
<img src="https://www.w3.org/html/logo/badge/html5-badge-h-css3.png" width="133" height="64" alt="HTML5 Powered with CSS3 / Styling" title="HTML5 Powered with CSS3 / Styling">
</a>
</footer>
</body>
<script>
const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]');
function switchTheme(e) {
if (e.target.checked) {
var r = confirm("Are you sure you want to switch on light mode? (It won't work if you have a dark mode browser extension installed)");
if(r == true) {
document.documentElement.setAttribute('data-theme', 'light');
localStorage.setItem('theme', 'light'); //add this
sessionStorage.setItem('bgColor', 'purple');
sessionStorage.setItem('textColor', 'white');
sessionStorage.setItem('buttonBg', 'black');
sessionStorage.setItem('versionTextColor', 'black');
sessionStorage.setItem('copyTextColor', 'black');
document.getElementById('banner').src = document.getElementById('banner').src
document.getElementById('version').src = document.getElementById('version').src
document.getElementById('copy').src = document.getElementById('copy').src
$(function(){
$("#buttons").load("buttons.html");
});
}else {
toggleSwitch.checked = false;
}
}
else {
document.documentElement.setAttribute('data-theme', 'dark');
localStorage.setItem('theme', 'dark'); //add this
sessionStorage.setItem('textColor', 'black');
sessionStorage.setItem('bgColor', 'red');
sessionStorage.setItem('buttonBg', 'blue');
sessionStorage.setItem('versionTextColor', 'white');
sessionStorage.setItem('copyTextColor', 'white');
document.getElementById('banner').src = document.getElementById('banner').src
document.getElementById('version').src = document.getElementById('version').src
document.getElementById('copy').src = document.getElementById('copy').src
$(function(){
$("#buttons").load("buttons.html");
});
}
}
const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null;
if (currentTheme) {
document.documentElement.setAttribute('data-theme', currentTheme);
if (currentTheme === 'light') {
toggleSwitch.checked = true;
}
}
toggleSwitch.addEventListener('change', switchTheme, false);
</script>
<div id="myCookieConsent">
<a id="cookieButton">Understood</a>
<div>This website is using cookies. <a href="privacypolicy.html">More details</a></div>
</div>
</html>