add pwa stuff

This commit is contained in:
2025-05-10 22:45:10 +01:00
parent 2cfee11ca9
commit bd560cbd90
7 changed files with 41 additions and 1 deletions

2
.idea/dataSources.xml generated
View File

@@ -5,7 +5,7 @@
<driver-ref>sqlite.xerial</driver-ref> <driver-ref>sqlite.xerial</driver-ref>
<synchronize>true</synchronize> <synchronize>true</synchronize>
<jdbc-driver>org.sqlite.JDBC</jdbc-driver> <jdbc-driver>org.sqlite.JDBC</jdbc-driver>
<jdbc-url>jdbc:sqlite:$PROJECT_DIR$/data.sqlite</jdbc-url> <jdbc-url>jdbc:sqlite:$PROJECT_DIR$/data/data.sqlite</jdbc-url>
<jdbc-additional-properties> <jdbc-additional-properties>
<property name="com.intellij.clouds.kubernetes.db.enabled" value="false" /> <property name="com.intellij.clouds.kubernetes.db.enabled" value="false" />
</jdbc-additional-properties> </jdbc-additional-properties>

View File

@@ -0,0 +1,12 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="Start placeholder server on 8080" type="GoApplicationRunConfiguration" factoryName="Go Application">
<module name="7am" />
<working_directory value="$PROJECT_DIR$" />
<parameters value="--use-placeholder" />
<kind value="PACKAGE" />
<package value="code.nym.sh/7am" />
<directory value="$PROJECT_DIR$" />
<filePath value="$PROJECT_DIR$/main.go" />
<method v="2" />
</configuration>
</component>

BIN
web/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@@ -4,6 +4,9 @@
<head> <head>
<title>7am Weather</title> <title>7am Weather</title>
<link rel="icon" type="image/png" href="/favicon.png">
<link rel="manifest" href="/manifest.json">
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap" rel="stylesheet"> <link href="https://fonts.googleapis.com/css2?family=Geist:wght@100..900&display=swap" rel="stylesheet">
@@ -37,6 +40,12 @@
</p> </p>
</footer> </footer>
</div> </div>
<script>
window.addEventListener("load", () => {
navigator.serviceWorker.register("/sw.js")
})
</script>
</body> </body>
</html> </html>

BIN
web/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

17
web/manifest.json Normal file
View File

@@ -0,0 +1,17 @@
{
"name": "7am Weather",
"short_name": "7am",
"theme_color": "#1f2937",
"background_color": "#f3f4f6",
"display": "standalone",
"scope": "/",
"start_url": "/",
"description": "Daily weather updates delivered to you at 7am.",
"orientation": "vertical",
"icons": [
{
"src": "/logo.png",
"sizes": "1024x1024"
}
]
}

View File

@@ -123,4 +123,6 @@ function jsonOrThrow(res) {
if (canReceiveUpdates) { if (canReceiveUpdates) {
main() main()
} else {
getSummaryButton.style.display = "none"
} }