all repos — breadsite @ 65ec84fd4e55ea87d7147c6a5717d04c235aae00

Unnamed repository; edit this file 'description' to name the repository.

uhhh stuff i think?
confusedbread confuseddbread@gmail.com
Thu, 03 Jul 2025 07:04:49 +0200
commit

65ec84fd4e55ea87d7147c6a5717d04c235aae00

parent

63b118288515ef1392f22813ffcd98b633ea7f05

4 files changed, 99 insertions(+), 66 deletions(-)

jump to
M backend/nowPlaying.gobackend/nowPlaying.go

@@ -4,7 +4,6 @@ import (

"fmt" "log" "net/http" - "reflect" "strings" "time" )

@@ -30,11 +29,11 @@

func nowPlayingHandler(w http.ResponseWriter, r *http.Request) { playingInfo := music_cache_handler(&music_handler_Cache, time.Second * 60) - v := reflect.ValueOf(playingInfo) - k := v.Type() - for i := range v.NumField() { - log.Printf("%s: %s\n", k.Field(i).Name, v.Field(i)) - } + // v := reflect.ValueOf(playingInfo) + // k := v.Type() + // for i := range v.NumField() { + // log.Printf("%s: %s\n", k.Field(i).Name, v.Field(i)) + // } w.Header().Add("Access-Control-Allow-Origin", "*") w.Header().Add("Access-Control-Allow-Headers", "*")
M src/main.rssrc/main.rs

@@ -17,6 +17,7 @@ (DOCTYPE)

head { meta charset="utf-8"; title { (page_title) } + link rel="icon" href="./static/neodog_laptop_notice.png"; link rel="stylesheet" href="static/style.css"; script src="https://cdn.jsdelivr.net/npm/htmx.org@2.0.6/dist/htmx.min.js" {} script { "htmx.config.selfRequestsOnly = false" }

@@ -51,7 +52,7 @@ header {

(nav_bar(vec![ NavElement{ name: "breadsite".to_string(), href: "/".to_string(), class: String::from("navElement")}, NavElement{ name: "boop".to_string(), href: "/boop".to_string(), class: String::from("navElement")}, - NavElement{ name: ":333".to_string(), href: "/3".to_string(), class: String::from("navElement")}, + NavElement{ name: "waf".to_string(), href: "/waf".to_string(), class: String::from("navElement")}, ], current))

@@ -65,8 +66,10 @@ // TODOO: pawer links

fn pawer() -> Markup { html! { pawer { - @for _ in 1..101 { - p { "paws...." } + ul { + li {"fedi: " a href="https://plasmatrap.com/@bread" {"@plasmatrap.com@bread"}} + br; br; + li {sub {"paws...."}} } } }

@@ -74,37 +77,38 @@ }

// TODOOOO: about me // TODO: idea: heart rate monitor -// TODO: idea: view counter // TODO: idea: svg -> neocat generator fn breadsite() -> Markup { html! { - main { - h1 { "Hiiii" } - } + h1 { "Hiiii" } } } fn boop() -> Markup { html! { - main { - h1 { "Boop me" } - div class="boop timestamp" { (format!("boops since {}:",Local::now().format("%d/%m/%Y %H:%M UTC%Z"))) } - div #boop-counter hx-get="http://localhost:5050/boop" hx-trigger="load" {} - div class="boop stack" { - img class="unbooped" src="./static/neodog.png" {} - button class="boop" hx-post="http://localhost:5050/boop" hx-trigger="mousedown throttle:500ms" hx-swap="swap:500ms" hx-target="#boop-counter" {} - } + h1 { "Boop me" } + div class="boop timestamp" { (format!("boops since {}:",Local::now().format("%d/%m/%Y %H:%M UTC%Z"))) } + div class="boop counter" #boop-counter hx-get="http://localhost:5050/boop" hx-trigger="load" {} + div class="boop stack" { + img class="boop unboop" src="./static/neodog.png" {} + button class="boop button" hx-post="http://localhost:5050/boop" hx-trigger="mousedown throttle:300ms" hx-swap="swap:275ms" hx-target="#boop-counter" {} } } } +fn waf() -> Markup { + html! { + h1 { "waf :3" } + } +} + fn layout(page_title: &str, current: &str,site: Markup) -> Markup { html! { (head(page_title)) - body { + body class={(page_title)} { (header(current)) - (site) + main {(site)} (pawer()) } }

@@ -124,10 +128,10 @@ (layout("boop", "/boop", boop()))

}) } -#[get("/3")] -async fn breadsite_3() -> AwResult<Markup> { +#[get("/waf")] +async fn breadsite_waf() -> AwResult<Markup> { Ok(html! { - (layout(":333", "/3", breadsite())) + (layout("waf", "/waf", waf())) }) }

@@ -136,7 +140,7 @@ async fn main() -> io::Result<()> {

HttpServer::new(|| App::new() .service(breadsite_index) .service(breadsite_boop) - .service(breadsite_3) + .service(breadsite_waf) .service(Files::new("/static", "./static")) ) .bind(("localhost", 8080))?
M src/static/style.csssrc/static/style.css

@@ -335,8 +335,6 @@ --mantle: var(--ctp-mocha-mantle);

--crust: var(--ctp-mocha-crust); --link: var(--ctp-mocha-blue); - --nav-song: var(--ctp-mocha-blue); - --nav-0: var(--ctp-mocha-peach); --nav-1: var(--ctp-mocha-pink); --nav-2: var(--ctp-mocha-mauve);

@@ -349,7 +347,17 @@ --nav-height: 4rem;

--nav-border: 0.6rem; --nav-border-n: calc(var(--nav-border) * -1); - --boop-animation: cubic-bezier(0,.39,1,-0.16); + --boop-animation: cubic-bezier(.8,.6,.3,.8); +} + +body.breadsite { + --site-color: var(--ctp-mocha-peach); +} +body.boop { + --site-color: var(--ctp-mocha-pink); +} +body.waf { + --site-color: var(--ctp-mocha-mauve); } * {

@@ -358,8 +366,11 @@ margin: 0;

} body { + display: flex; + flex-direction: column; background-color: var(--background); color: var(--text); + min-height: 100vh; } a {

@@ -367,7 +378,8 @@ color: var(--link);

text-decoration: none; &:hover{ - text-decoration: underline; + text-decoration: underline dotted 3px; + color: var(--site-color) } }

@@ -384,6 +396,11 @@ }

