diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index efd6312..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,7 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "note-app" -version = "0.1.0" diff --git a/Cargo.toml b/Cargo.toml deleted file mode 100644 index 13644a0..0000000 --- a/Cargo.toml +++ /dev/null @@ -1,8 +0,0 @@ -[package] -name = "note-app" -version = "0.1.0" -edition = "2021" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[dependencies] diff --git a/note-taking-app/.gitignore b/note-taking-app/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/note-taking-app/.gitignore @@ -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? diff --git a/note-taking-app/.vscode/extensions.json b/note-taking-app/.vscode/extensions.json new file mode 100644 index 0000000..24d7cc6 --- /dev/null +++ b/note-taking-app/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["tauri-apps.tauri-vscode", "rust-lang.rust-analyzer"] +} diff --git a/note-taking-app/README.md b/note-taking-app/README.md new file mode 100644 index 0000000..441faf7 --- /dev/null +++ b/note-taking-app/README.md @@ -0,0 +1,7 @@ +# Tauri + Vanilla + +This template should help get you started developing with Tauri in vanilla HTML, CSS and Javascript. + +## Recommended IDE Setup + +- [VS Code](https://code.visualstudio.com/) + [Tauri](https://marketplace.visualstudio.com/items?itemName=tauri-apps.tauri-vscode) + [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) diff --git a/note-taking-app/justfile b/note-taking-app/justfile new file mode 100644 index 0000000..f60231d --- /dev/null +++ b/note-taking-app/justfile @@ -0,0 +1,11 @@ +_default: + @just --list + +# Run any command with the android arguments +run-android *args: + #!/usr/bin/env bash + export JAVA_HOME=/opt/android-studio/jbr + export ANDROID_HOME="$HOME/Android/Sdk" + export NDK_HOME="$ANDROID_HOME/ndk/28.0.12433566" + {{args}} + diff --git a/note-taking-app/src-tauri/.gitignore b/note-taking-app/src-tauri/.gitignore new file mode 100644 index 0000000..b21bd68 --- /dev/null +++ b/note-taking-app/src-tauri/.gitignore @@ -0,0 +1,7 @@ +# Generated by Cargo +# will have compiled files and executables +/target/ + +# Generated by Tauri +# will have schema files for capabilities auto-completion +/gen/schemas diff --git a/note-taking-app/src-tauri/Cargo.toml b/note-taking-app/src-tauri/Cargo.toml new file mode 100644 index 0000000..306086c --- /dev/null +++ b/note-taking-app/src-tauri/Cargo.toml @@ -0,0 +1,25 @@ +[package] +name = "note-taking-app" +version = "0.1.0" +description = "A Tauri App" +authors = ["you"] +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lib] +# The `_lib` suffix may seem redundant but it is necessary +# to make the lib name unique and wouldn't conflict with the bin name. +# This seems to be only an issue on Windows, see https://github.com/rust-lang/cargo/issues/8519 +name = "note_taking_app_lib" +crate-type = ["staticlib", "cdylib", "rlib"] + +[build-dependencies] +tauri-build = { version = "2", features = [] } + +[dependencies] +tauri = { version = "2", features = [] } +tauri-plugin-shell = "2" +serde = { version = "1", features = ["derive"] } +serde_json = "1" + diff --git a/note-taking-app/src-tauri/build.rs b/note-taking-app/src-tauri/build.rs new file mode 100644 index 0000000..d860e1e --- /dev/null +++ b/note-taking-app/src-tauri/build.rs @@ -0,0 +1,3 @@ +fn main() { + tauri_build::build() +} diff --git a/note-taking-app/src-tauri/capabilities/default.json b/note-taking-app/src-tauri/capabilities/default.json new file mode 100644 index 0000000..3bb4cc4 --- /dev/null +++ b/note-taking-app/src-tauri/capabilities/default.json @@ -0,0 +1,10 @@ +{ + "$schema": "../gen/schemas/desktop-schema.json", + "identifier": "default", + "description": "Capability for the main window", + "windows": ["main"], + "permissions": [ + "core:default", + "shell:allow-open" + ] +} diff --git a/note-taking-app/src-tauri/icons/128x128.png b/note-taking-app/src-tauri/icons/128x128.png new file mode 100644 index 0000000..6be5e50 Binary files /dev/null and b/note-taking-app/src-tauri/icons/128x128.png differ diff --git a/note-taking-app/src-tauri/icons/128x128@2x.png b/note-taking-app/src-tauri/icons/128x128@2x.png new file mode 100644 index 0000000..e81bece Binary files /dev/null and b/note-taking-app/src-tauri/icons/128x128@2x.png differ diff --git a/note-taking-app/src-tauri/icons/32x32.png b/note-taking-app/src-tauri/icons/32x32.png new file mode 100644 index 0000000..a437dd5 Binary files /dev/null and b/note-taking-app/src-tauri/icons/32x32.png differ diff --git a/note-taking-app/src-tauri/icons/Square107x107Logo.png b/note-taking-app/src-tauri/icons/Square107x107Logo.png new file mode 100644 index 0000000..0ca4f27 Binary files /dev/null and b/note-taking-app/src-tauri/icons/Square107x107Logo.png differ diff --git a/note-taking-app/src-tauri/icons/Square142x142Logo.png b/note-taking-app/src-tauri/icons/Square142x142Logo.png new file mode 100644 index 0000000..b81f820 Binary files /dev/null and b/note-taking-app/src-tauri/icons/Square142x142Logo.png differ diff --git a/note-taking-app/src-tauri/icons/Square150x150Logo.png b/note-taking-app/src-tauri/icons/Square150x150Logo.png new file mode 100644 index 0000000..624c7bf Binary files /dev/null and b/note-taking-app/src-tauri/icons/Square150x150Logo.png differ diff --git a/note-taking-app/src-tauri/icons/Square284x284Logo.png b/note-taking-app/src-tauri/icons/Square284x284Logo.png new file mode 100644 index 0000000..c021d2b Binary files /dev/null and b/note-taking-app/src-tauri/icons/Square284x284Logo.png differ diff --git a/note-taking-app/src-tauri/icons/Square30x30Logo.png b/note-taking-app/src-tauri/icons/Square30x30Logo.png new file mode 100644 index 0000000..6219700 Binary files /dev/null and b/note-taking-app/src-tauri/icons/Square30x30Logo.png differ diff --git a/note-taking-app/src-tauri/icons/Square310x310Logo.png b/note-taking-app/src-tauri/icons/Square310x310Logo.png new file mode 100644 index 0000000..f9bc048 Binary files /dev/null and b/note-taking-app/src-tauri/icons/Square310x310Logo.png differ diff --git a/note-taking-app/src-tauri/icons/Square44x44Logo.png b/note-taking-app/src-tauri/icons/Square44x44Logo.png new file mode 100644 index 0000000..d5fbfb2 Binary files /dev/null and b/note-taking-app/src-tauri/icons/Square44x44Logo.png differ diff --git a/note-taking-app/src-tauri/icons/Square71x71Logo.png b/note-taking-app/src-tauri/icons/Square71x71Logo.png new file mode 100644 index 0000000..63440d7 Binary files /dev/null and b/note-taking-app/src-tauri/icons/Square71x71Logo.png differ diff --git a/note-taking-app/src-tauri/icons/Square89x89Logo.png b/note-taking-app/src-tauri/icons/Square89x89Logo.png new file mode 100644 index 0000000..f3f705a Binary files /dev/null and b/note-taking-app/src-tauri/icons/Square89x89Logo.png differ diff --git a/note-taking-app/src-tauri/icons/StoreLogo.png b/note-taking-app/src-tauri/icons/StoreLogo.png new file mode 100644 index 0000000..4556388 Binary files /dev/null and b/note-taking-app/src-tauri/icons/StoreLogo.png differ diff --git a/note-taking-app/src-tauri/icons/icon.icns b/note-taking-app/src-tauri/icons/icon.icns new file mode 100644 index 0000000..12a5bce Binary files /dev/null and b/note-taking-app/src-tauri/icons/icon.icns differ diff --git a/note-taking-app/src-tauri/icons/icon.ico b/note-taking-app/src-tauri/icons/icon.ico new file mode 100644 index 0000000..b3636e4 Binary files /dev/null and b/note-taking-app/src-tauri/icons/icon.ico differ diff --git a/note-taking-app/src-tauri/icons/icon.png b/note-taking-app/src-tauri/icons/icon.png new file mode 100644 index 0000000..e1cd261 Binary files /dev/null and b/note-taking-app/src-tauri/icons/icon.png differ diff --git a/note-taking-app/src-tauri/src/lib.rs b/note-taking-app/src-tauri/src/lib.rs new file mode 100644 index 0000000..f91b35e --- /dev/null +++ b/note-taking-app/src-tauri/src/lib.rs @@ -0,0 +1,14 @@ +// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/ +#[tauri::command] +fn greet(name: &str) -> String { + format!("Hello, {}! You've been greeted from Rust!", name) +} + +#[cfg_attr(mobile, tauri::mobile_entry_point)] +pub fn run() { + tauri::Builder::default() + .plugin(tauri_plugin_shell::init()) + .invoke_handler(tauri::generate_handler![greet]) + .run(tauri::generate_context!()) + .expect("error while running tauri application"); +} diff --git a/note-taking-app/src-tauri/src/main.rs b/note-taking-app/src-tauri/src/main.rs new file mode 100644 index 0000000..038c4af --- /dev/null +++ b/note-taking-app/src-tauri/src/main.rs @@ -0,0 +1,6 @@ +// Prevents additional console window on Windows in release, DO NOT REMOVE!! +#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] + +fn main() { + note_taking_app_lib::run() +} diff --git a/note-taking-app/src-tauri/tauri.conf.json b/note-taking-app/src-tauri/tauri.conf.json new file mode 100644 index 0000000..ea6228d --- /dev/null +++ b/note-taking-app/src-tauri/tauri.conf.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://schema.tauri.app/config/2", + "productName": "note-taking-app", + "version": "0.1.0", + "identifier": "com.note-taking-app.app", + "build": { + "frontendDist": "../src" + }, + "app": { + "withGlobalTauri": true, + "windows": [ + { + "title": "note-taking-app", + "width": 800, + "height": 600 + } + ], + "security": { + "csp": null + } + }, + "bundle": { + "active": true, + "targets": "all", + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ] + } +} diff --git a/note-taking-app/src/assets/javascript.svg b/note-taking-app/src/assets/javascript.svg new file mode 100644 index 0000000..f9abb2b --- /dev/null +++ b/note-taking-app/src/assets/javascript.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/note-taking-app/src/assets/tauri.svg b/note-taking-app/src/assets/tauri.svg new file mode 100644 index 0000000..31b62c9 --- /dev/null +++ b/note-taking-app/src/assets/tauri.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/note-taking-app/src/index.html b/note-taking-app/src/index.html new file mode 100644 index 0000000..aefce2a --- /dev/null +++ b/note-taking-app/src/index.html @@ -0,0 +1,39 @@ + + + + + + + Tauri App + + + + +
+

Welcome to Tauri

+ +
+ + + + + + +
+

Click on the Tauri logo to learn more about the framework

+ +
+ + +
+

+
+ + diff --git a/note-taking-app/src/main.js b/note-taking-app/src/main.js new file mode 100644 index 0000000..55d5f93 --- /dev/null +++ b/note-taking-app/src/main.js @@ -0,0 +1,18 @@ +const { invoke } = window.__TAURI__.core; + +let greetInputEl; +let greetMsgEl; + +async function greet() { + // Learn more about Tauri commands at https://tauri.app/develop/calling-rust/ + greetMsgEl.textContent = await invoke("greet", { name: greetInputEl.value }); +} + +window.addEventListener("DOMContentLoaded", () => { + greetInputEl = document.querySelector("#greet-input"); + greetMsgEl = document.querySelector("#greet-msg"); + document.querySelector("#greet-form").addEventListener("submit", (e) => { + e.preventDefault(); + greet(); + }); +}); diff --git a/note-taking-app/src/styles.css b/note-taking-app/src/styles.css new file mode 100644 index 0000000..e57b8ac --- /dev/null +++ b/note-taking-app/src/styles.css @@ -0,0 +1,112 @@ +.logo.vanilla:hover { + filter: drop-shadow(0 0 2em #ffe21c); +} +:root { + font-family: Inter, Avenir, Helvetica, Arial, sans-serif; + font-size: 16px; + line-height: 24px; + font-weight: 400; + + color: #0f0f0f; + background-color: #f6f6f6; + + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: 100%; +} + +.container { + margin: 0; + padding-top: 10vh; + display: flex; + flex-direction: column; + justify-content: center; + text-align: center; +} + +.logo { + height: 6em; + padding: 1.5em; + will-change: filter; + transition: 0.75s; +} + +.logo.tauri:hover { + filter: drop-shadow(0 0 2em #24c8db); +} + +.row { + display: flex; + justify-content: center; +} + +a { + font-weight: 500; + color: #646cff; + text-decoration: inherit; +} + +a:hover { + color: #535bf2; +} + +h1 { + text-align: center; +} + +input, +button { + border-radius: 8px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + color: #0f0f0f; + background-color: #ffffff; + transition: border-color 0.25s; + box-shadow: 0 2px 2px rgba(0, 0, 0, 0.2); +} + +button { + cursor: pointer; +} + +button:hover { + border-color: #396cd8; +} +button:active { + border-color: #396cd8; + background-color: #e8e8e8; +} + +input, +button { + outline: none; +} + +#greet-input { + margin-right: 5px; +} + +@media (prefers-color-scheme: dark) { + :root { + color: #f6f6f6; + background-color: #2f2f2f; + } + + a:hover { + color: #24c8db; + } + + input, + button { + color: #ffffff; + background-color: #0f0f0f98; + } + button:active { + background-color: #0f0f0f69; + } +} diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index e7a11a9..0000000 --- a/src/main.rs +++ /dev/null @@ -1,3 +0,0 @@ -fn main() { - println!("Hello, world!"); -}