-
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.
- Loading branch information
Showing
39 changed files
with
2,071 additions
and
23 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.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<browserconfig> | ||
<msapplication> | ||
<tile> | ||
<square150x150logo src="/mstile-150x150.png"/> | ||
<TileColor>#da532c</TileColor> | ||
</tile> | ||
</msapplication> | ||
</browserconfig> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"name": "", | ||
"short_name": "", | ||
"icons": [ | ||
{ | ||
"src": "/android-chrome-192x192.png", | ||
"sizes": "192x192", | ||
"type": "image/png" | ||
} | ||
], | ||
"theme_color": "#ffffff", | ||
"background_color": "#ffffff", | ||
"display": "standalone" | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
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,17 @@ | ||
use tauri::{Manager, Window}; | ||
// Create the command: | ||
// This command must be async so that it doesn't run on the main thread. | ||
#[tauri::command] | ||
pub async fn close_splashscreen(window: Window) { | ||
tracing::info!("Closing splashscreen"); | ||
// Close splashscreen | ||
match window.get_window("splashscreen") { | ||
Some(window) => window.close().unwrap(), | ||
None => tracing::info!("Couldn't find splashscreen window"), | ||
} | ||
|
||
match window.get_window("main") { | ||
Some(window) => window.show().unwrap(), | ||
None => tracing::info!("Couldn't find main window"), | ||
} | ||
} |
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 |
---|---|---|
|
@@ -4,5 +4,5 @@ | |
</script> | ||
|
||
<Canvas> | ||
<Scene /> | ||
<Scene on:loaded /> | ||
</Canvas> |
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,6 @@ | ||
import { invoke } from '@tauri-apps/api/tauri' | ||
|
||
export default async () => { | ||
console.log('hiding') | ||
await invoke('close_splashscreen') | ||
} |
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,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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 @@ | ||
# Jankboard 2 Splash Screen | ||
|
||
This directory contains the source code for the splash screen used by the Tauri | ||
app. It's a standalone Svelte + Vite project, with its own separate | ||
dependencies. In most cases, you won't ever have to touch the code in this | ||
directory unless you want to modify the loading screen. However, if you do | ||
decide to modify the files in this directory, keep in mind that **_they will not | ||
be reflected in the app until you compile and replace the_** `splashscreen.html` | ||
**_file in_** `/client/public`. Read more below to figure out how to do that. | ||
|
||
## How it works | ||
|
||
Tauri allows you to add a splash screen to display before your app loads by | ||
adding a file to the output directory called `splashscreen.html`. This is done | ||
in Jankboard 2 by adding the `splashscreen.html` file to the `public` directory, | ||
as recommended by Tauri's docs. However, since it's just one HTML file, we can't | ||
typically use a framework like Svelte, which outputs a CSS and JS bundle. While | ||
we can definitely write a simple splash screen in a raw HTML file, we miss out | ||
on nice Svelte features like easy to write animations. The Vite project in this | ||
directory solves that by using | ||
[vite-plugin-singlefile](https://github.com/richardtallent/vite-plugin-singlefile) | ||
to inline all CSS and JS outputted by Svelte's compiler into the HTML, resulting | ||
in a nice single `index.html` output in `./dist`, which can then be renamed as | ||
`splashscreen.html` and moved into the main Jankboard 2 project to be used as | ||
the loading splash screen. The best part about this is that since Svelte is | ||
meant to be compiled into such a small bundle size, there are virtually zero | ||
downsides to doing this versus writing the splash screen in raw HTML. We can | ||
easily write a nice looking splash screen using the same techniques as our | ||
existing codebase without having to deal with raw HTML and CSS. If you don't | ||
need to modify the splash screen, you **don't need to touch this project!** | ||
`splashscreen.html` is already included in the main project and you don't have | ||
to build it yourself here. If you do want to modify this splash screen, continue | ||
to the instructions below. | ||
|
||
## Installation and development instructions | ||
|
||
**Again, you don't need to do this if you don't want to modify the splash | ||
screen!** | ||
|
||
1. Install dependencies via `pnpm install`. | ||
2. Run `pnpm dev` to start the development server. | ||
3. After you're done making your changes, run `pnpm build`. This will output a | ||
single `index.html` file to `./dist`, which contains all of the JS and CSS | ||
inlined. | ||
4. Rename this outputted `index.html` to `splashscreen.html`, and then move it | ||
into `/client/public`, replacing the existing `splashscreen.html`. |
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,12 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Jankboard 2</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> |
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 @@ | ||
{ | ||
"name": "splash-screen", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"preview": "vite preview", | ||
"check": "svelte-check --tsconfig ./tsconfig.json" | ||
}, | ||
"devDependencies": { | ||
"@sveltejs/vite-plugin-svelte": "^3.0.2", | ||
"@tsconfig/svelte": "^5.0.2", | ||
"autoprefixer": "^10.4.18", | ||
"postcss": "^8.4.35", | ||
"svelte": "^4.2.11", | ||
"svelte-check": "^3.6.4", | ||
"tailwindcss": "^3.4.1", | ||
"tslib": "^2.6.2", | ||
"typescript": "^5.2.2", | ||
"vite": "^5.1.4", | ||
"vite-plugin-singlefile": "^2.0.1" | ||
} | ||
} |
Oops, something went wrong.