main { padding: 1rem; + flex-grow: 1; +} + +sub { + color: var(--subtext) !important; } pawer {

@@ -391,10 +408,18 @@ display: inline-block;

background: var(--crust); border-top-left-radius: 1rem; border-top-right-radius: 1rem; - width: calc(100vw - 2rem); - padding: 1rem; -} + width: calc(100vw - 4rem); + padding: 2rem; + display: flex; + flex-direction: row; + justify-content: space-between; + + ul { + list-style: none; + margin: auto; + } +} .navBar {

@@ -404,6 +429,8 @@ gap: 1rem;

z-index: 10; .navElement{ + min-width: 2rem; + padding-top: 0.8rem; padding-right: 1rem;

@@ -531,12 +558,12 @@ &.loading {

height: 2rem; width: 2rem; padding-left: 1rem; - margin-bottom: calc(5.7rem); + margin-bottom: 5.7rem; } &:hover { text-decoration: none !important; - box-shadow: -0.2rem 0.2rem var(--nav-song); + box-shadow: -0.2rem 0.2rem var(--site-color); background-color: var(--crust); }

@@ -547,7 +574,7 @@ right: 0;

display: flex; flex-direction: column; - gap: 0.2rem; + gap: 0.25rem; padding: 0.5rem; padding-right: 0.75rem;

@@ -590,41 +617,44 @@ img.coverImg {

height: var(--cover-size); width: var(--cover-size); border-radius: 0.5rem; + font-size: 0.6rem; + background-color: var(--crust); } } -button.boop, img.unbooped { - position: absolute; - height: 16rem; - width: 16rem; -} +.boop { + .button, .unboop { + position: absolute; + height: 16rem; + width: 16rem; + } -.boop.stack { - position: relative; - height: 16rem; - width: 16rem; -} + .button { + background: url("neodog_boop_blep.png") no-repeat scroll 0 0 transparent; + border: none; + background-size: 16rem 16rem; + opacity: 0; + &:active{ + animation: fadeIn 0.3s forwards; + animation-timing-function: var(--boop-animation); + animation-iteration-count: 1; + } + } -img.unbooped { - left: 18px; - opacity: 1; -} -img.unbooped:has(~ button.boop:active){ - animation: fadeOut 0.5s forwards; - animation-timing-function: var(--boop-animation); - animation-iteration-count: 1; -} + &.stack { + position: relative; + height: 16rem; + width: 16rem; + } -button.boop{ - background: url("neodog_boop_blep.png") no-repeat scroll 0 0 transparent; - border: none; - background-size: 16rem 16rem; - opacity: 0; - transition: transform 2s ease, opacity 2s ease 3s; - &:active{ - animation: fadeIn 0.5s forwards; - animation-timing-function: var(--boop-animation); - animation-iteration-count: 1; + .unboop { + left: 18px; + opacity: 1; + &:has(~ button.boop:active){ + animation: fadeOut 0.3s forwards; + animation-timing-function: var(--boop-animation); + animation-iteration-count: 1; + } } }