-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change the UI theme and dimensions
- Loading branch information
1 parent
f676598
commit 1cd212b
Showing
10 changed files
with
475 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,76 @@ | ||
<script> | ||
export let message = ''; | ||
export let type = 'success'; | ||
let visible = false; | ||
const showToast = () => { | ||
visible = true; | ||
setTimeout(() => { | ||
visible = false; | ||
message = ''; | ||
}, 5000); | ||
}; | ||
$: if (message) { | ||
showToast(); | ||
} | ||
import CheckIcon from "./icons/CheckIcon.svelte"; | ||
import CrossIcon from "./icons/CrossIcon.svelte"; | ||
import InfoIcon from "./icons/InfoIcon.svelte"; | ||
export let message = ""; | ||
export let type = "success"; | ||
let visible = false; | ||
const showToast = () => { | ||
visible = true; | ||
setTimeout(() => { | ||
visible = false; | ||
message = ""; | ||
}, 5000); | ||
}; | ||
$: if (message) { | ||
showToast(); | ||
} | ||
</script> | ||
|
||
{#if visible} | ||
<div class="toast-container"> | ||
{#if visible} | ||
<div class="toast {type}"> | ||
{message} | ||
<span class="icon"> | ||
{#if type === "success"} | ||
<CheckIcon /> | ||
{:else if type === "error"} | ||
<CrossIcon /> | ||
{:else} | ||
<InfoIcon /> | ||
{/if} | ||
</span> | ||
<span class="message">{message}</span> | ||
</div> | ||
{/if} | ||
{/if} | ||
</div> | ||
|
||
<style> | ||
.toast { | ||
position: absolute; | ||
top: -4rem; | ||
width: calc(100% - 32px); | ||
padding: 16px; | ||
color: white; | ||
border-radius: 4px; | ||
opacity: 0.9; | ||
z-index: 1000; | ||
font-weight: 500; | ||
text-align: center; | ||
} | ||
.success { | ||
background-color: #48bb78; | ||
} | ||
.error { | ||
background-color: #f56565; | ||
} | ||
.info { | ||
background-color: #4299e1; | ||
} | ||
</style> | ||
.toast-container { | ||
position: absolute; | ||
top: -4rem; | ||
left: 0; | ||
right: 0; | ||
} | ||
.toast { | ||
width: calc(100% - 32px); | ||
padding: 16px; | ||
color: white; | ||
border-radius: 4px; | ||
opacity: 0.9; | ||
z-index: 1000; | ||
font-weight: bold; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-wrap: wrap; | ||
gap: 8px; | ||
} | ||
.toast > .message { | ||
text-align: center; | ||
} | ||
.success { | ||
background-color: #48bb78; | ||
} | ||
.error { | ||
background-color: #f56565; | ||
} | ||
.info { | ||
background-color: #4299e1; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<svg | ||
width="25px" | ||
height="25px" | ||
stroke-width="1.5" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
color="currentColor" | ||
><path | ||
d="M7 12.5L10 15.5L17 8.5" | ||
stroke="currentColor" | ||
stroke-width="1.5" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
></path><path | ||
d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" | ||
stroke="currentColor" | ||
stroke-width="1.5" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
></path></svg | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<svg | ||
width="25px" | ||
height="25px" | ||
stroke-width="1.5" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
color="currentColor" | ||
><path | ||
d="M9.17218 14.8284L12.0006 12M14.829 9.17157L12.0006 12M12.0006 12L9.17218 9.17157M12.0006 12L14.829 14.8284" | ||
stroke="currentColor" | ||
stroke-width="1.5" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
></path><path | ||
d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" | ||
stroke="currentColor" | ||
stroke-width="1.5" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
></path></svg | ||
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<svg | ||
width="25px" | ||
height="25px" | ||
stroke-width="1.5" | ||
viewBox="0 0 24 24" | ||
fill="none" | ||
xmlns="http://www.w3.org/2000/svg" | ||
color="currentColor" | ||
><path | ||
d="M12 11.5V16.5" | ||
stroke="currentColor" | ||
stroke-width="1.5" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
></path><path | ||
d="M12 7.51L12.01 7.49889" | ||
stroke="currentColor" | ||
stroke-width="1.5" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
></path><path | ||
d="M12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z" | ||
stroke="currentColor" | ||
stroke-width="1.5" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
></path></svg | ||
> |