diff --git a/index.html b/index.html index 05fab479..c9a5cef7 100644 --- a/index.html +++ b/index.html @@ -4,8 +4,8 @@ Lume - +
- + diff --git a/package.json b/package.json index 80ee335a..882fedd4 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ }, "dependencies": { "@dnd-kit/core": "^6.0.8", + "@fontsource-variable/inter": "^5.0.12", "@getalby/sdk": "^2.4.0", "@nostr-dev-kit/ndk": "^1.3.1", "@nostr-dev-kit/ndk-cache-dexie": "^1.3.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f904528b..233f1077 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ dependencies: '@dnd-kit/core': specifier: ^6.0.8 version: 6.0.8(react-dom@18.2.0)(react@18.2.0) + '@fontsource-variable/inter': + specifier: ^5.0.12 + version: 5.0.12 '@getalby/sdk': specifier: ^2.4.0 version: 2.4.0 @@ -675,6 +678,10 @@ packages: resolution: {integrity: sha512-OfX7E2oUDYxtBvsuS4e/jSn4Q9Qb6DzgeYtsAdkPZ47znpoNsMgZw0+tVijiv3uGNR6dgNlty6r9rzIzHjtd/A==} dev: false + /@fontsource-variable/inter@5.0.12: + resolution: {integrity: sha512-BuYkYLsvqLnWlXeyUvo6HpcAAgiOpIeQeVXWuxTNrJWr3NpuY5mWzizCxHnHD2gWLZOSOx0GkBqhQl7Oh6zTUQ==} + dev: false + /@getalby/sdk@2.4.0: resolution: {integrity: sha512-aIGNwLRF9coj6koxfq7P4GtFZbFjQbnIheix39x9176PwFw4dXOdGXHPXnqioJTmeq80y+vX1yd+u/f03YGoeg==} engines: {node: '>=14'} diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 202bc54f..6edb5a0c 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2626,6 +2626,7 @@ dependencies = [ "tauri-plugin-stronghold", "tauri-plugin-upload", "webpage", + "window-shadows", "window-vibrancy", ] @@ -5949,6 +5950,17 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "window-shadows" +version = "0.2.1" +source = "git+https://github.com/tauri-apps/window-shadows?branch=dev#a9f5f1f7725609c71404539befca1f1a98095cd2" +dependencies = [ + "cocoa 0.25.0", + "objc", + "raw-window-handle", + "windows-sys 0.48.0", +] + [[package]] name = "window-vibrancy" version = "0.4.1" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index b4ae74bf..ec495687 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -49,6 +49,7 @@ tauri-plugin-stronghold = { git = "https://github.com/tauri-apps/plugins-workspa tauri-plugin-store = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } tauri-plugin-upload = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v1" } window-vibrancy = { git = "https://github.com/tauri-apps/window-vibrancy", branch = "dev" } +window-shadows = { git = "https://github.com/tauri-apps/window-shadows", branch = "dev" } sqlx-cli = { version = "0.7.0", default-features = false, features = [ "sqlite", ] } diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 87952bb2..f0e3e113 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -12,9 +12,8 @@ use tauri::{Manager, WindowEvent}; use tauri_plugin_autostart::MacosLauncher; use tauri_plugin_sql::{Migration, MigrationKind}; use webpage::{Webpage, WebpageOptions}; - -#[cfg(target_os = "macos")] -use window_vibrancy::{apply_vibrancy, NSVisualEffectMaterial}; +use window_vibrancy::{apply_mica, apply_vibrancy, NSVisualEffectMaterial}; +use window_shadows::set_shadow; #[cfg(target_os = "macos")] use traffic_light::TrafficLight; @@ -107,6 +106,12 @@ fn main() { tauri::Builder::default() .setup(|app| { let window = app.get_window("main").unwrap(); + let splashscreen = app.get_window("splashscreen").unwrap(); + + #[cfg(target_os = "windows")] + set_shadow(&window, true).expect("Unsupported platform!"); + #[cfg(target_os = "windows")] + set_shadow(&splashscreen, true).expect("Unsupported platform!"); #[cfg(target_os = "macos")] apply_vibrancy(&window, NSVisualEffectMaterial::HudWindow, None, None) diff --git a/src-tauri/tauri.windows.conf.json b/src-tauri/tauri.windows.conf.json index 41eb03d0..19bd3611 100644 --- a/src-tauri/tauri.windows.conf.json +++ b/src-tauri/tauri.windows.conf.json @@ -17,6 +17,7 @@ "height": 800, "minWidth": 1080, "minHeight": 800, + "decorations": false, "resizable": true, "theme": "Dark", "title": "Lume", diff --git a/src/index.css b/src/app.css similarity index 100% rename from src/index.css rename to src/app.css diff --git a/src/app.tsx b/src/app.tsx index a312965f..1f6544d4 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -1,3 +1,4 @@ +import '@fontsource-variable/inter/slnt.css'; import { message } from '@tauri-apps/api/dialog'; import { fetch } from '@tauri-apps/api/http'; import { RouterProvider, createBrowserRouter, defer, redirect } from 'react-router-dom'; @@ -12,14 +13,13 @@ import { ExploreScreen } from '@app/explore'; import { useStorage } from '@libs/storage/provider'; -import { Frame } from '@shared/frame'; import { LoaderIcon } from '@shared/icons'; import { AppLayout } from '@shared/layouts/app'; import { AuthLayout } from '@shared/layouts/auth'; import { NoteLayout } from '@shared/layouts/note'; import { SettingsLayout } from '@shared/layouts/settings'; -import './index.css'; +import './app.css'; export default function App() { const { db } = useStorage(); @@ -331,9 +331,9 @@ export default function App() { +
- +
} future={{ v7_startTransition: true }} /> diff --git a/src/app/error.tsx b/src/app/error.tsx index 074399b7..1d6bbbaa 100644 --- a/src/app/error.tsx +++ b/src/app/error.tsx @@ -1,8 +1,6 @@ import { useEffect, useState } from 'react'; import { useLocation, useRouteError } from 'react-router-dom'; -import { Frame } from '@shared/frame'; - interface RouteError { statusText: string; message: string; @@ -46,7 +44,7 @@ export function ErrorScreen() { }, []); return ( - +

@@ -88,6 +86,6 @@ export function ErrorScreen() {

- +
); } diff --git a/src/main.tsx b/src/main.jsx similarity index 100% rename from src/main.tsx rename to src/main.jsx diff --git a/src/shared/accounts/active.tsx b/src/shared/accounts/active.tsx index f4e80848..89fa8294 100644 --- a/src/shared/accounts/active.tsx +++ b/src/shared/accounts/active.tsx @@ -68,12 +68,12 @@ export function ActiveAccount() { className="h-9 w-9 shrink-0 rounded-lg object-cover" />
-

+

{user?.name || user?.display_name || user?.displayName} -

- +
+
{user?.nip05 || displayNpub(db.account.pubkey, 12)} - +
diff --git a/src/shared/frame.tsx b/src/shared/frame.tsx deleted file mode 100644 index cfa254ca..00000000 --- a/src/shared/frame.tsx +++ /dev/null @@ -1,28 +0,0 @@ -import { HTMLProps, ReactNode, useCallback } from 'react'; -import { twMerge } from 'tailwind-merge'; - -import { useStorage } from '@libs/storage/provider'; - -export function Frame({ - children, - className, - lighter, -}: { - children: ReactNode; - className: HTMLProps['className']; - lighter?: boolean; -}) { - const { db } = useStorage(); - - const platformStyles = useCallback(() => { - switch (db.platform) { - case 'darwin': - if (lighter) return 'bg-black/80'; - return 'bg-black/90'; - default: - return 'bg-black'; - } - }, []); - - return
{children}
; -} diff --git a/src/shared/layouts/app.tsx b/src/shared/layouts/app.tsx index bb0bff26..32db40e9 100644 --- a/src/shared/layouts/app.tsx +++ b/src/shared/layouts/app.tsx @@ -1,6 +1,5 @@ import { Outlet, ScrollRestoration } from 'react-router-dom'; -import { Frame } from '@shared/frame'; import { Navigation } from '@shared/navigation'; export function AppLayout() { @@ -9,14 +8,14 @@ export function AppLayout() {
- +
{ return location.pathname; }} /> - +
); } diff --git a/src/shared/layouts/auth.tsx b/src/shared/layouts/auth.tsx index c3854207..d1bb375b 100644 --- a/src/shared/layouts/auth.tsx +++ b/src/shared/layouts/auth.tsx @@ -1,12 +1,10 @@ import { Outlet } from 'react-router-dom'; -import { Frame } from '@shared/frame'; - export function AuthLayout() { return ( - +
- +
); } diff --git a/src/shared/layouts/note.tsx b/src/shared/layouts/note.tsx index 4e70ef4c..1dd0afe2 100644 --- a/src/shared/layouts/note.tsx +++ b/src/shared/layouts/note.tsx @@ -1,12 +1,10 @@ import { Outlet } from 'react-router-dom'; -import { Frame } from '@shared/frame'; - export function NoteLayout() { return ( - +
- +
); } diff --git a/src/shared/layouts/settings.tsx b/src/shared/layouts/settings.tsx index ac74034a..6ffc071d 100644 --- a/src/shared/layouts/settings.tsx +++ b/src/shared/layouts/settings.tsx @@ -1,13 +1,12 @@ import { Link, NavLink, Outlet, ScrollRestoration } from 'react-router-dom'; import { twMerge } from 'tailwind-merge'; -import { Frame } from '@shared/frame'; import { ArrowLeftIcon, SecureIcon, SettingsIcon } from '@shared/icons'; export function SettingsLayout() { return (
- +
@@ -56,7 +55,7 @@ export function SettingsLayout() {
- +
+
- +
); } diff --git a/tailwind.config.js b/tailwind.config.js index 8110e056..e9afbd89 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,10 +1,15 @@ /** @type {import('tailwindcss').Config} */ +const defaultTheme = require('tailwindcss/defaultTheme') + module.exports = { content: ['./src/**/*.{js,ts,jsx,tsx}', 'index.html'], darkMode: 'class', theme: { extend: { + fontFamily: { + sans: ['Inter Variable', ...defaultTheme.fontFamily.sans], + }, typography: ({ theme }) => ({ white: { css: { diff --git a/tsconfig.json b/tsconfig.json index 2f86f511..d37c8f01 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -24,6 +24,6 @@ "jsx": "preserve", "strictNullChecks": false }, - "include": ["**/*.ts", "**/*.tsx"], + "include": ["**/*.ts", "**/*.tsx", "src/main.jsx"], "exclude": ["node_modules", "dist", "src-tauri"] }