added in several workflow QOL features and updated flake

This commit is contained in:
specCon18 2023-08-07 18:04:19 -04:00
parent 153276f49c
commit bc27ffab4e
14 changed files with 3764 additions and 312 deletions

3162
assets/htmx.min.js vendored

File diff suppressed because one or more lines are too long

View file

@ -44,7 +44,7 @@ html {
-o-tab-size: 4; -o-tab-size: 4;
tab-size: 4; tab-size: 4;
/* 3 */ /* 3 */
font-family: Inter var, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
/* 4 */ /* 4 */
font-feature-settings: normal; font-feature-settings: normal;
/* 5 */ /* 5 */
@ -534,6 +534,19 @@ video {
--tw-backdrop-sepia: ; --tw-backdrop-sepia: ;
} }
.m-auto {
margin: auto;
}
.my-4 {
margin-top: 1rem;
margin-bottom: 1rem;
}
.block {
display: block;
}
.flex { .flex {
display: flex; display: flex;
} }

View file

@ -17,7 +17,12 @@
run-dev = pkgs.writeShellScriptBin "run-dev" '' run-dev = pkgs.writeShellScriptBin "run-dev" ''
#!/usr/bin/env zsh #!/usr/bin/env zsh
set -e set -e
cargo run test_data/test.json cargo watch -x 'run test_data/test.json'
'';
run-prettier = pkgs.writeShellScriptBin "run-prettier" ''
#!/usr/bin/env zsh
set -e
pnpm prettier --write --ignore-unknown .
''; '';
in { in {
@ -30,6 +35,7 @@
pkgconfig pkgconfig
rustc rustc
cargo cargo
cargo-watch
nodejs_20 nodejs_20
nodePackages_latest.pnpm nodePackages_latest.pnpm
]; ];
@ -43,5 +49,6 @@
build-tailwind = build-tailwind; build-tailwind = build-tailwind;
run-dev = run-dev; run-dev = run-dev;
run-prettier = run-prettier;
}; };
} }

785
pnpm-lock.yaml generated

File diff suppressed because it is too large Load diff

View file

@ -4,7 +4,9 @@ use crate::templates::RootTemplate;
use crate::util::HtmlTemplate; use crate::util::HtmlTemplate;
pub async fn root() -> impl IntoResponse { pub async fn root() -> impl IntoResponse {
let template = RootTemplate {}; let template = RootTemplate {
name: "Steven"
};
HtmlTemplate(template) HtmlTemplate(template)
} }

View file

@ -2,4 +2,14 @@ use askama::Template;
#[derive(Template)] #[derive(Template)]
#[template(path = "root.html")] #[template(path = "root.html")]
pub struct RootTemplate; pub struct RootTemplate<'a>{
pub name: &'a str,
}
#[derive(Template)]
#[template(path="base.html")]
pub struct BaseTemplate;
#[derive(Template)]
#[template(path="head.html")]
pub struct HeadTemplate;

View file

@ -1,13 +1,7 @@
const { fontFamily } = require('tailwindcss/defaultTheme');
/** @type {import('tailwindcss').Config} */ /** @type {import('tailwindcss').Config} */
module.exports = { module.exports = {
content: ['./templates/*.html'], content: ["./templates/*.html"],
theme: { theme: {
extend: { extend: {},
fontFamily: {
sans: ['Inter var', ...fontFamily.sans],
},
},
}, },
}; };

11
templates/base.html Normal file
View file

@ -0,0 +1,11 @@
<!doctype html>
<html>
<head>
<title>SK TCG Trader</title>
<link rel="stylesheet" href="/assets/main.css" />
<script src="/assets/htmx.min.js"></script>
</head>
<body class="bg-slate-700 m-auto">
{% block body %}{% endblock %}
</body>
</html>

0
templates/head.html Normal file
View file

View file

@ -1,20 +1,20 @@
<!DOCTYPE html> {% extends "base.html" %} {% block body %}
<html>
<head>
<title>SK TCG Trader</title>
<link rel="stylesheet" href="/assets/main.css">
<script src="/assets/htmx.min.js"></script>
</head>
<body class="bg-slate-700">
<div class="flex flex-col items-center"> <div class="flex flex-col items-center">
<h1 class="text-2xl text-white">SK TCG Trader</h1> <h1 class="text-2xl text-white">{{ name }}'s SK TCG Trader</h1>
<h2 class="text-xl text-white" id="help-text">Click the button below to get the metrics</h2> <br />
<h2 class="my-4 text-xl text-white" id="help-text">
Click the button below to get the metrics
</h2>
<br /> <br />
<p class="font-bold text-white" id="data"></p> <p class="font-bold text-white" id="data"></p>
<br /> <button
<button class="bg-purple-500 p-4 rounded-lg text-white font-bold" id="submit" hx-get="/metrics" hx-target='#data' hx-swap="innerHTML">Get Data</button> class="bg-purple-500 p-4 rounded-lg text-white font-bold"
id="submit"
hx-get="/metrics"
hx-target="#data"
hx-swap="innerHTML"
>
Get Data
</button>
</div> </div>
</body> {% endblock %}
<style>
</style>
</html>