-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
109 lines (96 loc) · 4.67 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
<html>
<head>
</head>
<body>
<script>
function setTheme() {
console.log(localStorage.getItem('themeused'));
if (localStorage.getItem('themeused')) {
if (localStorage.getItem('themeused') == "light") {
switchToLight();
} else if (localStorage.getItem('themeused') == "dark") {
//console.log("In Dark")
switchToDark();
}
} else {
switchToLight();
}
}
function switchToDark() {
document.body.style.background = "#2F3437"
document.getElementById("light").style.display = "none";
document.getElementById("dark").style.display = "block";
localStorage.setItem('themeused', "dark");
}
function switchToLight() {
document.body.style.background = "#FFFFFF"
document.getElementById("dark").style.display = "none";
document.getElementById("light").style.display = "block";
localStorage.setItem('themeused', "light");
}
document.addEventListener('readystatechange', function () {
if (document.readyState === "complete") {
setTheme();
}
});
</script>
<style>
.buttondivouter {
position: relative;
width: 300px;
height: 35px;
margin: 0 auto;
float: right;
opacity: 1;
transition: 3s;
}
.darkbuttonoverlap {
position: absolute;
z-index: 2;
height: 30px;
width: 80px;
top: 4px;
left: 180px;
opacity: 0;
transition: 3s;
}
.lightbuttonoverlap {
position: absolute;
z-index: 2;
height: 30px;
width: 80px;
top: 4px;
left: 80px;
opacity: 0;
transition: 3s;
}
.buttondivouter:hover .darkbuttonoverlap {
display: block;
opacity: 1;
}
.buttondivouter:hover .lightbuttonoverlap {
display: block;
opacity: 1;
}
</style>
<div id="light">
<!--Currency Converter widget by FreeCurrencyRates.com -->
<div id='gcw_mainFWJVrgQsB' class='gcw_mainFWJVrgQsB'></div>
<a id='gcw_siteFWJVrgQsB' href='https://freecurrencyrates.com/en/'>FreeCurrencyRates.com</a>
<script>function reloadFWJVrgQsB(){ var sc = document.getElementById('scFWJVrgQsB');if (sc) sc.parentNode.removeChild(sc);sc = document.createElement('script');sc.type = 'text/javascript';sc.charset = 'UTF-8';sc.async = true;sc.id='scFWJVrgQsB';sc.src = 'https://freecurrencyrates.com/en/widget-vertical?iso=GBP-USD-EUR-SGD-INR&df=2&p=FWJVrgQsB&v=fits&source=fcr&width=245&width_title=0&firstrowvalue=1.00&thm=A6C9E2,FCFDFD,4297D7,5C9CCC,FFFFFF,C5DBEC,FCFDFD,2E6E9E,000000&title=Currency%20Converter&tzo=-60';var div = document.getElementById('gcw_mainFWJVrgQsB');div.parentNode.insertBefore(sc, div);} reloadFWJVrgQsB(); </script>
<!-- put custom styles here: .gcw_mainFWJVrgQsB{}, .gcw_headerFWJVrgQsB{}, .gcw_ratesFWJVrgQsB{}, .gcw_sourceFWJVrgQsB{} -->
<!--End of Currency Converter widget by FreeCurrencyRates.com -->
</div>
<div id="dark">
<!--Currency Converter widget by FreeCurrencyRates.com -->
<div id='gcw_mainFWJVrgQsB' class='gcw_mainFWJVrgQsB'></div>
<a id='gcw_siteFWJVrgQsB' href='https://freecurrencyrates.com/en/'>FreeCurrencyRates.com</a>
<script>function reloadFWJVrgQsB(){ var sc = document.getElementById('scFWJVrgQsB');if (sc) sc.parentNode.removeChild(sc);sc = document.createElement('script');sc.type = 'text/javascript';sc.charset = 'UTF-8';sc.async = true;sc.id='scFWJVrgQsB';sc.src = 'https://freecurrencyrates.com/en/widget-vertical?iso=GBP-USD-EUR-SGD-INR&df=2&p=FWJVrgQsB&v=fits&source=fcr&width=245&width_title=0&firstrowvalue=1.00&thm=cccccc,F9F9F9,A3A3A3,333333,eeeeee,cccccc,ffffff,222222,000000&title=Currency%20Converter&tzo=-60';var div = document.getElementById('gcw_mainFWJVrgQsB');div.parentNode.insertBefore(sc, div);} reloadFWJVrgQsB(); </script>
<!-- put custom styles here: .gcw_mainFWJVrgQsB{}, .gcw_headerFWJVrgQsB{}, .gcw_ratesFWJVrgQsB{}, .gcw_sourceFWJVrgQsB{} -->
<!--End of Currency Converter widget by FreeCurrencyRates.com -->
<div class="buttondivouter">
<button class="darkbuttonoverlap" style="float: right;" onclick="switchToDark()">Dark</button>
<button class="lightbuttonoverlap" style="float: right;" onclick="switchToLight()">Light</button>
</div>
</body>
</html>