diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 74d7a09..e0f4e2e 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -14,15 +14,15 @@ use btleplug::platform::Manager as BleManager; async fn init(app: AppHandle) -> Result<(),()> { println!("init rideinn app"); let splash = app.get_webview_window("splashscreen").unwrap(); - let connect = app.get_webview_window("connect").unwrap(); + let main = app.get_webview_window("main").unwrap(); let state = app.state::(); let adapter = state.adapter.clone(); let repo = repo_from_devices((scan_devices(&adapter, 5).await).unwrap_or_default()); splash.close().unwrap(); - connect.show().unwrap(); + main.show().unwrap(); - app.emit_to("connect", "devices-loaded", repo).unwrap(); + app.emit("devices-loaded", repo).unwrap(); Ok(()) } diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index c702206..94b60a3 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -16,11 +16,6 @@ { "label": "splashscreen", "url": "splashscreen" - }, - { - "label": "connect", - "url": "connect", - "visible": false } ], "security": { diff --git a/src/assets/javascript.svg b/src/assets/javascript.svg deleted file mode 100644 index f9abb2b..0000000 --- a/src/assets/javascript.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/assets/tauri.svg b/src/assets/tauri.svg deleted file mode 100644 index 31b62c9..0000000 --- a/src/assets/tauri.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/colors.css b/src/colors.css new file mode 100644 index 0000000..ef7cad9 --- /dev/null +++ b/src/colors.css @@ -0,0 +1,8 @@ +:root { + --jet: hsla(0, 0%, 21%, 1); + --gunmetal: hsla(216, 28%, 20%, 1); + --cadet-gray: hsla(212, 8%, 58%, 1); + --nyanza: hsla(114, 100%, 93%, 1); + --rojo: hsla(357, 73%, 50%, 1); + --basewhite: #f6f6f6; +} diff --git a/src/connect.html b/src/connect.html deleted file mode 100644 index b0c5389..0000000 --- a/src/connect.html +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - Tauri App - - - - -
-

Connect

-
-
-
- - diff --git a/src/connect.js b/src/connect.js deleted file mode 100644 index d63a8e0..0000000 --- a/src/connect.js +++ /dev/null @@ -1,7 +0,0 @@ -const { once } = window.__TAURI__.event; -const { getCurrentWebviewWindow } = window.__TAURI__.webviewWindow; - -const appWebview = getCurrentWebviewWindow(); -appWebview.once("devices-loaded", (devices) => { - console.log("Devices are loaded", devices); -}); diff --git a/src/index.html b/src/index.html index 58437f5..cb08f48 100644 --- a/src/index.html +++ b/src/index.html @@ -9,10 +9,12 @@ -
-

Welcome to RideInn

-
-
-
+
+

подключение датчиков

+

чсс

+

каденс

+

станок

+ +
diff --git a/src/main.js b/src/main.js index 906574e..4acf346 100644 --- a/src/main.js +++ b/src/main.js @@ -1 +1,7 @@ +const { once } = window.__TAURI__.event; + +once("devices-loaded", (devices) => { + console.log("Devices are loaded", devices); +}); + console.log("hello from main.js"); diff --git a/src/reset.css b/src/reset.css new file mode 100644 index 0000000..7d4619c --- /dev/null +++ b/src/reset.css @@ -0,0 +1,78 @@ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + vertical-align: baseline; + box-sizing: border-box; + background: transparent; +} + +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} + +ol, ul { + list-style: none; +} + +img, picture, svg, video, iframe { + max-width: 100%; + height: auto; + display: block; +} + +button, input, select, textarea { + font: inherit; + color: inherit; + background: transparent; + border: none; + padding: 0; + margin: 0; + outline: none; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} + +:focus { + outline: 2px solid Highlight; + outline-offset: 2px; +} + +button, [role="button"], a[type="button"] { + cursor: pointer; +} + +a { + color: inherit; + text-decoration: none; + background-color: transparent; +} + +:disabled, [disabled] { + cursor: not-allowed; + opacity: 0.6; + pointer-events: none; +} + +@media (prefers-reduced-motion: reduce) { + *, *::before, *::after { + animation-duration: 0.001ms !important; + animation-iteration-count: 1 !important; + transition-duration: 0.001ms !important; + scroll-behavior: auto !important; + } +} diff --git a/src/splashscreen.html b/src/splashscreen.html index 0e5f935..1410473 100644 --- a/src/splashscreen.html +++ b/src/splashscreen.html @@ -8,11 +8,7 @@ - -
-

SplashScreen

-
-
-
+ +

поиск перефирии

diff --git a/src/styles.css b/src/styles.css index e5864df..cf10645 100644 --- a/src/styles.css +++ b/src/styles.css @@ -1,11 +1,14 @@ +@import "./reset.css"; +@import "./colors.css"; + :root { - font-family: Inter, Avenir, Helvetica, Arial, sans-serif; + font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; font-size: 16px; line-height: 24px; font-weight: 400; - color: #0f0f0f; - background-color: #f6f6f6; + color: var(--basewhite); + background-color: var(--jet); font-synthesis: none; text-rendering: optimizeLegibility; @@ -14,22 +17,42 @@ -webkit-text-size-adjust: 100%; } -@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; - } +body, +screen { + overflow: hidden; +} + +.screen { + align-content: center; + display: grid; + height: 100vh; + justify-content: center; + width: 100vw; +} + +#connect { + gap: 2em; + grid-template-columns: repeat(3, 1fr); + grid-template-rows: repeat(3, 1fr); + padding: 2em; +} + +#connect h1 { + grid-column: 1/-1; + justify-self: center; + align-self: end; +} + +#connect button { + grid-column: 1/-1; + justify-self: center; + align-self: start; +} + +.device-selection { + border: 1px solid var(--basewhite); + border-radius: 2%; + display: grid; + justify-content: center; + padding: 0.5em; }