-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaccess-point-html.cpp
More file actions
106 lines (99 loc) · 3.24 KB
/
access-point-html.cpp
File metadata and controls
106 lines (99 loc) · 3.24 KB
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
const char *HTML_HEADER = R"html(
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>tRacket</title>
<style>
body {background-color: #fff4e6;font-family: Arial, Helvetica, sans-serif;}
*{padding: 0;margin: 0;}
main{padding: 20px 0px 0px 0px;padding-bottom: 2.5rem; /* Footer height */}
#page-container {position: relative;min-height: 100vh;}
header{height: 76px;background-color: #242424;color: #fff;}
header brand h2{padding: 25px 0px 0px 10%;}
section{padding: 25px 10% 0px;}
footer {position: absolute;bottom: 0;width: 100%;display: flex;padding-top: 10px;justify-content: center;height: 2.5rem;font-size: 20px;background-color: #000;color: #fff;}
input[type=submit]{
font-size: 24px;
padding: 5px;
margin-top: 3px;
}
select, input{margin-bottom: 1em;min-width: 150px;}
.meter {
height: 5px;
position: relative;
background: #f3efe6;
overflow: hidden;
width: 90%;
}
.meter span {
display: block;
height: 100%;
}
.progress {
background-color: #e4c465;
-webkit-animation: progressBar 2s ease-in-out;
-webkit-animation-fill-mode:both;
-moz-animation: progressBar 2s ease-in-out;
-moz-animation-fill-mode:both;
}
@-webkit-keyframes progressBar {
0% { width: 0; }
100% { width: 100%; }
}
@-moz-keyframes progressBar {
0% { width: 0; }
100% { width: 100%; }
}
</style>
)html";
const char *HTML_CONTAINER = R"html(
</head>
<body>
<div id="page-container">
<header><nav><brand><h2>tRacket</h2></brand></nav></header>
<main>
<section>
<div class="Container">
<h1>tRacket sensor setup</h1>
)html";
const char *HTML_FOOTER = R"html(
</div>
</section>
</main>
<footer>
<p>[email protected]</p>
</footer>
</div>
</body>
</html>
)html";
const char *HTML_BODY_FORM_HEADER = R"html(
<p>Select your home WiFi network below and enter its password to get the sensor online:<br><br></p>
<form method='POST' action='/submit' enctype='multipart/form-data'>
<label for='ssid'>Wifi network name:</label><br>
<select name='ssid' id='ssid' required>
)html";
const char *HTML_BODY_FORM_FOOTER = R"html(
</select>
<p style="font-size: 0.75em">(🔒 = password required)<br>(Don't see your network? <a href="/manual">Enter it manually</a>)</p>
<br><label for='psk'>Wifi network password:</label><br>
<input type='password' name='psk' id='psk'/><br>
<label for='email'>Your Email (also your username for logging into the tRacket portal):</label><br>
<input type='email' name='email' id='email'/><br>
<p><input type='submit' value='Connect'/></p>
</form>
)html";
const char *HTML_BODY_FORM_MANUAL = R"html(
<p>Enter the wifi network name and password for your home network, which the sensor can connect to to get online:<br/><br/></p>
<form method='POST' action='/submit' enctype='multipart/form-data'>
<p>Wifi network name:</p>
<input type='text' name='ssid' autocorrect='off' autocapitalize='none' autocomplete='off' required/>
<p>Wifi network password:</p>
<input type='password' name='psk'/>
<p>Your Email (also your username for logging into the tRacket portal):</p>
<input type='email' name='email'/>
<p><input type='submit' value='Connect'/></p>
</form>
)html";