design: change post voting colors

This commit is contained in:
Xylight committed 2024-10-14 16:05:00 -07:00
1 parent e6bd415749
commit 4b5dcfa2e0
5 files changed
+9 -9

No files matched your search

@@ -149,7 +149,7 @@
/>
<FormattedNumber number={post.counts.comments} />
</Button>
<div class="ml-auto" />
<div class="flex-1" />
{#if $userSettings.debugInfo}
{#if debug}
@@ -2,9 +2,9 @@
import { userSettings } from '$lib/settings.js'
export const voteColor = (vote: number, border: boolean = false) =>
vote == 1
? `bg-blue-500 dark:bg-blue-400 text-slate-50 dark:text-zinc-900`
? `bg-gradient-to-br from-blue-500 to-indigo-500 dark:from-blue-400 dark:to-indigo-500 text-slate-50 dark:text-zinc-900`
: vote == -1
? `bg-red-500 text-slate-50 dark:bg-red-400 dark:text-zinc-900`
? `bg-gradient-to-br from-red-500 to-pink-500 dark:from-red-400 dark:to-pink-600 text-slate-50 `
: ''
export const shouldShowVoteColor = (
@@ -24,7 +24,7 @@
import { vote as voteItem } from '$lib/lemmy/contentview.js'
import { Button, Popover, buttonColor, toast } from 'mono-svelte'
import { site } from '$lib/lemmy.js'
import { fly } from 'svelte/transition'
import { fade, fly } from 'svelte/transition'
import { backOut } from 'svelte/easing'
import { t } from '$lib/translations'
import { errorMessage } from '$lib/lemmy/error'
@@ -71,7 +71,7 @@
>
<button
on:click={() => castVote(vote == 1 ? 0 : 1)}
class="flex items-center gap-0.5 transition-colors
class="flex items-center gap-0.5 transition-colors relative z-0
{vote == 1
? shouldShowVoteColor(vote, 'upvotes')
: 'hover:bg-slate-100 hover:dark:bg-zinc-800'}"
@@ -80,7 +80,7 @@
>
<Icon src={ChevronUp} size="20" micro />
{#if showCounts}
<span class="grid text-sm">
<span class="grid text-sm z-20">
{#key upvotes}
<span
style="grid-column: 1; grid-row: 1;"
@@ -57,7 +57,7 @@
src={bestImageURL(post, false, -1)}
loading="lazy"
class="max-h-[inherit] max-w-full h-auto z-30
transition-opacity duration-500 object-contain mx-auto blur-[64px]
transition-opacity duration-500 object-contain mx-auto
{imageLoaded === false ? 'opacity-0' : 'opacity-100'}"
width={512}
height={300}
+1 -1
View File
@@ -20,7 +20,7 @@
</script>
<nav
aria-label={$t('aria.pagination')}
aria-label={$t('aria.pagination.nav')}
class="flex flex-row w-full gap-4 items-center justify-center"
>
{#if $$slots.default}