Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: splashscreen #175

Merged
merged 9 commits into from
Sep 25, 2024
1 change: 1 addition & 0 deletions forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const config: ForgeConfig = {
'./resources/json_output.py',
'./resources/group_snippet.js',
'./resources/checks_snippet.js',
'./resources/splashscreen.html',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the splashscreen is a simple html file so that we don't need to wait any kind of react loading to show it. It has to be quick and visible and simple~

'./resources/' + getPlatform() + '/' + getArch(),
],
osxSign: {
Expand Down
74 changes: 74 additions & 0 deletions resources/splashscreen.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<meta http-equiv="Content-Security-Policy" content="script-src 'self'" />
<title>k6 Studio (experimental)</title>

<style>
#splashscreen {
display: flex;
flex-direction: column;
justify-content: space-between;
align-items: center;
height: calc(100vh - 40px);
}

#splashscreen picture {
display: flex;
flex-grow: 1;
}

#splashscreen-message {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}

#splashscreen-message p {
color: #7B7C9F;
font-size: 16px;
font-family: 'Inter', sans-serif;
}

.loader {
width: 8px;
aspect-ratio: 1;
border-radius: 50%;
animation: loader 1s infinite linear alternate;
}

@keyframes loader {
0% {box-shadow: 20px 0 #F8B36D, -20px 0 #F57427;background: #F8B36D }
33% {box-shadow: 20px 0 #F8B36D, -20px 0 #F57427;background: #F57427}
66% {box-shadow: 20px 0 #F57427,-20px 0 #F8B36D; background: #F57427}
100%{box-shadow: 20px 0 #F57427,-20px 0 #F8B36D; background: #F8B36D }
}

@media (prefers-color-scheme: dark) {
body {
background: #111110;
}

#splashscreen-message p {
color: #fff;
}
}
</style>
</head>
<body>
<div id="splashscreen">
<picture>
<source srcset="../src/assets/logo-splashscreen-dark.svg" media="(prefers-color-scheme: dark)">
<img src="../src/assets/logo-splashscreen.svg" alt="k6 Studio" width="100px" />
</picture>
<div id="splashscreen-message">
<p>Initialising the app and making magic happen</p>
<div class="loader"></div>
</div>
</div>
</div>
</body>
</html>

15 changes: 15 additions & 0 deletions src/assets/logo-splashscreen-dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions src/assets/logo-splashscreen.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading