Moved styles to the public folder for proper importing and hashing

master
Wynd 2025-06-29 16:20:23 +03:00
parent bd4fb25a6a
commit 54f125ab41
20 changed files with 31 additions and 11 deletions

View File

@ -1,7 +1,7 @@
export let showOnlyTracked = false;
export let kindFilter = new Set();
document.addEventListener("DOMContentLoaded", (event) => {
export function init() {
const onlyTrackedFilter = document.querySelector(
'input[name="onlyTracked"]',
);
@ -25,7 +25,7 @@ document.addEventListener("DOMContentLoaded", (event) => {
filter();
});
});
});
}
function filter() {
const categories = document.querySelectorAll(".category-wrapper");

View File

@ -1,7 +1,12 @@
import {
init,
kindFilter,
showOnlyTracked,
track,
} from "../common/mat-kind-filter.js";
document.addEventListener("DOMContentLoaded", (event) => {
init();
});
Object.assign(window, { track });

View File

@ -1,7 +1,12 @@
import {
init,
kindFilter,
showOnlyTracked,
track,
} from "../common/mat-kind-filter.js";
document.addEventListener("DOMContentLoaded", (event) => {
init();
});
Object.assign(window, { track });

View File

@ -1,8 +1,10 @@
@import url("./colors.css");
body {
position: relative;
min-height: 98vh;
background-color: #333;
color: #fff;
background-color: var(--bg-color);
color: var(--text-color);
}
footer {

View File

@ -0,0 +1,4 @@
:root {
--bg-color: #333;
--text-color: #fff;
}

View File

@ -0,0 +1 @@
@import url("../common/drops.css");

View File

@ -0,0 +1 @@
@import url("../common/drops.css");

View File

@ -26,6 +26,7 @@ mod kh3;
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub const ASSETS_FOLDER_PATH: &str = "./public/assets";
pub const SCRIPTS_FOLDER_PATH: &str = "./public/scripts";
pub const STYLES_FOLDER_PATH: &str = "./public/styles";
static FILE_HASHES: LazyLock<HashMap<String, Hash>> = LazyLock::new(|| {
let mut map = HashMap::new();
@ -56,6 +57,7 @@ static FILE_HASHES: LazyLock<HashMap<String, Hash>> = LazyLock::new(|| {
}
parse_path(SCRIPTS_FOLDER_PATH.into(), &mut map);
parse_path(STYLES_FOLDER_PATH.into(), &mut map);
map
});

View File

@ -3,7 +3,7 @@
<head>
<title>{% block title %}{% endblock %}</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>{% include "components/core/style.css"%} </style>
<link rel="stylesheet" href="{{ crate::find_hash("/public/styles/common/base.css") }}"></link>
{% block head %}{% endblock %}
</head>

View File

@ -3,7 +3,7 @@
{% block title %}BBS - Command Melding{% endblock %}
{% block head %}
<style> {% include "components/bbs/style.css" %}</style>
<link rel="stylesheet" href="{{ crate::find_hash("/public/styles/bbs/melding.css") }}"></link>
<script
type="module"
src="{{ crate::find_hash("/public/scripts/bbs/melding.js") }}"

View File

@ -3,7 +3,7 @@
{% block title %}DDD - Spirit Boards{% endblock %}
{% block head %}
<style>{% include "components/ddd/style.css" %}</style>
<link rel="stylesheet" href="{{ crate::find_hash("/public/styles/ddd/boards.css") }}"></link>
{% endblock %}
{% block content %}

View File

@ -4,7 +4,7 @@
{% block title %}KH1 - Drops{% endblock %}
{% block head %}
<style>{% include "components/kh2/style.css" %}</style>
<link rel="stylesheet" href="{{ crate::find_hash("/public/styles/kh1/drops.css") }}"></link>
<script
type="module"
src="{{ crate::find_hash("/public/scripts/kh1/drops.js") }}"

View File

@ -4,7 +4,7 @@
{% block title %}KH1 - Sythensis{% endblock %}
{% block head %}
<style>{% include "components/kh1/style.css" %}</style>
<link rel="stylesheet" href="{{ crate::find_hash("/public/styles/kh1/synth.css") }}"></link>
<script
type="module"
src="{{ crate::find_hash("/public/scripts/kh1/synth.js") }}"

View File

@ -4,7 +4,7 @@
{% block title %}KH2 - Drops{% endblock %}
{% block head %}
<style>{% include "components/kh2/style.css" %}</style>
<link rel="stylesheet" href="{{ crate::find_hash("/public/styles/kh2/drops.css") }}"></link>
<script
type="module"
src="{{ crate::find_hash("/public/scripts/kh2/drops.js") }}"

View File

@ -3,7 +3,7 @@
{% block title %}KH3 - Food Simulator{% endblock %}
{% block head %}
<style>{% include "components/kh3/style.css" %}</style>
<link rel="stylesheet" href="{{ crate::find_hash("/public/styles/kh3/food-sim.css") }}"></link>
<script
type="module"
src="{{ crate::find_hash("/public/scripts/kh3/food-sim.js") }}"