Compare commits

..

No commits in common. "e51d14b47ccd1facccdf9331045352f1904b5a29" and "e1753ae84060af85ab699b5a504ad662bbc5a897" have entirely different histories.

7 changed files with 32 additions and 26 deletions

View file

@ -1,9 +1,6 @@
@import "tailwindcss";
@theme {
--almostscreen: 90vh;
--halfscreen: 60vh;
}
@tailwind base;
@tailwind components;
@tailwind utilities;
/* Fixed background when scrolling in tailwind
* Disabled on iOS devices

View file

@ -68,7 +68,7 @@ pub fn hero(wallpaper: Option<&'static Wallpaper>) -> impl IntoAny {
<div
id="wallpaper"
class=tw_join!(
"relative", "text-white", "w-full", "h-(--almostscreen)", "bg-center", "bg-cover"
"relative", "text-white", "w-full", "h-almostscreen", "bg-center", "bg-cover"
)
style=background_image

View file

@ -22,7 +22,7 @@ pub fn wallpapers_page() -> impl IntoAny {
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css" integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=" crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js" integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=" crossorigin=""></script>
<div id="map" class="w-full h-(--halfscreen)"></div>
<div id="map" class="w-full h-halfscreen"></div>
<script inner_html=r#"
let map = L.map('map').setView([48.858288, 2.294442], 2);

View file

@ -8,6 +8,7 @@ pub fn shell(title: &str, children: impl IntoAny) -> AnyView {
title.into()
};
let year = jiff::Zoned::now().year();
view! {
<!DOCTYPE html>
<html lang="en">
@ -35,12 +36,15 @@ pub fn shell(title: &str, children: impl IntoAny) -> AnyView {
<main class=tw_join!("flex-grow")>
{children.into_any()}
</main>
{footer().into_any()}
<footer class=tw_join!("bg-black")>
<div class=tw_join!("container", "mx-auto", "px-4", "py-8")>
<p>"© 2015 - "{year}" Philippe Loctaux, made with "{underline_link(Link::new(uri!("https://leptos.dev").into(), "Leptos"), None).into_any()}"."</p>
</div>
</footer>
</body>
{stats().into_any()}
</html>
}
.into_any()
}.into_any()
}
pub fn content_page(title: &str, children: impl IntoAny) -> AnyView {
@ -58,18 +62,7 @@ pub fn content_page(title: &str, children: impl IntoAny) -> AnyView {
.into_any()
}
fn footer() -> impl IntoView {
let year = jiff::Zoned::now().year();
view! {
<footer class=tw_join!("bg-black")>
<div class=tw_join!("container", "mx-auto", "px-4", "py-8")>
<p>"© 2015 - "{year}" Philippe Loctaux, made with "{underline_link(Link::new(uri!("https://leptos.dev").into(), "Leptos"), None).into_any()}"."</p>
</div>
</footer>
}
}
fn stats() -> impl IntoView {
pub fn stats() -> impl IntoView {
view! {
<script inner_html=r#"
window.goatcounter = {

View file

@ -0,0 +1,16 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: {
relative: true,
files: ["./src/**/*.rs"],
},
theme: {
extend: {
height: {
almostscreen: "90vh",
halfscreen: "60vh",
}
},
},
plugins: [],
}

View file

@ -8,7 +8,7 @@
stdenvNoCC.mkDerivation {
name = "plcom-css-tailwind";
inherit src;
nativeBuildInputs = [ tailwindcss ];
buildInputs = [ tailwindcss ];
dontUnpack = true;
buildPhase = "${tailwindcss}/bin/tailwindcss --input ${src}/${inputFile} --output $out/output.css --cwd ${src} --minify";
buildPhase = "${tailwindcss}/bin/tailwindcss --config ${src}/tailwind.config.js --input ${src}/${inputFile} --output $out/output.css --minify";
}

View file

@ -30,7 +30,7 @@
# Gather assets
plcomAssets = import ./crates/plcom/assets.nix {
stdenvNoCC = pkgs.stdenvNoCC;
tailwindcss = pkgs.tailwindcss_4;
tailwindcss = pkgs.tailwindcss;
tailwindProjectRoot = ./crates/plcom;
src = ./public;
};