Update icon on homepage

pull/1/head
Made Baruna 2021-09-08 19:53:23 +07:00
parent a3259bbefa
commit d362944889
No known key found for this signature in database
GPG Key ID: 5AA5DA16AA5DCEAD
5 changed files with 24 additions and 22 deletions

View File

@ -12,6 +12,7 @@
class="flex justify-end items-center self-end lg:self-start text-white mt-4 class="flex justify-end items-center self-end lg:self-start text-white mt-4
bg-background-secondary rounded-xl py-2 px-4 hover:bg-background transition-colors duration-100" bg-background-secondary rounded-xl py-2 px-4 hover:bg-background transition-colors duration-100"
> >
<img src="/images/achievement.png" alt="wish" class="mr-2 h-6 w-6" />
{$t('home.achievement.detail')} {$t('home.achievement.detail')}
<Icon path={mdiChevronRight} /> <Icon path={mdiChevronRight} />
</a> </a>

View File

@ -12,6 +12,7 @@
class="flex justify-end items-center self-end lg:self-start text-white mt-4 class="flex justify-end items-center self-end lg:self-start text-white mt-4
bg-background-secondary rounded-xl py-2 px-4 hover:bg-background transition-colors duration-100" bg-background-secondary rounded-xl py-2 px-4 hover:bg-background transition-colors duration-100"
> >
<img src="/images/furnishing.png" alt="wish" class="mr-2 h-6 w-6" />
{$t('home.furnishing.detail')} {$t('home.furnishing.detail')}
<Icon path={mdiChevronRight} /> <Icon path={mdiChevronRight} />
</a> </a>

View File

@ -1,35 +1,35 @@
<script> <script>
import { createEventDispatcher, onMount, tick } from 'svelte'; import { createEventDispatcher, onMount } from 'svelte';
import { t } from 'svelte-i18n'; import { t } from 'svelte-i18n';
const numberFormat = Intl.NumberFormat('en', { // const numberFormat = Intl.NumberFormat('en', {
maximumFractionDigits: 1, // maximumFractionDigits: 1,
minimumFractionDigits: 0, // minimumFractionDigits: 0,
}); // });
const dispatch = createEventDispatcher(); const dispatch = createEventDispatcher();
let count = '...'; // let count = '...';
async function getData() { // async function getData() {
const url = new URL(`${__paimon.env.API_HOST}/visitor`); // const url = new URL(`${__paimon.env.API_HOST}/visitor`);
try { // try {
const res = await fetch(url, { // const res = await fetch(url, {
method: 'GET', // method: 'GET',
headers: { 'Content-Type': 'application/json' }, // headers: { 'Content-Type': 'application/json' },
}); // });
const data = await res.json(); // const data = await res.json();
count = `${numberFormat.format(data.count / 1000)}k`; // count = `${numberFormat.format(data.count / 1000)}k`;
} catch (err) { // } catch (err) {
console.error(err); // console.error(err);
} // }
} // }
onMount(async () => { onMount(async () => {
getData(); // getData();
await tick(); // await tick();
dispatch('done'); dispatch('done');
}); });
</script> </script>
@ -37,5 +37,5 @@
<div class="bg-item rounded-xl p-4"> <div class="bg-item rounded-xl p-4">
<p class="text-white font-bold font-display text-xl">{$t('home.welcome')}</p> <p class="text-white font-bold font-display text-xl">{$t('home.welcome')}</p>
<p class="text-white mt-2">{$t('home.message')}</p> <p class="text-white mt-2">{$t('home.message')}</p>
<p class="text-gray-400 mt-2">{$t('home.visitor', { values: { count } })}</p> <!-- <p class="text-gray-400 mt-2">{$t('home.visitor', { values: { count } })}</p> -->
</div> </div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB