cleaned up some components conditional css class assignment

This commit is contained in:
2026-04-15 16:27:44 +02:00
parent 4434a01341
commit 78eea262b2
4 changed files with 34 additions and 50 deletions

View File

@@ -27,9 +27,11 @@
<div class="title-container"> <div class="title-container">
<div class="title-text-container"> <div class="title-text-container">
<h1 class="title">{title}</h1> <h1 class="title">{title}</h1>
{#if subtitle} {#if subtitle}
<p class="subtitle">[ {subtitle} ]</p> <p class="subtitle">[ {subtitle} ]</p>
{/if} {/if}
{#if tags.length} {#if tags.length}
<div class="tag-container"> <div class="tag-container">
{#each tags as tag} {#each tags as tag}
@@ -43,9 +45,11 @@
{#if dateIndeterminate} {#if dateIndeterminate}
<p class="date">:: {dateIndeterminate}</p> <p class="date">:: {dateIndeterminate}</p>
{/if} {/if}
{#if date} {#if date}
<p class="date">posted :: {date}</p> <p class="date">posted :: {date}</p>
{/if} {/if}
{#if dateUpdated} {#if dateUpdated}
<p class="date">last updated :: {dateUpdated}</p> <p class="date">last updated :: {dateUpdated}</p>
{/if} {/if}
@@ -57,13 +61,10 @@
<div class="container"> <div class="container">
{#if banner && banner !== ""} {#if banner && banner !== ""}
<a class="banner-container" href={banner}> <a class="banner-container" href={banner}>
{#if pixelated} <img class="banner {pixelated ? "pixelated-img" : ""}" src={banner} alt={bannerAlt}>
<img class="banner pixelated-img" src={banner} alt={bannerAlt}>
{:else}
<img class="banner" src={banner} alt={bannerAlt}>
{/if}
</a> </a>
{/if} {/if}
{@render titles({title, subtitle, date})} {@render titles({title, subtitle, date})}
<hr> <hr>
</div> </div>

View File

@@ -10,11 +10,7 @@
} = $props(); } = $props();
</script> </script>
{#if fullWidth} <button class="outlined-button {fullWidth ? "outlined-button-fullwidth" : ""}" onclick={onClick}>{text}</button>
<button class="outlined-button outlined-button-fullwidth" onclick={onClick}>{text}</button>
{:else}
<button class="outlined-button" onclick={onClick}>{text}</button>
{/if}
<style> <style>
.outlined-button { .outlined-button {

View File

@@ -34,18 +34,24 @@
<div class="webring-container"> <div class="webring-container">
<div class="webring-row"> <div class="webring-row">
<span></span> <span></span>
<a href="{ringLink}">{highlightEmojiLeft} {ringName} {highlightEmojiRight ?? highlightEmojiLeft}</a> <a href="{ringLink}">{highlightEmojiLeft} {ringName} {highlightEmojiRight ?? highlightEmojiLeft}</a>
<span></span> <span></span>
</div> </div>
<div class="webring-row"> <div class="webring-row">
<span></span> <span></span>
<a href="{prevLink}">{prevSymbol} prev</a> <a href="{prevLink}">{prevSymbol} prev</a>
{#if randLink} {#if randLink}
<a href="{randLink}">rand</a> <a href="{randLink}">rand</a>
{/if} {/if}
{#if listLink} {#if listLink}
<a href="{listLink}">list</a> <a href="{listLink}">list</a>
{/if} {/if}
<a href="{nextLink}">next {nextSymbol}</a> <a href="{nextLink}">next {nextSymbol}</a>
<span></span> <span></span>
</div> </div>

View File

@@ -21,15 +21,29 @@
} = $props(); } = $props();
</script> </script>
{#snippet subtitledImageContent()} <a class="
subtitled-img-container
blurred-background
{smaller ? "subtitled-img-reduced-size" : ""}
{alignment == "left"
? "subtitled-img-container-left"
: alignment == "right"
? "subtitled-img-container-right"
: "subtitled-img-container-centred"
}"
href="{image}"
>
{#if video} {#if video}
<Video src={image} /> <Video src={image} />
{:else} {:else}
{#if pixelated} <img class="
<img class="subtitled-img pixelated-img" src="{image}" alt="{altText}"> subtitled-img
{:else} {pixelated ? "pixelated-img" : ""}
<img class="subtitled-img" src="{image}" alt="{altText}"> "
{/if} src="{image}"
alt="{altText}"
>
{/if} {/if}
{#if subtitle} {#if subtitle}
@@ -39,40 +53,7 @@
<p class="subtitled-img-text">{subtitle}</p> <p class="subtitled-img-text">{subtitle}</p>
</div> </div>
{/if} {/if}
{/snippet} </a>
<!-- this structure is ugly as fuck. there must be a better way of doing this -->
{#if alignment && alignment == "left"}
{#if smaller}
<a class="subtitled-img-container blurred-background subtitled-img-container-left subtitled-img-reduced-size" href="{image}">
{@render subtitledImageContent()}
</a>
{:else}
<a class="subtitled-img-container blurred-background subtitled-img-container-left" href="{image}">
{@render subtitledImageContent()}
</a>
{/if}
{:else if alignment && alignment == "right"}
{#if smaller}
<a class="subtitled-img-container blurred-background subtitled-img-container-right subtitled-img-reduced-size" href="{image}">
{@render subtitledImageContent()}
</a>
{:else}
<a class="subtitled-img-container subtitled-img-container-right" href="{image}">
{@render subtitledImageContent()}
</a>
{/if}
{:else}
{#if smaller}
<a class="subtitled-img-container blurred-background subtitled-img-container-centred subtitled-img-reduced-size" href="{image}">
{@render subtitledImageContent()}
</a>
{:else}
<a class="subtitled-img-container blurred-background subtitled-img-container-centred" href="{image}">
{@render subtitledImageContent()}
</a>
{/if}
{/if}
<style> <style>
.subtitled-img-container { .subtitled-img-container {