-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
231d393
commit 6738c5f
Showing
13 changed files
with
189 additions
and
56 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
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,46 @@ | ||
dialog { | ||
border: none; | ||
box-shadow: 0px 1px 2px #999; | ||
border-radius: 16px; | ||
padding: 0px; | ||
} | ||
|
||
dialog::backdrop { | ||
background-color: rgba(0, 0, 0, 0.5); | ||
} | ||
|
||
.loading { | ||
position: relative; | ||
width: 48px; | ||
height: 48px; | ||
border: 2px solid #000; | ||
border-top-color: rgba(0, 0, 0, 0.2); | ||
border-right-color: rgba(0, 0, 0, 0.2); | ||
border-bottom-color: rgba(0, 0, 0, 0.2); | ||
border-radius: 100%; | ||
|
||
animation: circle infinite 0.75s linear; | ||
} | ||
|
||
@keyframes circle { | ||
0% { | ||
transform: rotate(0); | ||
} | ||
|
||
100% { | ||
transform: rotate(360deg); | ||
} | ||
} | ||
|
||
.container { | ||
width: fit-content; | ||
height: fit-content; | ||
padding: 24px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
} | ||
|
||
.message { | ||
margin-top: 12px; | ||
} |
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,25 @@ | ||
// Copyright 2022-2023 the Chili authors. All rights reserved. AGPL-3.0 license. | ||
|
||
import { I18n, I18nKeys } from "chili-core"; | ||
import { div, span } from "./controls"; | ||
import style from "./permanent.module.css"; | ||
|
||
export class Permanent { | ||
static show(action: () => Promise<void>, message: I18nKeys, ...args: any[]) { | ||
let dialog = document.createElement("dialog"); | ||
dialog.appendChild( | ||
div( | ||
{ className: style.container }, | ||
div({ className: style.loading }), | ||
span({ | ||
className: style.message, | ||
textContent: I18n.translate(message, ...args), | ||
}), | ||
), | ||
); | ||
document.body.appendChild(dialog); | ||
action().finally(() => dialog.remove()); | ||
|
||
dialog.showModal(); | ||
} | ||
} |
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