Compare commits

...

2 commits

Author SHA1 Message Date
a8f18680c8 chore: fix restert when updating frontend files 2025-02-26 05:13:12 -03:00
e59ae1f31c feat: add mini-strap components 2025-02-26 04:52:27 -03:00
8 changed files with 17 additions and 41 deletions

View file

@ -10,7 +10,7 @@ docker-compose +ARGS:
start-dev-services: (docker-compose "up --remove-orphans") start-dev-services: (docker-compose "up --remove-orphans")
dev: dev:
watchexec --restart --clear --watch src --watch dist cargo run watchexec --no-vcs-ignore --clear --restart --watch=dist --watch=src cargo run
migrate: (docker-compose "run dbmate migrate") migrate: (docker-compose "run dbmate migrate")

View file

@ -4,6 +4,7 @@
"": { "": {
"name": "compendium", "name": "compendium",
"dependencies": { "dependencies": {
"@mini-strap/components": "^0.1.0",
"@mini-strap/core": "^0.1.2", "@mini-strap/core": "^0.1.2",
"htmx.org": "2.0.4", "htmx.org": "2.0.4",
}, },
@ -22,6 +23,8 @@
"@alecodes/bun-static-builder": ["@alecodes/bun-static-builder@0.1.0", "https://git.alecodes.page/api/packages/alecodes/npm/%40alecodes%2Fbun-static-builder/-/0.1.0/bun-static-builder-0.1.0.tgz", { "dependencies": { "sass": "^1.85.0", "slug": "^10.0.0" }, "peerDependencies": { "typescript": "^5.0.0" }, "bin": { "@alecodes/bun-static-builder": "src/cli.ts" } }, "sha512-1droOGfCr25rnVZCr7WhrECrk/03Y7gAGzhj0hr3h9ECMwIELT8B0nrL/K7j8IxmqfkOvA50l4uxRzgXHpOjGQ=="], "@alecodes/bun-static-builder": ["@alecodes/bun-static-builder@0.1.0", "https://git.alecodes.page/api/packages/alecodes/npm/%40alecodes%2Fbun-static-builder/-/0.1.0/bun-static-builder-0.1.0.tgz", { "dependencies": { "sass": "^1.85.0", "slug": "^10.0.0" }, "peerDependencies": { "typescript": "^5.0.0" }, "bin": { "@alecodes/bun-static-builder": "src/cli.ts" } }, "sha512-1droOGfCr25rnVZCr7WhrECrk/03Y7gAGzhj0hr3h9ECMwIELT8B0nrL/K7j8IxmqfkOvA50l4uxRzgXHpOjGQ=="],
"@mini-strap/components": ["@mini-strap/components@0.1.0", "https://git.alecodes.page/api/packages/alecodes/npm/%40mini-strap%2Fcomponents/-/0.1.0/components-0.1.0.tgz", { "peerDependencies": { "typescript": "^5.0.0" } }, "sha512-0FQxVSnk+YcFZpw7ldKncjVxtWWtMMUD9akNy4c1T4M3hgKf1s4ymo0lsTSMmM4o811VeSYfEWKXFXJWH9nU2A=="],
"@mini-strap/core": ["@mini-strap/core@0.1.2", "https://git.alecodes.page/api/packages/alecodes/npm/%40mini-strap%2Fcore/-/0.1.2/core-0.1.2.tgz", { "peerDependencies": { "typescript": "^5.0.0" }, "bin": { "@mini-strap/core": "build.ts" } }, "sha512-bt9su5jpslUMYmoNLz7s8P6RlN7Knriy8BtHBfVnpEizOh3DroStRr+yDCSLfhyByKXo6sa9ZNytc25ianEtbA=="], "@mini-strap/core": ["@mini-strap/core@0.1.2", "https://git.alecodes.page/api/packages/alecodes/npm/%40mini-strap%2Fcore/-/0.1.2/core-0.1.2.tgz", { "peerDependencies": { "typescript": "^5.0.0" }, "bin": { "@mini-strap/core": "build.ts" } }, "sha512-bt9su5jpslUMYmoNLz7s8P6RlN7Knriy8BtHBfVnpEizOh3DroStRr+yDCSLfhyByKXo6sa9ZNytc25ianEtbA=="],
"@parcel/watcher": ["@parcel/watcher@2.5.1", "", { "dependencies": { "detect-libc": "^1.0.3", "is-glob": "^4.0.3", "micromatch": "^4.0.5", "node-addon-api": "^7.0.0" }, "optionalDependencies": { "@parcel/watcher-android-arm64": "2.5.1", "@parcel/watcher-darwin-arm64": "2.5.1", "@parcel/watcher-darwin-x64": "2.5.1", "@parcel/watcher-freebsd-x64": "2.5.1", "@parcel/watcher-linux-arm-glibc": "2.5.1", "@parcel/watcher-linux-arm-musl": "2.5.1", "@parcel/watcher-linux-arm64-glibc": "2.5.1", "@parcel/watcher-linux-arm64-musl": "2.5.1", "@parcel/watcher-linux-x64-glibc": "2.5.1", "@parcel/watcher-linux-x64-musl": "2.5.1", "@parcel/watcher-win32-arm64": "2.5.1", "@parcel/watcher-win32-ia32": "2.5.1", "@parcel/watcher-win32-x64": "2.5.1" } }, "sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg=="], "@parcel/watcher": ["@parcel/watcher@2.5.1", "", { "dependencies": { "detect-libc": "^1.0.3", "is-glob": "^4.0.3", "micromatch": "^4.0.5", "node-addon-api": "^7.0.0" }, "optionalDependencies": { "@parcel/watcher-android-arm64": "2.5.1", "@parcel/watcher-darwin-arm64": "2.5.1", "@parcel/watcher-darwin-x64": "2.5.1", "@parcel/watcher-freebsd-x64": "2.5.1", "@parcel/watcher-linux-arm-glibc": "2.5.1", "@parcel/watcher-linux-arm-musl": "2.5.1", "@parcel/watcher-linux-arm64-glibc": "2.5.1", "@parcel/watcher-linux-arm64-musl": "2.5.1", "@parcel/watcher-linux-x64-glibc": "2.5.1", "@parcel/watcher-linux-x64-musl": "2.5.1", "@parcel/watcher-win32-arm64": "2.5.1", "@parcel/watcher-win32-ia32": "2.5.1", "@parcel/watcher-win32-x64": "2.5.1" } }, "sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg=="],

View file

@ -1,3 +0,0 @@
h1 {
color: red;
}

1
frontend/css/style.scss Normal file
View file

@ -0,0 +1 @@

View file

@ -4,16 +4,23 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="@mini-strap/core" /> <link rel="stylesheet" href="@mini-strap/core" />
<link rel="stylesheet" href="../css/style.css" /> <link rel="stylesheet" href="@mini-strap/components/offcanvas/style.scss" />
<link rel="stylesheet"
href="@mini-strap/components/accordion/accordion.scss" />
<link rel="stylesheet" href="@mini-strap/components/navbar/navbar.scss" />
<link rel="stylesheet" href="../css/style.scss" />
<script type="module" src="htmx.org"></script> <script type="module" src="htmx.org"></script>
<script type="module" src="@mini-strap/components/offcanvas/index.ts"></script>
<title> <title>
{% block title %}Axum web service!{% endblock %} {% block title %}Axum web service!{% endblock %}
</title> </title>
</head> </head>
<body> <body>
{% include "partials/header.html" %} <header>
<main> {% include "partials/header.html" %}
</header>
<main class="msp-container">
<nav class="msp-d-sm-none msp-d-flex msp-justify-content-end"> <nav class="msp-d-sm-none msp-d-flex msp-justify-content-end">
<button class="msp-offcanvas-toggle" data-msp-target="#main-offcanvas">Toggle</button> <button class="msp-offcanvas-toggle" data-msp-target="#main-offcanvas">Toggle</button>
</nav> </nav>

View file

@ -6,6 +6,7 @@
<button class="msp-btn-sm" hx-get="/" hx-target="#example-table">Refresh</button> <button class="msp-btn-sm" hx-get="/" hx-target="#example-table">Refresh</button>
</div> </div>
<h1>Axum example! 1</h1>
{% block htmx %} {% block htmx %}
<table id="example-table"> <table id="example-table">

View file

@ -1,34 +0,0 @@
<aside id="main-offcanvas" class="msp-offcanvas msp-offcanvas-sm">
<div class="msp-offcanvas-backdrop msp-offcanvas-toggle"
data-msp-target="#main-offcanvas"></div>
<div class="msp-offcanvas-content">
<div class="msp-offcanvas-body">
<ul class="msp-list-unstyle msp-accordion">
<li>
<a href="/">Overview</a>
</li>
{% for page in global_routes %}
<li class="msp-accordion-item">
<a class="msp-accordion-header" href="{{ page.path }}">{{ page.text }}</a>
{% if page.subpages.length > 0 %}
}
<div class="msp-accordion-collapse">
<ul class="msp-list-unstyle msp-accordion-content">
{% for subpage in page.subpages %}
<li class="">
<a href="{{ subpage.path }}">{{ subpage.text }}</a>
</li>
{% endfor %}
</ul>
</div>
{
{% endif %}
</li>
{% endfor %}
</ul>
</div>
</div>
</aside>

View file

@ -11,6 +11,7 @@
}, },
"type": "module", "type": "module",
"dependencies": { "dependencies": {
"@mini-strap/components": "^0.1.0",
"@mini-strap/core": "^0.1.2", "@mini-strap/core": "^0.1.2",
"htmx.org": "2.0.4" "htmx.org": "2.0.4"
} }