11# SPDX-FileCopyrightText: 2022 Liz Clark for Adafruit Industries
22#
33# SPDX-License-Identifier: MIT
4- # Pico W CircuitPython HTTP Server
54
65import os
76import time
@@ -90,7 +89,6 @@ def c_to_f(temp):
9089unit = "F"
9190# font for HTML
9291font_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