Skip to content

Commit c0dd078

Browse files
committed
Add web interface Dark mode
* Move common css elements to top of main.css * Add web interface css dark mode * Add "main page" link to 404 page
1 parent b0cb9e6 commit c0dd078

File tree

7 files changed

+118
-24
lines changed

7 files changed

+118
-24
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# Eclipse
55
.project
66
.cproject
7+
.pydevproject
78
.settings/
89

910
# Others

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This is done by selecting one from a dropdown which contains a default option sp
88
the last selected IP(if that is a different one), and 255.255.255.255, or manually specifying one.
99
To manually specify a MAC or IP address simply select the "Other" option and enter it into the text input that appears.
1010
This is how the web interface looks:
11-
![ESP Wake on Lan Web Interface](https://raw.githubusercontent.com/ToMe25/ESP-WakeOnLan/master/images/web-interface.png)
11+
![ESP Wake on Lan Web Interface](https://raw.githubusercontent.com/ToMe25/ESP-WakeOnLan/master/images/web_interface.png)
1212

1313
## Requirements
1414
1. A system with a working [platform io](https://platformio.org/) installation.

images/web-interface.png

-88.5 KB
Binary file not shown.

images/web_interface.png

129 KB
Loading

read_ota_pass.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
#!/usr/bin/python
22
Import ("env")
33
import os
4-
import sys
54

65
def main():
76
input = "otapass.txt"
87

98
if not os.path.exists(input) or not os.path.isfile(input):
109
print(f"Error: {input} does not exist.")
11-
sys.exit(1)
10+
env.Exit(1)
1211

1312
password = ""
1413

src/html/main.css

Lines changed: 114 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,49 @@
1+
/* This is the start of the common css for most of my esp projects */
12
body {
2-
background-color: #acbec6;
3+
background-color: #c2cbd1;
34
text-align: center;
45
}
56

67
.main {
7-
border: 4px solid #8c8c8c;
8-
border-radius: 10px;
8+
--border-color: #808080;
99
background-color: #ededed;
10-
padding: 30px;
11-
display: inline-block;
12-
margin: 4% 0;
10+
color: #0d0d0d;
1311
font-size: 2em;
12+
border: 4px solid var(--border-color);
13+
border-radius: 10px;
14+
display: inline-block;
15+
padding: 30px;
16+
margin: 5% 0;
1417
}
1518

1619
h1 {
17-
margin-top: 2%;
20+
font-size: 2.2em;
21+
margin: 5% 0.3em;
22+
}
23+
24+
h3, label, p {
25+
color: #3F3F48;
26+
font-weight: bold;
27+
margin: 0.3em 0;
1828
}
1929

30+
@media (prefers-color-scheme: dark) {
31+
body {
32+
background-color: #222221;
33+
}
34+
35+
.main {
36+
background-color: #131312;
37+
color: #aab1b5;
38+
--border-color: #484946;
39+
}
40+
41+
h3, label, p {
42+
color: #8d9398;
43+
}
44+
}
45+
/* This is the end of the common css for most of my esp projects */
46+
2047
.message {
2148
border-radius: 25px;
2249
padding: 30px;
@@ -33,40 +60,106 @@ h1 {
3360
border: 3px solid #791A10;
3461
}
3562

63+
button {
64+
--bg-color-h: 212;
65+
--bg-color-s: 97%;
66+
--bg-color-l: 54%;
67+
--border-color: hsl(var(--bg-color-h), var(--bg-color-s), calc(var(--bg-color-l) * 2 / 3));
68+
background-color: hsl(var(--bg-color-h), var(--bg-color-s), var(--bg-color-l));
69+
color: #0f0f0f;
70+
font-size: 0.8em;
71+
border: 2px solid var(--border-color);
72+
border-radius: 6px;
73+
box-shadow: -1px -1px 5px var(--border-color), 6px 8px 8px #000000cd;
74+
padding: 6px 3em;
75+
margin: 5px;
76+
margin-top: 12px;
77+
transition: all .5s;
78+
-webkit-transition: all .5s;
79+
}
80+
81+
button:focus {
82+
outline: none;
83+
}
84+
85+
button:hover {
86+
background-color: hsl(var(--bg-color-h), var(--bg-color-s), calc(var(--bg-color-l) * 16 / 15));
87+
border-color: hsl(var(--bg-color-h), var(--bg-color-s), calc(var(--bg-color-l) * 11 / 15));
88+
box-shadow: -1px -1px 5px var(--border-color), 3px 5px 6px #000000cd;
89+
}
90+
91+
button:active {
92+
background-color: hsl(var(--bg-color-h), var(--bg-color-s), calc(var(--bg-color-l) * 17 / 15));
93+
border-color: hsl(var(--bg-color-h), var(--bg-color-s), calc(var(--bg-color-l) * 11 / 15));
94+
box-shadow: none;
95+
}
96+
3697
.wakeup {
98+
--color-h: 0;
99+
--color-s: 0%;
100+
--color-l: 99%;
37101
width: 7ch;
38102
height: 7ch;
39-
background-color: #258AFC;
40-
color: #fcfcfc;
41-
border: 3px solid #225AFC;
103+
color: hsl(var(--color-h), var(--color-s), var(--color-l));
42104
border-radius: 50%;
43-
box-shadow: 3px 3px 6px 2px #225AFC;
44105
font-size: 2em;
45106
vertical-align: middle;
107+
padding: 5px;
46108
margin-top: 0.5em;
47-
transition: all 0.5s;
48-
-webkit-transition: all 0.5s;
49109
}
50110

51111
.wakeup:hover {
52-
background-color: #237DE2;
53-
color: #f6f6f6;
54-
border-color: #2052E2;
55-
box-shadow: 2px 2px 4px 2px #225AFC;
112+
--color-l: 95%;
56113
}
57114

58115
.wakeup:active {
59-
background-color: #2171CD;
60-
color: #efefef;
61-
border-color: #184ACD;
62-
box-shadow: none;
116+
--color-l: 90%;
63117
}
64118

65119
.input {
66120
background-color: white;
121+
color: black;
67122
border: 2px solid black;
68123
border-radius: 0;
69124
margin: 6px;
70125
padding: 5px 30px;
71126
font-size: 1.2em;
72127
}
128+
129+
a:link,
130+
a:visited,
131+
a:hover,
132+
a:active {
133+
color: #8d9398;
134+
}
135+
136+
@media (prefers-color-scheme: dark) {
137+
.message {
138+
color: #2d2e2f;
139+
}
140+
141+
.wakeup {
142+
--color-l: 15%;
143+
}
144+
145+
.wakeup:hover {
146+
--color-l: 17%;
147+
}
148+
149+
.wakeup:active {
150+
--color-l: 20%;
151+
}
152+
153+
.input {
154+
background-color: black;
155+
color: white;
156+
border-color: white;
157+
}
158+
159+
a:link,
160+
a:visited,
161+
a:hover,
162+
a:active {
163+
color: #525550;
164+
}
165+
}

src/html/not_found.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<body>
99
<div class="main">
1010
<h1>The requested file can not be found on this server!</h1>
11+
<p>Do you want to return to the <a href="/index.html">main page</a>?</p>
1112
</div>
1213
</body>
1314
</html>

0 commit comments

Comments
 (0)