Skip to content

Commit

Permalink
update theme
Browse files Browse the repository at this point in the history
  • Loading branch information
henriquepw committed Aug 10, 2024
1 parent 88c5dea commit d9b8bb5
Show file tree
Hide file tree
Showing 22 changed files with 436 additions and 31 deletions.
54 changes: 37 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -43,21 +43,41 @@ clean:
@rm -f main


# Live Reload
.PHONY: watch
watch:
@if command -v air > /dev/null; then \
air; \
echo "Watching...";\
else \
read -p "Go's 'air' is not installed on your machine. Do you want to install it? [Y/n] " choice; \
if [ "$$choice" != "n" ] && [ "$$choice" != "N" ]; then \
make setup \
air; \
echo "Watching...";\
else \
echo "You chose not to install air. Exiting..."; \
exit 1; \
fi; \
fi
# run templ generation in watch mode to detect all .templ files and
# re-create _templ.txt files on change, then send reload event to browser.
# Default url: http://localhost:7331
watch/templ:
templ generate --watch --proxy="http://localhost:3000" --open-browser=false -v


# run air to detect any go file changes to re-build and re-run the server.
watch/server:
air \
--build.cmd "go build -o .tmp/main cmd/main.go" \
--build.bin ".tmp/main" \
--build.delay "100" \
--build.exclude_dir "node_modules" \
--build.include_ext "go" \
--build.stop_on_error "false" \
--misc.clean_on_exit true


# run tailwindcss to generate the styles.css bundle in watch mode.
watch/tailwind:
tailwindcss -i static/css/input.css -o static/css/output.css --minify --watch


# watch for any js or css change in the assets/ folder, then reload the browser via templ proxy.
watch/sync_assets:
air \
--build.cmd "templ generate --notify-proxy" \
--build.bin "true" \
--build.delay "100" \
--build.exclude_dir "" \
--build.include_dir "static" \
--build.include_ext "js,css"


