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} /> <FormattedNumber number={post.counts.comments} />
</Button> </Button>
<div class="ml-auto" /> <div class="flex-1" />
{#if $userSettings.debugInfo} {#if $userSettings.debugInfo}
{#if debug} {#if debug}
@@ -2,9 +2,9 @@
import { userSettings } from '$lib/settings.js' import { userSettings } from '$lib/settings.js'
export const voteColor = (vote: number, border: boolean = false) => export const voteColor = (vote: number, border: boolean = false) =>
vote == 1 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 : 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 = ( export const shouldShowVoteColor = (
@@ -24,7 +24,7 @@
import { vote as voteItem } from '$lib/lemmy/contentview.js' import { vote as voteItem } from '$lib/lemmy/contentview.js'
import { Button, Popover, buttonColor, toast } from 'mono-svelte' import { Button, Popover, buttonColor, toast } from 'mono-svelte'
import { site } from '$lib/lemmy.js' import { site } from '$lib/lemmy.js'
import { fly } from 'svelte/transition' import { fade, fly } from 'svelte/transition'
import { backOut } from 'svelte/easing' import { backOut } from 'svelte/easing'
import { t } from '$lib/translations' import { t } from '$lib/translations'
import { errorMessage } from '$lib/lemmy/error' import { errorMessage } from '$lib/lemmy/error'
@@ -71,7 +71,7 @@
> >
<button <button
on:click={() => castVote(vote == 1 ? 0 : 1)} 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 {vote == 1
? shouldShowVoteColor(vote, 'upvotes') ? shouldShowVoteColor(vote, 'upvotes')
: 'hover:bg-slate-100 hover:dark:bg-zinc-800'}" : 'hover:bg-slate-100 hover:dark:bg-zinc-800'}"
@@ -80,7 +80,7 @@
> >
<Icon src={ChevronUp} size="20" micro /> <Icon src={ChevronUp} size="20" micro />
{#if showCounts} {#if showCounts}
<span class="grid text-sm"> <span class="grid text-sm z-20">
{#key upvotes} {#key upvotes}
<span <span
style="grid-column: 1; grid-row: 1;" style="grid-column: 1; grid-row: 1;"
@@ -57,7 +57,7 @@
src={bestImageURL(post, false, -1)} src={bestImageURL(post, false, -1)}
loading="lazy" loading="lazy"
class="max-h-[inherit] max-w-full h-auto z-30 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'}" {imageLoaded === false ? 'opacity-0' : 'opacity-100'}"
width={512} width={512}
height={300} height={300}
+1 -1
View File
@@ -20,7 +20,7 @@
</script> </script>
<nav <nav
aria-label={$t('aria.pagination')} aria-label={$t('aria.pagination.nav')}
class="flex flex-row w-full gap-4 items-center justify-center" class="flex flex-row w-full gap-4 items-center justify-center"
> >
{#if $$slots.default} {#if $$slots.default}
+1 -1
View File
@@ -20,7 +20,7 @@
export let data export let data
</script> </script>
<div class="flex flex-col gap-4 max-w-full w-full min-w-0"> <div class="flex flex-col gap-2 max-w-full w-full min-w-0">
<header class="flex flex-col gap-4 relative"> <header class="flex flex-col gap-4 relative">
<Header pageHeader> <Header pageHeader>
{$t('routes.frontpage.title')} {$t('routes.frontpage.title')}