-
Notifications
You must be signed in to change notification settings - Fork 54
/
Copy pathTheme.html
83 lines (66 loc) · 1.6 KB
/
Theme.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
<!DOCTYPE html>
<html>
<head>
<meta name='viewport' content='width=device-width, initial-scale=1'>
<title>html Editor </title>
<style>
@import url('https://fonts.googleapis.com/css?family=Quicksand&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Advent+Pro&display=swap');
html, button{
font-family: Quicksand, sans-serif;
}
body{
background: white;
color:#555;
text-align: center;
}
.brackets{
font-family: Advent Pro, sans-serif;
}
.left{
color:tomato;
}
.right{
color:dodgerblue;
}
.sample{
padding:20px;
font-size:18px;
background: inherit;
color:inherit;
}
#button{
margin-top:10px;
background:dodgerblue;
color:white;
width:80%;
height:60px;
font-size: 20px;
outline: none;
border:5px solid deepskyblue;
border-radius: 5px;
}
#button:active{
transform: scale(0.95);
}
</style>
</head>
<body>
<p class='sample'>This is the simple example of how HTML Editor works. You can change the code if you want.</p>
<button id='button' onClick='changeTheme()'>Dark Theme</button>
</body>
<script>
function changeTheme(){
if(document.getElementById('button').innerHTML==='Dark Theme'){
document.body.style.background='#555';
document.body.style.color='white';
document.getElementById('button').innerHTML='Light Theme';
}
else{
document.body.style.background='white';
document.body.style.color='#555';
document.getElementById('button').innerHTML='Dark Theme';
}
}
</script>
</html>