From 7801109dc32bce9e6c5407acc38c40a85b72f199 Mon Sep 17 00:00:00 2001 From: Nick Kosarev Date: Mon, 1 Jul 2024 13:33:11 +0000 Subject: [PATCH] chore: coupons counter on profile page --- .../[lang]/(website)/coupon/+page.svelte | 17 +-------- .../(website)/p/[userName]/+page.svelte | 37 ++++++++++++++++++- 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/src/routes/[lang]/(website)/coupon/+page.svelte b/src/routes/[lang]/(website)/coupon/+page.svelte index 7e73f862..e57c536b 100644 --- a/src/routes/[lang]/(website)/coupon/+page.svelte +++ b/src/routes/[lang]/(website)/coupon/+page.svelte @@ -20,9 +20,7 @@
-

- Купон -

+

Купон

Уже встречался на стриме?

banana coupon @@ -38,7 +36,7 @@
-
{coupon.profile.coupons}
+
@@ -141,17 +139,6 @@ display: inline; } - .latest-coupons .block .card .coupons-counter { - position: absolute; - bottom: 10px; - right: 8px; - color: #fff; - font-weight: 700; - font-size: 0.8rem; - background: var(--color-bg-accent-2); - padding: 0 0.2em; - } - .game-info { padding-top: 2em; padding-bottom: 4em; diff --git a/src/routes/[lang]/(website)/p/[userName]/+page.svelte b/src/routes/[lang]/(website)/p/[userName]/+page.svelte index b786e944..76eecfd4 100644 --- a/src/routes/[lang]/(website)/p/[userName]/+page.svelte +++ b/src/routes/[lang]/(website)/p/[userName]/+page.svelte @@ -5,12 +5,21 @@ import Handshake from 'lucide-svelte/icons/handshake' import unitAvatar from '$lib/assets/website/unit-512.png' import { pluralizationRu } from '$lib/utils/locale' + import couponSmall from '$lib/assets/website/coupon-64.png' export let data
-

{data.pageProfile.userName}

+
+

{data.pageProfile.userName}

+ + {#if data.pageProfile.coupons > 0} +
+
{data.pageProfile.coupons}
+
+ {/if} +

Профиль игрока {data.pageProfile.level} уровня

@@ -59,11 +68,35 @@ max-width: 64em; } + .hero .header-block { + display: flex; + align-items: center; + justify-content: center; + gap: 0.75em; + } + .hero .profile-lvl { color: var(--color-common); } - h1 { + .hero .coupon { + position: relative; + display: inline-block; + } + + .hero .coupons-counter { + position: absolute; + top: 6px; + left: 3px; + color: #fff; + font-weight: 700; + font-size: 0.8rem; + background: var(--color-text); + padding: 0 0.4em; + border-radius: 50%; + } + + .hero h1 { margin-bottom: 0.25em; }