-
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.
Merge pull request #19 from greeenboi/new-changes
added splashscreen with animated svg and threaded the splashscreen to…
- Loading branch information
Showing
8 changed files
with
182 additions
and
14 deletions.
There are no files selected for viewing
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.
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 @@ | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Document</title> | ||
</head> | ||
<body data-tauri-drag-region style="background-image: url('/splashscreen.webp'); background-size: contain; display: flex; flex-direction: column; justify-content: center; align-items: center; overflow: hidden;"> | ||
<div data-tauri-drag-region style="display: flex; flex-direction: row;justify-content: center;align-items: center;"> | ||
<object type="image/svg+xml" data="/bg.svg"></object> | ||
</div> | ||
</body> | ||
</html> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 |
---|---|---|
@@ -1,16 +1,44 @@ | ||
// Prevents additional console window on Windows in release, DO NOT REMOVE!! | ||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] | ||
|
||
use tauri::{Manager, Window}; | ||
|
||
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command | ||
#[tauri::command] | ||
fn greet(name: &str) -> String { | ||
format!("Hello, {}! You've been greeted from Rust and SuvanGS the creator!", name) | ||
} | ||
|
||
#[tauri::command] | ||
async fn close_splashscreen(window: Window) { | ||
if let Some(splashscreen) = window.get_window("splashscreen") { | ||
splashscreen.close().unwrap(); | ||
} | ||
// window.get_window("splashscreen").expect("no window labeled 'splashscreen' found").close().unwrap(); | ||
|
||
window.get_window("main").expect("no window labeled 'main' found").show().unwrap(); | ||
} | ||
|
||
|
||
fn main() { | ||
tauri::Builder::default() | ||
.invoke_handler(tauri::generate_handler![greet]) | ||
.invoke_handler(tauri::generate_handler![greet, close_splashscreen]) | ||
.setup(|app| { | ||
let splashscreen_window = app.get_window("splashscreen").unwrap(); | ||
let main_window = app.get_window("main").unwrap(); | ||
|
||
tauri::async_runtime::spawn(async move { | ||
|
||
println!("Initializing..."); | ||
std::thread::sleep(std::time::Duration::from_secs(2)); | ||
println!("Done initializing."); | ||
|
||
|
||
splashscreen_window.close().unwrap(); | ||
main_window.show().unwrap(); | ||
}); | ||
Ok(()) | ||
}) | ||
.run(tauri::generate_context!()) | ||
.expect("error while running tauri application"); | ||
} |
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