Skip to content

Commit e194e43

Browse files
authored
Merge pull request #2329 from adafruit/html_update
Updating HTML
2 parents 0e8339e + d2901ec commit e194e43

File tree

1 file changed

+9
-9
lines changed
  • PicoW_CircuitPython_HTTP_Server

1 file changed

+9
-9
lines changed

PicoW_CircuitPython_HTTP_Server/code.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# SPDX-FileCopyrightText: 2022 Liz Clark for Adafruit Industries
22
#
33
# SPDX-License-Identifier: MIT
4-
# Pico W CircuitPython HTTP Server
54

65
import os
76
import time
@@ -90,7 +89,6 @@ def c_to_f(temp):
9089
unit = "F"
9190
# font for HTML
9291
font_family = "monospace"
93-
party_state = "Party?"
9492

9593
# the HTML script
9694
# setup as an f string
@@ -107,30 +105,32 @@ def webpage():
107105
<style>
108106
html{{font-family: {font_family}; background-color: lightgrey;
109107
display:inline-block; margin: 0px auto; text-align: center;}}
110-
h1{{color: deeppink; padding: 2vh; font-size: 35px;}}
111-
p{{font-size: 1.5rem;}}
108+
h1{{color: deeppink; width: 200; word-wrap: break-word; padding: 2vh; font-size: 35px;}}
109+
p{{font-size: 1.5rem; width: 200; word-wrap: break-word;}}
112110
.button{{font-family: {font_family};display: inline-block;
113111
background-color: black; border: none;
114112
border-radius: 4px; color: white; padding: 16px 40px;
115113
text-decoration: none; font-size: 30px; margin: 2px; cursor: pointer;}}
116-
p.dotted {{margin: auto; height: 50px;
114+
p.dotted {{margin: auto;
117115
width: 75%; font-size: 25px; text-align: center;}}
118116
</style>
119117
</head>
120118
<body>
121119
<title>Pico W HTTP Server</title>
122120
<h1>Pico W HTTP Server</h1>
121+
<br>
123122
<p class="dotted">This is a Pico W running an HTTP server with CircuitPython.</p>
124-
<p class="dotted">The current ambient temperature near the Pico W is
125-
<span style="color: deeppink;">{temp_test}°{unit}</span></p>
126-
<h1>Control the LED on the Pico W with these buttons:</h1>
123+
<br>
124+
<p class="dotted">The current ambient temperature near the Pico W is
125+
<span style="color: deeppink;">{temp_test}°{unit}</span></p><br>
126+
<h1>Control the LED on the Pico W with these buttons:</h1><br>
127127
<form accept-charset="utf-8" method="POST">
128128
<button class="button" name="LED ON" value="ON" type="submit">LED ON</button></a></p></form>
129129
<p><form accept-charset="utf-8" method="POST">
130130
<button class="button" name="LED OFF" value="OFF" type="submit">LED OFF</button></a></p></form>
131131
<h1>Party?</h>
132132
<p><form accept-charset="utf-8" method="POST">
133-
<button class="button" name="party" type="submit">PARTY!</button></a></p></form>
133+
<button class="button" name="party" value="party" type="submit">PARTY!</button></a></p></form>
134134
</body></html>
135135
"""
136136
return html

0 commit comments

Comments
 (0)