Skip to content

Commit eb50046

Browse files
authored
Initial Update
1 parent e102a2f commit eb50046

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

index.html

+14-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
<head>
55
<meta charset="UTF-8">
66
<meta name="viewport" content="width=device-width, initial-scale=1">
7+
<meta name="theme-color" content="white">
78
<title>Note</title>
89
<style>
910
@import url('https://fonts.googleapis.com/css2?family=Open+Sans&display=swap');
1011

1112
html,
12-
body,
13-
textarea {
13+
body {
1414
margin: 0;
1515
padding: 0;
1616
height: 100%;
@@ -21,20 +21,31 @@
2121
width: 90%;
2222
height: 90%;
2323
padding: 5%;
24+
margin: 0;
2425
border: none;
2526
resize: none;
2627
outline: none;
28+
background-color: transparent;
2729
}
2830
</style>
2931
</head>
3032

3133
<body>
32-
<textarea placeholder="Click here to type"></textarea>
34+
<textarea placeholder="Click here to type. Type dark to activate dark mode. Reload to set to light. Type Clear to delete all data."></textarea>
3335
<script>
3436
const text = document.querySelector('textarea');
3537
text.value = localStorage.getItem('key');
3638
text.oninput = () => {
3739
localStorage.setItem('key', text.value);
40+
if (text.value == 'dark') {
41+
document.body.style.backgroundColor = 'black';
42+
document.querySelector('meta[name="theme-color"]').setAttribute("content", 'black');
43+
text.style.color = 'white';
44+
}
45+
if (text.value == 'Clear') {
46+
localStorage.clear();
47+
location.reload();
48+
}
3849
}
3950
</script>
4051
</body>

0 commit comments

Comments
 (0)