-
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ac3073
commit e77f269
Showing
14 changed files
with
290 additions
and
38 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,39 @@ | ||
// Prevents additional console window on Windows in release, DO NOT REMOVE!! | ||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] | ||
|
||
use enigo::*; | ||
use std::sync::Mutex; | ||
use tauri::State; | ||
|
||
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command | ||
#[tauri::command] | ||
fn greet(name: &str) -> String { | ||
format!("Hello, {}! You've been greeted from Rust!", name) | ||
} | ||
|
||
struct Controller(Mutex<Enigo>); | ||
|
||
#[tauri::command] | ||
fn press(controller: State<'_, Controller>, key: &str) { | ||
let mut controller = (&controller.0).lock().unwrap(); | ||
match key { | ||
"VOL_UP" => { | ||
controller.key_down(Key::VolumeUp); | ||
}, | ||
"VOL_DN" => { | ||
controller.key_down(Key::VolumeDown); | ||
}, | ||
_ => {} | ||
} | ||
} | ||
|
||
|
||
fn main() { | ||
let controller = Enigo::new(); | ||
|
||
tauri::Builder::default() | ||
.invoke_handler(tauri::generate_handler![greet]) | ||
.manage(Controller(Mutex::new(controller))) | ||
.invoke_handler(tauri::generate_handler![press]) | ||
.run(tauri::generate_context!()) | ||
.expect("error while running tauri application"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const BASE_URL = 'https://thewh1teagle.github.io/mobslide/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import QRCodeStyling, {Options} from "qr-code-styling"; | ||
|
||
const options: Options = { | ||
width: 300, | ||
height: 300, | ||
data: "", | ||
margin: 0, | ||
qrOptions: { | ||
|
||
mode: "Byte", | ||
errorCorrectionLevel: "Q" | ||
}, | ||
imageOptions: { | ||
hideBackgroundDots: true, | ||
imageSize: 0.4, | ||
margin: 0 | ||
}, | ||
dotsOptions: { | ||
type: "extra-rounded", | ||
color: "#2786ec" | ||
}, | ||
backgroundOptions: { | ||
color: "#ffffff" | ||
}, | ||
cornersSquareOptions: { | ||
type: "extra-rounded", | ||
color: "#595959" | ||
}, | ||
cornersDotOptions: { | ||
type: "square", | ||
color: "#595959" | ||
}, | ||
} | ||
|
||
export function createQR(data: string) { | ||
return new QRCodeStyling({...options, data}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.