-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Windows builds dont show cmd, nicer toasts, loader added, more effeci…
…ent theme switcher (css based)
- Loading branch information
Showing
11 changed files
with
300 additions
and
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package utils | ||
|
||
import ( | ||
"os/exec" | ||
"runtime" | ||
"syscall" | ||
) | ||
|
||
func RunCmd(cmd *exec.Cmd) ([]byte, error) { | ||
if runtime.GOOS == "windows" { | ||
cmd.SysProcAttr = &syscall.SysProcAttr{HideWindow: true} | ||
} | ||
return cmd.CombinedOutput() | ||
} |
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,70 @@ | ||
|
||
<script> | ||
export let message = ""; | ||
export let detail = ""; | ||
export let onClose; | ||
export let id; // Add id to track each toast | ||
let isOpen = false; | ||
function toggle() { | ||
isOpen = !isOpen; | ||
} | ||
// Automatically close the toast after 3 seconds | ||
setTimeout(() => { | ||
if (!isOpen) { | ||
onClose(id); // Pass the id when closing | ||
} | ||
}, 3000); | ||
</script> | ||
|
||
<style> | ||
.toast { | ||
margin: 0.1rem 0; | ||
background: #333; | ||
color: white; | ||
padding: 16px; | ||
border-radius: 8px; | ||
position: relative; | ||
transition: opacity 0.3s ease; | ||
max-width: 300px; /* Optional: set a max-width */ | ||
} | ||
.detail { | ||
max-height: 0; | ||
overflow: hidden; | ||
transition: max-height 0.3s ease; | ||
} | ||
.detail.open { | ||
max-height: 200px; /* Adjust as necessary to fit your content */ | ||
} | ||
.collapse-button, | ||
.close-button { | ||
margin: 0; | ||
background: transparent; | ||
border: none; | ||
color: #ccc; | ||
cursor: pointer; | ||
text-decoration: underline; | ||
} | ||
.close-button { | ||
position: absolute; | ||
top: 8px; | ||
right: 8px; | ||
font-size: 16px; | ||
} | ||
</style> | ||
|
||
|
||
<div class="toast"> | ||
<button class="close-button" on:click={() => onClose(id)}>✖</button> | ||
<div>{message}</div> | ||
<div class={`detail ${isOpen ? 'open' : ''}`}> | ||
{detail} | ||
</div> | ||
<button class="collapse-button" on:click={toggle}>{isOpen ? 'Collapse' : 'Expand'}</button> | ||
</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,35 @@ | ||
<style> | ||
.loader { | ||
width: 100%; | ||
height: 0.2rem; | ||
display: inline-block; | ||
position: relative; | ||
background: rgba(255, 255, 255, 0.15); | ||
overflow: hidden; | ||
} | ||
.loader::after { | ||
content: ''; | ||
width: 50%; | ||
height: 0.2rem; | ||
background: var(--accent); | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
box-sizing: border-box; | ||
animation: animloader 2s ease-in-out infinite; | ||
} | ||
@keyframes animloader { | ||
0% { | ||
left: 0; | ||
transform: translateX(-100%); | ||
} | ||
100% { | ||
left: 100%; | ||
transform: translateX(0%); | ||
} | ||
} | ||
</style> | ||
|
||
<span class="loader"></span> |
Oops, something went wrong.