-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Twitch auto reconnect and status (#110)
- Loading branch information
Showing
7 changed files
with
132 additions
and
16 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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<script> | ||
import Icon from "@/components/UI/Icon.svelte"; | ||
import MdCheck from "svelte-icons/md/MdCheck.svelte"; | ||
import MdError from "svelte-icons/md/MdError.svelte"; | ||
export let label; | ||
export let status; | ||
$: statusIcon = status.connected ? MdCheck : MdError; | ||
$: statusColor = status.connected ? "text-green-600" : "text-red-600"; | ||
</script> | ||
|
||
<div class="px-2 flex gap-2 {statusColor}"> | ||
<span class="flex-auto">{label}</span> | ||
<Icon icon="{statusIcon}" /> | ||
</div> |
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 @@ | ||
<script> | ||
export let connected; | ||
$: color = connected ? "green" : "red"; | ||
</script> | ||
|
||
<style> | ||
.spin { | ||
animation: spin 2s linear infinite; | ||
} | ||
@keyframes spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
</style> | ||
|
||
{#if !connected} | ||
<div | ||
class="spin absolute rounded-full" | ||
style="width:2.2rem; height:2.2rem; background: linear-gradient(90deg, {color}, transparent 35%);" | ||
></div> | ||
<div class="spin absolute bg-primary-darker w-8 h-8 rounded-full"></div> | ||
{/if} |
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