-
Notifications
You must be signed in to change notification settings - Fork 0
/
darkmode.html
84 lines (78 loc) · 1.64 KB
/
darkmode.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
<!DOCTYPE html>
<html>
<head>
<title>Saving Notebook</title>
<style>
body, .fullscreen {
font-family: Arial;
}
/* The original code for the fullscreen class was found on Stack Overflow. Here, I've heavily modified it, however.*/
.fullscreen {
position: fixed;
top: 0;
left: 70;
bottom: 0;
right: 0;
overflow: auto;
width: 95%;
hieght: 100%;
border: 1px solid DimGrey;
background-color: DimGrey;
color: GhostWhite;
font-weight: normal;
resize: none;
}
.fullscreen:focus {
position: fixed;
top: 0;
left: 70;
bottom: 0;
right: 0;
overflow: auto;
width: 95%;
hieght: 100%;
border: 1px solid DimGrey;
background-color: DimGrey;
color: GhostWhite;
font-weight: normal;
resize: none;
}
button {
background-color: Grey;
color: Honeydew;
border: 2px solid DarkSlateGrey;
width: 45px;
text-align: center;
}
body {
background-color: DarkSlateGrey;
color: Gainsboro;
}
.light {
position: absolute;
bottom: 0;
margin: 0 0 5px 0;
}
</style>
</head>
<body>
<textarea class="fullscreen" id="0">This is a paragraph.</textarea>
<button onclick="storeCookie()" draggable="false"><b>Save</b></button><br>
<button onclick="getCookie()" draggable="false"><b>Load</b></button><br>
<button class="light" onclick="lightMode()" draggable="false"><b>☀</b></button>
<script>
function storeCookie() {
var x = document.getElementById('0').value;
document.cookie = "note=" + x + ";path=/";
};
function getCookie() {
var a = decodeURIComponent(document.cookie);
var b = a.split("note=");
document.getElementById('0').value = b[1];
};
function lightMode() {
location.href = '/Saving-Notebook';
}
</script>
</body>
</html>