diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 1c8c5ffe7..158f2d152 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,6 +1,6 @@ name: 🐞 Bug Report description: Report a bug -labels: +labels: - kind/bug - status/needs-triage @@ -43,8 +43,8 @@ body: id: info attributes: label: Platform and versions - description: "Please include the output of `pnpm --version && cargo --version && rustc --version` along with information about your Operating System such as version and/or specific distribution if revelant." - render: shell + description: 'Please include the output of `pnpm --version && cargo --version && rustc --version` along with information about your Operating System such as version and/or specific distribution if revelant.' + render: Shell validations: required: true @@ -52,8 +52,8 @@ body: id: logs attributes: label: Stack trace - render: shell - + render: Shell + - type: textarea id: context attributes: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 5ec4697aa..911f5b2bc 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,3 +1,5 @@ +# tell yaml plugin that this is the config file and not a template of its own: +# yaml-language-server: $schema=https://json.schemastore.org/github-issue-config.json blank_issues_enabled: false contact_links: - name: 📝 Report Typo @@ -11,4 +13,4 @@ contact_links: about: Suggest any ideas you have using our discussion forums. - name: 💬 Discord Chat url: https://discord.gg/gTaF2Z44f5 - about: Ask questions and talk to other Spacedrive users and the maintainers \ No newline at end of file + about: Ask questions and talk to other Spacedrive users and the maintainers diff --git a/.github/actions/build-server-image/action.yml b/.github/actions/build-server-image/action.yml index 6b6f86e38..e4ffc3dce 100644 --- a/.github/actions/build-server-image/action.yml +++ b/.github/actions/build-server-image/action.yml @@ -1,4 +1,4 @@ -name: Build Server Image +name: Build Server Image description: Builds and publishes the docker image for the Spacedrive server inputs: gh_token: diff --git a/.github/actions/install-ffmpeg-macos/index.js b/.github/actions/install-ffmpeg-macos/index.js index 700837043..38812de3c 100644 --- a/.github/actions/install-ffmpeg-macos/index.js +++ b/.github/actions/install-ffmpeg-macos/index.js @@ -3,6 +3,6 @@ const core = require('@actions/core'); const exec = require('@actions/exec'); const github = require('@actions/github'); -// const folders = +// const folders = exec.exec('brew', ['install', 'ffmpeg']); diff --git a/.github/actions/install-ffmpeg-macos/package.json b/.github/actions/install-ffmpeg-macos/package.json index 6d0070abe..a752be00f 100644 --- a/.github/actions/install-ffmpeg-macos/package.json +++ b/.github/actions/install-ffmpeg-macos/package.json @@ -1,17 +1,17 @@ { - "name": "install-ffmpeg-macos", - "version": "0.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "Brendan Allan", - "license": "ISC", - "dependencies": { - "@actions/core": "^1.6.0", - "@actions/exec": "^1.1.1", - "@actions/github": "^5.0.1" - } + "name": "install-ffmpeg-macos", + "version": "0.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "Brendan Allan", + "license": "ISC", + "dependencies": { + "@actions/core": "^1.6.0", + "@actions/exec": "^1.1.1", + "@actions/github": "^5.0.1" + } } diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index eb3361eda..b87b20af0 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,10 +1,9 @@ - - + Closes #(issue) diff --git a/.rustfmt.toml b/.rustfmt.toml index 7f591ca55..b6bfaa825 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -1,5 +1,4 @@ hard_tabs = true -tab_spaces = 4 match_block_trailing_comma = true max_width = 90 newline_style = "Unix" diff --git a/.vscode/settings.json b/.vscode/settings.json index d2be09262..05a5dc79c 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,26 +1,28 @@ { - "cSpell.words": [ - "actix", - "bpfrpt", - "consts", - "creationdate", - "ipfs", - "Keepsafe", - "pathctx", - "prismjs", - "proptype", - "quicktime", - "repr", - "Roadmap", - "svgr", - "tailwindcss", - "trivago", - "tsparticles", - "upsert" - ], - "[rust]": { - "editor.defaultFormatter": "matklad.rust-analyzer" - }, - "rust-analyzer.procMacro.enable": true, - "rust-analyzer.diagnostics.experimental.enable": false + "cSpell.words": [ + "actix", + "bpfrpt", + "consts", + "creationdate", + "ipfs", + "Keepsafe", + "pathctx", + "prismjs", + "proptype", + "quicktime", + "repr", + "Roadmap", + "svgr", + "tailwindcss", + "trivago", + "tsparticles", + "upsert" + ], + "[rust]": { + "editor.defaultFormatter": "matklad.rust-analyzer" + }, + "rust-analyzer.procMacro.enable": true, + "rust-analyzer.diagnostics.experimental.enable": false, + "rust-analyzer.inlayHints.parameterHints.enable": false, + "rust-analyzer.inlayHints.typeHints.enable": false } diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 5df1a2aa4..bb617bbf5 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,4 +1,3 @@ - # Contributor Covenant Code of Conduct ## Our Pledge @@ -18,23 +17,23 @@ diverse, inclusive, and healthy community. Examples of behavior that contributes to a positive environment for our community include: -* Demonstrating empathy and kindness toward other people -* Being respectful of differing opinions, viewpoints, and experiences -* Giving and gracefully accepting constructive feedback -* Accepting responsibility and apologizing to those affected by our mistakes, +- Demonstrating empathy and kindness toward other people +- Being respectful of differing opinions, viewpoints, and experiences +- Giving and gracefully accepting constructive feedback +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience -* Focusing on what is best not just for us as individuals, but for the +- Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -* The use of sexualized language or imagery, and sexual attention or +- The use of sexualized language or imagery, and sexual attention or advances of any kind -* Trolling, insulting or derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or email +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email address, without their explicit permission -* Other conduct which could reasonably be considered inappropriate in a +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Enforcement Responsibilities @@ -107,7 +106,7 @@ Violating these terms may lead to a permanent ban. ### 4. Permanent Ban **Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an +standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. **Consequence**: A permanent ban from any sort of public interaction within @@ -119,15 +118,15 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, available at [https://www.contributor-covenant.org/version/2/0/code_of_conduct.html][v2.0]. -Community Impact Guidelines were inspired by -[Mozilla's code of conduct enforcement ladder][Mozilla CoC]. +Community Impact Guidelines were inspired by +[Mozilla's code of conduct enforcement ladder][mozilla coc]. For answers to common questions about this code of conduct, see the FAQ at -[https://www.contributor-covenant.org/faq][FAQ]. Translations are available +[https://www.contributor-covenant.org/faq][faq]. Translations are available at [https://www.contributor-covenant.org/translations][translations]. [homepage]: https://www.contributor-covenant.org [v2.0]: https://www.contributor-covenant.org/version/2/0/code_of_conduct.html -[Mozilla CoC]: https://github.com/mozilla/diversity -[FAQ]: https://www.contributor-covenant.org/faq +[mozilla coc]: https://github.com/mozilla/diversity +[faq]: https://www.contributor-covenant.org/faq [translations]: https://www.contributor-covenant.org/translations diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 41df6d1a5..b8ba04560 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -61,17 +61,18 @@ If you are having issues ensure you are using the following versions of Rust and ### Pull Request When you're finished with the changes, create a pull request, also known as a PR. -- Fill the "Ready for review" template so that we can review your PR. This template helps reviewers understand your changes as well as the purpose of your pull request. + +- Fill the "Ready for review" template so that we can review your PR. This template helps reviewers understand your changes as well as the purpose of your pull request. - Don't forget to [link PR to issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue) if you are solving one. - Enable the checkbox to [allow maintainer edits](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/allowing-changes-to-a-pull-request-branch-created-from-a-fork) so the branch can be updated for a merge. -Once you submit your PR, a team member will review your proposal. We may ask questions or request for additional information. + Once you submit your PR, a team member will review your proposal. We may ask questions or request for additional information. - We may ask for changes to be made before a PR can be merged, either using [suggested changes](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/incorporating-feedback-in-your-pull-request) or pull request comments. You can apply suggested changes directly through the UI. You can make any other changes in your fork, then commit them to your branch. - As you update your PR and apply changes, mark each conversation as [resolved](https://docs.github.com/en/github/collaborating-with-issues-and-pull-requests/commenting-on-a-pull-request#resolving-conversations). - If you run into any merge issues, checkout this [git tutorial](https://lab.github.com/githubtraining/managing-merge-conflicts) to help you resolve merge conflicts and other issues. ### Your PR is merged! -Congratulations :tada::tada: The Spacedrive team thanks you :sparkles:. +Congratulations :tada::tada: The Spacedrive team thanks you :sparkles:. Once your PR is merged, your contributions will be included in the next release of the application. diff --git a/README.md b/README.md index ebf04950e..1d66cefc2 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,6 @@ Organize files across many devices in one place. From cloud services to offline For independent creatives, hoarders and those that want to own their digital footprint. Spacedrive provides a file management experience like no other, and it's completely free. -

Logo
diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 0aaedc26f..e72ead71a 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -1,41 +1,41 @@ { - "name": "@sd/desktop", - "version": "1.0.0", - "main": "index.js", - "license": "MIT", - "private": true, - "scripts": { - "vite": "vite", - "dev": "concurrently \"pnpm tauri dev\" \"vite\"", - "tauri": "tauri", - "build": "vite build" - }, - "dependencies": { - "@sd/client": "workspace:*", - "@sd/core": "workspace:*", - "@sd/interface": "workspace:*", - "@sd/ui": "workspace:*", - "@tauri-apps/api": "^1.0.0-rc.3", - "react": "^18.0.0", - "react-dom": "^18.0.0" - }, - "devDependencies": { - "@tauri-apps/cli": "^1.0.0-rc.8", - "@tauri-apps/tauricon": "github:tauri-apps/tauricon", - "@types/babel-core": "^6.25.7", - "@types/byte-size": "^8.1.0", - "@types/react": "^18.0.8", - "@types/react-dom": "^18.0.0", - "@types/react-router-dom": "^5.3.3", - "@types/react-window": "^1.8.5", - "@types/tailwindcss": "^3.0.10", - "@vitejs/plugin-react": "^1.3.1", - "concurrently": "^7.1.0", - "prettier": "^2.6.2", - "sass": "^1.50.0", - "typescript": "^4.6.3", - "vite": "^2.9.5", - "vite-plugin-filter-replace": "^0.1.9", - "vite-plugin-svgr": "^1.1.0" - } + "name": "@sd/desktop", + "version": "1.0.0", + "main": "index.js", + "license": "MIT", + "private": true, + "scripts": { + "vite": "vite", + "dev": "concurrently \"pnpm tauri dev\" \"vite\"", + "tauri": "tauri", + "build": "vite build" + }, + "dependencies": { + "@sd/client": "workspace:*", + "@sd/core": "workspace:*", + "@sd/interface": "workspace:*", + "@sd/ui": "workspace:*", + "@tauri-apps/api": "^1.0.0-rc.3", + "react": "^18.0.0", + "react-dom": "^18.0.0" + }, + "devDependencies": { + "@tauri-apps/cli": "^1.0.0-rc.8", + "@tauri-apps/tauricon": "github:tauri-apps/tauricon", + "@types/babel-core": "^6.25.7", + "@types/byte-size": "^8.1.0", + "@types/react": "^18.0.8", + "@types/react-dom": "^18.0.0", + "@types/react-router-dom": "^5.3.3", + "@types/react-window": "^1.8.5", + "@types/tailwindcss": "^3.0.10", + "@vitejs/plugin-react": "^1.3.1", + "concurrently": "^7.1.0", + "prettier": "^2.6.2", + "sass": "^1.50.0", + "typescript": "^4.6.3", + "vite": "^2.9.5", + "vite-plugin-filter-replace": "^0.1.9", + "vite-plugin-svgr": "^1.1.0" + } } diff --git a/apps/desktop/src-tauri/rustfmt.toml b/apps/desktop/src-tauri/rustfmt.toml index 136f5f330..a231bfab7 100644 --- a/apps/desktop/src-tauri/rustfmt.toml +++ b/apps/desktop/src-tauri/rustfmt.toml @@ -1,6 +1,5 @@ max_width = 100 -hard_tabs = false -tab_spaces = 2 +hard_tabs = true newline_style = "Auto" use_small_heuristics = "Default" reorder_imports = true diff --git a/apps/desktop/src-tauri/src/build.rs b/apps/desktop/src-tauri/src/build.rs index 5e6666d8b..5aba44c8d 100644 --- a/apps/desktop/src-tauri/src/build.rs +++ b/apps/desktop/src-tauri/src/build.rs @@ -1,11 +1,11 @@ // use swift_rs::build_utils::{link_swift, link_swift_package}; fn main() { - // HOTFIX: compile the swift code for arm64 - // std::env::set_var("CARGO_CFG_TARGET_ARCH", "arm64"); + // HOTFIX: compile the swift code for arm64 + // std::env::set_var("CARGO_CFG_TARGET_ARCH", "arm64"); - // link_swift(); - // link_swift_package("swift-lib", "../../../packages/macos/"); + // link_swift(); + // link_swift_package("swift-lib", "../../../packages/macos/"); - tauri_build::build(); + tauri_build::build(); } diff --git a/apps/desktop/src-tauri/src/main.rs b/apps/desktop/src-tauri/src/main.rs index fdc82d8cd..a9383971a 100644 --- a/apps/desktop/src-tauri/src/main.rs +++ b/apps/desktop/src-tauri/src/main.rs @@ -11,106 +11,106 @@ use window::WindowExt; #[tauri::command(async)] async fn client_query_transport( - core: tauri::State<'_, CoreController>, - data: ClientQuery, + core: tauri::State<'_, CoreController>, + data: ClientQuery, ) -> Result { - match core.query(data).await { - Ok(response) => Ok(response), - Err(err) => { - println!("query error: {:?}", err); - Err(err.to_string()) - } - } + match core.query(data).await { + Ok(response) => Ok(response), + Err(err) => { + println!("query error: {:?}", err); + Err(err.to_string()) + } + } } #[tauri::command(async)] async fn client_command_transport( - core: tauri::State<'_, CoreController>, - data: ClientCommand, + core: tauri::State<'_, CoreController>, + data: ClientCommand, ) -> Result { - match core.command(data).await { - Ok(response) => Ok(response), - Err(err) => { - println!("command error: {:?}", err); - Err(err.to_string()) - } - } + match core.command(data).await { + Ok(response) => Ok(response), + Err(err) => { + println!("command error: {:?}", err); + Err(err.to_string()) + } + } } #[tauri::command(async)] async fn app_ready(app_handle: tauri::AppHandle) { - let window = app_handle.get_window("main").unwrap(); + let window = app_handle.get_window("main").unwrap(); - window.show().unwrap(); + window.show().unwrap(); - #[cfg(target_os = "macos")] - { - std::thread::sleep(std::time::Duration::from_millis(1000)); - println!("fixing shadow for, {:?}", window.ns_window().unwrap()); - window.fix_shadow(); - } + #[cfg(target_os = "macos")] + { + std::thread::sleep(std::time::Duration::from_millis(1000)); + println!("fixing shadow for, {:?}", window.ns_window().unwrap()); + window.fix_shadow(); + } } #[tokio::main] async fn main() { - let data_dir = path::data_dir().unwrap_or(std::path::PathBuf::from("./")); - // create an instance of the core - let (mut node, mut event_receiver) = Node::new(data_dir).await; - // run startup tasks - node.initializer().await; - // extract the node controller - let controller = node.get_controller(); - // throw the node into a dedicated thread - tokio::spawn(async move { - node.start().await; - }); - // create tauri app - tauri::Builder::default() - // pass controller to the tauri state manager - .manage(controller) - .setup(|app| { - let app = app.handle(); + let data_dir = path::data_dir().unwrap_or(std::path::PathBuf::from("./")); + // create an instance of the core + let (mut node, mut event_receiver) = Node::new(data_dir).await; + // run startup tasks + node.initializer().await; + // extract the node controller + let controller = node.get_controller(); + // throw the node into a dedicated thread + tokio::spawn(async move { + node.start().await; + }); + // create tauri app + tauri::Builder::default() + // pass controller to the tauri state manager + .manage(controller) + .setup(|app| { + let app = app.handle(); - app.windows().iter().for_each(|(_, window)| { - window.hide().unwrap(); + app.windows().iter().for_each(|(_, window)| { + window.hide().unwrap(); - #[cfg(target_os = "windows")] - window.set_decorations(true).unwrap(); + #[cfg(target_os = "windows")] + window.set_decorations(true).unwrap(); - #[cfg(target_os = "macos")] - window.set_transparent_titlebar(true, true); - }); + #[cfg(target_os = "macos")] + window.set_transparent_titlebar(true, true); + }); - // core event transport - tokio::spawn(async move { - let mut last = Instant::now(); - // handle stream output - while let Some(event) = event_receiver.recv().await { - match event { - CoreEvent::InvalidateQueryDebounced(_) => { - let current = Instant::now(); - if current.duration_since(last) > Duration::from_millis(1000 / 60) { - last = current; - app.emit_all("core_event", &event).unwrap(); - } - } - event => { - app.emit_all("core_event", &event).unwrap(); - } - } - } - }); + // core event transport + tokio::spawn(async move { + let mut last = Instant::now(); + // handle stream output + while let Some(event) = event_receiver.recv().await { + match event { + CoreEvent::InvalidateQueryDebounced(_) => { + let current = Instant::now(); + if current.duration_since(last) > Duration::from_millis(1000 / 60) { + last = current; + app.emit_all("core_event", &event).unwrap(); + } + } + event => { + app.emit_all("core_event", &event).unwrap(); + } + } + } + }); - Ok(()) - }) - .on_menu_event(|event| menu::handle_menu_event(event)) - .on_window_event(|event| window::handle_window_event(event)) - .invoke_handler(tauri::generate_handler![ - client_query_transport, - client_command_transport, - app_ready, - ]) - .menu(menu::get_menu()) - .run(tauri::generate_context!()) - .expect("error while running tauri application"); + Ok(()) + }) + .on_menu_event(|event| menu::handle_menu_event(event)) + .on_window_event(|event| window::handle_window_event(event)) + .invoke_handler(tauri::generate_handler![ + client_query_transport, + client_command_transport, + app_ready, + ]) + .menu(menu::get_menu()) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); } diff --git a/apps/desktop/src-tauri/src/menu.rs b/apps/desktop/src-tauri/src/menu.rs index 52db3400a..ffd1a4b2e 100644 --- a/apps/desktop/src-tauri/src/menu.rs +++ b/apps/desktop/src-tauri/src/menu.rs @@ -3,88 +3,88 @@ use std::env::consts; use tauri::{AboutMetadata, CustomMenuItem, Menu, MenuItem, Submenu, WindowMenuEvent, Wry}; pub(crate) fn get_menu() -> Menu { - match consts::OS { - "linux" => Menu::new(), - "macos" => custom_menu_bar(), - _ => Menu::new(), - } + match consts::OS { + "linux" => Menu::new(), + "macos" => custom_menu_bar(), + _ => Menu::new(), + } } fn custom_menu_bar() -> Menu { - // let quit = CustomMenuItem::new("quit".to_string(), "Quit"); - // let close = CustomMenuItem::new("close".to_string(), "Close"); - // let jeff = CustomMenuItem::new("jeff".to_string(), "Jeff"); - // let submenu = Submenu::new( - // "File", - // Menu::new().add_item(quit).add_item(close).add_item(jeff), - // ); - let spacedrive = Submenu::new( - "Spacedrive", - Menu::new() - .add_native_item(MenuItem::About( - "Spacedrive".to_string(), - AboutMetadata::new(), - )) // TODO: fill out about metadata - .add_native_item(MenuItem::Separator) - .add_native_item(MenuItem::Services) - .add_native_item(MenuItem::Separator) - .add_native_item(MenuItem::Hide) - .add_native_item(MenuItem::HideOthers) - .add_native_item(MenuItem::ShowAll) - .add_native_item(MenuItem::Separator) - .add_native_item(MenuItem::Quit), - ); + // let quit = CustomMenuItem::new("quit".to_string(), "Quit"); + // let close = CustomMenuItem::new("close".to_string(), "Close"); + // let jeff = CustomMenuItem::new("jeff".to_string(), "Jeff"); + // let submenu = Submenu::new( + // "File", + // Menu::new().add_item(quit).add_item(close).add_item(jeff), + // ); + let spacedrive = Submenu::new( + "Spacedrive", + Menu::new() + .add_native_item(MenuItem::About( + "Spacedrive".to_string(), + AboutMetadata::new(), + )) // TODO: fill out about metadata + .add_native_item(MenuItem::Separator) + .add_native_item(MenuItem::Services) + .add_native_item(MenuItem::Separator) + .add_native_item(MenuItem::Hide) + .add_native_item(MenuItem::HideOthers) + .add_native_item(MenuItem::ShowAll) + .add_native_item(MenuItem::Separator) + .add_native_item(MenuItem::Quit), + ); - let file = Submenu::new( - "File", - Menu::new() - .add_item( - CustomMenuItem::new("new_window".to_string(), "New Window") - .accelerator("CmdOrCtrl+N") - .disabled(), - ) - .add_item( - CustomMenuItem::new("close".to_string(), "Close Window").accelerator("CmdOrCtrl+W"), - ), - ); - let edit = Submenu::new( - "Edit", - Menu::new() - .add_native_item(MenuItem::Copy) - .add_native_item(MenuItem::Paste), - ); - let view = Submenu::new( - "View", - Menu::new() - .add_item( - CustomMenuItem::new("command_pallete".to_string(), "Command Pallete") - .accelerator("CmdOrCtrl+P"), - ) - .add_item(CustomMenuItem::new("layout".to_string(), "Layout").disabled()), - ); - let window = Submenu::new( - "Window", - Menu::new().add_native_item(MenuItem::EnterFullScreen), - ); + let file = Submenu::new( + "File", + Menu::new() + .add_item( + CustomMenuItem::new("new_window".to_string(), "New Window") + .accelerator("CmdOrCtrl+N") + .disabled(), + ) + .add_item( + CustomMenuItem::new("close".to_string(), "Close Window").accelerator("CmdOrCtrl+W"), + ), + ); + let edit = Submenu::new( + "Edit", + Menu::new() + .add_native_item(MenuItem::Copy) + .add_native_item(MenuItem::Paste), + ); + let view = Submenu::new( + "View", + Menu::new() + .add_item( + CustomMenuItem::new("command_pallete".to_string(), "Command Pallete") + .accelerator("CmdOrCtrl+P"), + ) + .add_item(CustomMenuItem::new("layout".to_string(), "Layout").disabled()), + ); + let window = Submenu::new( + "Window", + Menu::new().add_native_item(MenuItem::EnterFullScreen), + ); - let menu = Menu::new() - .add_submenu(spacedrive) - .add_submenu(file) - .add_submenu(edit) - .add_submenu(view) - .add_submenu(window); + let menu = Menu::new() + .add_submenu(spacedrive) + .add_submenu(file) + .add_submenu(edit) + .add_submenu(view) + .add_submenu(window); - menu + menu } pub(crate) fn handle_menu_event(event: WindowMenuEvent) { - match event.menu_item_id() { - "quit" => { - std::process::exit(0); - } - "close" => { - event.window().close().unwrap(); - } - _ => {} - } + match event.menu_item_id() { + "quit" => { + std::process::exit(0); + } + "close" => { + event.window().close().unwrap(); + } + _ => {} + } } diff --git a/apps/desktop/src-tauri/src/window.rs b/apps/desktop/src-tauri/src/window.rs index 77f56c679..676c98292 100644 --- a/apps/desktop/src-tauri/src/window.rs +++ b/apps/desktop/src-tauri/src/window.rs @@ -1,93 +1,93 @@ use tauri::{GlobalWindowEvent, Runtime, Window, Wry}; pub(crate) fn handle_window_event(event: GlobalWindowEvent) { - match event.event() { - _ => {} - } + match event.event() { + _ => {} + } } pub trait WindowExt { - #[cfg(target_os = "macos")] - fn set_toolbar(&self, shown: bool); - #[cfg(target_os = "macos")] - fn set_transparent_titlebar(&self, transparent: bool, large: bool); - #[cfg(target_os = "macos")] - fn fix_shadow(&self); + #[cfg(target_os = "macos")] + fn set_toolbar(&self, shown: bool); + #[cfg(target_os = "macos")] + fn set_transparent_titlebar(&self, transparent: bool, large: bool); + #[cfg(target_os = "macos")] + fn fix_shadow(&self); } impl WindowExt for Window { - #[cfg(target_os = "macos")] - fn set_toolbar(&self, shown: bool) { - use cocoa::{ - appkit::{NSToolbar, NSWindow}, - base::{nil, NO}, - foundation::NSString, - }; + #[cfg(target_os = "macos")] + fn set_toolbar(&self, shown: bool) { + use cocoa::{ + appkit::{NSToolbar, NSWindow}, + base::{nil, NO}, + foundation::NSString, + }; - unsafe { - let id = self.ns_window().unwrap() as cocoa::base::id; + unsafe { + let id = self.ns_window().unwrap() as cocoa::base::id; - if shown { - let toolbar = - NSToolbar::alloc(nil).initWithIdentifier_(NSString::alloc(nil).init_str("wat")); - toolbar.setShowsBaselineSeparator_(NO); - id.setToolbar_(toolbar); - } else { - id.setToolbar_(nil); - } - } - } + if shown { + let toolbar = + NSToolbar::alloc(nil).initWithIdentifier_(NSString::alloc(nil).init_str("wat")); + toolbar.setShowsBaselineSeparator_(NO); + id.setToolbar_(toolbar); + } else { + id.setToolbar_(nil); + } + } + } - #[cfg(target_os = "macos")] - fn set_transparent_titlebar(&self, transparent: bool, large: bool) { - use cocoa::{ - appkit::{NSWindow, NSWindowStyleMask, NSWindowTitleVisibility}, - base::{NO, YES}, - }; + #[cfg(target_os = "macos")] + fn set_transparent_titlebar(&self, transparent: bool, large: bool) { + use cocoa::{ + appkit::{NSWindow, NSWindowStyleMask, NSWindowTitleVisibility}, + base::{NO, YES}, + }; - unsafe { - let id = self.ns_window().unwrap() as cocoa::base::id; + unsafe { + let id = self.ns_window().unwrap() as cocoa::base::id; - let mut style_mask = id.styleMask(); - // println!("existing style mask, {:#?}", style_mask); - style_mask.set( - NSWindowStyleMask::NSFullSizeContentViewWindowMask, - transparent, - ); - style_mask.set( - NSWindowStyleMask::NSTexturedBackgroundWindowMask, - transparent, - ); - style_mask.set( - NSWindowStyleMask::NSUnifiedTitleAndToolbarWindowMask, - transparent && large, - ); - id.setStyleMask_(style_mask); + let mut style_mask = id.styleMask(); + // println!("existing style mask, {:#?}", style_mask); + style_mask.set( + NSWindowStyleMask::NSFullSizeContentViewWindowMask, + transparent, + ); + style_mask.set( + NSWindowStyleMask::NSTexturedBackgroundWindowMask, + transparent, + ); + style_mask.set( + NSWindowStyleMask::NSUnifiedTitleAndToolbarWindowMask, + transparent && large, + ); + id.setStyleMask_(style_mask); - if large { - self.set_toolbar(true); - } + if large { + self.set_toolbar(true); + } - id.setTitleVisibility_(if transparent { - NSWindowTitleVisibility::NSWindowTitleHidden - } else { - NSWindowTitleVisibility::NSWindowTitleVisible - }); + id.setTitleVisibility_(if transparent { + NSWindowTitleVisibility::NSWindowTitleHidden + } else { + NSWindowTitleVisibility::NSWindowTitleVisible + }); - id.setTitlebarAppearsTransparent_(if transparent { YES } else { NO }); - } - } + id.setTitlebarAppearsTransparent_(if transparent { YES } else { NO }); + } + } - #[cfg(target_os = "macos")] - fn fix_shadow(&self) { - use cocoa::appkit::NSWindow; + #[cfg(target_os = "macos")] + fn fix_shadow(&self) { + use cocoa::appkit::NSWindow; - unsafe { - let id = self.ns_window().unwrap() as cocoa::base::id; + unsafe { + let id = self.ns_window().unwrap() as cocoa::base::id; - println!("recomputing shadow for window {:?}", id.title()); + println!("recomputing shadow for window {:?}", id.title()); - id.invalidateShadow(); - } - } + id.invalidateShadow(); + } + } } diff --git a/apps/desktop/src-tauri/tauri.conf.json b/apps/desktop/src-tauri/tauri.conf.json index 34a5757fc..efbb3361b 100644 --- a/apps/desktop/src-tauri/tauri.conf.json +++ b/apps/desktop/src-tauri/tauri.conf.json @@ -1,83 +1,83 @@ { - "package": { - "productName": "Spacedrive", - "version": "0.1.0" - }, - "build": { - "distDir": "../dist", - "devPath": "http://localhost:8001", - "beforeDevCommand": "", - "beforeBuildCommand": "" - }, - "tauri": { - "macOSPrivateApi": true, - "bundle": { - "active": true, - "targets": "all", - "identifier": "app.spacedrive.desktop", - "icon": [ - "icons/32x32.png", - "icons/128x128.png", - "icons/128x128@2x.png", - "icons/icon.icns", - "icons/icon.ico" - ], - "resources": [], - "externalBin": [], - "copyright": "Jamie Pine", - "shortDescription": "The Universal File Explorer", - "longDescription": "A cross-platform file explorer, powered by an open source virtual distributed filesystem.", - "deb": { - "depends": [], - "useBootstrapper": false - }, - "macOS": { - "frameworks": [], - "minimumSystemVersion": "", - "useBootstrapper": false, - "exceptionDomain": "", - "signingIdentity": null, - "entitlements": null - }, - "windows": { - "certificateThumbprint": null, - "digestAlgorithm": "sha256", - "timestampUrl": "" - } - }, - "updater": { - "active": false - }, - "allowlist": { - "all": true, - "protocol": { - "assetScope": ["*"] - }, - "dialog": { - "all": true, - "open": true, - "save": true - } - }, - "windows": [ - { - "title": "Spacedrive", - "width": 1200, - "height": 725, - "minWidth": 700, - "minHeight": 500, - "resizable": true, - "fullscreen": false, - "alwaysOnTop": false, - "focus": false, - "fileDropEnabled": false, - "decorations": true, - "transparent": true, - "center": true - } - ], - "security": { - "csp": "default-src asset: https://asset.localhost blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'" - } - } + "package": { + "productName": "Spacedrive", + "version": "0.1.0" + }, + "build": { + "distDir": "../dist", + "devPath": "http://localhost:8001", + "beforeDevCommand": "", + "beforeBuildCommand": "" + }, + "tauri": { + "macOSPrivateApi": true, + "bundle": { + "active": true, + "targets": "all", + "identifier": "app.spacedrive.desktop", + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ], + "resources": [], + "externalBin": [], + "copyright": "Jamie Pine", + "shortDescription": "The Universal File Explorer", + "longDescription": "A cross-platform file explorer, powered by an open source virtual distributed filesystem.", + "deb": { + "depends": [], + "useBootstrapper": false + }, + "macOS": { + "frameworks": [], + "minimumSystemVersion": "", + "useBootstrapper": false, + "exceptionDomain": "", + "signingIdentity": null, + "entitlements": null + }, + "windows": { + "certificateThumbprint": null, + "digestAlgorithm": "sha256", + "timestampUrl": "" + } + }, + "updater": { + "active": false + }, + "allowlist": { + "all": true, + "protocol": { + "assetScope": ["*"] + }, + "dialog": { + "all": true, + "open": true, + "save": true + } + }, + "windows": [ + { + "title": "Spacedrive", + "width": 1200, + "height": 725, + "minWidth": 700, + "minHeight": 500, + "resizable": true, + "fullscreen": false, + "alwaysOnTop": false, + "focus": false, + "fileDropEnabled": false, + "decorations": true, + "transparent": true, + "center": true + } + ], + "security": { + "csp": "default-src asset: https://asset.localhost blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'" + } + } } diff --git a/apps/desktop/src-tauri/tauri.linux.conf.json b/apps/desktop/src-tauri/tauri.linux.conf.json index 8ab285e3d..16a6e4a2d 100644 --- a/apps/desktop/src-tauri/tauri.linux.conf.json +++ b/apps/desktop/src-tauri/tauri.linux.conf.json @@ -1,74 +1,74 @@ { - "package": { - "productName": "Spacedrive", - "version": "0.1.0" - }, - "build": { - "distDir": "../dist", - "devPath": "http://localhost:8001", - "beforeDevCommand": "", - "beforeBuildCommand": "" - }, - "tauri": { - "bundle": { - "active": true, - "targets": "all", - "identifier": "co.spacedrive.desktop", - "icon": ["icons/icon.icns"], - "resources": [], - "externalBin": [], - "copyright": "Jamie Pine", - "shortDescription": "Your personal virtual cloud.", - "longDescription": "Spacedrive is an open source virtual filesystem, a personal cloud powered by your everyday devices. Feature-rich benefits of the cloud, only its owned and hosted by you with security, privacy and ownership as a foundation. Spacedrive makes it possible to create a limitless directory of your digital life that will stand the test of time.", - "deb": { - "depends": [], - "useBootstrapper": false - }, - "macOS": { - "frameworks": [], - "minimumSystemVersion": "", - "useBootstrapper": false, - "exceptionDomain": "", - "signingIdentity": null, - "entitlements": null - }, - "windows": { - "certificateThumbprint": null, - "digestAlgorithm": "sha256", - "timestampUrl": "" - } - }, - "updater": { - "active": false - }, - "allowlist": { - "all": true, - "os": { - "all": true - }, - "dialog": { - "all": true, - "open": true, - "save": true - } - }, - "windows": [ - { - "title": "Spacedrive", - "width": 1250, - "height": 625, - "resizable": true, - "fullscreen": false, - "alwaysOnTop": false, - "focus": true, - "fileDropEnabled": false, - "decorations": true, - "transparent": false, - "center": true - } - ], - "security": { - "csp": "default-src asset: blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'" - } - } + "package": { + "productName": "Spacedrive", + "version": "0.1.0" + }, + "build": { + "distDir": "../dist", + "devPath": "http://localhost:8001", + "beforeDevCommand": "", + "beforeBuildCommand": "" + }, + "tauri": { + "bundle": { + "active": true, + "targets": "all", + "identifier": "co.spacedrive.desktop", + "icon": ["icons/icon.icns"], + "resources": [], + "externalBin": [], + "copyright": "Jamie Pine", + "shortDescription": "Your personal virtual cloud.", + "longDescription": "Spacedrive is an open source virtual filesystem, a personal cloud powered by your everyday devices. Feature-rich benefits of the cloud, only its owned and hosted by you with security, privacy and ownership as a foundation. Spacedrive makes it possible to create a limitless directory of your digital life that will stand the test of time.", + "deb": { + "depends": [], + "useBootstrapper": false + }, + "macOS": { + "frameworks": [], + "minimumSystemVersion": "", + "useBootstrapper": false, + "exceptionDomain": "", + "signingIdentity": null, + "entitlements": null + }, + "windows": { + "certificateThumbprint": null, + "digestAlgorithm": "sha256", + "timestampUrl": "" + } + }, + "updater": { + "active": false + }, + "allowlist": { + "all": true, + "os": { + "all": true + }, + "dialog": { + "all": true, + "open": true, + "save": true + } + }, + "windows": [ + { + "title": "Spacedrive", + "width": 1250, + "height": 625, + "resizable": true, + "fullscreen": false, + "alwaysOnTop": false, + "focus": true, + "fileDropEnabled": false, + "decorations": true, + "transparent": false, + "center": true + } + ], + "security": { + "csp": "default-src asset: blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'" + } + } } diff --git a/apps/desktop/src/index.html b/apps/desktop/src/index.html index f493787ea..4d441a0c7 100644 --- a/apps/desktop/src/index.html +++ b/apps/desktop/src/index.html @@ -1,13 +1,13 @@ - - - - - Spacedrive - - -

