mirror of
https://github.com/danbulant/Portfolio
synced 2026-05-24 12:35:31 +00:00
fix: icon refactoring
This commit is contained in:
parent
42a6481691
commit
bd98cb90aa
3 changed files with 45 additions and 29 deletions
|
|
@ -3,6 +3,8 @@
|
|||
import 'tippy.js/dist/tippy.css';
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import { submissionProgress, UploadStatus } from '$lib/stores/portfolio';
|
||||
import Document from '../icons/Document.svelte';
|
||||
import Download from '../icons/Download.svelte';
|
||||
|
||||
export let showDetails: boolean;
|
||||
|
||||
|
|
@ -17,7 +19,6 @@
|
|||
};
|
||||
</script>
|
||||
|
||||
<!-- TODO: better icon for "hide details"? -->
|
||||
<span
|
||||
on:click={(_) => showInfo()}
|
||||
on:keydown={(_) => showInfo()}
|
||||
|
|
@ -27,20 +28,10 @@
|
|||
showOnCreate: false,
|
||||
delay: 0
|
||||
}}
|
||||
class="icon"
|
||||
class:showDetails
|
||||
>
|
||||
<svg
|
||||
class="icon"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
><path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
|
||||
/></svg
|
||||
>
|
||||
<Document />
|
||||
</span>
|
||||
|
||||
{#if $submissionProgress.status === UploadStatus.Submitted}
|
||||
|
|
@ -76,28 +67,21 @@
|
|||
showOnCreate: false,
|
||||
delay: 0
|
||||
}}
|
||||
class="icon disabledIcon"
|
||||
>
|
||||
<svg
|
||||
class="disabledIcon"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
><path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"
|
||||
/></svg
|
||||
>
|
||||
<Download />
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
<style>
|
||||
.icon {
|
||||
@apply stroke-sspsBlueDark h-10 w-10 hover:cursor-pointer;
|
||||
@apply text-sspsBlueDark h-10 w-10 transition-colors duration-300 hover:cursor-pointer;
|
||||
@apply hover:text-sspsBlue;
|
||||
}
|
||||
.showDetails {
|
||||
@apply text-sspsBlue;
|
||||
}
|
||||
.disabledIcon {
|
||||
@apply h-10 w-10 stroke-gray-300 hover:cursor-not-allowed;
|
||||
@apply text-gray-300 hover:cursor-not-allowed hover:text-gray-300;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
16
frontend/src/lib/components/icons/Document.svelte
Normal file
16
frontend/src/lib/components/icons/Document.svelte
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
><path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"
|
||||
/></svg
|
||||
>
|
||||
|
||||
<style>
|
||||
svg {
|
||||
@apply fill-none stroke-current;
|
||||
}
|
||||
</style>
|
||||
|
After Width: | Height: | Size: 337 B |
16
frontend/src/lib/components/icons/Download.svelte
Normal file
16
frontend/src/lib/components/icons/Download.svelte
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<svg
|
||||
viewBox="0 0 24 24"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
><path
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
stroke-width="2"
|
||||
d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"
|
||||
/></svg
|
||||
>
|
||||
|
||||
<style>
|
||||
svg {
|
||||
@apply fill-none stroke-current;
|
||||
}
|
||||
</style>
|
||||
|
After Width: | Height: | Size: 283 B |
Loading…
Reference in a new issue