IamFrozenFruit monra commited on
Commit
ef571a5
1 Parent(s): ecbae5a

Add Light Mode (#72)

Browse files

* Create global-light.css

Light Mode CSS code


---------

Co-authored-by: Ramon <ramonvc19@gmail.com>

client/css/global-light.css ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ @import url("https://fonts.googleapis.com/css2?family=Inter:wght@100;200;300;400;500;600;700;800;900&display=swap");
2
+
3
+ :root {
4
+ --font-1: "Inter", sans-serif;
5
+ --section-gap: 20px;
6
+ --border-radius-1: 12px;
7
+
8
+ --colour-1: #ededed;
9
+ --colour-2: #000000;
10
+ --colour-3: #000000;
11
+ --colour-4: #000000;
12
+ --colour-5: #f4f4f4;
13
+ --colour-6: #d3d3d3;
14
+
15
+ --accent: #303030;
16
+ --blur-bg: #f4f4f4;
17
+ --blur-border: #e8e8e8;
18
+ --user-input: #000000;
19
+ --conversations: #555555;
20
+ }
21
+
22
+ * {
23
+ margin: 0;
24
+ padding: 0;
25
+ box-sizing: border-box;
26
+ position: relative;
27
+ font-family: var(--font-1);
28
+ }
29
+
30
+ html,
31
+ body {
32
+ background: var(--colour-1);
33
+ color: var(--colour-3);
34
+ }
35
+
36
+ ol,
37
+ ul {
38
+ padding-left: 40px;
39
+ }
40
+
41
+ .shown {
42
+ display: flex !important;
43
+ }
44
+
45
+ a:-webkit-any-link {
46
+ color: var(--accent);
47
+ }
48
+
49
+ @media screen and (max-height: 720px) {
50
+ :root {
51
+ --section-gap: 40px;
52
+ }
53
+ }
client/html/index.html CHANGED
@@ -91,6 +91,11 @@
91
  <label for="switch"></label>
92
  <span>Web Access</span>
93
  </div>
 
 
 
 
 
94
  </div>
95
  </div>
96
  </div>
@@ -108,5 +113,20 @@
108
  <script src="https://cdn.jsdelivr.net/npm/markdown-it@latest/dist/markdown-it.min.js"></script>
109
  <script src="/assets/js/highlight.min.js"></script>
110
  <script src="/assets/js/highlightjs-copy.min.js"></script>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  </body>
112
  </html>
 
91
  <label for="switch"></label>
92
  <span>Web Access</span>
93
  </div>
94
+ <div class="field checkbox">
95
+ <input type="checkbox" id="lightmode" />
96
+ <label for="lightmode"></label>
97
+ <span>Light Mode</span>
98
+ </div>
99
  </div>
100
  </div>
101
  </div>
 
113
  <script src="https://cdn.jsdelivr.net/npm/markdown-it@latest/dist/markdown-it.min.js"></script>
114
  <script src="/assets/js/highlight.min.js"></script>
115
  <script src="/assets/js/highlightjs-copy.min.js"></script>
116
+ <script>
117
+ var lightmode = document.getElementById("lightmode");
118
+ var styleLink = document.createElement("link");
119
+ styleLink.rel = "stylesheet";
120
+ styleLink.href = "/assets/css/global.css";
121
+ document.head.appendChild(styleLink);
122
+
123
+ lightmode.addEventListener("change", function() {
124
+ if (lightmode.checked) {
125
+ styleLink.href = "/assets/css/global-light.css";
126
+ } else {
127
+ styleLink.href = "/assets/css/global.css";
128
+ }
129
+ });
130
+ </script>
131
  </body>
132
  </html>