# start all 4 watch processes in parallel.
watch:
make -j4 watch/templ watch/server watch/tailwind watch/sync_assets
11 changes: 8 additions & 3 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ func main() {

server := http.NewServeMux()

fs := http.FileServer(http.Dir("./static"))
server.Handle("/static/", http.StripPrefix("/static/", fs))
homeHandler := handler.NewHomeHandler()
server.HandleFunc("/", homeHandler.HomePage)

authHandler := handler.NewAuthHandler()
server.Handle("/", authHandler.Setup())
server.HandleFunc("GET /login", authHandler.LoginPage)
server.HandleFunc("POST /login", authHandler.Login)
server.HandleFunc("/logout", authHandler.Logout)

fs := http.FileServer(http.Dir("./static"))
server.Handle("/static/", http.StripPrefix("/static/", fs))

err := http.ListenAndServe(addr, server)
if err != nil {
Expand Down
Empty file added database/database.go
Empty file.
122 changes: 119 additions & 3 deletions static/css/input.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,137 @@
font-family: raleway;
font-weight: 400;
font-style: normal;
src: url(/static/font/raleway-regular.ttf);
src: url(/static/font/raleway-regular.woff2);
}

@font-face {
font-family: raleway;
font-weight: 500;
font-style: medium;
src: url(/static/font/raleway-medium.ttf);
src: url(/static/font/raleway-medium.woff2);
}

@font-face {
font-family: raleway;
font-weight: 700;
font-style: bold;
src: url(/static/font/raleway-bold.ttf);
src: url(/static/font/raleway-bold.woff2);
}

.dark {
--sand-1: #111110;
--sand-2: #191918;
--sand-3: #222221;
--sand-4: #2a2a28;
--sand-5: #31312e;
--sand-6: #3b3a37;
--sand-7: #494844;
--sand-8: #62605b;
--sand-9: #6f6d66;
--sand-10: #7c7b74;
--sand-11: #b5b3ad;
--sand-12: #eeeeec;

--orange-1: #17120e;
--orange-2: #1e160f;
--orange-3: #331e0b;
--orange-4: #462100;
--orange-5: #562800;
--orange-6: #66350c;
--orange-7: #7e451d;
--orange-8: #a35829;
--orange-9: #f76b15;
--orange-10: #ff801f;
--orange-11: #ffa057;
--orange-12: #ffe0c2;
}

.light {
--sand-1: #fdfdfc;
--sand-2: #f9f9f8;
--sand-3: #f1f0ef;
--sand-4: #e9e8e6;
--sand-5: #e2e1de;
--sand-6: #dad9d6;
--sand-7: #cfceca;
--sand-8: #bcbbb5;
--sand-9: #8d8d86;
--sand-10: #82827c;
--sand-11: #63635e;
--sand-12: #21201c;

--orange-1: #fefcfb;
--orange-2: #fff7ed;
--orange-3: #ffefd6;
--orange-4: #ffdfb5;
--orange-5: #ffd19a;
--orange-6: #ffc182;
--orange-7: #f5ae73;
--orange-8: #ec9455;
--orange-9: #f76b15;
--orange-10: #ef5f00;
--orange-11: #cc4e00;
--orange-12: #582d1d;
}

@supports (color: color(display-p3 1 1 1)) {
@media (color-gamut: p3) {
.dark {
--sand-1: color(display-p3 0.067 0.067 0.063);
--sand-2: color(display-p3 0.098 0.098 0.094);
--sand-3: color(display-p3 0.135 0.135 0.129);
--sand-4: color(display-p3 0.164 0.163 0.156);
--sand-5: color(display-p3 0.193 0.192 0.183);
--sand-6: color(display-p3 0.23 0.229 0.217);
--sand-7: color(display-p3 0.285 0.282 0.267);
--sand-8: color(display-p3 0.384 0.378 0.357);
--sand-9: color(display-p3 0.434 0.428 0.403);
--sand-10: color(display-p3 0.487 0.481 0.456);
--sand-11: color(display-p3 0.707 0.703 0.68);
--sand-12: color(display-p3 0.933 0.933 0.926);

--orange-1: color(display-p3 0.088 0.07 0.057);
--orange-2: color(display-p3 0.113 0.089 0.061);
--orange-3: color(display-p3 0.189 0.12 0.056);
--orange-4: color(display-p3 0.262 0.132 0);
--orange-5: color(display-p3 0.315 0.168 0.016);
--orange-6: color(display-p3 0.376 0.219 0.088);
--orange-7: color(display-p3 0.465 0.283 0.147);
--orange-8: color(display-p3 0.601 0.359 0.201);
--orange-9: color(display-p3 0.9 0.45 0.2);
--orange-10: color(display-p3 0.98 0.51 0.23);
--orange-11: color(display-p3 1 0.63 0.38);
--orange-12: color(display-p3 0.98 0.883 0.775);
}

.light {
--sand-1: color(display-p3 0.992 0.992 0.989);
--sand-2: color(display-p3 0.977 0.977 0.973);
--sand-3: color(display-p3 0.943 0.942 0.936);
--sand-4: color(display-p3 0.913 0.912 0.903);
--sand-5: color(display-p3 0.885 0.883 0.873);
--sand-6: color(display-p3 0.854 0.852 0.839);
--sand-7: color(display-p3 0.813 0.81 0.794);
--sand-8: color(display-p3 0.738 0.734 0.713);
--sand-9: color(display-p3 0.553 0.553 0.528);
--sand-10: color(display-p3 0.511 0.511 0.488);
--sand-11: color(display-p3 0.388 0.388 0.37);
--sand-12: color(display-p3 0.129 0.126 0.111);

--orange-1: color(display-p3 0.995 0.988 0.985);
--orange-2: color(display-p3 0.994 0.968 0.934);
--orange-3: color(display-p3 0.989 0.938 0.85);
--orange-4: color(display-p3 1 0.874 0.687);
--orange-5: color(display-p3 1 0.821 0.583);
--orange-6: color(display-p3 0.975 0.767 0.545);
--orange-7: color(display-p3 0.919 0.693 0.486);
--orange-8: color(display-p3 0.877 0.597 0.379);
--orange-9: color(display-p3 0.9 0.45 0.2);
--orange-10: color(display-p3 0.87 0.409 0.164);
--orange-11: color(display-p3 0.76 0.34 0);
--orange-12: color(display-p3 0.323 0.185 0.127);
}
}
}
}

Expand Down
Loading

0 comments on commit d9b8bb5

Please sign in to comment.