feat: improve UX

This commit is contained in:
thomas
2024-03-28 11:00:35 +01:00
parent 7da9b83eb3
commit e8ecec98f0
4 changed files with 24 additions and 6 deletions

View File

@@ -31,12 +31,12 @@
{#if !error && !loading} {#if !error && !loading}
<div class="github"> <div class="github">
<a class="category" href="https://github.com/tomalaforge/angular-challenges"> <a class="category star" href="https://github.com/tomalaforge/angular-challenges">
<slot name="star"/> <slot name="star"/>
<div>{stargazersCount}</div> <div>{stargazersCount}</div>
</a> </a>
<div class="category fork"> <div class="category">
<slot name="fork"/> <slot name="fork"/>
<div>{forksCount}</div> <div>{forksCount}</div>
</div> </div>
@@ -48,7 +48,7 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: flex-start; align-items: flex-start;
margin-left: var(--sl-nav-gap) margin-left: var(--sl-nav-gap);
} }
.category { .category {
@@ -58,4 +58,13 @@
gap: 0.25rem; gap: 0.25rem;
} }
.star {
color: var(--sl-color-text);
text-decoration: none;
}
.star:hover {
color: var(--sl-color-accent-high);
}
</style> </style>

View File

@@ -2,8 +2,8 @@
import { isLoaded, totalCount } from './github-store'; import { isLoaded, totalCount } from './github-store';
</script> </script>
{#if isLoaded} {#if $isLoaded}
<div class="answer-text">Answered by {$totalCount} people</div> <a href="#answers" class="answer-text">Answered by {$totalCount} people</a>
{/if} {/if}
<style> <style>
@@ -11,5 +11,10 @@
font-size: var(--sl-text-xs); font-size: var(--sl-text-xs);
color: var(--sl-color-gray-3); color: var(--sl-color-gray-3);
width: max-content; width: max-content;
text-decoration: none;
}
.answer-text:hover {
color: var(--sl-color-accent-high);
} }
</style> </style>

View File

@@ -37,7 +37,7 @@
</script> </script>
{#if $isLoaded} {#if $isLoaded}
<div class="solution-container"> <div class="solution-container" id="answers">
<div>Answered by</div> <div>Answered by</div>
{#each $data as { user }} {#each $data as { user }}
<img <img

View File

@@ -32,6 +32,10 @@
--color-chip-border: rgb(33, 38, 45); --color-chip-border: rgb(33, 38, 45);
} }
html {
scroll-behavior: smooth;
}
.github-success-btn { .github-success-btn {
border: 2px solid rgba(240, 246, 252, 0.1); border: 2px solid rgba(240, 246, 252, 0.1);
border-radius: 6px; border-radius: 6px;