Skip to content

Commit 817eafd

Browse files
committed
Add opengraph and twitter images to website
1 parent bb8c73b commit 817eafd

File tree

16 files changed

+94
-71
lines changed

16 files changed

+94
-71
lines changed

apps/fluster/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"@citation-js/plugin-csl": "0.7.18",
4747
"@datalayer/jupyter-react": "^1.0.1",
4848
"@excalidraw/excalidraw": "^0.18.0",
49-
"@fluster.io/dev": "0.3.7",
49+
"@fluster.io/dev": "workspace:*",
5050
"@google/model-viewer": "^4.1.0",
5151
"@hookform/resolvers": "5.0.1",
5252
"@lancedb/lancedb": "^0.19.1",

apps/fluster/src-tauri/src/features/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ pub mod router;
1616
pub mod search;
1717
pub mod settings;
1818
pub mod snippets;
19+
pub mod splash_screen;
1920
pub mod taggables;
2021
pub mod task_manager;
2122
pub mod whiteboard;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
use tauri::{AppHandle, Manager};
2+
3+
use crate::core::types::errors::errors::FlusterResult;
4+
5+
#[tauri::command]
6+
#[specta::specta]
7+
pub async fn hide_splash_screen(app: AppHandle) -> FlusterResult<()> {
8+
let splash_window = app.get_webview_window("splashscreen").unwrap();
9+
let main_window = app.get_webview_window("main").unwrap();
10+
splash_window.close().unwrap();
11+
main_window.show().unwrap();
12+
Ok(())
13+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pub mod hide_splash_screen;

apps/fluster/src-tauri/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ use crate::features::snippets::delete_snippet_by_id::delete_snippet_by_id;
8484
use crate::features::snippets::get_snippet_by_id::get_snippet_by_id;
8585
use crate::features::snippets::get_snippets::get_snippets;
8686
use crate::features::snippets::save_snippet::save_snippet;
87+
use crate::features::splash_screen::hide_splash_screen::hide_splash_screen;
8788
use crate::features::taggables::commands::get_all_subjects::get_all_subjects;
8889
use crate::features::taggables::commands::get_all_tags::get_all_tags;
8990
use crate::features::taggables::commands::get_all_topics::get_all_topics;
@@ -126,6 +127,7 @@ pub fn run() {
126127
get_operating_system,
127128
path_exists,
128129
normalize_path,
130+
hide_splash_screen,
129131
// -- Auto Settings --
130132
create_auto_setting,
131133
get_all_auto_settings,

apps/fluster/src-tauri/tauri.conf.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,19 @@
1212
"withGlobalTauri": true,
1313
"windows": [
1414
{
15+
"label": "main",
1516
"title": "Fluster",
1617
"titleBarStyle": "Overlay",
1718
"width": 800,
18-
"height": 600
19+
"height": 600,
20+
"visible": false
21+
},
22+
{
23+
"label": "splashscreen",
24+
"url": "/splash_screen",
25+
"width": 800,
26+
"height": 600,
27+
"visible": true
1928
}
2029
],
2130
"security": {

apps/fluster/src/core/lib/bindings.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ async pathExists(filePath: string) : Promise<boolean> {
2323
async normalizePath(fsPath: string, basePath: string) : Promise<string> {
2424
return await TAURI_INVOKE("normalize_path", { fsPath, basePath });
2525
},
26+
async hideSplashScreen() : Promise<Result<null, FlusterError>> {
27+
try {
28+
return { status: "ok", data: await TAURI_INVOKE("hide_splash_screen") };
29+
} catch (e) {
30+
if(e instanceof Error) throw e;
31+
else return { status: "error", error: e as any };
32+
}
33+
},
2634
async createAutoSetting(data: AutoSettingModel[]) : Promise<Result<null, FlusterError>> {
2735
try {
2836
return { status: "ok", data: await TAURI_INVOKE("create_auto_setting", { data }) };
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React, { type ReactNode } from "react";
2+
3+
export const SplashScreen = (): ReactNode => {
4+
return <div>Splashy splash</div>;
5+
};
6+
7+
SplashScreen.displayName = "SplashScreen";
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { commands } from "@/lib/bindings";
2+
import { useEffect, useState } from "react";
3+
4+
export const useSplashScreen = (delay = 3000) => {
5+
const [splashVisible, setSplashVisible] = useState(true);
6+
const hideSplash = async (): Promise<void> => {
7+
if (splashVisible) {
8+
await commands.hideSplashScreen();
9+
setSplashVisible(false);
10+
}
11+
};
12+
useEffect(() => {
13+
hideSplash();
14+
}, []);
15+
};
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fluster, free & open source academic note taking for STEM students and professionals

0 commit comments

Comments
 (0)