Skip to content

Commit bbbe6b3

Browse files
committed
dark mode
1 parent 7aa2b10 commit bbbe6b3

25 files changed

+2767
-3452
lines changed

main.go

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,42 @@ import (
1313
//go:embed public
1414
var staticFiles embed.FS
1515

16+
// main is the entry point of the program.
17+
// It serves the HTML content from the "public" directory.
18+
// It listens on the address specified by the environment variables HOST and PORT,
19+
// defaulting to "127.0.0.1:8080" if the variables are not set.
1620
func main() {
21+
// Load the embedded file system and get the "public" directory.
1722
htmlContent, err := fs.Sub(staticFiles, "public")
1823
if err != nil {
19-
log.Fatal(err)
24+
log.Fatal("Failed to load embedded file system:", err) // Exit if the embedded file system cannot be loaded
2025
}
2126

22-
http.Handle("/", http.FileServer(http.FS(htmlContent)))
27+
// Create a file server to serve the HTML content.
28+
fileServer := http.FileServer(http.FS(htmlContent))
2329

24-
host, _ := os.LookupEnv("HOST")
25-
port, ok := os.LookupEnv("PORT")
30+
// Set the handler for the root path ("/") to the file server.
31+
http.Handle("/", fileServer)
32+
33+
// Get the host and port from the environment variables.
34+
host, _ := os.LookupEnv("HOST") // Get the host from the environment variable, defaulting to "" if not set
35+
port, ok := os.LookupEnv("PORT") // Get the port from the environment variable, defaulting to "" if not set
2636
if !ok {
27-
port = "8080"
37+
port = "8080" // Default port is 8080
2838
}
2939

30-
addr := net.JoinHostPort(host, port)
40+
// Create the address to listen on.
41+
addr := net.JoinHostPort(host, port) // Join the host and port with a colon separator
42+
43+
// Log the address we are listening on.
3144
log.Printf("Listening on %s...\n", addr)
3245

46+
// Start the server.
47+
// The server will listen indefinitely until it is stopped.
48+
// If an error occurs that is not due to the server being closed,
49+
// the error will be logged and the program will exit.
3350
err = http.ListenAndServe(addr, nil)
3451
if err != nil && !errors.Is(err, http.ErrServerClosed) {
35-
log.Fatal(err)
52+
log.Fatal("Server error:", err) // Exit if there is an error other than the server being closed
3653
}
3754
}

package-lock.json

Lines changed: 1862 additions & 3174 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@
3131
"@rollup/plugin-json": "^6.1.0",
3232
"@rollup/plugin-node-resolve": "^15.2.3",
3333
"@rollup/plugin-replace": "^5.0.7",
34+
"@rollup/plugin-terser": "^0.4.4",
35+
"@theme-toggles/react": "^4.1.0",
3436
"babel-preset-minify": "^0.5.2",
3537
"bulma": "^1.0.2",
3638
"notiflix": "^3.2.7",
3739
"preact": "^10.23.1",
40+
"react-helmet-async": "^2.0.5",
3841
"rollup": "^4.19.0",
39-
"rollup-copy-transform-css": "^1.2.5",
40-
"rollup-plugin-copy": "^3.5.0",
42+
"rollup-plugin-import-css": "^3.5.0",
4143
"test": "^3.3.0",
4244
"uuid": "^10.0.0"
4345
}

public/app.css

Lines changed: 0 additions & 2 deletions
This file was deleted.

public/app.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/bulma-tooltip.css

Lines changed: 0 additions & 2 deletions
This file was deleted.

public/bulma-tooltip.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/bulma.css

Lines changed: 0 additions & 2 deletions
This file was deleted.

public/bulma.css.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

public/index.html

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -10,32 +10,10 @@
1010
<link rel="icon" type="image/png" sizes="32x32" href="./favicon-32x32.png">
1111
<link rel="icon" type="image/png" sizes="16x16" href="./favicon-16x16.png">
1212
<link rel="manifest" href="./site.webmanifest">
13-
14-
<link rel="stylesheet" href="./bulma.css">
15-
<link rel="stylesheet" href="./bulma-tooltip.css">
1613
<link rel="stylesheet" href="./app.css">
1714
</head>
1815
<body>
19-
<div class="uuid-ui--wrapper">
20-
<nav class="navbar is-light" role="navigation" aria-label="main navigation">
21-
<div class="container">
22-
<div class="navbar-brand">
23-
<a class="navbar-item" href="./">
24-
<img src="./android-chrome-192x192.png" >
25-
</a>
26-
</div>
27-
<div class="navbar-menu">
28-
<div class="navbar-start">
29-
<a class="navbar-item" href="./">
30-
UUIDConv UI
31-
</a>
32-
</div>
33-
</div>
34-
</div>
35-
</nav>
36-
37-
<div class="container margin-top" id="app"></div>
38-
</div>
16+
<div id="app"></div>
3917

4018
<footer class="footer margin-top">
4119
<div class="content has-text-centered">

0 commit comments

Comments
 (0)