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;
tab-size: 4;
/* 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 */
font-feature-settings: normal;
/* 5 */
@ -534,6 +534,19 @@ video {
--tw-backdrop-sepia: ;
}
.m-auto {
margin: auto;
}
.my-4 {
margin-top: 1rem;
margin-bottom: 1rem;
}
.block {
display: block;
}
.flex {
display: flex;
}
@ -581,4 +594,4 @@ video {
.text-white {
--tw-text-opacity: 1;
color: rgb(255 255 255 / var(--tw-text-opacity));
}
}

View file

@ -17,7 +17,12 @@
run-dev = pkgs.writeShellScriptBin "run-dev" ''
#!/usr/bin/env zsh
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 {
@ -30,6 +35,7 @@
pkgconfig
rustc
cargo
cargo-watch
nodejs_20
nodePackages_latest.pnpm
];
@ -43,5 +49,6 @@
build-tailwind = build-tailwind;
run-dev = run-dev;
run-prettier = run-prettier;
};
}

View file

@ -1,7 +1,7 @@
{
"devDependencies": {
"prettier": "^3.0.1",
"prettier-plugin-tailwindcss": "^0.4.1",
"tailwindcss": "^3.3.3"
}
"devDependencies": {
"prettier": "^3.0.1",
"prettier-plugin-tailwindcss": "^0.4.1",
"tailwindcss": "^3.3.3"
}
}

793
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;
pub async fn root() -> impl IntoResponse {
let template = RootTemplate {};
let template = RootTemplate {
name: "Steven"
};
HtmlTemplate(template)
}

View file

@ -1,3 +1,3 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind utilities;

View file

@ -2,4 +2,14 @@ use askama::Template;
#[derive(Template)]
#[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} */
module.exports = {
content: ['./templates/*.html'],
content: ["./templates/*.html"],
theme: {
extend: {
fontFamily: {
sans: ['Inter var', ...fontFamily.sans],
},
},
extend: {},
},
};
};

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>
<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">
<h1 class="text-2xl text-white">SK TCG Trader</h1>
<h2 class="text-xl text-white" id="help-text">Click the button below to get the metrics</h2>
<br />
<p class="font-bold text-white"id="data"></p>
<br />
<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>
</body>
<style>
</style>
</html>
{% extends "base.html" %} {% block body %}
<div class="flex flex-col items-center">
<h1 class="text-2xl text-white">{{ name }}'s SK TCG Trader</h1>
<br />
<h2 class="my-4 text-xl text-white" id="help-text">
Click the button below to get the metrics
</h2>
<br />
<p class="font-bold text-white" id="data"></p>
<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>
{% endblock %}

View file

@ -3161,4 +3161,4 @@
"usd_value": "0.0"
}
]
}
}

View file

@ -51,4 +51,4 @@
"usd_value": "7.67"
}
]
}
}