- - + + + + + Spacedrive + + +
+ + diff --git a/apps/desktop/src/index.tsx b/apps/desktop/src/index.tsx index 34835a780..423e5c79e 100644 --- a/apps/desktop/src/index.tsx +++ b/apps/desktop/src/index.tsx @@ -15,79 +15,79 @@ import { appWindow } from '@tauri-apps/api/window'; // bind state to core via Tauri class Transport extends BaseTransport { - constructor() { - super(); + constructor() { + super(); - listen('core_event', (e: Event) => { - this.emit('core_event', e.payload); - }); - } - async query(query: ClientQuery) { - return await invoke('client_query_transport', { data: query }); - } - async command(query: ClientCommand) { - return await invoke('client_command_transport', { data: query }); - } + listen('core_event', (e: Event) => { + this.emit('core_event', e.payload); + }); + } + async query(query: ClientQuery) { + return await invoke('client_query_transport', { data: query }); + } + async command(query: ClientCommand) { + return await invoke('client_command_transport', { data: query }); + } } function App() { - function getPlatform(platform: string): Platform { - switch (platform) { - case 'darwin': - return 'macOS'; - case 'win32': - return 'windows'; - case 'linux': - return 'linux'; - default: - return 'browser'; - } - } + function getPlatform(platform: string): Platform { + switch (platform) { + case 'darwin': + return 'macOS'; + case 'win32': + return 'windows'; + case 'linux': + return 'linux'; + default: + return 'browser'; + } + } - const [platform, setPlatform] = useState('macOS'); - const [focused, setFocused] = useState(true); + const [platform, setPlatform] = useState('macOS'); + const [focused, setFocused] = useState(true); - useEffect(() => { - os.platform().then((platform) => setPlatform(getPlatform(platform))); - invoke('app_ready'); - }, []); + useEffect(() => { + os.platform().then((platform) => setPlatform(getPlatform(platform))); + invoke('app_ready'); + }, []); - useEffect(() => { - const unlistenFocus = listen('tauri://focus', () => setFocused(true)); - const unlistenBlur = listen('tauri://blur', () => setFocused(false)); + useEffect(() => { + const unlistenFocus = listen('tauri://focus', () => setFocused(true)); + const unlistenBlur = listen('tauri://blur', () => setFocused(false)); - return () => { - unlistenFocus.then((unlisten) => unlisten()); - unlistenBlur.then((unlisten) => unlisten()); - }; - }, []); + return () => { + unlistenFocus.then((unlisten) => unlisten()); + unlistenBlur.then((unlisten) => unlisten()); + }; + }, []); - return ( - { - return dialog.open(options); - }} - isFocused={focused} - onClose={() => appWindow.close()} - onFullscreen={() => appWindow.setFullscreen(true)} - onMinimize={() => appWindow.minimize()} - onOpen={(path: string) => shell.open(path)} - /> - ); + return ( + { + return dialog.open(options); + }} + isFocused={focused} + onClose={() => appWindow.close()} + onFullscreen={() => appWindow.setFullscreen(true)} + onMinimize={() => appWindow.minimize()} + onOpen={(path: string) => shell.open(path)} + /> + ); } const root = createRoot(document.getElementById('root')!); root.render( - - - + + + ); diff --git a/apps/desktop/src/vite-env.d.ts b/apps/desktop/src/vite-env.d.ts index 04e148c9d..16334d7f0 100644 --- a/apps/desktop/src/vite-env.d.ts +++ b/apps/desktop/src/vite-env.d.ts @@ -1,7 +1,7 @@ /// declare interface ImportMetaEnv { - VITE_OS: string; + VITE_OS: string; } declare module '@babel/core' {} diff --git a/apps/desktop/tsconfig.json b/apps/desktop/tsconfig.json index c44e3731e..168f12434 100644 --- a/apps/desktop/tsconfig.json +++ b/apps/desktop/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../packages/config/interface.tsconfig.json", - "compilerOptions": {}, - "include": ["src"] + "extends": "../../packages/config/interface.tsconfig.json", + "compilerOptions": {}, + "include": ["src"] } diff --git a/apps/desktop/vite.config.ts b/apps/desktop/vite.config.ts index d669f544a..a787cf66e 100644 --- a/apps/desktop/vite.config.ts +++ b/apps/desktop/vite.config.ts @@ -1,27 +1,27 @@ import { defineConfig } from 'vite'; import react from '@vitejs/plugin-react'; import { name, version } from './package.json'; -import svg from "vite-plugin-svgr" +import svg from 'vite-plugin-svgr'; // https://vitejs.dev/config/ export default defineConfig({ - server: { - port: 8001 - }, - plugins: [ - //@ts-ignore - react({ - jsxRuntime: 'classic' - }), - svg({ svgrOptions: { icon: true } }) - ], - root: 'src', - publicDir: '../../packages/interface/src/assets', - define: { - pkgJson: { name, version } - }, - build: { - outDir: '../dist', - assetsDir: '.' - } + server: { + port: 8001 + }, + plugins: [ + //@ts-ignore + react({ + jsxRuntime: 'classic' + }), + svg({ svgrOptions: { icon: true } }) + ], + root: 'src', + publicDir: '../../packages/interface/src/assets', + define: { + pkgJson: { name, version } + }, + build: { + outDir: '../dist', + assetsDir: '.' + } }); diff --git a/apps/landing/index.html b/apps/landing/index.html index 46e87dcfc..1f739c216 100644 --- a/apps/landing/index.html +++ b/apps/landing/index.html @@ -1,23 +1,23 @@ - - - - - Spacedrive — A file manager from the future. - - - - - - -
- - + + + + + Spacedrive — A file manager from the future. + + + + + + +
+ + diff --git a/apps/landing/package.json b/apps/landing/package.json index a9b21cdc8..358b46af4 100644 --- a/apps/landing/package.json +++ b/apps/landing/package.json @@ -1,59 +1,59 @@ { - "name": "@sd/landing", - "private": true, - "version": "0.0.0", - "scripts": { - "dev": "vite", - "build": "vite build", - "serve": "vite preview" - }, - "dependencies": { - "@fontsource/inter": "^4.5.7", - "@headlessui/react": "^1.5.0", - "@heroicons/react": "^1.0.6", - "@icons-pack/react-simple-icons": "^4.6.1", - "@sd/client": "workspace:*", - "@sd/core": "workspace:*", - "@sd/interface": "workspace:*", - "@sd/ui": "workspace:*", - "@tailwindcss/typography": "^0.5.2", - "@types/compression": "^1.7.2", - "@types/express": "^4.17.13", - "clsx": "^1.1.1", - "compression": "^1.7.4", - "express": "^4.17.3", - "phosphor-react": "^1.4.1", - "prismjs": "^1.28.0", - "react": "^18.0.0", - "react-device-detect": "^2.2.2", - "react-dom": "^18.0.0", - "react-helmet": "^6.1.0", - "react-router-dom": "6.3.0", - "react-tsparticles": "^2.0.6", - "simple-icons": "^6.19.0", - "tsparticles": "^2.0.6" - }, - "devDependencies": { - "@babel/preset-react": "^7.16.7", - "@types/lodash": "^4.14.182", - "@types/prismjs": "^1.26.0", - "@types/react": "^18.0.8", - "@types/react-dom": "^18.0.0", - "@types/react-helmet": "^6.1.5", - "@vitejs/plugin-react": "^1.3.1", - "autoprefixer": "^10.4.4", - "nodemon": "^2.0.15", - "postcss": "^8.4.12", - "sass": "^1.50.0", - "tailwind": "^4.0.0", - "ts-node": "^10.7.0", - "typescript": "^4.6.3", - "vite": "^2.9.5", - "vite-plugin-markdown": "^2.0.2", - "vite-plugin-md": "^0.13.0", - "vite-plugin-pages": "^0.23.0", - "vite-plugin-pages-sitemap": "^1.2.2", - "vite-plugin-ssr": "^0.3.64", - "vite-plugin-svgr": "^1.1.0" - } + "name": "@sd/landing", + "private": true, + "version": "0.0.0", + "scripts": { + "dev": "vite", + "build": "vite build", + "serve": "vite preview" + }, + "dependencies": { + "@fontsource/inter": "^4.5.7", + "@headlessui/react": "^1.5.0", + "@heroicons/react": "^1.0.6", + "@icons-pack/react-simple-icons": "^4.6.1", + "@sd/client": "workspace:*", + "@sd/core": "workspace:*", + "@sd/interface": "workspace:*", + "@sd/ui": "workspace:*", + "@tailwindcss/typography": "^0.5.2", + "@types/compression": "^1.7.2", + "@types/express": "^4.17.13", + "clsx": "^1.1.1", + "compression": "^1.7.4", + "express": "^4.17.3", + "phosphor-react": "^1.4.1", + "prismjs": "^1.28.0", + "react": "^18.0.0", + "react-device-detect": "^2.2.2", + "react-dom": "^18.0.0", + "react-helmet": "^6.1.0", + "react-router-dom": "6.3.0", + "react-tsparticles": "^2.0.6", + "simple-icons": "^6.19.0", + "tsparticles": "^2.0.6" + }, + "devDependencies": { + "@babel/preset-react": "^7.16.7", + "@types/lodash": "^4.14.182", + "@types/prismjs": "^1.26.0", + "@types/react": "^18.0.8", + "@types/react-dom": "^18.0.0", + "@types/react-helmet": "^6.1.5", + "@vitejs/plugin-react": "^1.3.1", + "autoprefixer": "^10.4.4", + "nodemon": "^2.0.15", + "postcss": "^8.4.12", + "sass": "^1.50.0", + "tailwind": "^4.0.0", + "ts-node": "^10.7.0", + "typescript": "^4.6.3", + "vite": "^2.9.5", + "vite-plugin-markdown": "^2.0.2", + "vite-plugin-md": "^0.13.0", + "vite-plugin-pages": "^0.23.0", + "vite-plugin-pages-sitemap": "^1.2.2", + "vite-plugin-ssr": "^0.3.64", + "vite-plugin-svgr": "^1.1.0" + } } diff --git a/apps/landing/src/atom-one.css b/apps/landing/src/atom-one.css index 9e4e86c27..b8457e47e 100644 --- a/apps/landing/src/atom-one.css +++ b/apps/landing/src/atom-one.css @@ -28,413 +28,416 @@ * --syntax-cursor-line: hsla(220, 100%, 80%, 0.04); */ - code[class*="language-"], - pre[class*="language-"] { - background: hsl(220, 9%, 6%); - color: hsl(220, 14%, 71%); - text-shadow: 0 1px rgba(0, 0, 0, 0.3); - font-family: "Fira Code", "Fira Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace; - direction: ltr; - text-align: left; - white-space: pre; - word-spacing: normal; - word-break: normal; - line-height: 1.5; - -moz-tab-size: 2; - -o-tab-size: 2; - tab-size: 2; - -webkit-hyphens: none; - -moz-hyphens: none; - -ms-hyphens: none; - hyphens: none; - } - - /* Selection */ - code[class*="language-"]::-moz-selection, - code[class*="language-"] *::-moz-selection, - pre[class*="language-"] *::-moz-selection { - background: hsl(220, 13%, 28%); - color: inherit; - text-shadow: none; - } - - code[class*="language-"]::selection, - code[class*="language-"] *::selection, - pre[class*="language-"] *::selection { - background: hsl(220, 13%, 28%); - color: inherit; - text-shadow: none; - } - - /* Code blocks */ - pre[class*="language-"] { - padding: 1em; - margin: 0.5em 0; - overflow: auto; - border-radius: 0.3em; - } - - /* Inline code */ - :not(pre) > code[class*="language-"] { - padding: 0.2em 0.3em; - border-radius: 0.3em; - white-space: normal; - } - - /* Print */ - @media print { - code[class*="language-"], - pre[class*="language-"] { - text-shadow: none; - } - } - - .token.comment, - .token.prolog, - .token.cdata { - color: hsl(220, 10%, 40%); - } - - .token.doctype, - .token.punctuation, - .token.entity { - color: hsl(220, 14%, 71%); - } - - .token.attr-name, - .token.class-name, - .token.boolean, - .token.constant, - .token.number, - .token.atrule { - color: hsl(29, 54%, 61%); - } - - .token.keyword { - color: hsl(286, 60%, 67%); - } - - .token.property, - .token.tag, - .token.symbol, - .token.deleted, - .token.important { - color: hsl(355, 65%, 65%); - } - - .token.selector, - .token.string, - .token.char, - .token.builtin, - .token.inserted, - .token.regex, - .token.attr-value, - .token.attr-value > .token.punctuation { - color: hsl(95, 38%, 62%); - } - - .token.variable, - .token.operator, - .token.function { - color: hsl(207, 82%, 66%); - } - - .token.url { - color: hsl(187, 47%, 55%); - } - - /* HTML overrides */ - .token.attr-value > .token.punctuation.attr-equals, - .token.special-attr > .token.attr-value > .token.value.css { - color: hsl(220, 14%, 71%); - } - - /* CSS overrides */ - .language-css .token.selector { - color: hsl(355, 65%, 65%); - } - - .language-css .token.property { - color: hsl(220, 14%, 71%); - } - - .language-css .token.function, - .language-css .token.url > .token.function { - color: hsl(187, 47%, 55%); - } - - .language-css .token.url > .token.string.url { - color: hsl(95, 38%, 62%); - } - - .language-css .token.important, - .language-css .token.atrule .token.rule { - color: hsl(286, 60%, 67%); - } - - /* JS overrides */ - .language-javascript .token.operator { - color: hsl(286, 60%, 67%); - } - - .language-javascript .token.template-string > .token.interpolation > .token.interpolation-punctuation.punctuation { - color: hsl(5, 48%, 51%); - } - - /* JSON overrides */ - .language-json .token.operator { - color: hsl(220, 14%, 71%); - } - - .language-json .token.null.keyword { - color: hsl(29, 54%, 61%); - } - - /* MD overrides */ - .language-markdown .token.url, - .language-markdown .token.url > .token.operator, - .language-markdown .token.url-reference.url > .token.string { - color: hsl(220, 14%, 71%); - } - - .language-markdown .token.url > .token.content { - color: hsl(207, 82%, 66%); - } - - .language-markdown .token.url > .token.url, - .language-markdown .token.url-reference.url { - color: hsl(187, 47%, 55%); - } - - .language-markdown .token.blockquote.punctuation, - .language-markdown .token.hr.punctuation { - color: hsl(220, 10%, 40%); - font-style: italic; - } - - .language-markdown .token.code-snippet { - color: hsl(95, 38%, 62%); - } - - .language-markdown .token.bold .token.content { - color: hsl(29, 54%, 61%); - } - - .language-markdown .token.italic .token.content { - color: hsl(286, 60%, 67%); - } - - .language-markdown .token.strike .token.content, - .language-markdown .token.strike .token.punctuation, - .language-markdown .token.list.punctuation, - .language-markdown .token.title.important > .token.punctuation { - color: hsl(355, 65%, 65%); - } - - /* General */ - .token.bold { - font-weight: bold; - } - - .token.comment, - .token.italic { - font-style: italic; - } - - .token.entity { - cursor: help; - } - - .token.namespace { - opacity: 0.8; - } - - /* Plugin overrides */ - /* Selectors should have higher specificity than those in the plugins' default stylesheets */ - - /* Show Invisibles plugin overrides */ - .token.token.tab:not(:empty):before, - .token.token.cr:before, - .token.token.lf:before, - .token.token.space:before { - color: hsla(220, 14%, 71%, 0.15); - text-shadow: none; - } - - /* Toolbar plugin overrides */ - /* Space out all buttons and move them away from the right edge of the code block */ - div.code-toolbar > .toolbar.toolbar > .toolbar-item { - margin-right: 0.4em; - } - - /* Styling the buttons */ - div.code-toolbar > .toolbar.toolbar > .toolbar-item > button, - div.code-toolbar > .toolbar.toolbar > .toolbar-item > a, - div.code-toolbar > .toolbar.toolbar > .toolbar-item > span { - background: hsl(220, 13%, 26%); - color: hsl(220, 9%, 55%); - padding: 0.1em 0.4em; - border-radius: 0.3em; - } - - div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover, - div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus, - div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover, - div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus, - div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover, - div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus { - background: hsl(220, 13%, 28%); - color: hsl(220, 14%, 71%); - } - - /* Line Highlight plugin overrides */ - /* The highlighted line itself */ - .line-highlight.line-highlight { - background: hsla(220, 100%, 80%, 0.04); - } - - /* Default line numbers in Line Highlight plugin */ - .line-highlight.line-highlight:before, - .line-highlight.line-highlight[data-end]:after { - background: hsl(220, 13%, 26%); - color: hsl(220, 14%, 71%); - padding: 0.1em 0.6em; - border-radius: 0.3em; - box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.2); /* same as Toolbar plugin default */ - } - - /* Hovering over a linkable line number (in the gutter area) */ - /* Requires Line Numbers plugin as well */ - pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before { - background-color: hsla(220, 100%, 80%, 0.04); - } - - /* Line Numbers and Command Line plugins overrides */ - /* Line separating gutter from coding area */ - .line-numbers.line-numbers .line-numbers-rows, - .command-line .command-line-prompt { - border-right-color: hsla(220, 14%, 71%, 0.15); - } - - /* Stuff in the gutter */ - .line-numbers .line-numbers-rows > span:before, - .command-line .command-line-prompt > span:before { - color: hsl(220, 14%, 45%); - } - - /* Match Braces plugin overrides */ - /* Note: Outline colour is inherited from the braces */ - .rainbow-braces .token.token.punctuation.brace-level-1, - .rainbow-braces .token.token.punctuation.brace-level-5, - .rainbow-braces .token.token.punctuation.brace-level-9 { - color: hsl(355, 65%, 65%); - } - - .rainbow-braces .token.token.punctuation.brace-level-2, - .rainbow-braces .token.token.punctuation.brace-level-6, - .rainbow-braces .token.token.punctuation.brace-level-10 { - color: hsl(95, 38%, 62%); - } - - .rainbow-braces .token.token.punctuation.brace-level-3, - .rainbow-braces .token.token.punctuation.brace-level-7, - .rainbow-braces .token.token.punctuation.brace-level-11 { - color: hsl(207, 82%, 66%); - } - - .rainbow-braces .token.token.punctuation.brace-level-4, - .rainbow-braces .token.token.punctuation.brace-level-8, - .rainbow-braces .token.token.punctuation.brace-level-12 { - color: hsl(286, 60%, 67%); - } - - /* Diff Highlight plugin overrides */ - /* Taken from https://github.com/atom/github/blob/master/styles/variables.less */ - pre.diff-highlight > code .token.token.deleted:not(.prefix), - pre > code.diff-highlight .token.token.deleted:not(.prefix) { - background-color: hsla(353, 100%, 66%, 0.15); - } - - pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection, - pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection, - pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection, - pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection { - background-color: hsla(353, 95%, 66%, 0.25); - } - - pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection, - pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection, - pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection, - pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection { - background-color: hsla(353, 95%, 66%, 0.25); - } - - pre.diff-highlight > code .token.token.inserted:not(.prefix), - pre > code.diff-highlight .token.token.inserted:not(.prefix) { - background-color: hsla(137, 100%, 55%, 0.15); - } - - pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection, - pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection, - pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection, - pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection { - background-color: hsla(135, 73%, 55%, 0.25); - } - - pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection, - pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection, - pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection, - pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection { - background-color: hsla(135, 73%, 55%, 0.25); - } - - /* Previewers plugin overrides */ - /* Based on https://github.com/atom-community/atom-ide-datatip/blob/master/styles/atom-ide-datatips.less and https://github.com/atom/atom/blob/master/packages/one-dark-ui */ - /* Border around popup */ - .prism-previewer.prism-previewer:before, - .prism-previewer-gradient.prism-previewer-gradient div { - border-color: hsl(224, 13%, 17%); - } - - /* Angle and time should remain as circles and are hence not included */ - .prism-previewer-color.prism-previewer-color:before, - .prism-previewer-gradient.prism-previewer-gradient div, - .prism-previewer-easing.prism-previewer-easing:before { - border-radius: 0.3em; - } - - /* Triangles pointing to the code */ - .prism-previewer.prism-previewer:after { - border-top-color: hsl(224, 13%, 17%); - } - - .prism-previewer-flipped.prism-previewer-flipped.after { - border-bottom-color: hsl(224, 13%, 17%); - } - - /* Background colour within the popup */ - .prism-previewer-angle.prism-previewer-angle:before, - .prism-previewer-time.prism-previewer-time:before, - .prism-previewer-easing.prism-previewer-easing { - background: hsl(219, 13%, 22%); - } - - /* For angle, this is the positive area (eg. 90deg will display one quadrant in this colour) */ - /* For time, this is the alternate colour */ - .prism-previewer-angle.prism-previewer-angle circle, - .prism-previewer-time.prism-previewer-time circle { - stroke: hsl(220, 14%, 71%); - stroke-opacity: 1; - } - - /* Stroke colours of the handle, direction point, and vector itself */ - .prism-previewer-easing.prism-previewer-easing circle, - .prism-previewer-easing.prism-previewer-easing path, - .prism-previewer-easing.prism-previewer-easing line { - stroke: hsl(220, 14%, 71%); - } - - /* Fill colour of the handle */ - .prism-previewer-easing.prism-previewer-easing circle { - fill: transparent; - } \ No newline at end of file +code[class*='language-'], +pre[class*='language-'] { + background: hsl(220, 9%, 6%); + color: hsl(220, 14%, 71%); + text-shadow: 0 1px rgba(0, 0, 0, 0.3); + font-family: 'Fira Code', 'Fira Mono', Menlo, Consolas, 'DejaVu Sans Mono', monospace; + direction: ltr; + text-align: left; + white-space: pre; + word-spacing: normal; + word-break: normal; + line-height: 1.5; + -moz-tab-size: 2; + -o-tab-size: 2; + tab-size: 2; + -webkit-hyphens: none; + -moz-hyphens: none; + -ms-hyphens: none; + hyphens: none; +} + +/* Selection */ +code[class*='language-']::-moz-selection, +code[class*='language-'] *::-moz-selection, +pre[class*='language-'] *::-moz-selection { + background: hsl(220, 13%, 28%); + color: inherit; + text-shadow: none; +} + +code[class*='language-']::selection, +code[class*='language-'] *::selection, +pre[class*='language-'] *::selection { + background: hsl(220, 13%, 28%); + color: inherit; + text-shadow: none; +} + +/* Code blocks */ +pre[class*='language-'] { + padding: 1em; + margin: 0.5em 0; + overflow: auto; + border-radius: 0.3em; +} + +/* Inline code */ +:not(pre) > code[class*='language-'] { + padding: 0.2em 0.3em; + border-radius: 0.3em; + white-space: normal; +} + +/* Print */ +@media print { + code[class*='language-'], + pre[class*='language-'] { + text-shadow: none; + } +} + +.token.comment, +.token.prolog, +.token.cdata { + color: hsl(220, 10%, 40%); +} + +.token.doctype, +.token.punctuation, +.token.entity { + color: hsl(220, 14%, 71%); +} + +.token.attr-name, +.token.class-name, +.token.boolean, +.token.constant, +.token.number, +.token.atrule { + color: hsl(29, 54%, 61%); +} + +.token.keyword { + color: hsl(286, 60%, 67%); +} + +.token.property, +.token.tag, +.token.symbol, +.token.deleted, +.token.important { + color: hsl(355, 65%, 65%); +} + +.token.selector, +.token.string, +.token.char, +.token.builtin, +.token.inserted, +.token.regex, +.token.attr-value, +.token.attr-value > .token.punctuation { + color: hsl(95, 38%, 62%); +} + +.token.variable, +.token.operator, +.token.function { + color: hsl(207, 82%, 66%); +} + +.token.url { + color: hsl(187, 47%, 55%); +} + +/* HTML overrides */ +.token.attr-value > .token.punctuation.attr-equals, +.token.special-attr > .token.attr-value > .token.value.css { + color: hsl(220, 14%, 71%); +} + +/* CSS overrides */ +.language-css .token.selector { + color: hsl(355, 65%, 65%); +} + +.language-css .token.property { + color: hsl(220, 14%, 71%); +} + +.language-css .token.function, +.language-css .token.url > .token.function { + color: hsl(187, 47%, 55%); +} + +.language-css .token.url > .token.string.url { + color: hsl(95, 38%, 62%); +} + +.language-css .token.important, +.language-css .token.atrule .token.rule { + color: hsl(286, 60%, 67%); +} + +/* JS overrides */ +.language-javascript .token.operator { + color: hsl(286, 60%, 67%); +} + +.language-javascript + .token.template-string + > .token.interpolation + > .token.interpolation-punctuation.punctuation { + color: hsl(5, 48%, 51%); +} + +/* JSON overrides */ +.language-json .token.operator { + color: hsl(220, 14%, 71%); +} + +.language-json .token.null.keyword { + color: hsl(29, 54%, 61%); +} + +/* MD overrides */ +.language-markdown .token.url, +.language-markdown .token.url > .token.operator, +.language-markdown .token.url-reference.url > .token.string { + color: hsl(220, 14%, 71%); +} + +.language-markdown .token.url > .token.content { + color: hsl(207, 82%, 66%); +} + +.language-markdown .token.url > .token.url, +.language-markdown .token.url-reference.url { + color: hsl(187, 47%, 55%); +} + +.language-markdown .token.blockquote.punctuation, +.language-markdown .token.hr.punctuation { + color: hsl(220, 10%, 40%); + font-style: italic; +} + +.language-markdown .token.code-snippet { + color: hsl(95, 38%, 62%); +} + +.language-markdown .token.bold .token.content { + color: hsl(29, 54%, 61%); +} + +.language-markdown .token.italic .token.content { + color: hsl(286, 60%, 67%); +} + +.language-markdown .token.strike .token.content, +.language-markdown .token.strike .token.punctuation, +.language-markdown .token.list.punctuation, +.language-markdown .token.title.important > .token.punctuation { + color: hsl(355, 65%, 65%); +} + +/* General */ +.token.bold { + font-weight: bold; +} + +.token.comment, +.token.italic { + font-style: italic; +} + +.token.entity { + cursor: help; +} + +.token.namespace { + opacity: 0.8; +} + +/* Plugin overrides */ +/* Selectors should have higher specificity than those in the plugins' default stylesheets */ + +/* Show Invisibles plugin overrides */ +.token.token.tab:not(:empty):before, +.token.token.cr:before, +.token.token.lf:before, +.token.token.space:before { + color: hsla(220, 14%, 71%, 0.15); + text-shadow: none; +} + +/* Toolbar plugin overrides */ +/* Space out all buttons and move them away from the right edge of the code block */ +div.code-toolbar > .toolbar.toolbar > .toolbar-item { + margin-right: 0.4em; +} + +/* Styling the buttons */ +div.code-toolbar > .toolbar.toolbar > .toolbar-item > button, +div.code-toolbar > .toolbar.toolbar > .toolbar-item > a, +div.code-toolbar > .toolbar.toolbar > .toolbar-item > span { + background: hsl(220, 13%, 26%); + color: hsl(220, 9%, 55%); + padding: 0.1em 0.4em; + border-radius: 0.3em; +} + +div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:hover, +div.code-toolbar > .toolbar.toolbar > .toolbar-item > button:focus, +div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:hover, +div.code-toolbar > .toolbar.toolbar > .toolbar-item > a:focus, +div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:hover, +div.code-toolbar > .toolbar.toolbar > .toolbar-item > span:focus { + background: hsl(220, 13%, 28%); + color: hsl(220, 14%, 71%); +} + +/* Line Highlight plugin overrides */ +/* The highlighted line itself */ +.line-highlight.line-highlight { + background: hsla(220, 100%, 80%, 0.04); +} + +/* Default line numbers in Line Highlight plugin */ +.line-highlight.line-highlight:before, +.line-highlight.line-highlight[data-end]:after { + background: hsl(220, 13%, 26%); + color: hsl(220, 14%, 71%); + padding: 0.1em 0.6em; + border-radius: 0.3em; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.2); /* same as Toolbar plugin default */ +} + +/* Hovering over a linkable line number (in the gutter area) */ +/* Requires Line Numbers plugin as well */ +pre[id].linkable-line-numbers.linkable-line-numbers span.line-numbers-rows > span:hover:before { + background-color: hsla(220, 100%, 80%, 0.04); +} + +/* Line Numbers and Command Line plugins overrides */ +/* Line separating gutter from coding area */ +.line-numbers.line-numbers .line-numbers-rows, +.command-line .command-line-prompt { + border-right-color: hsla(220, 14%, 71%, 0.15); +} + +/* Stuff in the gutter */ +.line-numbers .line-numbers-rows > span:before, +.command-line .command-line-prompt > span:before { + color: hsl(220, 14%, 45%); +} + +/* Match Braces plugin overrides */ +/* Note: Outline colour is inherited from the braces */ +.rainbow-braces .token.token.punctuation.brace-level-1, +.rainbow-braces .token.token.punctuation.brace-level-5, +.rainbow-braces .token.token.punctuation.brace-level-9 { + color: hsl(355, 65%, 65%); +} + +.rainbow-braces .token.token.punctuation.brace-level-2, +.rainbow-braces .token.token.punctuation.brace-level-6, +.rainbow-braces .token.token.punctuation.brace-level-10 { + color: hsl(95, 38%, 62%); +} + +.rainbow-braces .token.token.punctuation.brace-level-3, +.rainbow-braces .token.token.punctuation.brace-level-7, +.rainbow-braces .token.token.punctuation.brace-level-11 { + color: hsl(207, 82%, 66%); +} + +.rainbow-braces .token.token.punctuation.brace-level-4, +.rainbow-braces .token.token.punctuation.brace-level-8, +.rainbow-braces .token.token.punctuation.brace-level-12 { + color: hsl(286, 60%, 67%); +} + +/* Diff Highlight plugin overrides */ +/* Taken from https://github.com/atom/github/blob/master/styles/variables.less */ +pre.diff-highlight > code .token.token.deleted:not(.prefix), +pre > code.diff-highlight .token.token.deleted:not(.prefix) { + background-color: hsla(353, 100%, 66%, 0.15); +} + +pre.diff-highlight > code .token.token.deleted:not(.prefix)::-moz-selection, +pre.diff-highlight > code .token.token.deleted:not(.prefix) *::-moz-selection, +pre > code.diff-highlight .token.token.deleted:not(.prefix)::-moz-selection, +pre > code.diff-highlight .token.token.deleted:not(.prefix) *::-moz-selection { + background-color: hsla(353, 95%, 66%, 0.25); +} + +pre.diff-highlight > code .token.token.deleted:not(.prefix)::selection, +pre.diff-highlight > code .token.token.deleted:not(.prefix) *::selection, +pre > code.diff-highlight .token.token.deleted:not(.prefix)::selection, +pre > code.diff-highlight .token.token.deleted:not(.prefix) *::selection { + background-color: hsla(353, 95%, 66%, 0.25); +} + +pre.diff-highlight > code .token.token.inserted:not(.prefix), +pre > code.diff-highlight .token.token.inserted:not(.prefix) { + background-color: hsla(137, 100%, 55%, 0.15); +} + +pre.diff-highlight > code .token.token.inserted:not(.prefix)::-moz-selection, +pre.diff-highlight > code .token.token.inserted:not(.prefix) *::-moz-selection, +pre > code.diff-highlight .token.token.inserted:not(.prefix)::-moz-selection, +pre > code.diff-highlight .token.token.inserted:not(.prefix) *::-moz-selection { + background-color: hsla(135, 73%, 55%, 0.25); +} + +pre.diff-highlight > code .token.token.inserted:not(.prefix)::selection, +pre.diff-highlight > code .token.token.inserted:not(.prefix) *::selection, +pre > code.diff-highlight .token.token.inserted:not(.prefix)::selection, +pre > code.diff-highlight .token.token.inserted:not(.prefix) *::selection { + background-color: hsla(135, 73%, 55%, 0.25); +} + +/* Previewers plugin overrides */ +/* Based on https://github.com/atom-community/atom-ide-datatip/blob/master/styles/atom-ide-datatips.less and https://github.com/atom/atom/blob/master/packages/one-dark-ui */ +/* Border around popup */ +.prism-previewer.prism-previewer:before, +.prism-previewer-gradient.prism-previewer-gradient div { + border-color: hsl(224, 13%, 17%); +} + +/* Angle and time should remain as circles and are hence not included */ +.prism-previewer-color.prism-previewer-color:before, +.prism-previewer-gradient.prism-previewer-gradient div, +.prism-previewer-easing.prism-previewer-easing:before { + border-radius: 0.3em; +} + +/* Triangles pointing to the code */ +.prism-previewer.prism-previewer:after { + border-top-color: hsl(224, 13%, 17%); +} + +.prism-previewer-flipped.prism-previewer-flipped.after { + border-bottom-color: hsl(224, 13%, 17%); +} + +/* Background colour within the popup */ +.prism-previewer-angle.prism-previewer-angle:before, +.prism-previewer-time.prism-previewer-time:before, +.prism-previewer-easing.prism-previewer-easing { + background: hsl(219, 13%, 22%); +} + +/* For angle, this is the positive area (eg. 90deg will display one quadrant in this colour) */ +/* For time, this is the alternate colour */ +.prism-previewer-angle.prism-previewer-angle circle, +.prism-previewer-time.prism-previewer-time circle { + stroke: hsl(220, 14%, 71%); + stroke-opacity: 1; +} + +/* Stroke colours of the handle, direction point, and vector itself */ +.prism-previewer-easing.prism-previewer-easing circle, +.prism-previewer-easing.prism-previewer-easing path, +.prism-previewer-easing.prism-previewer-easing line { + stroke: hsl(220, 14%, 71%); +} + +/* Fill colour of the handle */ +.prism-previewer-easing.prism-previewer-easing circle { + fill: transparent; +} diff --git a/apps/landing/src/components/AppEmbed.tsx b/apps/landing/src/components/AppEmbed.tsx index 229835b05..4503a60f1 100644 --- a/apps/landing/src/components/AppEmbed.tsx +++ b/apps/landing/src/components/AppEmbed.tsx @@ -4,93 +4,93 @@ import { useEffect } from 'react'; import { isMobile } from 'react-device-detect'; export default function AppEmbed() { - const [showApp, setShowApp] = useState(false); - const [iFrameAppReady, setIframeAppReady] = useState(false); - const [forceImg, setForceImg] = useState(false); - const [imgFallback, setImageFallback] = useState(false); - const iFrame = useRef(null); + const [showApp, setShowApp] = useState(false); + const [iFrameAppReady, setIframeAppReady] = useState(false); + const [forceImg, setForceImg] = useState(false); + const [imgFallback, setImageFallback] = useState(false); + const iFrame = useRef(null); - function handleResize() { - if (window.innerWidth < 1000) { - setForceImg(true); - } else if (forceImg) { - setForceImg(false); - } - } + function handleResize() { + if (window.innerWidth < 1000) { + setForceImg(true); + } else if (forceImg) { + setForceImg(false); + } + } - useEffect(() => { - window.addEventListener('resize', handleResize); - handleResize(); - return () => window.removeEventListener('resize', handleResize); - }, []); + useEffect(() => { + window.addEventListener('resize', handleResize); + handleResize(); + return () => window.removeEventListener('resize', handleResize); + }, []); - function handleEvent(e: any) { - if (e.data === 'spacedrive-hello') { - if (!iFrameAppReady) setIframeAppReady(true); - } - } + function handleEvent(e: any) { + if (e.data === 'spacedrive-hello') { + if (!iFrameAppReady) setIframeAppReady(true); + } + } - // after five minutes kill the live demo - useEffect(() => { - const timer = setTimeout(() => { - setIframeAppReady(false); - }, 300000); - return () => clearTimeout(timer); - }, []); + // after five minutes kill the live demo + useEffect(() => { + const timer = setTimeout(() => { + setIframeAppReady(false); + }, 300000); + return () => clearTimeout(timer); + }, []); - useEffect(() => { - window.addEventListener('message', handleEvent, false); - setShowApp(true); + useEffect(() => { + window.addEventListener('message', handleEvent, false); + setShowApp(true); - return () => window.removeEventListener('message', handleEvent); - }, []); + return () => window.removeEventListener('message', handleEvent); + }, []); - useEffect(() => { - setTimeout(() => { - if (!iFrameAppReady) setImageFallback(true); - }, 1500); - }, []); + useEffect(() => { + setTimeout(() => { + if (!iFrameAppReady) setImageFallback(true); + }, 1500); + }, []); - const renderImage = (imgFallback && !iFrameAppReady) || forceImg; + const renderImage = (imgFallback && !iFrameAppReady) || forceImg; - const renderBloom = renderImage || iFrameAppReady; + const renderBloom = renderImage || iFrameAppReady; - return ( -
- {renderBloom && ( -
-
-
-
-
-
-
- )} -
-
- {showApp && !forceImg && ( -