commit 2057476c8560c384f7509d28c0dba7660d122897 Author: Plucky Date: Sat Oct 15 18:11:32 2022 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c0ed7d0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/target +/logs \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..b5f92ce --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,841 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "anyhow" +version = "1.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "backtrace" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + +[[package]] +name = "bumpalo" +version = "3.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "cc" +version = "1.0.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "console_error_panic_hook" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" +dependencies = [ + "cfg-if", + "wasm-bindgen", +] + +[[package]] +name = "dioxus" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "211119e0c96d2d0221ce1886b94aed18c41f7f9ccb23d0dc80fff5e919b2a1a2" +dependencies = [ + "dioxus-core", + "dioxus-core-macro", + "dioxus-hooks", + "dioxus-html", + "dioxus-router", + "dioxus-web", + "fermi", +] + +[[package]] +name = "dioxus-core" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50fd75cb8f4752b122e3935eaa65b4c8c5c61dac2a305cb3d4c3422a01e0aee2" +dependencies = [ + "backtrace", + "bumpalo", + "futures-channel", + "futures-util", + "fxhash", + "indexmap", + "log", + "longest-increasing-subsequence", + "once_cell", + "slab", + "smallvec", +] + +[[package]] +name = "dioxus-core-macro" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "243fe485d0455d6f3645526970100a403fd037740af105cb5f175d8f4227baa6" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dioxus-hooks" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51ffbb5b87c3bcd32a5629b5bd7921b7a7c685eded345c32100574b4a4df7872" +dependencies = [ + "dioxus-core", + "futures-channel", + "log", +] + +[[package]] +name = "dioxus-html" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42fe33f30303e9acb0404e9c9aa61535ab50ad9e84f4809543881ee6a2b5abc" +dependencies = [ + "dioxus-core", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "dioxus-html-macro" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bdf706b1c5dfbfd2940ff116d2ddd433776b81a1900e31ced5884dfc45c5b11" +dependencies = [ + "dioxus", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dioxus-interpreter-js" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d78a436643ca61ca4f5dec869fb91318c72068a013d2d5e21f9960810453b47" +dependencies = [ + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "dioxus-router" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d87ba54351495b657c291831de8f259be9616047f9e9826757788a43d3d2907" +dependencies = [ + "dioxus-core", + "dioxus-core-macro", + "dioxus-html", + "futures-channel", + "futures-util", + "gloo-events", + "js-sys", + "log", + "serde", + "serde_urlencoded", + "thiserror", + "url", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "dioxus-web" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61399ab0ebd255e3ad58c46cebc2a2db5d69a22af80bca68fe0a9aaf6480058f" +dependencies = [ + "anyhow", + "console_error_panic_hook", + "dioxus-core", + "dioxus-html", + "dioxus-interpreter-js", + "futures-channel", + "futures-util", + "fxhash", + "gloo-timers", + "js-sys", + "log", + "once_cell", + "serde-wasm-bindgen", + "smallstr", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + +[[package]] +name = "fermi" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa3c170a3972c362a46622d09946b69c976c39832e24024c8efabe6073f8b995" +dependencies = [ + "dioxus-core", + "im-rc", + "log", +] + +[[package]] +name = "form_urlencoded" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures-channel" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" + +[[package]] +name = "futures-macro" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-task" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" + +[[package]] +name = "futures-util" +version = "0.3.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" +dependencies = [ + "futures-core", + "futures-macro", + "futures-task", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + +[[package]] +name = "gimli" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" + +[[package]] +name = "gloo-events" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b107f8abed8105e4182de63845afcc7b69c098b7852a813ea7462a320992fc" +dependencies = [ + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "gloo-timers" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fb7d06c1c8cc2a29bee7ec961009a0b2caa0793ee4900c2ffb348734ba1c8f9" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "im-rc" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1955a75fa080c677d3972822ec4bad316169ab1cfc6c257a942c2265dbe5fe" +dependencies = [ + "bitmaps", + "rand_core", + "rand_xoshiro", + "serde", + "sized-chunks", + "typenum", + "version_check", +] + +[[package]] +name = "indexmap" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "itoa" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" + +[[package]] +name = "js-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.135" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68783febc7782c6c5cb401fbda4de5a9898be1762314da0bb2c10ced61f18b0c" + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "longest-increasing-subsequence" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3bd0dd2cd90571056fdb71f6275fada10131182f84899f4b2a916e565d81d86" + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "miniz_oxide" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" +dependencies = [ + "adler", +] + +[[package]] +name = "object" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" + +[[package]] +name = "percent-encoding" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94e2ef8dbfc347b10c094890f778ee2e36ca9bb4262e86dc99cd217e35f3470b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-dashboard" +version = "0.1.0" +dependencies = [ + "console_error_panic_hook", + "dioxus", + "dioxus-html-macro", + "tracing", + "tracing-wasm", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" + +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + +[[package]] +name = "ryu" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" + +[[package]] +name = "serde" +version = "1.0.145" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" + +[[package]] +name = "serde-wasm-bindgen" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b4c031cd0d9014307d82b8abf653c0290fbdaeb4c02d00c63cf52f728628bf" +dependencies = [ + "js-sys", + "serde", + "wasm-bindgen", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + +[[package]] +name = "slab" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallstr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e922794d168678729ffc7e07182721a14219c65814e66e91b839a272fe5ae4f" +dependencies = [ + "smallvec", +] + +[[package]] +name = "smallvec" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" + +[[package]] +name = "syn" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fcd952facd492f9be3ef0d0b7032a6e442ee9b361d4acc2b1d0c4aaa5f613a1" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +dependencies = [ + "sharded-slab", + "thread_local", + "tracing-core", +] + +[[package]] +name = "tracing-wasm" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4575c663a174420fa2d78f4108ff68f65bf2fbb7dd89f33749b6e826b3626e07" +dependencies = [ + "tracing", + "tracing-subscriber", + "wasm-bindgen", +] + +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" + +[[package]] +name = "unicode-normalization" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "url" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", +] + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasm-bindgen" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +dependencies = [ + "cfg-if", + "js-sys", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" + +[[package]] +name = "web-sys" +version = "0.3.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +dependencies = [ + "js-sys", + "wasm-bindgen", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..fda3627 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "r-dashboard" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +dioxus = {version = "0.2", features = ["web","router","fermi"]} +console_error_panic_hook = "0.1" +dioxus-html-macro = "0.2" + +tracing = "0" +tracing-wasm = "0" diff --git a/build.rs b/build.rs new file mode 100644 index 0000000..d7545ae --- /dev/null +++ b/build.rs @@ -0,0 +1,18 @@ +/* + * @Author: plucky + * @Date: 2022-10-10 11:51:28 + * @LastEditTime: 2022-10-15 13:43:11 + * @Description: + */ + +use std::process::Command; + +fn main(){ + // println!("hello, build.rs"); + // tailwindcss -i index.css -o style.css + Command::new("tailwindcss").args(&["-i", "index.css", "-o", "dist/.stage/style.css"]) + .status().unwrap(); + // cp static/favicon.ico ... dist/.stage + Command::new("cp").args(&["static/favicon.ico", "...", "dist/.stage/"]) + .status().unwrap(); +} \ No newline at end of file diff --git a/dist/favicon.ico b/dist/favicon.ico new file mode 100644 index 0000000..df36fcf Binary files /dev/null and b/dist/favicon.ico differ diff --git a/dist/index.html b/dist/index.html new file mode 100644 index 0000000..c5c2f8c --- /dev/null +++ b/dist/index.html @@ -0,0 +1,43 @@ + + + + + + + Dashboard + + + + +
+
+ + + \ No newline at end of file diff --git a/dist/r-dashboard-b0c35e8e84272a79.js b/dist/r-dashboard-b0c35e8e84272a79.js new file mode 100644 index 0000000..8ea8a90 --- /dev/null +++ b/dist/r-dashboard-b0c35e8e84272a79.js @@ -0,0 +1,1099 @@ +import { Interpreter } from './snippets/dioxus-interpreter-js-459fb15b86d869f7/src/interpreter.js'; + +let wasm; + +const heap = new Array(32).fill(undefined); + +heap.push(undefined, null, true, false); + +function getObject(idx) { return heap[idx]; } + +let heap_next = heap.length; + +function dropObject(idx) { + if (idx < 36) return; + heap[idx] = heap_next; + heap_next = idx; +} + +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} + +const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); + +cachedTextDecoder.decode(); + +let cachedUint8Memory0 = new Uint8Array(); + +function getUint8Memory0() { + if (cachedUint8Memory0.byteLength === 0) { + cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer); + } + return cachedUint8Memory0; +} + +function getStringFromWasm0(ptr, len) { + return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); +} + +function addHeapObject(obj) { + if (heap_next === heap.length) heap.push(heap.length + 1); + const idx = heap_next; + heap_next = heap[idx]; + + heap[idx] = obj; + return idx; +} + +function debugString(val) { + // primitive types + const type = typeof val; + if (type == 'number' || type == 'boolean' || val == null) { + return `${val}`; + } + if (type == 'string') { + return `"${val}"`; + } + if (type == 'symbol') { + const description = val.description; + if (description == null) { + return 'Symbol'; + } else { + return `Symbol(${description})`; + } + } + if (type == 'function') { + const name = val.name; + if (typeof name == 'string' && name.length > 0) { + return `Function(${name})`; + } else { + return 'Function'; + } + } + // objects + if (Array.isArray(val)) { + const length = val.length; + let debug = '['; + if (length > 0) { + debug += debugString(val[0]); + } + for(let i = 1; i < length; i++) { + debug += ', ' + debugString(val[i]); + } + debug += ']'; + return debug; + } + // Test for built-in + const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); + let className; + if (builtInMatches.length > 1) { + className = builtInMatches[1]; + } else { + // Failed to match the standard '[object ClassName]' + return toString.call(val); + } + if (className == 'Object') { + // we're a user defined class or Object + // JSON.stringify avoids problems with cycles, and is generally much + // easier than looping through ownProperties of `val`. + try { + return 'Object(' + JSON.stringify(val) + ')'; + } catch (_) { + return 'Object'; + } + } + // errors + if (val instanceof Error) { + return `${val.name}: ${val.message}\n${val.stack}`; + } + // TODO we could test for more things here, like `Set`s and `Map`s. + return className; +} + +let WASM_VECTOR_LEN = 0; + +const cachedTextEncoder = new TextEncoder('utf-8'); + +const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' + ? function (arg, view) { + return cachedTextEncoder.encodeInto(arg, view); +} + : function (arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; +}); + +function passStringToWasm0(arg, malloc, realloc) { + + if (realloc === undefined) { + const buf = cachedTextEncoder.encode(arg); + const ptr = malloc(buf.length); + getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr; + } + + let len = arg.length; + let ptr = malloc(len); + + const mem = getUint8Memory0(); + + let offset = 0; + + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 0x7F) break; + mem[ptr + offset] = code; + } + + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3); + const view = getUint8Memory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + + offset += ret.written; + } + + WASM_VECTOR_LEN = offset; + return ptr; +} + +let cachedInt32Memory0 = new Int32Array(); + +function getInt32Memory0() { + if (cachedInt32Memory0.byteLength === 0) { + cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); + } + return cachedInt32Memory0; +} + +function makeMutClosure(arg0, arg1, dtor, f) { + const state = { a: arg0, b: arg1, cnt: 1, dtor }; + const real = (...args) => { + // First up with a closure we increment the internal reference + // count. This ensures that the Rust closure environment won't + // be deallocated while we're invoking it. + state.cnt++; + const a = state.a; + state.a = 0; + try { + return f(a, state.b, ...args); + } finally { + if (--state.cnt === 0) { + wasm.__wbindgen_export_2.get(state.dtor)(a, state.b); + + } else { + state.a = a; + } + } + }; + real.original = state; + + return real; +} + +let stack_pointer = 32; + +function addBorrowedObject(obj) { + if (stack_pointer == 1) throw new Error('out of js stack'); + heap[--stack_pointer] = obj; + return stack_pointer; +} +function __wbg_adapter_18(arg0, arg1, arg2) { + try { + wasm._dyn_core__ops__function__FnMut___A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hf89f29bef37ba695(arg0, arg1, addBorrowedObject(arg2)); + } finally { + heap[stack_pointer++] = undefined; + } +} + +function makeClosure(arg0, arg1, dtor, f) { + const state = { a: arg0, b: arg1, cnt: 1, dtor }; + const real = (...args) => { + // First up with a closure we increment the internal reference + // count. This ensures that the Rust closure environment won't + // be deallocated while we're invoking it. + state.cnt++; + try { + return f(state.a, state.b, ...args); + } finally { + if (--state.cnt === 0) { + wasm.__wbindgen_export_2.get(state.dtor)(state.a, state.b); + state.a = 0; + + } + } + }; + real.original = state; + + return real; +} +function __wbg_adapter_21(arg0, arg1, arg2) { + wasm._dyn_core__ops__function__Fn__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h0b8908e12fc71428(arg0, arg1, addHeapObject(arg2)); +} + +function __wbg_adapter_24(arg0, arg1, arg2) { + try { + wasm._dyn_core__ops__function__FnMut___A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hb2e72e5ce28c2adb(arg0, arg1, addBorrowedObject(arg2)); + } finally { + heap[stack_pointer++] = undefined; + } +} + +function __wbg_adapter_27(arg0, arg1, arg2) { + wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h215be629f56c1384(arg0, arg1, addHeapObject(arg2)); +} + +function __wbg_adapter_30(arg0, arg1) { + wasm._dyn_core__ops__function__FnMut_____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__h776550fe0570ae07(arg0, arg1); +} + +function getCachedStringFromWasm0(ptr, len) { + if (ptr === 0) { + return getObject(len); + } else { + return getStringFromWasm0(ptr, len); + } +} + +function handleError(f, args) { + try { + return f.apply(this, args); + } catch (e) { + wasm.__wbindgen_exn_store(addHeapObject(e)); + } +} + +function notDefined(what) { return () => { throw new Error(`${what} is not defined`); }; } + +function isLikeNone(x) { + return x === undefined || x === null; +} + +async function load(module, imports) { + if (typeof Response === 'function' && module instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === 'function') { + try { + return await WebAssembly.instantiateStreaming(module, imports); + + } catch (e) { + if (module.headers.get('Content-Type') != 'application/wasm') { + console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); + + } else { + throw e; + } + } + } + + const bytes = await module.arrayBuffer(); + return await WebAssembly.instantiate(bytes, imports); + + } else { + const instance = await WebAssembly.instantiate(module, imports); + + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + + } else { + return instance; + } + } +} + +function getImports() { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbg_mark_40e050a77cc39fea = function(arg0, arg1) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + performance.mark(v0); + }; + imports.wbg.__wbg_measure_aa7a73f17813f708 = function() { return handleError(function (arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + if (arg0 !== 0) { wasm.__wbindgen_free(arg0, arg1); } + var v1 = getCachedStringFromWasm0(arg2, arg3); +if (arg2 !== 0) { wasm.__wbindgen_free(arg2, arg3); } +performance.measure(v0, v1); +}, arguments) }; +imports.wbg.__wbg_log_c9486ca5d8e2cbe8 = function(arg0, arg1) { + var v0 = getCachedStringFromWasm0(arg0, arg1); +if (arg0 !== 0) { wasm.__wbindgen_free(arg0, arg1); } +console.log(v0); +}; +imports.wbg.__wbg_log_aba5996d9bde071f = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) { + var v0 = getCachedStringFromWasm0(arg0, arg1); +if (arg0 !== 0) { wasm.__wbindgen_free(arg0, arg1); } +var v1 = getCachedStringFromWasm0(arg2, arg3); +var v2 = getCachedStringFromWasm0(arg4, arg5); +var v3 = getCachedStringFromWasm0(arg6, arg7); +console.log(v0, v1, v2, v3); +}; +imports.wbg.__wbindgen_cb_drop = function(arg0) { + const obj = takeObject(arg0).original; + if (obj.cnt-- == 1) { + obj.a = 0; + return true; + } + const ret = false; + return ret; +}; +imports.wbg.__wbindgen_string_new = function(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + const ret = getObject(arg0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) { + var v0 = getCachedStringFromWasm0(arg0, arg1); +if (arg0 !== 0) { wasm.__wbindgen_free(arg0, arg1); } +console.error(v0); +}; +imports.wbg.__wbg_new_abda76e883ba8a5f = function() { + const ret = new Error(); + return addHeapObject(ret); +}; +imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) { + const ret = getObject(arg1).stack; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_setTimeout_02c3975efb677088 = function() { return handleError(function (arg0, arg1) { + const ret = setTimeout(getObject(arg0), arg1); + return ret; +}, arguments) }; +imports.wbg.__wbg_clearTimeout_5b4145302d77e5f3 = typeof clearTimeout == 'function' ? clearTimeout : notDefined('clearTimeout'); +imports.wbg.__wbg_new_67f219e1431f9bfb = function(arg0) { + const ret = new Interpreter(takeObject(arg0)); + return addHeapObject(ret); +}; +imports.wbg.__wbg_SetNode_e348a2373658c0e5 = function(arg0, arg1, arg2) { + getObject(arg0).SetNode(arg1 >>> 0, takeObject(arg2)); +}; +imports.wbg.__wbg_PushRoot_d77bf2f07d78ee04 = function(arg0, arg1) { + getObject(arg0).PushRoot(BigInt.asUintN(64, arg1)); +}; +imports.wbg.__wbg_PopRoot_e5d3ec5dea882a1d = function(arg0) { + getObject(arg0).PopRoot(); +}; +imports.wbg.__wbg_AppendChildren_6d62bb4fe693e279 = function(arg0, arg1) { + getObject(arg0).AppendChildren(arg1 >>> 0); +}; +imports.wbg.__wbg_ReplaceWith_8ebcac8be1fb1ca8 = function(arg0, arg1, arg2) { + getObject(arg0).ReplaceWith(BigInt.asUintN(64, arg1), arg2 >>> 0); +}; +imports.wbg.__wbg_InsertAfter_f22ec9a3aadcd11d = function(arg0, arg1, arg2) { + getObject(arg0).InsertAfter(BigInt.asUintN(64, arg1), arg2 >>> 0); +}; +imports.wbg.__wbg_InsertBefore_c5a8dca846bdfe92 = function(arg0, arg1, arg2) { + getObject(arg0).InsertBefore(BigInt.asUintN(64, arg1), arg2 >>> 0); +}; +imports.wbg.__wbg_Remove_49f795846a239f69 = function(arg0, arg1) { + getObject(arg0).Remove(BigInt.asUintN(64, arg1)); +}; +imports.wbg.__wbg_CreateTextNode_96506678bbad22ec = function(arg0, arg1, arg2) { + getObject(arg0).CreateTextNode(takeObject(arg1), BigInt.asUintN(64, arg2)); +}; +imports.wbg.__wbg_CreateElement_3def0fedd162d196 = function(arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).CreateElement(v0, BigInt.asUintN(64, arg3)); +}; +imports.wbg.__wbg_CreateElementNs_8bf15ccda6dbcc6d = function(arg0, arg1, arg2, arg3, arg4, arg5) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + var v1 = getCachedStringFromWasm0(arg4, arg5); + getObject(arg0).CreateElementNs(v0, BigInt.asUintN(64, arg3), v1); +}; +imports.wbg.__wbg_CreatePlaceholder_0d13c892ea9189a7 = function(arg0, arg1) { + getObject(arg0).CreatePlaceholder(BigInt.asUintN(64, arg1)); +}; +imports.wbg.__wbg_NewEventListener_1191f0ffe7726998 = function(arg0, arg1, arg2, arg3, arg4) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).NewEventListener(v0, BigInt.asUintN(64, arg3), getObject(arg4)); +}; +imports.wbg.__wbg_RemoveEventListener_b89963320b7e7fec = function(arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + getObject(arg0).RemoveEventListener(BigInt.asUintN(64, arg1), v0); +}; +imports.wbg.__wbg_SetText_805dc255ca48ee91 = function(arg0, arg1, arg2) { + getObject(arg0).SetText(BigInt.asUintN(64, arg1), takeObject(arg2)); +}; +imports.wbg.__wbg_SetAttribute_eb74ba21b8a1196f = function(arg0, arg1, arg2, arg3, arg4, arg5, arg6) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + var v1 = getCachedStringFromWasm0(arg5, arg6); + getObject(arg0).SetAttribute(BigInt.asUintN(64, arg1), v0, takeObject(arg4), v1); +}; +imports.wbg.__wbg_RemoveAttribute_ff4184d97eafc3f8 = function(arg0, arg1, arg2, arg3, arg4, arg5) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + var v1 = getCachedStringFromWasm0(arg4, arg5); + getObject(arg0).RemoveAttribute(BigInt.asUintN(64, arg1), v0, v1); +}; +imports.wbg.__wbg_instanceof_Window_acc97ff9f5d2c7b4 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Window; + } catch { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_document_3ead31dbcad65886 = function(arg0) { + const ret = getObject(arg0).document; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_location_8cc8ccf27e342c0a = function(arg0) { + const ret = getObject(arg0).location; + return addHeapObject(ret); +}; +imports.wbg.__wbg_history_2a104346a1208269 = function() { return handleError(function (arg0) { + const ret = getObject(arg0).history; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_requestAnimationFrame_4181656476a7d86c = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).requestAnimationFrame(getObject(arg1)); + return ret; +}, arguments) }; +imports.wbg.__wbg_requestIdleCallback_a0421b878285ed65 = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).requestIdleCallback(getObject(arg1)); + return ret; +}, arguments) }; +imports.wbg.__wbg_title_74f9ffa27e9c750f = function(arg0, arg1) { + const ret = getObject(arg1).title; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_createElement_976dbb84fe1661b5 = function() { return handleError(function (arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).createElement(v0); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_getElementById_3a708b83e4f034d7 = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + const ret = getObject(arg0).getElementById(v0); + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_type_a86a71d052709b75 = function(arg0, arg1) { + const ret = getObject(arg1).type; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_target_bf704b7db7ad1387 = function(arg0) { + const ret = getObject(arg0).target; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_preventDefault_3209279b490de583 = function(arg0) { + getObject(arg0).preventDefault(); +}; +imports.wbg.__wbg_addEventListener_1fc744729ac6dc27 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).addEventListener(v0, getObject(arg3), getObject(arg4)); +}, arguments) }; +imports.wbg.__wbg_removeEventListener_b10f1a66647f3aa0 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).removeEventListener(v0, getObject(arg3), arg4 !== 0); +}, arguments) }; +imports.wbg.__wbg_get_eff2c5e76f778292 = function(arg0, arg1) { + const ret = getObject(arg0)[arg1 >>> 0]; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_altKey_8643110400698556 = function(arg0) { + const ret = getObject(arg0).altKey; + return ret; +}; +imports.wbg.__wbg_metaKey_f0f73554e84cdfb6 = function(arg0) { + const ret = getObject(arg0).metaKey; + return ret; +}; +imports.wbg.__wbg_ctrlKey_f05ebfd7290f66a9 = function(arg0) { + const ret = getObject(arg0).ctrlKey; + return ret; +}; +imports.wbg.__wbg_shiftKey_dbede4ad30972b26 = function(arg0) { + const ret = getObject(arg0).shiftKey; + return ret; +}; +imports.wbg.__wbg_instanceof_HtmlSelectElement_e8421685c2eaa299 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLSelectElement; + } catch { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_value_2527a85fd5ada680 = function(arg0, arg1) { + const ret = getObject(arg1).value; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_charCode_b0f31612a52c2bff = function(arg0) { + const ret = getObject(arg0).charCode; + return ret; +}; +imports.wbg.__wbg_keyCode_72faed4278f77f2c = function(arg0) { + const ret = getObject(arg0).keyCode; + return ret; +}; +imports.wbg.__wbg_altKey_6dbe46bf3ae42d67 = function(arg0) { + const ret = getObject(arg0).altKey; + return ret; +}; +imports.wbg.__wbg_ctrlKey_fd79f035994d9387 = function(arg0) { + const ret = getObject(arg0).ctrlKey; + return ret; +}; +imports.wbg.__wbg_shiftKey_908ae224b8722a41 = function(arg0) { + const ret = getObject(arg0).shiftKey; + return ret; +}; +imports.wbg.__wbg_metaKey_cdd15bf44efb510e = function(arg0) { + const ret = getObject(arg0).metaKey; + return ret; +}; +imports.wbg.__wbg_location_af9a9961ca66ef22 = function(arg0) { + const ret = getObject(arg0).location; + return ret; +}; +imports.wbg.__wbg_repeat_edc4d7c555e257a3 = function(arg0) { + const ret = getObject(arg0).repeat; + return ret; +}; +imports.wbg.__wbg_key_ad4fc49423a94efa = function(arg0, arg1) { + const ret = getObject(arg1).key; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_instanceof_Node_b1195878cdeab85c = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Node; + } catch { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_parentElement_0cffb3ceb0f107bd = function(arg0) { + const ret = getObject(arg0).parentElement; + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_childNodes_7345d62ab4ea541a = function(arg0) { + const ret = getObject(arg0).childNodes; + return addHeapObject(ret); +}; +imports.wbg.__wbg_nodeValue_848072908b1d0a22 = function(arg0, arg1) { + const ret = getObject(arg1).nodeValue; + var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_textContent_77bd294928962f93 = function(arg0, arg1) { + const ret = getObject(arg1).textContent; + var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_settextContent_538ceb17614272d8 = function(arg0, arg1, arg2) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + getObject(arg0).textContent = v0; +}; +imports.wbg.__wbg_instanceof_Text_6855016c7825859b = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Text; + } catch { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_pageX_829fdc137b743208 = function(arg0) { + const ret = getObject(arg0).pageX; + return ret; +}; +imports.wbg.__wbg_pageY_d67aef101099fd37 = function(arg0) { + const ret = getObject(arg0).pageY; + return ret; +}; +imports.wbg.__wbg_which_16f59d07cee1a753 = function(arg0) { + const ret = getObject(arg0).which; + return ret; +}; +imports.wbg.__wbg_instanceof_Comment_1758f7164ca9ea81 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Comment; + } catch { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_pushState_38917fb88b4add30 = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + var v1 = getCachedStringFromWasm0(arg4, arg5); + getObject(arg0).pushState(getObject(arg1), v0, v1); +}, arguments) }; +imports.wbg.__wbg_replaceState_b6d5ce07beb296ed = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + var v1 = getCachedStringFromWasm0(arg4, arg5); + getObject(arg0).replaceState(getObject(arg1), v0, v1); +}, arguments) }; +imports.wbg.__wbg_href_bbb11e0e61ea410e = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg1).href; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}, arguments) }; +imports.wbg.__wbg_length_e015bc7ac630e55b = function(arg0) { + const ret = getObject(arg0).length; + return ret; +}; +imports.wbg.__wbg_item_37cbb972da31ad43 = function(arg0, arg1) { + const ret = getObject(arg0).item(arg1 >>> 0); + return isLikeNone(ret) ? 0 : addHeapObject(ret); +}; +imports.wbg.__wbg_instanceof_IdleDeadline_4a82da4e4c7002fc = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof IdleDeadline; + } catch { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_timeRemaining_5c5c26712f275485 = function(arg0) { + const ret = getObject(arg0).timeRemaining(); + return ret; +}; +imports.wbg.__wbg_animationName_52b570bbde323225 = function(arg0, arg1) { + const ret = getObject(arg1).animationName; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_elapsedTime_a5dcd61ea72b5e93 = function(arg0) { + const ret = getObject(arg0).elapsedTime; + return ret; +}; +imports.wbg.__wbg_pseudoElement_434c37ac9cf98e15 = function(arg0, arg1) { + const ret = getObject(arg1).pseudoElement; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_instanceof_CompositionEvent_c099782c181693d1 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof CompositionEvent; + } catch { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_data_8bd9c72cda1424e9 = function(arg0, arg1) { + const ret = getObject(arg1).data; + var ptr0 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_screenX_bda1387744fb6677 = function(arg0) { + const ret = getObject(arg0).screenX; + return ret; +}; +imports.wbg.__wbg_screenY_fa513a5b7d68c34f = function(arg0) { + const ret = getObject(arg0).screenY; + return ret; +}; +imports.wbg.__wbg_clientX_e39206f946859108 = function(arg0) { + const ret = getObject(arg0).clientX; + return ret; +}; +imports.wbg.__wbg_clientY_e376bb2d8f470c88 = function(arg0) { + const ret = getObject(arg0).clientY; + return ret; +}; +imports.wbg.__wbg_ctrlKey_4795fb55a59f026c = function(arg0) { + const ret = getObject(arg0).ctrlKey; + return ret; +}; +imports.wbg.__wbg_shiftKey_81014521a7612e6a = function(arg0) { + const ret = getObject(arg0).shiftKey; + return ret; +}; +imports.wbg.__wbg_altKey_2b8d6d80ead4bad7 = function(arg0) { + const ret = getObject(arg0).altKey; + return ret; +}; +imports.wbg.__wbg_metaKey_49e49046d8402fb7 = function(arg0) { + const ret = getObject(arg0).metaKey; + return ret; +}; +imports.wbg.__wbg_button_2bb5dc0116d6b89b = function(arg0) { + const ret = getObject(arg0).button; + return ret; +}; +imports.wbg.__wbg_buttons_047716c1296e3d1c = function(arg0) { + const ret = getObject(arg0).buttons; + return ret; +}; +imports.wbg.__wbg_propertyName_6261bc64663a261b = function(arg0, arg1) { + const ret = getObject(arg1).propertyName; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_elapsedTime_f71097509836b2f2 = function(arg0) { + const ret = getObject(arg0).elapsedTime; + return ret; +}; +imports.wbg.__wbg_pseudoElement_5c39e80f916267a2 = function(arg0, arg1) { + const ret = getObject(arg1).pseudoElement; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_deltaX_6b627fd6f4c19e51 = function(arg0) { + const ret = getObject(arg0).deltaX; + return ret; +}; +imports.wbg.__wbg_deltaY_a5393ec7ac0f7bb4 = function(arg0) { + const ret = getObject(arg0).deltaY; + return ret; +}; +imports.wbg.__wbg_deltaZ_8d9e7a1ac88162b3 = function(arg0) { + const ret = getObject(arg0).deltaZ; + return ret; +}; +imports.wbg.__wbg_deltaMode_a90be314f5c676f1 = function(arg0) { + const ret = getObject(arg0).deltaMode; + return ret; +}; +imports.wbg.__wbg_instanceof_Element_33bd126d58f2021b = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Element; + } catch { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_tagName_50571f9480ac166a = function(arg0, arg1) { + const ret = getObject(arg1).tagName; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_getAttribute_3a1f0fb396184372 = function(arg0, arg1, arg2, arg3) { + var v0 = getCachedStringFromWasm0(arg2, arg3); + const ret = getObject(arg1).getAttribute(v0); + var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len1; + getInt32Memory0()[arg0 / 4 + 0] = ptr1; +}; +imports.wbg.__wbg_setAttribute_d8436c14a59ab1af = function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { + var v0 = getCachedStringFromWasm0(arg1, arg2); + var v1 = getCachedStringFromWasm0(arg3, arg4); + getObject(arg0).setAttribute(v0, v1); +}, arguments) }; +imports.wbg.__wbg_instanceof_HtmlElement_eff00d16af7bd6e7 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLElement; + } catch { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_data_f73ecd8190a91c14 = function(arg0, arg1) { + const ret = getObject(arg1).data; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_instanceof_HtmlTextAreaElement_a091a90ac155d1ab = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLTextAreaElement; + } catch { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_value_ccb32485ee1b3928 = function(arg0, arg1) { + const ret = getObject(arg1).value; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_instanceof_HtmlFormElement_1c489ff7e99e43d3 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLFormElement; + } catch { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_elements_e459ba1be1bb71da = function(arg0) { + const ret = getObject(arg0).elements; + return addHeapObject(ret); +}; +imports.wbg.__wbg_pointerId_18be034781db46f3 = function(arg0) { + const ret = getObject(arg0).pointerId; + return ret; +}; +imports.wbg.__wbg_width_4fed142776de682f = function(arg0) { + const ret = getObject(arg0).width; + return ret; +}; +imports.wbg.__wbg_height_fb6382c90e010142 = function(arg0) { + const ret = getObject(arg0).height; + return ret; +}; +imports.wbg.__wbg_pressure_c3ba152bf8a3491d = function(arg0) { + const ret = getObject(arg0).pressure; + return ret; +}; +imports.wbg.__wbg_tangentialPressure_f6bd99bd6df8e15c = function(arg0) { + const ret = getObject(arg0).tangentialPressure; + return ret; +}; +imports.wbg.__wbg_tiltX_fe39b58f39622392 = function(arg0) { + const ret = getObject(arg0).tiltX; + return ret; +}; +imports.wbg.__wbg_tiltY_6e725ba5a979ae65 = function(arg0) { + const ret = getObject(arg0).tiltY; + return ret; +}; +imports.wbg.__wbg_twist_29056239dbb46cce = function(arg0) { + const ret = getObject(arg0).twist; + return ret; +}; +imports.wbg.__wbg_pointerType_bf6b13edfec8614b = function(arg0, arg1) { + const ret = getObject(arg1).pointerType; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_isPrimary_8a1c3caca08ecc33 = function(arg0) { + const ret = getObject(arg0).isPrimary; + return ret; +}; +imports.wbg.__wbg_instanceof_HtmlInputElement_970e4026de0fccff = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof HTMLInputElement; + } catch { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_checked_f0b666100ef39e44 = function(arg0) { + const ret = getObject(arg0).checked; + return ret; +}; +imports.wbg.__wbg_type_6ce8af5475dcc48f = function(arg0, arg1) { + const ret = getObject(arg1).type; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_value_b2a620d34c663701 = function(arg0, arg1) { + const ret = getObject(arg1).value; + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbg_newnoargs_b5b063fc6c2f0376 = function(arg0, arg1) { + var v0 = getCachedStringFromWasm0(arg0, arg1); + const ret = new Function(v0); + return addHeapObject(ret); +}; +imports.wbg.__wbg_call_97ae9d8645dc388b = function() { return handleError(function (arg0, arg1) { + const ret = getObject(arg0).call(getObject(arg1)); + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_instanceof_Object_595a1007518cbea3 = function(arg0) { + let result; + try { + result = getObject(arg0) instanceof Object; + } catch { + result = false; + } + const ret = result; + return ret; +}; +imports.wbg.__wbg_hasOwnProperty_43f5b0861e010743 = function(arg0, arg1) { + const ret = getObject(arg0).hasOwnProperty(getObject(arg1)); + return ret; +}; +imports.wbg.__wbg_new_0b9bfdd97583284e = function() { + const ret = new Object(); + return addHeapObject(ret); +}; +imports.wbg.__wbg_resolve_99fe17964f31ffc0 = function(arg0) { + const ret = Promise.resolve(getObject(arg0)); + return addHeapObject(ret); +}; +imports.wbg.__wbg_then_11f7a54d67b4bfad = function(arg0, arg1) { + const ret = getObject(arg0).then(getObject(arg1)); + return addHeapObject(ret); +}; +imports.wbg.__wbg_globalThis_7f206bda628d5286 = function() { return handleError(function () { + const ret = globalThis.globalThis; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_self_6d479506f72c6a71 = function() { return handleError(function () { + const ret = self.self; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_window_f2557cc78490aceb = function() { return handleError(function () { + const ret = window.window; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_global_ba75c50d1cf384f4 = function() { return handleError(function () { + const ret = global.global; + return addHeapObject(ret); +}, arguments) }; +imports.wbg.__wbg_set_bf3f89b92d5a34bf = function() { return handleError(function (arg0, arg1, arg2) { + const ret = Reflect.set(getObject(arg0), getObject(arg1), getObject(arg2)); + return ret; +}, arguments) }; +imports.wbg.__wbindgen_is_function = function(arg0) { + const ret = typeof(getObject(arg0)) === 'function'; + return ret; +}; +imports.wbg.__wbindgen_is_undefined = function(arg0) { + const ret = getObject(arg0) === undefined; + return ret; +}; +imports.wbg.__wbindgen_debug_string = function(arg0, arg1) { + const ret = debugString(getObject(arg1)); + const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + const len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; +}; +imports.wbg.__wbindgen_object_drop_ref = function(arg0) { + takeObject(arg0); +}; +imports.wbg.__wbindgen_throw = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); +}; +imports.wbg.__wbindgen_closure_wrapper6679 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 726, __wbg_adapter_18); + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_closure_wrapper10290 = function(arg0, arg1, arg2) { + const ret = makeClosure(arg0, arg1, 778, __wbg_adapter_21); + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_closure_wrapper10292 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 780, __wbg_adapter_24); + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_closure_wrapper10845 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 888, __wbg_adapter_27); + return addHeapObject(ret); +}; +imports.wbg.__wbindgen_closure_wrapper11694 = function(arg0, arg1, arg2) { + const ret = makeMutClosure(arg0, arg1, 923, __wbg_adapter_30); + return addHeapObject(ret); +}; + +return imports; +} + +function initMemory(imports, maybe_memory) { + +} + +function finalizeInit(instance, module) { + wasm = instance.exports; + init.__wbindgen_wasm_module = module; + cachedInt32Memory0 = new Int32Array(); + cachedUint8Memory0 = new Uint8Array(); + + wasm.__wbindgen_start(); + return wasm; +} + +function initSync(module) { + const imports = getImports(); + + initMemory(imports); + + if (!(module instanceof WebAssembly.Module)) { + module = new WebAssembly.Module(module); + } + + const instance = new WebAssembly.Instance(module, imports); + + return finalizeInit(instance, module); +} + +async function init(input) { + if (typeof input === 'undefined') { + input = new URL('r-dashboard-b0c35e8e84272a79_bg.wasm', import.meta.url); + } + const imports = getImports(); + + if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) { + input = fetch(input); + } + + initMemory(imports); + + const { instance, module } = await load(await input, imports); + + return finalizeInit(instance, module); +} + +export { initSync } +export default init; diff --git a/dist/r-dashboard-b0c35e8e84272a79_bg.wasm b/dist/r-dashboard-b0c35e8e84272a79_bg.wasm new file mode 100644 index 0000000..a24f3f9 Binary files /dev/null and b/dist/r-dashboard-b0c35e8e84272a79_bg.wasm differ diff --git a/dist/snippets/dioxus-interpreter-js-459fb15b86d869f7/src/interpreter.js b/dist/snippets/dioxus-interpreter-js-459fb15b86d869f7/src/interpreter.js new file mode 100644 index 0000000..4725fff --- /dev/null +++ b/dist/snippets/dioxus-interpreter-js-459fb15b86d869f7/src/interpreter.js @@ -0,0 +1,603 @@ +export function main() { + let root = window.document.getElementById("main"); + if (root != null) { + window.interpreter = new Interpreter(root); + window.ipc.postMessage(serializeIpcMessage("initialize")); + } +} +export class Interpreter { + constructor(root) { + this.root = root; + this.stack = [root]; + this.listeners = {}; + this.handlers = {}; + this.lastNodeWasText = false; + this.nodes = [root]; + } + top() { + return this.stack[this.stack.length - 1]; + } + pop() { + return this.stack.pop(); + } + SetNode(id, node) { + this.nodes[id] = node; + } + PushRoot(root) { + const node = this.nodes[root]; + this.stack.push(node); + } + PopRoot() { + this.stack.pop(); + } + AppendChildren(many) { + let root = this.stack[this.stack.length - (1 + many)]; + let to_add = this.stack.splice(this.stack.length - many); + for (let i = 0; i < many; i++) { + root.appendChild(to_add[i]); + } + } + ReplaceWith(root_id, m) { + let root = this.nodes[root_id]; + let els = this.stack.splice(this.stack.length - m); + root.replaceWith(...els); + } + InsertAfter(root, n) { + let old = this.nodes[root]; + let new_nodes = this.stack.splice(this.stack.length - n); + old.after(...new_nodes); + } + InsertBefore(root, n) { + let old = this.nodes[root]; + let new_nodes = this.stack.splice(this.stack.length - n); + old.before(...new_nodes); + } + Remove(root) { + let node = this.nodes[root]; + if (node !== undefined) { + node.remove(); + } + } + CreateTextNode(text, root) { + const node = document.createTextNode(text); + this.nodes[root] = node; + this.stack.push(node); + } + CreateElement(tag, root) { + const el = document.createElement(tag); + this.nodes[root] = el; + this.stack.push(el); + } + CreateElementNs(tag, root, ns) { + let el = document.createElementNS(ns, tag); + this.stack.push(el); + this.nodes[root] = el; + } + CreatePlaceholder(root) { + let el = document.createElement("pre"); + el.hidden = true; + this.stack.push(el); + this.nodes[root] = el; + } + NewEventListener(event_name, root, handler) { + const element = this.nodes[root]; + element.setAttribute("data-dioxus-id", `${root}`); + if (this.listeners[event_name] === undefined) { + this.listeners[event_name] = 1; + this.handlers[event_name] = handler; + this.root.addEventListener(event_name, handler); + } else { + this.listeners[event_name]++; + } + } + RemoveEventListener(root, event_name) { + const element = this.nodes[root]; + element.removeAttribute(`data-dioxus-id`); + this.listeners[event_name]--; + if (this.listeners[event_name] === 0) { + this.root.removeEventListener(event_name, this.handlers[event_name]); + delete this.listeners[event_name]; + delete this.handlers[event_name]; + } + } + SetText(root, text) { + this.nodes[root].textContent = text; + } + SetAttribute(root, field, value, ns) { + const name = field; + const node = this.nodes[root]; + if (ns === "style") { + // @ts-ignore + node.style[name] = value; + } else if (ns != null || ns != undefined) { + node.setAttributeNS(ns, name, value); + } else { + switch (name) { + case "value": + if (value !== node.value) { + node.value = value; + } + break; + case "checked": + node.checked = value === "true"; + break; + case "selected": + node.selected = value === "true"; + break; + case "dangerous_inner_html": + node.innerHTML = value; + break; + default: + // https://github.com/facebook/react/blob/8b88ac2592c5f555f315f9440cbb665dd1e7457a/packages/react-dom/src/shared/DOMProperty.js#L352-L364 + if (value === "false" && bool_attrs.hasOwnProperty(name)) { + node.removeAttribute(name); + } else { + node.setAttribute(name, value); + } + } + } + } + RemoveAttribute(root, field, ns) { + const name = field; + const node = this.nodes[root]; + if (ns !== null || ns !== undefined) { + node.removeAttributeNS(ns, name); + } else if (name === "value") { + node.value = ""; + } else if (name === "checked") { + node.checked = false; + } else if (name === "selected") { + node.selected = false; + } else if (name === "dangerous_inner_html") { + node.innerHTML = ""; + } else { + node.removeAttribute(name); + } + } + handleEdits(edits) { + this.stack.push(this.root); + for (let edit of edits) { + this.handleEdit(edit); + } + } + handleEdit(edit) { + switch (edit.type) { + case "PushRoot": + this.PushRoot(edit.root); + break; + case "AppendChildren": + this.AppendChildren(edit.many); + break; + case "ReplaceWith": + this.ReplaceWith(edit.root, edit.m); + break; + case "InsertAfter": + this.InsertAfter(edit.root, edit.n); + break; + case "InsertBefore": + this.InsertBefore(edit.root, edit.n); + break; + case "Remove": + this.Remove(edit.root); + break; + case "CreateTextNode": + this.CreateTextNode(edit.text, edit.root); + break; + case "CreateElement": + this.CreateElement(edit.tag, edit.root); + break; + case "CreateElementNs": + this.CreateElementNs(edit.tag, edit.root, edit.ns); + break; + case "CreatePlaceholder": + this.CreatePlaceholder(edit.root); + break; + case "RemoveEventListener": + this.RemoveEventListener(edit.root, edit.event_name); + break; + case "NewEventListener": + console.log(this.listeners); + + // this handler is only provided on desktop implementations since this + // method is not used by the web implementation + let handler = (event) => { + console.log(event); + + let target = event.target; + if (target != null) { + let realId = target.getAttribute(`data-dioxus-id`); + let shouldPreventDefault = target.getAttribute( + `dioxus-prevent-default` + ); + + if (event.type === "click") { + // todo call prevent default if it's the right type of event + if (shouldPreventDefault !== `onclick`) { + if (target.tagName === "A") { + event.preventDefault(); + const href = target.getAttribute("href"); + if (href !== "" && href !== null && href !== undefined) { + window.ipc.postMessage( + serializeIpcMessage("browser_open", { href }) + ); + } + } + } + + // also prevent buttons from submitting + if (target.tagName === "BUTTON" && event.type == "submit") { + event.preventDefault(); + } + } + // walk the tree to find the real element + while (realId == null) { + // we've reached the root we don't want to send an event + if (target.parentElement === null) { + return; + } + + target = target.parentElement; + realId = target.getAttribute(`data-dioxus-id`); + } + + shouldPreventDefault = target.getAttribute( + `dioxus-prevent-default` + ); + + let contents = serialize_event(event); + + if (shouldPreventDefault === `on${event.type}`) { + event.preventDefault(); + } + + if (event.type === "submit") { + event.preventDefault(); + } + + if ( + target.tagName === "FORM" && + (event.type === "submit" || event.type === "input") + ) { + for (let x = 0; x < target.elements.length; x++) { + let element = target.elements[x]; + let name = element.getAttribute("name"); + if (name != null) { + if (element.getAttribute("type") === "checkbox") { + // @ts-ignore + contents.values[name] = element.checked ? "true" : "false"; + } else if (element.getAttribute("type") === "radio") { + if (element.checked) { + contents.values[name] = element.value; + } + } else { + // @ts-ignore + contents.values[name] = + element.value ?? element.textContent; + } + } + } + } + + if (realId === null) { + return; + } + window.ipc.postMessage( + serializeIpcMessage("user_event", { + event: edit.event_name, + mounted_dom_id: parseInt(realId), + contents: contents, + }) + ); + } + }; + this.NewEventListener(edit.event_name, edit.root, handler); + break; + case "SetText": + this.SetText(edit.root, edit.text); + break; + case "SetAttribute": + this.SetAttribute(edit.root, edit.field, edit.value, edit.ns); + break; + case "RemoveAttribute": + this.RemoveAttribute(edit.root, edit.name, edit.ns); + break; + } + } +} + +export function serialize_event(event) { + switch (event.type) { + case "copy": + case "cut": + case "past": { + return {}; + } + case "compositionend": + case "compositionstart": + case "compositionupdate": { + let { data } = event; + return { + data, + }; + } + case "keydown": + case "keypress": + case "keyup": { + let { + charCode, + key, + altKey, + ctrlKey, + metaKey, + keyCode, + shiftKey, + location, + repeat, + which, + } = event; + return { + char_code: charCode, + key: key, + alt_key: altKey, + ctrl_key: ctrlKey, + meta_key: metaKey, + key_code: keyCode, + shift_key: shiftKey, + location: location, + repeat: repeat, + which: which, + locale: "locale", + }; + } + case "focus": + case "blur": { + return {}; + } + case "change": { + let target = event.target; + let value; + if (target.type === "checkbox" || target.type === "radio") { + value = target.checked ? "true" : "false"; + } else { + value = target.value ?? target.textContent; + } + return { + value: value, + values: {}, + }; + } + case "input": + case "invalid": + case "reset": + case "submit": { + let target = event.target; + let value = target.value ?? target.textContent; + + if (target.type === "checkbox") { + value = target.checked ? "true" : "false"; + } + + return { + value: value, + values: {}, + }; + } + case "click": + case "contextmenu": + case "doubleclick": + case "dblclick": + case "drag": + case "dragend": + case "dragenter": + case "dragexit": + case "dragleave": + case "dragover": + case "dragstart": + case "drop": + case "mousedown": + case "mouseenter": + case "mouseleave": + case "mousemove": + case "mouseout": + case "mouseover": + case "mouseup": { + const { + altKey, + button, + buttons, + clientX, + clientY, + ctrlKey, + metaKey, + pageX, + pageY, + screenX, + screenY, + shiftKey, + } = event; + return { + alt_key: altKey, + button: button, + buttons: buttons, + client_x: clientX, + client_y: clientY, + ctrl_key: ctrlKey, + meta_key: metaKey, + page_x: pageX, + page_y: pageY, + screen_x: screenX, + screen_y: screenY, + shift_key: shiftKey, + }; + } + case "pointerdown": + case "pointermove": + case "pointerup": + case "pointercancel": + case "gotpointercapture": + case "lostpointercapture": + case "pointerenter": + case "pointerleave": + case "pointerover": + case "pointerout": { + const { + altKey, + button, + buttons, + clientX, + clientY, + ctrlKey, + metaKey, + pageX, + pageY, + screenX, + screenY, + shiftKey, + pointerId, + width, + height, + pressure, + tangentialPressure, + tiltX, + tiltY, + twist, + pointerType, + isPrimary, + } = event; + return { + alt_key: altKey, + button: button, + buttons: buttons, + client_x: clientX, + client_y: clientY, + ctrl_key: ctrlKey, + meta_key: metaKey, + page_x: pageX, + page_y: pageY, + screen_x: screenX, + screen_y: screenY, + shift_key: shiftKey, + pointer_id: pointerId, + width: width, + height: height, + pressure: pressure, + tangential_pressure: tangentialPressure, + tilt_x: tiltX, + tilt_y: tiltY, + twist: twist, + pointer_type: pointerType, + is_primary: isPrimary, + }; + } + case "select": { + return {}; + } + case "touchcancel": + case "touchend": + case "touchmove": + case "touchstart": { + const { altKey, ctrlKey, metaKey, shiftKey } = event; + return { + // changed_touches: event.changedTouches, + // target_touches: event.targetTouches, + // touches: event.touches, + alt_key: altKey, + ctrl_key: ctrlKey, + meta_key: metaKey, + shift_key: shiftKey, + }; + } + case "scroll": { + return {}; + } + case "wheel": { + const { deltaX, deltaY, deltaZ, deltaMode } = event; + return { + delta_x: deltaX, + delta_y: deltaY, + delta_z: deltaZ, + delta_mode: deltaMode, + }; + } + case "animationstart": + case "animationend": + case "animationiteration": { + const { animationName, elapsedTime, pseudoElement } = event; + return { + animation_name: animationName, + elapsed_time: elapsedTime, + pseudo_element: pseudoElement, + }; + } + case "transitionend": { + const { propertyName, elapsedTime, pseudoElement } = event; + return { + property_name: propertyName, + elapsed_time: elapsedTime, + pseudo_element: pseudoElement, + }; + } + case "abort": + case "canplay": + case "canplaythrough": + case "durationchange": + case "emptied": + case "encrypted": + case "ended": + case "error": + case "loadeddata": + case "loadedmetadata": + case "loadstart": + case "pause": + case "play": + case "playing": + case "progress": + case "ratechange": + case "seeked": + case "seeking": + case "stalled": + case "suspend": + case "timeupdate": + case "volumechange": + case "waiting": { + return {}; + } + case "toggle": { + return {}; + } + default: { + return {}; + } + } +} +function serializeIpcMessage(method, params = {}) { + return JSON.stringify({ method, params }); +} +const bool_attrs = { + allowfullscreen: true, + allowpaymentrequest: true, + async: true, + autofocus: true, + autoplay: true, + checked: true, + controls: true, + default: true, + defer: true, + disabled: true, + formnovalidate: true, + hidden: true, + ismap: true, + itemscope: true, + loop: true, + multiple: true, + muted: true, + nomodule: true, + novalidate: true, + open: true, + playsinline: true, + readonly: true, + required: true, + reversed: true, + selected: true, + truespeed: true, +}; diff --git a/dist/style.css b/dist/style.css new file mode 100644 index 0000000..79c762c --- /dev/null +++ b/dist/style.css @@ -0,0 +1,2137 @@ +/* +! tailwindcss v3.1.8 | MIT License | https://tailwindcss.com +*/ + +/* +1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4) +2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116) +*/ + +*, +::before, +::after { + box-sizing: border-box; + /* 1 */ + border-width: 0; + /* 2 */ + border-style: solid; + /* 2 */ + border-color: #e5e7eb; + /* 2 */ +} + +::before, +::after { + --tw-content: ''; +} + +/* +1. Use a consistent sensible line-height in all browsers. +2. Prevent adjustments of font size after orientation changes in iOS. +3. Use a more readable tab size. +4. Use the user's configured `sans` font-family by default. +*/ + +html { + line-height: 1.5; + /* 1 */ + -webkit-text-size-adjust: 100%; + /* 2 */ + -moz-tab-size: 4; + /* 3 */ + -o-tab-size: 4; + tab-size: 4; + /* 3 */ + font-family: Inter var, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji"; + /* 4 */ +} + +/* +1. Remove the margin in all browsers. +2. Inherit line-height from `html` so users can set them as a class directly on the `html` element. +*/ + +body { + margin: 0; + /* 1 */ + line-height: inherit; + /* 2 */ +} + +/* +1. Add the correct height in Firefox. +2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655) +3. Ensure horizontal rules are visible by default. +*/ + +hr { + height: 0; + /* 1 */ + color: inherit; + /* 2 */ + border-top-width: 1px; + /* 3 */ +} + +/* +Add the correct text decoration in Chrome, Edge, and Safari. +*/ + +abbr:where([title]) { + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; +} + +/* +Remove the default font size and weight for headings. +*/ + +h1, +h2, +h3, +h4, +h5, +h6 { + font-size: inherit; + font-weight: inherit; +} + +/* +Reset links to optimize for opt-in styling instead of opt-out. +*/ + +a { + color: inherit; + text-decoration: inherit; +} + +/* +Add the correct font weight in Edge and Safari. +*/ + +b, +strong { + font-weight: bolder; +} + +/* +1. Use the user's configured `mono` font family by default. +2. Correct the odd `em` font sizing in all browsers. +*/ + +code, +kbd, +samp, +pre { + font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; + /* 1 */ + font-size: 1em; + /* 2 */ +} + +/* +Add the correct font size in all browsers. +*/ + +small { + font-size: 80%; +} + +/* +Prevent `sub` and `sup` elements from affecting the line height in all browsers. +*/ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* +1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297) +2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016) +3. Remove gaps between table borders by default. +*/ + +table { + text-indent: 0; + /* 1 */ + border-color: inherit; + /* 2 */ + border-collapse: collapse; + /* 3 */ +} + +/* +1. Change the font styles in all browsers. +2. Remove the margin in Firefox and Safari. +3. Remove default padding in all browsers. +*/ + +button, +input, +optgroup, +select, +textarea { + font-family: inherit; + /* 1 */ + font-size: 100%; + /* 1 */ + font-weight: inherit; + /* 1 */ + line-height: inherit; + /* 1 */ + color: inherit; + /* 1 */ + margin: 0; + /* 2 */ + padding: 0; + /* 3 */ +} + +/* +Remove the inheritance of text transform in Edge and Firefox. +*/ + +button, +select { + text-transform: none; +} + +/* +1. Correct the inability to style clickable types in iOS and Safari. +2. Remove default button styles. +*/ + +button, +[type='button'], +[type='reset'], +[type='submit'] { + -webkit-appearance: button; + /* 1 */ + background-color: transparent; + /* 2 */ + background-image: none; + /* 2 */ +} + +/* +Use the modern Firefox focus style for all focusable elements. +*/ + +:-moz-focusring { + outline: auto; +} + +/* +Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737) +*/ + +:-moz-ui-invalid { + box-shadow: none; +} + +/* +Add the correct vertical alignment in Chrome and Firefox. +*/ + +progress { + vertical-align: baseline; +} + +/* +Correct the cursor style of increment and decrement buttons in Safari. +*/ + +::-webkit-inner-spin-button, +::-webkit-outer-spin-button { + height: auto; +} + +/* +1. Correct the odd appearance in Chrome and Safari. +2. Correct the outline style in Safari. +*/ + +[type='search'] { + -webkit-appearance: textfield; + /* 1 */ + outline-offset: -2px; + /* 2 */ +} + +/* +Remove the inner padding in Chrome and Safari on macOS. +*/ + +::-webkit-search-decoration { + -webkit-appearance: none; +} + +/* +1. Correct the inability to style clickable types in iOS and Safari. +2. Change font properties to `inherit` in Safari. +*/ + +::-webkit-file-upload-button { + -webkit-appearance: button; + /* 1 */ + font: inherit; + /* 2 */ +} + +/* +Add the correct display in Chrome and Safari. +*/ + +summary { + display: list-item; +} + +/* +Removes the default spacing and border for appropriate elements. +*/ + +blockquote, +dl, +dd, +h1, +h2, +h3, +h4, +h5, +h6, +hr, +figure, +p, +pre { + margin: 0; +} + +fieldset { + margin: 0; + padding: 0; +} + +legend { + padding: 0; +} + +ol, +ul, +menu { + list-style: none; + margin: 0; + padding: 0; +} + +/* +Prevent resizing textareas horizontally by default. +*/ + +textarea { + resize: vertical; +} + +/* +1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300) +2. Set the default placeholder color to the user's configured gray 400 color. +*/ + +input::-moz-placeholder, textarea::-moz-placeholder { + opacity: 1; + /* 1 */ + color: #9ca3af; + /* 2 */ +} + +input::placeholder, +textarea::placeholder { + opacity: 1; + /* 1 */ + color: #9ca3af; + /* 2 */ +} + +/* +Set the default cursor for buttons. +*/ + +button, +[role="button"] { + cursor: pointer; +} + +/* +Make sure disabled buttons don't get the pointer cursor. +*/ + +:disabled { + cursor: default; +} + +/* +1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14) +2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210) + This can trigger a poorly considered lint error in some tools but is included by design. +*/ + +img, +svg, +video, +canvas, +audio, +iframe, +embed, +object { + display: block; + /* 1 */ + vertical-align: middle; + /* 2 */ +} + +/* +Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14) +*/ + +img, +video { + max-width: 100%; + height: auto; +} + +[type='text'],[type='email'],[type='url'],[type='password'],[type='number'],[type='date'],[type='datetime-local'],[type='month'],[type='search'],[type='tel'],[type='time'],[type='week'],[multiple],textarea,select { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + background-color: #fff; + border-color: #6b7280; + border-width: 1px; + border-radius: 0px; + padding-top: 0.5rem; + padding-right: 0.75rem; + padding-bottom: 0.5rem; + padding-left: 0.75rem; + font-size: 1rem; + line-height: 1.5rem; + --tw-shadow: 0 0 #0000; +} + +[type='text']:focus, [type='email']:focus, [type='url']:focus, [type='password']:focus, [type='number']:focus, [type='date']:focus, [type='datetime-local']:focus, [type='month']:focus, [type='search']:focus, [type='tel']:focus, [type='time']:focus, [type='week']:focus, [multiple]:focus, textarea:focus, select:focus { + outline: 2px solid transparent; + outline-offset: 2px; + --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/); + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: #2563eb; + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); + border-color: #2563eb; +} + +input::-moz-placeholder, textarea::-moz-placeholder { + color: #6b7280; + opacity: 1; +} + +input::placeholder,textarea::placeholder { + color: #6b7280; + opacity: 1; +} + +::-webkit-datetime-edit-fields-wrapper { + padding: 0; +} + +::-webkit-date-and-time-value { + min-height: 1.5em; +} + +::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field { + padding-top: 0; + padding-bottom: 0; +} + +select { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); + background-position: right 0.5rem center; + background-repeat: no-repeat; + background-size: 1.5em 1.5em; + padding-right: 2.5rem; + -webkit-print-color-adjust: exact; + color-adjust: exact; + print-color-adjust: exact; +} + +[multiple] { + background-image: initial; + background-position: initial; + background-repeat: unset; + background-size: initial; + padding-right: 0.75rem; + -webkit-print-color-adjust: unset; + color-adjust: unset; + print-color-adjust: unset; +} + +[type='checkbox'],[type='radio'] { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; + padding: 0; + -webkit-print-color-adjust: exact; + color-adjust: exact; + print-color-adjust: exact; + display: inline-block; + vertical-align: middle; + background-origin: border-box; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; + flex-shrink: 0; + height: 1rem; + width: 1rem; + color: #2563eb; + background-color: #fff; + border-color: #6b7280; + border-width: 1px; + --tw-shadow: 0 0 #0000; +} + +[type='checkbox'] { + border-radius: 0px; +} + +[type='radio'] { + border-radius: 100%; +} + +[type='checkbox']:focus,[type='radio']:focus { + outline: 2px solid transparent; + outline-offset: 2px; + --tw-ring-inset: var(--tw-empty,/*!*/ /*!*/); + --tw-ring-offset-width: 2px; + --tw-ring-offset-color: #fff; + --tw-ring-color: #2563eb; + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow); +} + +[type='checkbox']:checked,[type='radio']:checked { + border-color: transparent; + background-color: currentColor; + background-size: 100% 100%; + background-position: center; + background-repeat: no-repeat; +} + +[type='checkbox']:checked { + background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e"); +} + +[type='radio']:checked { + background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e"); +} + +[type='checkbox']:checked:hover,[type='checkbox']:checked:focus,[type='radio']:checked:hover,[type='radio']:checked:focus { + border-color: transparent; + background-color: currentColor; +} + +[type='checkbox']:indeterminate { + background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 16 16'%3e%3cpath stroke='white' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M4 8h8'/%3e%3c/svg%3e"); + border-color: transparent; + background-color: currentColor; + background-size: 100% 100%; + background-position: center; + background-repeat: no-repeat; +} + +[type='checkbox']:indeterminate:hover,[type='checkbox']:indeterminate:focus { + border-color: transparent; + background-color: currentColor; +} + +[type='file'] { + background: unset; + border-color: inherit; + border-width: 0; + border-radius: 0; + padding: 0; + font-size: unset; + line-height: inherit; +} + +[type='file']:focus { + outline: 1px solid ButtonText; + outline: 1px auto -webkit-focus-ring-color; +} + +*, ::before, ::after { + --tw-border-spacing-x: 0; + --tw-border-spacing-y: 0; + --tw-translate-x: 0; + --tw-translate-y: 0; + --tw-rotate: 0; + --tw-skew-x: 0; + --tw-skew-y: 0; + --tw-scale-x: 1; + --tw-scale-y: 1; + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; + --tw-ordinal: ; + --tw-slashed-zero: ; + --tw-numeric-figure: ; + --tw-numeric-spacing: ; + --tw-numeric-fraction: ; + --tw-ring-inset: ; + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: rgb(59 130 246 / 0.5); + --tw-ring-offset-shadow: 0 0 #0000; + --tw-ring-shadow: 0 0 #0000; + --tw-shadow: 0 0 #0000; + --tw-shadow-colored: 0 0 #0000; + --tw-blur: ; + --tw-brightness: ; + --tw-contrast: ; + --tw-grayscale: ; + --tw-hue-rotate: ; + --tw-invert: ; + --tw-saturate: ; + --tw-sepia: ; + --tw-drop-shadow: ; + --tw-backdrop-blur: ; + --tw-backdrop-brightness: ; + --tw-backdrop-contrast: ; + --tw-backdrop-grayscale: ; + --tw-backdrop-hue-rotate: ; + --tw-backdrop-invert: ; + --tw-backdrop-opacity: ; + --tw-backdrop-saturate: ; + --tw-backdrop-sepia: ; +} + +::-webkit-backdrop { + --tw-border-spacing-x: 0; + --tw-border-spacing-y: 0; + --tw-translate-x: 0; + --tw-translate-y: 0; + --tw-rotate: 0; + --tw-skew-x: 0; + --tw-skew-y: 0; + --tw-scale-x: 1; + --tw-scale-y: 1; + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; + --tw-ordinal: ; + --tw-slashed-zero: ; + --tw-numeric-figure: ; + --tw-numeric-spacing: ; + --tw-numeric-fraction: ; + --tw-ring-inset: ; + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: rgb(59 130 246 / 0.5); + --tw-ring-offset-shadow: 0 0 #0000; + --tw-ring-shadow: 0 0 #0000; + --tw-shadow: 0 0 #0000; + --tw-shadow-colored: 0 0 #0000; + --tw-blur: ; + --tw-brightness: ; + --tw-contrast: ; + --tw-grayscale: ; + --tw-hue-rotate: ; + --tw-invert: ; + --tw-saturate: ; + --tw-sepia: ; + --tw-drop-shadow: ; + --tw-backdrop-blur: ; + --tw-backdrop-brightness: ; + --tw-backdrop-contrast: ; + --tw-backdrop-grayscale: ; + --tw-backdrop-hue-rotate: ; + --tw-backdrop-invert: ; + --tw-backdrop-opacity: ; + --tw-backdrop-saturate: ; + --tw-backdrop-sepia: ; +} + +::backdrop { + --tw-border-spacing-x: 0; + --tw-border-spacing-y: 0; + --tw-translate-x: 0; + --tw-translate-y: 0; + --tw-rotate: 0; + --tw-skew-x: 0; + --tw-skew-y: 0; + --tw-scale-x: 1; + --tw-scale-y: 1; + --tw-pan-x: ; + --tw-pan-y: ; + --tw-pinch-zoom: ; + --tw-scroll-snap-strictness: proximity; + --tw-ordinal: ; + --tw-slashed-zero: ; + --tw-numeric-figure: ; + --tw-numeric-spacing: ; + --tw-numeric-fraction: ; + --tw-ring-inset: ; + --tw-ring-offset-width: 0px; + --tw-ring-offset-color: #fff; + --tw-ring-color: rgb(59 130 246 / 0.5); + --tw-ring-offset-shadow: 0 0 #0000; + --tw-ring-shadow: 0 0 #0000; + --tw-shadow: 0 0 #0000; + --tw-shadow-colored: 0 0 #0000; + --tw-blur: ; + --tw-brightness: ; + --tw-contrast: ; + --tw-grayscale: ; + --tw-hue-rotate: ; + --tw-invert: ; + --tw-saturate: ; + --tw-sepia: ; + --tw-drop-shadow: ; + --tw-backdrop-blur: ; + --tw-backdrop-brightness: ; + --tw-backdrop-contrast: ; + --tw-backdrop-grayscale: ; + --tw-backdrop-hue-rotate: ; + --tw-backdrop-invert: ; + --tw-backdrop-opacity: ; + --tw-backdrop-saturate: ; + --tw-backdrop-sepia: ; +} + +.container { + width: 100%; +} + +@media (min-width: 640px) { + .container { + max-width: 640px; + } +} + +@media (min-width: 768px) { + .container { + max-width: 768px; + } +} + +@media (min-width: 1024px) { + .container { + max-width: 1024px; + } +} + +@media (min-width: 1280px) { + .container { + max-width: 1280px; + } +} + +@media (min-width: 1536px) { + .container { + max-width: 1536px; + } +} + +.pointer-events-none { + pointer-events: none; +} + +.static { + position: static; +} + +.fixed { + position: fixed; +} + +.absolute { + position: absolute; +} + +.relative { + position: relative; +} + +.inset-0 { + top: 0px; + right: 0px; + bottom: 0px; + left: 0px; +} + +.inset-y-0 { + top: 0px; + bottom: 0px; +} + +.left-0 { + left: 0px; +} + +.right-0 { + right: 0px; +} + +.top-0 { + top: 0px; +} + +.z-10 { + z-index: 10; +} + +.z-20 { + z-index: 20; +} + +.z-30 { + z-index: 30; +} + +.z-50 { + z-index: 50; +} + +.mx-auto { + margin-left: auto; + margin-right: auto; +} + +.mx-4 { + margin-left: 1rem; + margin-right: 1rem; +} + +.mx-2 { + margin-left: 0.5rem; + margin-right: 0.5rem; +} + +.-mx-6 { + margin-left: -1.5rem; + margin-right: -1.5rem; +} + +.mx-5 { + margin-left: 1.25rem; + margin-right: 1.25rem; +} + +.-my-2 { + margin-top: -0.5rem; + margin-bottom: -0.5rem; +} + +.my-6 { + margin-top: 1.5rem; + margin-bottom: 1.5rem; +} + +.-mx-4 { + margin-left: -1rem; + margin-right: -1rem; +} + +.-mx-3 { + margin-left: -0.75rem; + margin-right: -0.75rem; +} + +.mx-3 { + margin-left: 0.75rem; + margin-right: 0.75rem; +} + +.mx-1 { + margin-left: 0.25rem; + margin-right: 0.25rem; +} + +.mt-2 { + margin-top: 0.5rem; +} + +.mt-4 { + margin-top: 1rem; +} + +.mt-8 { + margin-top: 2rem; +} + +.mt-10 { + margin-top: 2.5rem; +} + +.mb-3 { + margin-bottom: 0.75rem; +} + +.mt-6 { + margin-top: 1.5rem; +} + +.mb-2 { + margin-bottom: 0.5rem; +} + +.mr-2 { + margin-right: 0.5rem; +} + +.mt-5 { + margin-top: 1.25rem; +} + +.mb-8 { + margin-bottom: 2rem; +} + +.mr-4 { + margin-right: 1rem; +} + +.ml-4 { + margin-left: 1rem; +} + +.mt-1 { + margin-top: 0.25rem; +} + +.mt-3 { + margin-top: 0.75rem; +} + +.ml-3 { + margin-left: 0.75rem; +} + +.ml-2 { + margin-left: 0.5rem; +} + +.ml-0 { + margin-left: 0px; +} + +.block { + display: block; +} + +.inline-block { + display: inline-block; +} + +.flex { + display: flex; +} + +.inline-flex { + display: inline-flex; +} + +.table { + display: table; +} + +.grid { + display: grid; +} + +.hidden { + display: none; +} + +.h-screen { + height: 100vh; +} + +.h-8 { + height: 2rem; +} + +.h-full { + height: 100%; +} + +.h-6 { + height: 1.5rem; +} + +.h-5 { + height: 1.25rem; +} + +.h-12 { + height: 3rem; +} + +.h-48 { + height: 12rem; +} + +.h-10 { + height: 2.5rem; +} + +.h-3 { + height: 0.75rem; +} + +.h-4 { + height: 1rem; +} + +.w-32 { + width: 8rem; +} + +.w-8 { + width: 2rem; +} + +.w-full { + width: 100%; +} + +.w-48 { + width: 12rem; +} + +.w-6 { + width: 1.5rem; +} + +.w-5 { + width: 1.25rem; +} + +.w-64 { + width: 16rem; +} + +.w-12 { + width: 3rem; +} + +.w-10 { + width: 2.5rem; +} + +.w-3 { + width: 0.75rem; +} + +.w-4 { + width: 1rem; +} + +.w-11\/12 { + width: 91.666667%; +} + +.min-w-full { + min-width: 100%; +} + +.max-w-sm { + max-width: 24rem; +} + +.flex-1 { + flex: 1 1 0%; +} + +.flex-none { + flex: none; +} + +.flex-shrink-0 { + flex-shrink: 0; +} + +.border-collapse { + border-collapse: collapse; +} + +.translate-x-0 { + --tw-translate-x: 0px; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.-translate-x-full { + --tw-translate-x: -100%; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.scale-95 { + --tw-scale-x: .95; + --tw-scale-y: .95; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.scale-100 { + --tw-scale-x: 1; + --tw-scale-y: 1; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.transform { + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); +} + +.cursor-pointer { + cursor: pointer; +} + +.appearance-none { + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} + +.grid-cols-1 { + grid-template-columns: repeat(1, minmax(0, 1fr)); +} + +.flex-col { + flex-direction: column; +} + +.flex-wrap { + flex-wrap: wrap; +} + +.items-center { + align-items: center; +} + +.justify-end { + justify-content: flex-end; +} + +.justify-center { + justify-content: center; +} + +.justify-between { + justify-content: space-between; +} + +.gap-6 { + gap: 1.5rem; +} + +.space-x-4 > :not([hidden]) ~ :not([hidden]) { + --tw-space-x-reverse: 0; + margin-right: calc(1rem * var(--tw-space-x-reverse)); + margin-left: calc(1rem * calc(1 - var(--tw-space-x-reverse))); +} + +.overflow-hidden { + overflow: hidden; +} + +.overflow-x-auto { + overflow-x: auto; +} + +.overflow-y-auto { + overflow-y: auto; +} + +.overflow-x-hidden { + overflow-x: hidden; +} + +.whitespace-nowrap { + white-space: nowrap; +} + +.rounded-md { + border-radius: 0.375rem; +} + +.rounded-full { + border-radius: 9999px; +} + +.rounded { + border-radius: 0.25rem; +} + +.rounded-lg { + border-radius: 0.5rem; +} + +.rounded-t { + border-top-left-radius: 0.25rem; + border-top-right-radius: 0.25rem; +} + +.rounded-b { + border-bottom-right-radius: 0.25rem; + border-bottom-left-radius: 0.25rem; +} + +.rounded-l { + border-top-left-radius: 0.25rem; + border-bottom-left-radius: 0.25rem; +} + +.rounded-r { + border-top-right-radius: 0.25rem; + border-bottom-right-radius: 0.25rem; +} + +.border { + border-width: 1px; +} + +.border-b-4 { + border-bottom-width: 4px; +} + +.border-l-4 { + border-left-width: 4px; +} + +.border-b { + border-bottom-width: 1px; +} + +.border-l { + border-left-width: 1px; +} + +.border-r { + border-right-width: 1px; +} + +.border-t { + border-top-width: 1px; +} + +.border-b-2 { + border-bottom-width: 2px; +} + +.border-r-0 { + border-right-width: 0px; +} + +.border-indigo-600 { + --tw-border-opacity: 1; + border-color: rgb(79 70 229 / var(--tw-border-opacity)); +} + +.border-gray-200 { + --tw-border-opacity: 1; + border-color: rgb(229 231 235 / var(--tw-border-opacity)); +} + +.border-gray-100 { + --tw-border-opacity: 1; + border-color: rgb(243 244 246 / var(--tw-border-opacity)); +} + +.border-gray-900 { + --tw-border-opacity: 1; + border-color: rgb(17 24 39 / var(--tw-border-opacity)); +} + +.border-transparent { + border-color: transparent; +} + +.border-gray-400 { + --tw-border-opacity: 1; + border-color: rgb(156 163 175 / var(--tw-border-opacity)); +} + +.bg-gray-200 { + --tw-bg-opacity: 1; + background-color: rgb(229 231 235 / var(--tw-bg-opacity)); +} + +.bg-white { + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +} + +.bg-gray-600 { + --tw-bg-opacity: 1; + background-color: rgb(75 85 99 / var(--tw-bg-opacity)); +} + +.bg-black { + --tw-bg-opacity: 1; + background-color: rgb(0 0 0 / var(--tw-bg-opacity)); +} + +.bg-gray-900 { + --tw-bg-opacity: 1; + background-color: rgb(17 24 39 / var(--tw-bg-opacity)); +} + +.bg-indigo-600 { + --tw-bg-opacity: 1; + background-color: rgb(79 70 229 / var(--tw-bg-opacity)); +} + +.bg-blue-600 { + --tw-bg-opacity: 1; + background-color: rgb(37 99 235 / var(--tw-bg-opacity)); +} + +.bg-pink-600 { + --tw-bg-opacity: 1; + background-color: rgb(219 39 119 / var(--tw-bg-opacity)); +} + +.bg-gray-50 { + --tw-bg-opacity: 1; + background-color: rgb(249 250 251 / var(--tw-bg-opacity)); +} + +.bg-green-100 { + --tw-bg-opacity: 1; + background-color: rgb(220 252 231 / var(--tw-bg-opacity)); +} + +.bg-gray-800 { + --tw-bg-opacity: 1; + background-color: rgb(31 41 55 / var(--tw-bg-opacity)); +} + +.bg-transparent { + background-color: transparent; +} + +.bg-indigo-800 { + --tw-bg-opacity: 1; + background-color: rgb(55 48 163 / var(--tw-bg-opacity)); +} + +.bg-red-100 { + --tw-bg-opacity: 1; + background-color: rgb(254 226 226 / var(--tw-bg-opacity)); +} + +.bg-orange-100 { + --tw-bg-opacity: 1; + background-color: rgb(255 237 213 / var(--tw-bg-opacity)); +} + +.bg-gray-100 { + --tw-bg-opacity: 1; + background-color: rgb(243 244 246 / var(--tw-bg-opacity)); +} + +.bg-gray-300 { + --tw-bg-opacity: 1; + background-color: rgb(209 213 219 / var(--tw-bg-opacity)); +} + +.bg-green-500 { + --tw-bg-opacity: 1; + background-color: rgb(34 197 94 / var(--tw-bg-opacity)); +} + +.bg-blue-500 { + --tw-bg-opacity: 1; + background-color: rgb(59 130 246 / var(--tw-bg-opacity)); +} + +.bg-yellow-500 { + --tw-bg-opacity: 1; + background-color: rgb(234 179 8 / var(--tw-bg-opacity)); +} + +.bg-red-500 { + --tw-bg-opacity: 1; + background-color: rgb(239 68 68 / var(--tw-bg-opacity)); +} + +.bg-opacity-25 { + --tw-bg-opacity: 0.25; +} + +.bg-opacity-75 { + --tw-bg-opacity: 0.75; +} + +.bg-cover { + background-size: cover; +} + +.fill-current { + fill: currentColor; +} + +.object-cover { + -o-object-fit: cover; + object-fit: cover; +} + +.p-4 { + padding: 1rem; +} + +.p-3 { + padding: 0.75rem; +} + +.p-6 { + padding: 1.5rem; +} + +.p-2 { + padding: 0.5rem; +} + +.px-6 { + padding-left: 1.5rem; + padding-right: 1.5rem; +} + +.py-8 { + padding-top: 2rem; + padding-bottom: 2rem; +} + +.py-4 { + padding-top: 1rem; + padding-bottom: 1rem; +} + +.py-2 { + padding-top: 0.5rem; + padding-bottom: 0.5rem; +} + +.px-4 { + padding-left: 1rem; + padding-right: 1rem; +} + +.px-3 { + padding-left: 0.75rem; + padding-right: 0.75rem; +} + +.py-1 { + padding-top: 0.25rem; + padding-bottom: 0.25rem; +} + +.px-5 { + padding-left: 1.25rem; + padding-right: 1.25rem; +} + +.py-6 { + padding-top: 1.5rem; + padding-bottom: 1.5rem; +} + +.py-3 { + padding-top: 0.75rem; + padding-bottom: 0.75rem; +} + +.px-2 { + padding-left: 0.5rem; + padding-right: 0.5rem; +} + +.px-12 { + padding-left: 3rem; + padding-right: 3rem; +} + +.py-5 { + padding-top: 1.25rem; + padding-bottom: 1.25rem; +} + +.pl-3 { + padding-left: 0.75rem; +} + +.pl-10 { + padding-left: 2.5rem; +} + +.pr-4 { + padding-right: 1rem; +} + +.pt-4 { + padding-top: 1rem; +} + +.pb-2 { + padding-bottom: 0.5rem; +} + +.pb-3 { + padding-bottom: 0.75rem; +} + +.pt-2 { + padding-top: 0.5rem; +} + +.pr-8 { + padding-right: 2rem; +} + +.pl-2 { + padding-left: 0.5rem; +} + +.pl-8 { + padding-left: 2rem; +} + +.pr-6 { + padding-right: 1.5rem; +} + +.text-left { + text-align: left; +} + +.text-center { + text-align: center; +} + +.text-right { + text-align: right; +} + +.align-middle { + vertical-align: middle; +} + +.text-2xl { + font-size: 1.5rem; + line-height: 2rem; +} + +.text-sm { + font-size: 0.875rem; + line-height: 1.25rem; +} + +.text-3xl { + font-size: 1.875rem; + line-height: 2.25rem; +} + +.text-xl { + font-size: 1.25rem; + line-height: 1.75rem; +} + +.text-base { + font-size: 1rem; + line-height: 1.5rem; +} + +.text-xs { + font-size: 0.75rem; + line-height: 1rem; +} + +.text-lg { + font-size: 1.125rem; + line-height: 1.75rem; +} + +.font-bold { + font-weight: 700; +} + +.font-semibold { + font-weight: 600; +} + +.font-medium { + font-weight: 500; +} + +.uppercase { + text-transform: uppercase; +} + +.capitalize { + text-transform: capitalize; +} + +.leading-normal { + line-height: 1.5; +} + +.leading-none { + line-height: 1; +} + +.leading-4 { + line-height: 1rem; +} + +.leading-5 { + line-height: 1.25rem; +} + +.leading-tight { + line-height: 1.25; +} + +.tracking-wider { + letter-spacing: 0.05em; +} + +.tracking-wide { + letter-spacing: 0.025em; +} + +.text-red-500 { + --tw-text-opacity: 1; + color: rgb(239 68 68 / var(--tw-text-opacity)); +} + +.text-gray-500 { + --tw-text-opacity: 1; + color: rgb(107 114 128 / var(--tw-text-opacity)); +} + +.text-indigo-600 { + --tw-text-opacity: 1; + color: rgb(79 70 229 / var(--tw-text-opacity)); +} + +.text-gray-600 { + --tw-text-opacity: 1; + color: rgb(75 85 99 / var(--tw-text-opacity)); +} + +.text-gray-700 { + --tw-text-opacity: 1; + color: rgb(55 65 81 / var(--tw-text-opacity)); +} + +.text-gray-100 { + --tw-text-opacity: 1; + color: rgb(243 244 246 / var(--tw-text-opacity)); +} + +.text-white { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +.text-gray-900 { + --tw-text-opacity: 1; + color: rgb(17 24 39 / var(--tw-text-opacity)); +} + +.text-green-800 { + --tw-text-opacity: 1; + color: rgb(22 101 52 / var(--tw-text-opacity)); +} + +.text-gray-200 { + --tw-text-opacity: 1; + color: rgb(229 231 235 / var(--tw-text-opacity)); +} + +.text-indigo-700 { + --tw-text-opacity: 1; + color: rgb(67 56 202 / var(--tw-text-opacity)); +} + +.text-indigo-500 { + --tw-text-opacity: 1; + color: rgb(99 102 241 / var(--tw-text-opacity)); +} + +.text-red-800 { + --tw-text-opacity: 1; + color: rgb(153 27 27 / var(--tw-text-opacity)); +} + +.text-orange-800 { + --tw-text-opacity: 1; + color: rgb(154 52 18 / var(--tw-text-opacity)); +} + +.text-gray-800 { + --tw-text-opacity: 1; + color: rgb(31 41 55 / var(--tw-text-opacity)); +} + +.text-green-500 { + --tw-text-opacity: 1; + color: rgb(34 197 94 / var(--tw-text-opacity)); +} + +.text-blue-500 { + --tw-text-opacity: 1; + color: rgb(59 130 246 / var(--tw-text-opacity)); +} + +.text-yellow-500 { + --tw-text-opacity: 1; + color: rgb(234 179 8 / var(--tw-text-opacity)); +} + +.placeholder-gray-400::-moz-placeholder { + --tw-placeholder-opacity: 1; + color: rgb(156 163 175 / var(--tw-placeholder-opacity)); +} + +.placeholder-gray-400::placeholder { + --tw-placeholder-opacity: 1; + color: rgb(156 163 175 / var(--tw-placeholder-opacity)); +} + +.opacity-0 { + opacity: 0; +} + +.opacity-100 { + opacity: 1; +} + +.opacity-50 { + opacity: 0.5; +} + +.shadow { + --tw-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.shadow-xl { + --tw-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.shadow-lg { + --tw-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.shadow-sm { + --tw-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); + --tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.shadow-md { + --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.transition { + transition-property: color, background-color, border-color, fill, stroke, opacity, box-shadow, transform, filter, -webkit-text-decoration-color, -webkit-backdrop-filter; + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter, -webkit-text-decoration-color, -webkit-backdrop-filter; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} + +.transition-opacity { + transition-property: opacity; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} + +.transition-colors { + transition-property: color, background-color, border-color, fill, stroke, -webkit-text-decoration-color; + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke; + transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, -webkit-text-decoration-color; + transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); + transition-duration: 150ms; +} + +.duration-150 { + transition-duration: 150ms; +} + +.duration-200 { + transition-duration: 200ms; +} + +.duration-300 { + transition-duration: 300ms; +} + +.ease-in { + transition-timing-function: cubic-bezier(0.4, 0, 1, 1); +} + +.ease-out { + transition-timing-function: cubic-bezier(0, 0, 0.2, 1); +} + +.btn { + border-radius: 0.5rem; + padding-top: 0.5rem; + padding-bottom: 0.5rem; + padding-left: 1rem; + padding-right: 1rem; + font-weight: 600; + --tw-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1); + --tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color); + box-shadow: var(--tw-ring-offset-shadow, 0 0 #0000), var(--tw-ring-shadow, 0 0 #0000), var(--tw-shadow); +} + +.btn-green { + --tw-bg-opacity: 1; + background-color: rgb(34 197 94 / var(--tw-bg-opacity)); + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +.btn-green:hover { + --tw-bg-opacity: 1; + background-color: rgb(21 128 61 / var(--tw-bg-opacity)); +} + +.hover\:bg-indigo-600:hover { + --tw-bg-opacity: 1; + background-color: rgb(79 70 229 / var(--tw-bg-opacity)); +} + +.hover\:bg-gray-600:hover { + --tw-bg-opacity: 1; + background-color: rgb(75 85 99 / var(--tw-bg-opacity)); +} + +.hover\:bg-gray-300:hover { + --tw-bg-opacity: 1; + background-color: rgb(209 213 219 / var(--tw-bg-opacity)); +} + +.hover\:bg-indigo-500:hover { + --tw-bg-opacity: 1; + background-color: rgb(99 102 241 / var(--tw-bg-opacity)); +} + +.hover\:bg-gray-700:hover { + --tw-bg-opacity: 1; + background-color: rgb(55 65 81 / var(--tw-bg-opacity)); +} + +.hover\:bg-gray-100:hover { + --tw-bg-opacity: 1; + background-color: rgb(243 244 246 / var(--tw-bg-opacity)); +} + +.hover\:bg-gray-200:hover { + --tw-bg-opacity: 1; + background-color: rgb(229 231 235 / var(--tw-bg-opacity)); +} + +.hover\:bg-gray-400:hover { + --tw-bg-opacity: 1; + background-color: rgb(156 163 175 / var(--tw-bg-opacity)); +} + +.hover\:bg-opacity-25:hover { + --tw-bg-opacity: 0.25; +} + +.hover\:text-white:hover { + --tw-text-opacity: 1; + color: rgb(255 255 255 / var(--tw-text-opacity)); +} + +.hover\:text-gray-100:hover { + --tw-text-opacity: 1; + color: rgb(243 244 246 / var(--tw-text-opacity)); +} + +.hover\:text-indigo-900:hover { + --tw-text-opacity: 1; + color: rgb(49 46 129 / var(--tw-text-opacity)); +} + +.hover\:text-indigo-400:hover { + --tw-text-opacity: 1; + color: rgb(129 140 248 / var(--tw-text-opacity)); +} + +.hover\:underline:hover { + -webkit-text-decoration-line: underline; + text-decoration-line: underline; +} + +.focus\:border-l:focus { + border-left-width: 1px; +} + +.focus\:border-r:focus { + border-right-width: 1px; +} + +.focus\:border-indigo-600:focus { + --tw-border-opacity: 1; + border-color: rgb(79 70 229 / var(--tw-border-opacity)); +} + +.focus\:border-gray-500:focus { + --tw-border-opacity: 1; + border-color: rgb(107 114 128 / var(--tw-border-opacity)); +} + +.focus\:bg-gray-700:focus { + --tw-bg-opacity: 1; + background-color: rgb(55 65 81 / var(--tw-bg-opacity)); +} + +.focus\:bg-white:focus { + --tw-bg-opacity: 1; + background-color: rgb(255 255 255 / var(--tw-bg-opacity)); +} + +.focus\:bg-indigo-500:focus { + --tw-bg-opacity: 1; + background-color: rgb(99 102 241 / var(--tw-bg-opacity)); +} + +.focus\:text-gray-700:focus { + --tw-text-opacity: 1; + color: rgb(55 65 81 / var(--tw-text-opacity)); +} + +.focus\:placeholder-gray-600:focus::-moz-placeholder { + --tw-placeholder-opacity: 1; + color: rgb(75 85 99 / var(--tw-placeholder-opacity)); +} + +.focus\:placeholder-gray-600:focus::placeholder { + --tw-placeholder-opacity: 1; + color: rgb(75 85 99 / var(--tw-placeholder-opacity)); +} + +.focus\:outline-none:focus { + outline: 2px solid transparent; + outline-offset: 2px; +} + +.focus\:ring:focus { + --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color); + --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color); + box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000); +} + +.focus\:ring-indigo-500:focus { + --tw-ring-opacity: 1; + --tw-ring-color: rgb(99 102 241 / var(--tw-ring-opacity)); +} + +.focus\:ring-opacity-40:focus { + --tw-ring-opacity: 0.4; +} + +@media (prefers-color-scheme: dark) { + .dark\:bg-gray-700 { + --tw-bg-opacity: 1; + background-color: rgb(55 65 81 / var(--tw-bg-opacity)); + } +} + +@media (min-width: 640px) { + .sm\:-mx-6 { + margin-left: -1.5rem; + margin-right: -1.5rem; + } + + .sm\:-mx-8 { + margin-left: -2rem; + margin-right: -2rem; + } + + .sm\:mt-0 { + margin-top: 0px; + } + + .sm\:w-64 { + width: 16rem; + } + + .sm\:w-1\/2 { + width: 50%; + } + + .sm\:grid-cols-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + .sm\:flex-row { + flex-direction: row; + } + + .sm\:rounded-lg { + border-radius: 0.5rem; + } + + .sm\:rounded-r-none { + border-top-right-radius: 0px; + border-bottom-right-radius: 0px; + } + + .sm\:rounded-l-none { + border-top-left-radius: 0px; + border-bottom-left-radius: 0px; + } + + .sm\:border-r-0 { + border-right-width: 0px; + } + + .sm\:px-6 { + padding-left: 1.5rem; + padding-right: 1.5rem; + } + + .sm\:px-8 { + padding-left: 2rem; + padding-right: 2rem; + } +} + +@media (min-width: 768px) { + .md\:max-w-md { + max-width: 28rem; + } +} + +@media (min-width: 1024px) { + .lg\:static { + position: static; + } + + .lg\:inset-0 { + top: 0px; + right: 0px; + bottom: 0px; + left: 0px; + } + + .lg\:mx-0 { + margin-left: 0px; + margin-right: 0px; + } + + .lg\:-mx-8 { + margin-left: -2rem; + margin-right: -2rem; + } + + .lg\:flex { + display: flex; + } + + .lg\:hidden { + display: none; + } + + .lg\:h-auto { + height: auto; + } + + .lg\:w-48 { + width: 12rem; + } + + .lg\:max-w-full { + max-width: 100%; + } + + .lg\:translate-x-0 { + --tw-translate-x: 0px; + transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y)); + } + + .lg\:rounded-t-none { + border-top-left-radius: 0px; + border-top-right-radius: 0px; + } + + .lg\:rounded-l { + border-top-left-radius: 0.25rem; + border-bottom-left-radius: 0.25rem; + } + + .lg\:rounded-b-none { + border-bottom-right-radius: 0px; + border-bottom-left-radius: 0px; + } + + .lg\:rounded-r { + border-top-right-radius: 0.25rem; + border-bottom-right-radius: 0.25rem; + } + + .lg\:border-l-0 { + border-left-width: 0px; + } + + .lg\:border-t { + border-top-width: 1px; + } + + .lg\:border-gray-200 { + --tw-border-opacity: 1; + border-color: rgb(229 231 235 / var(--tw-border-opacity)); + } + + .lg\:px-8 { + padding-left: 2rem; + padding-right: 2rem; + } +} + +@media (min-width: 1280px) { + .xl\:mt-0 { + margin-top: 0px; + } + + .xl\:w-1\/3 { + width: 33.333333%; + } +} + diff --git a/index.css b/index.css new file mode 100644 index 0000000..1fa9588 --- /dev/null +++ b/index.css @@ -0,0 +1,12 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + + +.btn { + @apply py-2 px-4 font-semibold rounded-lg shadow-md; +} +.btn-green { + @apply text-white bg-green-500 hover:bg-green-700; +} + diff --git a/index.html b/index.html new file mode 100644 index 0000000..84b61c5 --- /dev/null +++ b/index.html @@ -0,0 +1,16 @@ + + + + + + + + + Dashboard + + +
+
+ + + \ No newline at end of file diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..63f5bf7 --- /dev/null +++ b/readme.md @@ -0,0 +1,5 @@ +# v-dashboard ui wasm +by rust + dioxus + tailwind + +参考vue项目: +https://github.com/wobsoriano/v-dashboard/ \ No newline at end of file diff --git a/src/app.rs b/src/app.rs new file mode 100644 index 0000000..a90408f --- /dev/null +++ b/src/app.rs @@ -0,0 +1,109 @@ +/* + * @Author: plucky + * @Date: 2022-10-11 00:07:29 + * @LastEditTime: 2022-10-15 12:38:33 + * @Description: + */ +#![allow(non_snake_case)] + +use dioxus::prelude::*; +use crate::{components::*, views::*}; + +pub fn app(cx: Scope) -> Element { + cx.render(rsx! { + Router { + self::routes {} + } + }) +} + +/// Routes +fn routes(cx: Scope) -> Element { + cx.render(rsx! { + Route { to: "/", login::view{}} + Route { to: "/dashboard", Home{} } + Route { to: "/ui-elements", Home{} } + Route { to: "/tables", Home{} } + Route { to: "/forms", Home{} } + Route { to: "/cards", Home{} } + Route { to: "/modal", Home{} } + Route { to: "/blank", Home{} } + + Redirect {from: "", to: "/" } + }) +} + +/// Home Page View +fn Home(cx: Scope)->Element{ + let route = use_route(&cx); + + let h = route.last_segment().unwrap_or_default(); + + cx.render(rsx!{ + div { + class: "flex h-screen bg-gray-200 font-roboto", + sidebar::view{} + div { + class: "flex-1 flex flex-col overflow-hidden", + header::view{} + main { + class: "flex-1 overflow-x-hidden overflow-y-auto bg-gray-200", + div { + class: "container mx-auto px-6 py-8", + slot { + i{"{h}"} + match h { + "dashboard" => rsx!{ dashboard::view{} }, + "ui-elements" => rsx!{ ui_elements::view{} }, + "tables" => rsx!{tables::view{} }, + "forms" => rsx!{forms::view{} }, + "cards" => rsx!{card::view{} }, + "modal" => rsx!{modal::view{} }, + "blank" => rsx!{blank::view{} }, + _ => rsx!{ div{}} + } + + } + } + } + } + } + + }) +} + + +// pub fn app2(cx: Scope)->Element{ +// let show_title = true; +// let user_name = Some("bob"); +// cx.render(rsx!{ +// div { +// class: format_args!("text-2xl font-bold {}", show_title.then(|| "text-red-500").unwrap_or("hidden")), +// // Renders nothing by returning None when show_title is false +// show_title.then(|| rsx!{ +// "This is the title" +// }), +// } + +// div { +// // Renders nothing if user_name is None +// user_name.map(|name| rsx!("Hello {name}")) +// } +// }) +// } + +// router 参数解析 +// #[derive(Deserialize)] +// struct Query { name: String } +// // blogpost:post?name=plucky +// fn BlogPost(cx: Scope) -> Element { +// let post = use_route(&cx).segment("post")?; +// let query = use_route(&cx).query::()?; + +// cx.render(rsx!{ +// "Viewing post {post}" +// "Name selected: {query}" +// }) +// } + + diff --git a/src/components/header.rs b/src/components/header.rs new file mode 100644 index 0000000..a618645 --- /dev/null +++ b/src/components/header.rs @@ -0,0 +1,185 @@ +use dioxus::{prelude::{*}}; +use tracing::info; + +use super::sidebar::IS_SIDEBAR_OPEN; + +pub fn view(cx: Scope)->Element{ + //const dropdownOpen = ref(false); + //const { isOpen } = useSidebar(); + let set_sidebar_open = use_set(&cx,IS_SIDEBAR_OPEN); + let dropdown_open = use_state(&cx, || true); + + let dropdown_class = match dropdown_open.get() { + true => "transition duration-150 ease-in transform scale-95 opacity-0", + false => "transition duration-150 ease-out transform scale-100 opacity-100", + }; + + cx.render(rsx!{ + header { + class: "flex items-center justify-between px-6 py-4 bg-white border-b-4 border-indigo-600", + div { + class: "flex items-center", + button{ + class: "text-gray-500 focus:outline-none lg:hidden",// + // @click=\"isOpen = true\"\n + onclick: move |_| { + set_sidebar_open(true); + }, + icons::icon_1{} + } + + div { + class: "relative mx-4 lg:mx-0", + span { + class: "absolute inset-y-0 left-0 flex items-center pl-3 ", + icons::icon_2{} + } + input { + class: "w-32 pl-10 pr-4 text-indigo-600 border-gray-200 rounded-md sm:w-64 focus:border-indigo-600 focus:ring focus:ring-opacity-40 focus:ring-indigo-500", + placeholder: "Search", + r#type: "text", + value: "", + } + + } + } + + div { + class: "flex items-center", + button { + class: "flex mx-4 text-gray-600 focus:outline-none", + icons::icon_3{} + } + + div { + class: "relative", + button{ + class: "relative z-10 block w-8 h-8 overflow-hidden rounded-full shadow focus:outline-none", + // @click=\"dropdownOpen = !dropdownOpen\"\n + onclick: move |_| { + dropdown_open.set(!dropdown_open); + }, + img { + class: "object-cover w-full h-full", + alt: "Your avatar", + src: "https://images.unsplash.com/photo-1528892952291-009c663ce843?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=296&q=80", + } + } + div{ + class:"fixed inset-0 z-10 w-full h-full",// + // v-show: "dropdownOpen", + //@click=\"dropdownOpen = false\" + // 点击屏幕关闭菜单 + hidden: "{dropdown_open}", + onclick: move |_| { + dropdown_open.set(true); + }, + + } + + // + + div{ + class:"absolute right-0 z-20 w-48 py-2 mt-2 bg-white rounded-md shadow-xl {dropdown_class}", + // v-show: "dropdownOpen", + hidden: "{dropdown_open}", + //onmouseout onmouseover + onmouseout: move |_| { + info!("onmouseout"); + }, + // style: "display:block", + + a{ + class:"block px-4 py-2 text-sm text-gray-700 hover:bg-indigo-600 hover:text-white", + href:"#", + "Profile" + } + a{ + class:"block px-4 py-2 text-sm text-gray-700 hover:bg-indigo-600 hover:text-white", + href:"#", + "Products" + } + + a{ + class:"block px-4 py-2 text-sm text-gray-700 hover:bg-indigo-600 hover:text-white", + href:"/", + "Log out" + } + + } + } + + // + } + } + + }) +} + +mod icons{ + use dioxus::prelude::*; + + pub fn icon_1(cx: Scope)->Element{ + cx.render(rsx!{ + svg{ + class:"w-6 h-6", + view_box:"0 0 24 24", + fill:"none", + xmlns:"http://www.w3.org/2000/svg", + path{ + d:"M4 6H20M4 12H20M4 18H11", + stroke:"currentColor", + stroke_width:"2", + stroke_linecap:"round", + stroke_linejoin:"round", + } + + } + }) + } + + pub fn icon_2(cx: Scope)->Element{ + cx.render(rsx!{ + svg{ + class:"w-5 h-5 text-gray-500", + view_box:"0 0 24 24", + fill:"none", + xmlns:"http://www.w3.org/2000/svg", + path{ + d:"M21 21L15 15M17 10C17 13.866 13.866 17 10 17C6.13401 17 3 13.866 3 10C3 6.13401 6.13401 3 10 3C13.866 3 17 6.13401 17 10Z", + stroke:"currentColor", + stroke_width:"2", + stroke_linecap:"round", + stroke_linejoin:"round", + } + } + }) + } + + pub fn icon_3(cx: Scope)->Element{ + cx.render(rsx!{ + svg{ + class:"w-6 h-6", + view_box:"0 0 24 24", + fill:"none", + xmlns:"http://www.w3.org/2000/svg", + path{ + d:"M15 17H20L18.5951 15.5951C18.2141 15.2141 18 14.6973 18 14.1585V11C18 8.38757 16.3304 6.16509 14 5.34142V5C14 3.89543 13.1046 3 12 3C10.8954 3 10 3.89543 10 5V5.34142C7.66962 6.16509 6 8.38757 6 11V14.1585C6 14.6973 5.78595 15.2141 5.40493 15.5951L4 17H9M15 17V18C15 19.6569 13.6569 21 12 21C10.3431 21 9 19.6569 9 18V17M15 17H9", + stroke:"currentColor", + stroke_width:"2", + stroke_linecap:"round", + stroke_linejoin:"round", + } + } + }) + } + + +} \ No newline at end of file diff --git a/src/components/mod.rs b/src/components/mod.rs new file mode 100644 index 0000000..f365b23 --- /dev/null +++ b/src/components/mod.rs @@ -0,0 +1,20 @@ +/* + * @Author: plucky + * @Date: 2022-10-11 23:13:17 + * @LastEditTime: 2022-10-14 12:33:51 + * @Description: + */ + + + +pub mod header; +pub mod sidebar; + + +// pub fn view(cx: Scope)->Element{ + +// cx.render(rsx!{ +// div { +// } +// }) +// } \ No newline at end of file diff --git a/src/components/sidebar.rs b/src/components/sidebar.rs new file mode 100644 index 0000000..80a723d --- /dev/null +++ b/src/components/sidebar.rs @@ -0,0 +1,267 @@ +/* + * @Author: plucky + * @Date: 2022-10-11 18:53:17 + * @LastEditTime: 2022-10-15 14:17:49 + * @Description: + */ + +use dioxus::{prelude::{*}}; +use dioxus::prelude::Atom; + +pub static IS_SIDEBAR_OPEN: Atom = |_| false; + +pub fn view(cx:Scope)->Element{ + let route = use_route(&cx); + let route_name = route.last_segment().unwrap_or_default(); + + let set_sidebar_open = use_set(&cx,IS_SIDEBAR_OPEN); + let is_open = use_read(&cx,IS_SIDEBAR_OPEN); + + let highlight_class = |e:&str|{ + match e == route_name { + true => "flex items-center px-6 py-2 mt-4 duration-200 border-l-4 bg-gray-600 bg-opacity-25 text-gray-100 border-gray-100", + false => "flex items-center px-6 py-2 mt-4 duration-200 border-l-4 border-gray-900 text-gray-500 hover:bg-gray-600 hover:bg-opacity-25 hover:text-gray-100", + } + }; + + cx.render(rsx!( + div{ + class:"flex", + div{ + // :class="isOpen ? 'block' : 'hidden'" + // @click="isOpen = false" + onclick: move |_| { + set_sidebar_open(false); + }, + // class:"fixed inset-0 z-20 transition-opacity bg-black opacity-50 lg:hidden", + class: format_args!("fixed inset-0 z-20 transition-opacity bg-black opacity-50 lg:hidden {}",if *is_open {"block"} else {"hidden"}), + // hidden: format_args!("{}",!is_open), + + } + div{ + // :class="isOpen ? 'translate-x-0 ease-out' : '-translate-x-full ease-in'" + // class:"fixed inset-y-0 left-0 z-30 w-64 overflow-y-auto transition duration-300 transform bg-gray-900 lg:translate-x-0 lg:static lg:inset-0", + class: format_args!("fixed inset-y-0 left-0 z-30 w-64 overflow-y-auto transition duration-300 transform bg-gray-900 lg:translate-x-0 lg:static lg:inset-0 {}", + if !*is_open { "-translate-x-full ease-in" } else { "translate-x-0 ease-out" }), + div { + class: "flex items-center justify-center mt-8 ", + div { + class: "flex items-center", + icons::icon_1 {} + span { + class: "mx-2 text-2xl font-semibold text-white", + "Dashboard" + } + } + } + + nav{ + class: "mt-10", + // router-link + Link{ + class: highlight_class + ("dashboard"), + //to="/dashboard" + to: "/dashboard", + icons::icon_2 {} + span{class:"mx-4","Dashboard"} + } + Link{ + class: highlight_class + ("ui-elements"), + to: "/ui-elements", + icons::icon_3 {} + span{class:"mx-4","UI Elements"} + } + Link{ + class: highlight_class + ("tables"), + to: "/tables", + icons::icon_4 {} + span{class:"mx-4","Tables"} + } + Link{ + class: highlight_class + ("forms"), + to: "/forms", + icons::icon_5 {} + span{class:"mx-4","Forms"} + } + Link{ + class: highlight_class + ("cards"), + to: "/cards", + icons::icon_6 {} + span{class:"mx-4","Cards"} + } + Link{ + class: highlight_class + ("modal"), + to: "/modal", + icons::icon_7 {} + span{class:"mx-4","Modal"} + } + + Link{ + class: highlight_class + ("blank"), + to: "/blank", + icons::icon_8 {} + span{class:"mx-4","Blank"} + } + + + } + + } + + } + )) + +} + +mod icons{ + use dioxus::prelude::*; + use dioxus_html_macro::html; + + pub fn icon_1(cx: Scope)->Element{ + cx.render(html!{ + + + + + }) + } + pub fn icon_2(cx:Scope)->Element{ + cx.render(html!{ + + + + + }) + } + + pub fn icon_3(cx:Scope)->Element{ + cx.render(html!( + + + + + + + )) + } + + pub fn icon_4(cx:Scope)->Element{ + cx.render(html!( + + + + + + )) + } + + pub fn icon_5(cx:Scope)->Element{ + cx.render(html!( + + + + + )) + } + + pub fn icon_6(cx:Scope)->Element{ + cx.render(html!( + + + + + )) + } + + pub fn icon_7(cx:Scope)->Element{ + cx.render(html!( + + + + + + )) + } + + pub fn icon_8(cx:Scope)->Element{ + cx.render(html!( + + + + )) + } +} + diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..0a8fec6 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,12 @@ +/* + * @Author: plucky + * @Date: 2022-10-11 00:07:45 + * @LastEditTime: 2022-10-14 16:52:30 + * @Description: + */ + +pub mod app; +pub mod components; +pub mod views; +pub mod modules; + diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..58b192e --- /dev/null +++ b/src/main.rs @@ -0,0 +1,16 @@ +/* + * @Author: plucky + * @Date: 2022-10-10 23:58:17 + * @LastEditTime: 2022-10-15 14:02:24 + * @Description: + */ + +use r_dashboard::app::*; + + +// trunk serve +fn main() { + console_error_panic_hook::set_once(); + tracing_wasm::set_as_global_default(); + dioxus::web::launch(app); +} diff --git a/src/modules/demo_data.rs b/src/modules/demo_data.rs new file mode 100644 index 0000000..6c90f98 --- /dev/null +++ b/src/modules/demo_data.rs @@ -0,0 +1,82 @@ +/* + * @Author: plucky + * @Date: 2022-10-14 18:11:55 + * @LastEditTime: 2022-10-14 23:48:07 + * @Description: + */ + +use dioxus::prelude::Atom; + +use super::*; + + +pub struct UseTableData{ + pub simpleTableData: Vec, + pub paginatedTableData: Vec, + pub wideTableData: Vec, + +} + +/// 表格测试数据 for tables +pub static USE_TABLE_DATA: Atom = |_| { + UseTableData{ + simpleTableData: vec![ + SimpleTableData{ + city: "New York".to_string(), + totalOrders: "200,120".to_string(), + }, + SimpleTableData{ + city: "Manchester".to_string(), + totalOrders: "632,310".to_string(), + }, + SimpleTableData{ + city: "London".to_string(), + totalOrders: "1,200,120".to_string(), + }, + ], + paginatedTableData: vec![ + PaginatedTableData{ + picture: "https://images.unsplash.com/photo-1494790108377-be9c29b29330?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2.2&w=160&h=160&q=80".to_string(), + name: "Vera Carpenter".to_string(), + role: "Admin".to_string(), + created: "Jan 21, 2020".to_string(), + status: "Active".to_string(), + statusColor: "green".to_string(), + }, + PaginatedTableData{ + picture: "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2.2&w=160&h=160&q=80".to_string(), + name: "Blake Bowman".to_string(), + role: "Editor".to_string(), + created: "Jan 01, 2020".to_string(), + status: "Active".to_string(), + statusColor: "green".to_string(), + }, + PaginatedTableData{ + picture: "https://images.unsplash.com/photo-1540845511934-7721dd7adec3?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2.2&w=160&h=160&q=80".to_string(), + name: "Dana Moore".to_string(), + role: "Editor".to_string(), + created: "Jan 10, 2020".to_string(), + status: "Suspended".to_string(), + statusColor: "orange".to_string(), + }, + PaginatedTableData{ + picture: "https://images.unsplash.com/photo-1522609925277-66fea332c575?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2.2&h=160&w=160&q=80".to_string(), + name: "Alonzo Cox".to_string(), + role: "Admin".to_string(), + created: "Jan 18, 2020".to_string(), + status: "Inactive".to_string(), + statusColor: "red".to_string(), + }, + ], + wideTableData: (0..5).map(|_i| { + WideTableData { + name: "John Doe".into(), + email: "john@example.com".into(), + title: "Software Engineer".into(), + title2: "Web dev".into(), + status: "Active".into(), + role: "Owner".into(), + } + }).collect(), + } +}; \ No newline at end of file diff --git a/src/modules/mod.rs b/src/modules/mod.rs new file mode 100644 index 0000000..f399819 --- /dev/null +++ b/src/modules/mod.rs @@ -0,0 +1,40 @@ +#![allow(non_snake_case)] + +pub mod demo_data; + +/// USERS for dashboard +#[derive(Debug )] +pub struct User { + pub name: String, + pub email: String, + pub title: String, + pub title2: String, + pub status: String, + pub role: String, +} + +/// simple data for talbes +pub struct SimpleTableData { + pub city: String, + pub totalOrders: String, +} + + +pub struct PaginatedTableData { + pub picture: String, + pub name: String, + pub role: String, + pub created: String, + pub status: String, + pub statusColor: String, +} + + +pub struct WideTableData { + pub name: String, + pub email: String, + pub title: String, + pub title2: String, + pub status: String, + pub role: String, +} \ No newline at end of file diff --git a/src/views/blank.rs b/src/views/blank.rs new file mode 100644 index 0000000..a08ebd1 --- /dev/null +++ b/src/views/blank.rs @@ -0,0 +1,17 @@ +/* + * @Author: plucky + * @Date: 2022-10-15 09:52:33 + * @LastEditTime: 2022-10-15 09:58:23 + * @Description: + */ + +use dioxus::prelude::*; +use dioxus_html_macro::html; + +pub fn view(cx: Scope)->Element{ + + cx.render(html!{ +

"Blank Page"

+ + }) +} diff --git a/src/views/card.rs b/src/views/card.rs new file mode 100644 index 0000000..ef5c0ce --- /dev/null +++ b/src/views/card.rs @@ -0,0 +1,137 @@ +/* + * @Author: plucky + * @Date: 2022-10-15 09:47:37 + * @LastEditTime: 2022-10-15 09:51:33 + * @Description: + */ +use dioxus::prelude::*; + +pub fn view(cx: Scope)->Element{ + + cx.render(rsx!{ + div { + h3 { + class: "text-3xl font-semibold text-gray-700", + "Card" + } + div { + class: "mt-4 mb-3", + h4 { + class: "text-gray-700", + "Stacked" + } + div { + class: "max-w-sm mt-6 overflow-hidden bg-white rounded shadow-lg", + img { + class: "w-full", + alt: "Sunset in the mountains", + src: "https://picsum.photos/id/1016/384/234", + } + div { + class: "px-6 py-4", + div { + class: "mb-2 text-xl font-bold text-gray-900", + "The Coldest Sunset" + } + p { + class: "text-base text-gray-700", + "Lorem ipsum dolor sit amet, consectetur adipisicing elit.\n Voluptatibus quia, nulla! Maiores et perferendis eaque,\n exercitationem praesentium nihil." + } + } + div { + class: "px-6 pt-4 pb-2", + span { + class: "inline-block px-3 py-1 mb-2 mr-2 text-sm font-semibold text-gray-700 bg-gray-200 rounded-full", + "#photography" + } + span { + class: "inline-block px-3 py-1 mb-2 mr-2 text-sm font-semibold text-gray-700 bg-gray-200 rounded-full", + "#travel" + } + span { + class: "inline-block px-3 py-1 mb-2 mr-2 text-sm font-semibold text-gray-700 bg-gray-200 rounded-full", + "#winter" + } + } + } + } + hr { + + } + div { + class: "mt-5", + h4 { + class: "text-gray-700", + "Horizontal" + } + div { + class: "w-full max-w-sm mt-6 lg:max-w-full lg:flex", + div { + class: "flex-none h-48 overflow-hidden text-center bg-cover rounded-t lg:h-auto lg:w-48 lg:rounded-t-none lg:rounded-l", + style: "background-image: url('https://picsum.photos/id/0/192/213')", + title: "Woman holding a mug", + } + div { + class: "flex flex-col justify-between p-4 leading-normal bg-white border-b border-l border-r border-gray-200 rounded-b lg:border-l-0 lg:border-t lg:border-gray-200 lg:rounded-b-none lg:rounded-r", + div { + class: "mb-8", + p { + class: "flex items-center text-sm text-gray-600", + icons::icon_1 {} + "Members only" + } + div { + class: "mb-2 text-xl font-bold text-gray-900", + "Can coffee make you a better developer?" + } + p { + class: "text-base text-gray-700", + "Lorem ipsum dolor sit amet, consectetur adipisicing elit.\n Voluptatibus quia, nulla! Maiores et perferendis eaque,\n exercitationem praesentium nihil." + } + } + div { + class: "flex items-center", + img { + class: "w-10 h-10 mr-4 rounded-full", + alt: "Avatar of Jonathan Reinink", + src: "https://via.placeholder.com/50", + } + div { + class: "text-sm", + p { + class: "leading-none text-gray-900", + "Jonathan Reinink" + } + p { + class: "text-gray-600", + "Aug 18" + } + } + } + } + } + } + } + }) +} + +mod icons{ + use dioxus::prelude::*; + use dioxus_html_macro::html; + + pub fn icon_1(cx: Scope)->Element{ + cx.render(html!{ + + + + }) + } + + +} \ No newline at end of file diff --git a/src/views/dashboard.rs b/src/views/dashboard.rs new file mode 100644 index 0000000..90bbba1 --- /dev/null +++ b/src/views/dashboard.rs @@ -0,0 +1,318 @@ +/* + * @Author: plucky + * @Date: 2022-10-14 12:31:43 + * @LastEditTime: 2022-10-14 23:48:22 + * @Description: + */ + + +use dioxus::prelude::*; + +use crate::modules::User; + +// test data +pub static USERS: Atom> = |_| { + (0..5).map(|_i| { + User { + name: "John Doe".into(), + email: "john@example.com".into(), + title: "Software Engineer".into(), + title2: "Web dev".into(), + status: "Active".into(), + role: "Owner".into(), + } + }).collect() +}; + +pub fn view(cx: Scope)->Element{ + let users = use_read(&cx, USERS); + + cx.render(rsx!{ + div { + h3 { + class: "text-3xl font-medium text-gray-700", + "Dashboard" + } + div { + class: "mt-4", + div { + class: "flex flex-wrap -mx-6", + div { + class: "w-full px-6 sm:w-1/2 xl:w-1/3", + div { + class: "flex items-center px-5 py-6 bg-white rounded-md shadow-sm", + div { + class: "p-3 bg-indigo-600 bg-opacity-75 rounded-full", + icons::icon_1 {} + } + div { + class: "mx-5", + h4 { + class: "text-2xl font-semibold text-gray-700", + "8,282" + } + div { + class: "text-gray-500", + "New Users" + } + } + } + } + div { + class: "w-full px-6 mt-6 sm:w-1/2 xl:w-1/3 sm:mt-0", + div { + class: "flex items-center px-5 py-6 bg-white rounded-md shadow-sm", + div { + class: "p-3 bg-blue-600 bg-opacity-75 rounded-full", + icons::icon_2 {} + } + div { + class: "mx-5", + h4 { + class: "text-2xl font-semibold text-gray-700", + "200,521" + } + div { + class: "text-gray-500", + "Total Orders" + } + } + } + } + div { + class: "w-full px-6 mt-6 sm:w-1/2 xl:w-1/3 xl:mt-0", + div { + class: "flex items-center px-5 py-6 bg-white rounded-md shadow-sm", + div { + class: "p-3 bg-pink-600 bg-opacity-75 rounded-full", + icons::icon_3 {} + } + div { + class: "mx-5", + h4 { + class: "text-2xl font-semibold text-gray-700", + "215,542" + } + div { + class: "text-gray-500", + "Available Products" + } + } + } + } + } + } + div { + class: "mt-8", + + } + + div { + class: "flex flex-col mt-8", + div { + class: "py-2 -my-2 overflow-x-auto sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8", + div { + class: "inline-block min-w-full overflow-hidden align-middle border-b border-gray-200 shadow sm:rounded-lg", + table { + class: "min-w-full", + thead { + tr { + th { + class: "px-6 py-3 text-xs font-medium leading-4 tracking-wider text-left text-gray-500 uppercase border-b border-gray-200 bg-gray-50", + "Name" + } + th { + class: "px-6 py-3 text-xs font-medium leading-4 tracking-wider text-left text-gray-500 uppercase border-b border-gray-200 bg-gray-50", + "Title" + } + th { + class: "px-6 py-3 text-xs font-medium leading-4 tracking-wider text-left text-gray-500 uppercase border-b border-gray-200 bg-gray-50", + "Status" + } + th { + class: "px-6 py-3 text-xs font-medium leading-4 tracking-wider text-left text-gray-500 uppercase border-b border-gray-200 bg-gray-50", + "Role" + } + th { + class: "px-6 py-3 border-b border-gray-200 bg-gray-50", + + } + } + } + // 表格数据 + tbody { + class: "bg-white", + // "" + users.iter().map(|u|{ + rsx!{ UserList{user:u}} + }) + + } + } + } + } + } + } + }) +} + +// #[derive(PartialEq, Props)] +// pub struct UserListProps<'a>{ +// user: &'a User, +// } + +#[allow(non_snake_case)] +#[inline_props] +pub fn UserList<'a>(cx: Scope, user: &'a User) -> Element { + // let u = cx.props.user; + let u = user; + cx.render(rsx!{ + tr { + // key: "{index}", + td { + class: "px-6 py-4 border-b border-gray-200 whitespace-nowrap", + div { + class: "flex items-center", + div { + class: "flex-shrink-0 w-10 h-10", + img { + class: "w-10 h-10 rounded-full", + alt: "", + src: "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80", + } + } + div { + class: "ml-4", + div { + class: "text-sm font-medium leading-5 text-gray-900", + "{ u.name }" + } + div { + class: "text-sm leading-5 text-gray-500", + "{ u.email }" + } + } + } + } + td { + class: "px-6 py-4 border-b border-gray-200 whitespace-nowrap", + div { + class: "text-sm leading-5 text-gray-900", + "{ u.title }" + } + div { + class: "text-sm leading-5 text-gray-500", + "{ u.title2 }" + } + } + td { + class: "px-6 py-4 border-b border-gray-200 whitespace-nowrap", + span { + class: "inline-flex px-2 text-xs font-semibold leading-5 text-green-800 bg-green-100 rounded-full", + "{ u.status }" + } + } + td { + class: "px-6 py-4 text-sm leading-5 text-gray-500 border-b border-gray-200 whitespace-nowrap", + "{ u.role }" + } + td { + class: "px-6 py-4 text-sm font-medium leading-5 text-right border-b border-gray-200 whitespace-nowrap", + a { + class: "text-indigo-600 hover:text-indigo-900", + href: "#","Edit" + } + } + } + }) +} + +mod icons{ + use dioxus::prelude::*; + use dioxus_html_macro::html; + + pub fn icon_1(cx: Scope)->Element{ + cx.render(html!{ + + + + + + + + + }) + } + + pub fn icon_2(cx: Scope)->Element{ + cx.render(html!{ + + + + + + }) + } + + pub fn icon_3(cx: Scope)->Element{ + cx.render(html!{ + + + + + }) + } + +} \ No newline at end of file diff --git a/src/views/forms.rs b/src/views/forms.rs new file mode 100644 index 0000000..5858ee1 --- /dev/null +++ b/src/views/forms.rs @@ -0,0 +1,263 @@ +/* + * @Author: plucky + * @Date: 2022-10-15 00:32:59 + * @LastEditTime: 2022-10-15 09:45:50 + * @Description: + */ + +#![allow(non_snake_case)] +use dioxus::prelude::*; +use tracing::info; + +#[derive(Debug, Default)] +struct User { + pub username: String, + pub email: String, + pub password: String, + pub confirm: String, +} + +pub fn view(cx: Scope)->Element{ + + cx.render(rsx!{ + div { + h3 { + class: "text-3xl font-semibold text-gray-700", + "Forms" + } + + // Modal Form + Model_form{} + + // Form Elements + Forms{} + + } + }) +} + + +// Model Form +fn Model_form(cx: Scope)->Element{ + + cx.render(rsx!{ + div { + class: "mt-4", + h4 { + class: "text-gray-600", + "Model Form" + } + div { + class: "mt-4", + div { + class: "w-full max-w-sm overflow-hidden bg-white border rounded-md shadow-md", + // form + form { + div { + class: "flex items-center justify-between px-5 py-3 text-gray-700 border-b", + h3 { + class: "text-sm", + "Add Category" + } + button { + r#type: "button", + onclick: |_| { + + }, + icons::icon_1 {} + } + } + div { + class: "px-5 py-6 text-gray-700 bg-gray-200 border-b", + label { + class: "text-xs", + "Name" + } + div { + class: "relative mt-2 rounded-md shadow-sm", + span { + class: "absolute inset-y-0 left-0 flex items-center pl-3 text-gray-600", + icons::icon_2 {} + } + input { + class: "w-full px-12 py-2 border-transparent rounded-md appearance-none focus:border-indigo-600 focus:ring focus:ring-opacity-40 focus:ring-indigo-500", + r#type: "text", + } + } + } + div { + class: "flex items-center justify-between px-5 py-3", + button { + r#type: "button", + onclick: |_| { + info!("click"); + + }, + class: "px-3 py-1 text-sm text-gray-700 bg-gray-200 rounded-md hover:bg-gray-300 focus:outline-none", + "Cancel" + } + button { + class: "px-3 py-1 text-sm text-white bg-indigo-600 rounded-md hover:bg-indigo-500 focus:outline-none", + "Save" + } + } + } + } + } + } + }) +} + +// Forms +fn Forms(cx: Scope)->Element{ + let user = use_ref(&cx, || User::default()); + let ur = user.read(); + + cx.render(rsx!{ + div { + class: "mt-8", + h4 { + class: "text-gray-600", + "Forms" + } + div { + class: "mt-4", + div { + class: "p-6 bg-white rounded-md shadow-md", + h2 { + class: "text-lg font-semibold text-gray-700 capitalize", + "Account settings" + } + + form{ + //action="" methods="post" + prevent_default: "onsubmit", + onsubmit: move |e|{ + info!("onsubmit: {:?}", e); + info!("onsubmit: {:?}", user.read()); + }, + + div { + class: "grid grid-cols-1 gap-6 mt-4 sm:grid-cols-2", + div { + label { + class: "text-gray-700", + r#for: "username","Username" + } + input { + class: "w-full mt-2 border-gray-200 rounded-md focus:border-indigo-600 focus:ring focus:ring-opacity-40 focus:ring-indigo-500", + r#type: "text", + // "v-model: "user.username", + // 双向绑定 + value: "{ur.username}", + oninput: {|e|{ + // info!("oninput{:?}", e); + user.write().username=e.value.to_string(); + }}, + + } + } + div { + label { + class: "text-gray-700", + r#for: "emailAddress","Email Address" + } + input { + class: "w-full mt-2 border-gray-200 rounded-md focus:border-indigo-600 focus:ring focus:ring-opacity-40 focus:ring-indigo-500", + r#type: "email", + // "v-model": "user.email", + value: "{ur.email}", + oninput: {|e|{ + user.write().email=e.value.to_string(); + }}, + } + } + div { + label { + class: "text-gray-700", + r#for: "password","Password" + } + input { + class: "w-full mt-2 border-gray-200 rounded-md focus:border-indigo-600 focus:ring focus:ring-opacity-40 focus:ring-indigo-500", + r#type: "password", + // "v-model": "user.password", + value: "{ur.password}", + oninput: {|e|{ + user.write().password=e.value.to_string(); + }}, + } + } + div { + label { + class: "text-gray-700", + r#for: "passwordConfirmation","Password Confirmation" + } + input { + class: "w-full mt-2 border-gray-200 rounded-md focus:border-indigo-600 focus:ring focus:ring-opacity-40 focus:ring-indigo-500", + r#type: "password", + // "v-model": "user.confirm", + value: "{ur.confirm}", + oninput: {|e|{ + user.write().confirm=e.value.to_string(); + }}, + } + } + } + div { + class: "flex justify-end mt-4", + button { + r#type: "submit", + class: "px-4 py-2 text-gray-200 bg-gray-800 rounded-md hover:bg-gray-700 focus:outline-none focus:bg-gray-700", + "Save" + } + } + } + } + } + } + }) +} + +mod icons{ + use dioxus::prelude::*; + use dioxus_html_macro::html; + + pub fn icon_1(cx: Scope)->Element{ + cx.render(html!{ + + + + }) + } + + pub fn icon_2(cx: Scope)->Element{ + cx.render(html!{ + + + + }) + } + + + +} \ No newline at end of file diff --git a/src/views/login.rs b/src/views/login.rs new file mode 100644 index 0000000..2dcd48b --- /dev/null +++ b/src/views/login.rs @@ -0,0 +1,138 @@ +/* + * @Author: plucky + * @Date: 2022-10-12 00:00:54 + * @LastEditTime: 2022-10-14 16:54:55 + * @Description: + */ +use dioxus::prelude::*; + +pub fn view(cx: Scope)->Element{ + let email = use_state(&cx, ||"".to_string()); + let password = use_state(&cx, ||"".to_string()); + // function login() { + // router.push("/dashboard"); + // } + let router = use_router(&cx); + + cx.render(rsx!{ + div { + class: "flex items-center justify-center h-screen px-6 bg-gray-200", + div { + class: "w-full max-w-sm p-6 bg-white rounded-md shadow-md", + div { + class: "flex items-center justify-center", + icons::icon_1 {} + span { + class: "text-2xl font-semibold text-gray-700", + "V-Dashboard" + } + } + + form{ + class: "mt-4", + //@submit.prevent="login" + onsubmit: move |_|{ + // login(); + router.push_route("/dashboard", None, None); + }, + label { + class: "block", + span { + class: "text-sm text-gray-700", + "Email" + } + input { + class: "block w-full mt-1 border-gray-200 rounded-md focus:border-indigo-600 focus:ring focus:ring-opacity-40 focus:ring-indigo-500", + r#type: "email", + // "v-model": "email", + placeholder: "Enter your email", + // value: "{email}", + oninput: move |e| { + email.set(e.value.clone()); + }, + } + } + label { + class: "block mt-3", + span { + class: "text-sm text-gray-700", + "Password" + } + input { + class: "block w-full mt-1 border-gray-200 rounded-md focus:border-indigo-600 focus:ring focus:ring-opacity-40 focus:ring-indigo-500", + r#type: "password", + // "v-model": "password", + placeholder: "Enter your password", + value: "{password}", + oninput: move |e| { + password.set(e.value.clone()); + }, + } + } + div { + class: "flex items-center justify-between mt-4", + div { + label { + class: "inline-flex items-center", + input { + class: "text-indigo-600 border-gray-200 rounded-md focus:border-indigo-600 focus:ring focus:ring-opacity-40 focus:ring-indigo-500", + r#type: "checkbox", + } + span { + class: "mx-2 text-sm text-gray-600", + "Remember me" + } + } + } + div { + a { + class: "block text-sm text-indigo-700 fontme hover:underline", + href: "#", "Forgot your password?" + } + } + } + div { + class: "mt-6", + button { + class: "w-full px-4 py-2 text-sm text-center text-white bg-indigo-600 rounded-md focus:outline-none hover:bg-indigo-500", + r#type: "submit", "Sign in" + } + } + } + } + } + }) +} + + + +mod icons{ + use dioxus::prelude::*; + use dioxus_html_macro::html; + + pub fn icon_1(cx: Scope)->Element{ + cx.render(html!{ + + + + + }) + } + + +} \ No newline at end of file diff --git a/src/views/mod.rs b/src/views/mod.rs new file mode 100644 index 0000000..83a1885 --- /dev/null +++ b/src/views/mod.rs @@ -0,0 +1,25 @@ +/* + * @Author: plucky + * @Date: 2022-10-11 23:13:24 + * @LastEditTime: 2022-10-15 09:53:40 + * @Description: + */ + + +pub mod login; +pub mod dashboard; +pub mod ui_elements; +pub mod tables; +pub mod forms; +pub mod card; +pub mod modal; +pub mod blank; + + +// pub fn view(cx: Scope)->Element{ + +// cx.render(rsx!{ +// div { +// } +// }) +// } diff --git a/src/views/modal.rs b/src/views/modal.rs new file mode 100644 index 0000000..3c685d3 --- /dev/null +++ b/src/views/modal.rs @@ -0,0 +1,126 @@ +/* + * @Author: plucky + * @Date: 2022-10-15 09:52:14 + * @LastEditTime: 2022-10-15 11:24:14 + * @Description: + */ + +use dioxus::prelude::*; + +pub fn view(cx: Scope)->Element{ + let open = use_state(&cx, || false); + // let modal = "transition: opacity 0.25s ease"; + + cx.render(rsx!{ + div { + h3 { + class: "text-3xl font-medium text-gray-700", + "Modal" + } + // open modal + button { + onclick: move |_| { + open.set(true); + }, + class: "px-6 py-3 mt-3 font-medium tracking-wide text-white bg-indigo-600 rounded-md hover:bg-indigo-500 focus:outline-none", + "Open Modal", + } + + // Modal + div{ + class: format_args!("transition:opacity 0.25s ease {}", if !open.get(){"opacity-0 pointer-events-none"}else{"z-50 fixed w-full h-full top-0 left-0 flex items-center justify-center"}), + // overlay + div{ + class: "absolute w-full h-full bg-gray-900 opacity-50 modal-overlay", + } + + + // + div { + class: "z-50 w-11/12 mx-auto overflow-y-auto bg-white rounded shadow-lg modal-container md:max-w-md", + // 右上角关闭按钮 + div { + onclick: move |_| { + open.set(false); + }, + class: "absolute top-0 right-0 z-50 flex flex-col items-center mt-4 mr-4 text-sm text-white cursor-pointer modal-close", + icons::icon_1 {} + span { + class: "text-sm", + "(Esc)" + } + } + + // + div { + class: "px-6 py-4 text-left modal-content", + // + div { + class: "flex items-center justify-between pb-3", + p { + class: "text-2xl font-bold", + "Modal Title" + } + div{ + class: "z-50 cursor-pointer modal-close", + onclick: move |_| { + open.set(false); + }, + icons::icon_1 {} + } + + } + + // + p {"Modal content."} + + // + div { + class: "flex justify-end pt-2", + button { + onclick: move |_| { + open.set(false); + }, + class: "p-3 px-6 py-3 mr-2 text-indigo-500 bg-transparent rounded-lg hover:bg-gray-100 hover:text-indigo-400 focus:outline-none", + "Close" + } + button { + onclick: move |_| { + open.set(false); + }, + class: "px-6 py-3 font-medium tracking-wide text-white bg-indigo-600 rounded-md hover:bg-indigo-500 focus:outline-none", + "Action" + } + } + } + } + } + } + }) +} + + +mod icons{ + use dioxus::prelude::*; + use dioxus_html_macro::html; + + pub fn icon_1(cx: Scope)->Element{ + cx.render(html!{ + + + + }) + } + + +} \ No newline at end of file diff --git a/src/views/tables.rs b/src/views/tables.rs new file mode 100644 index 0000000..d40a8e3 --- /dev/null +++ b/src/views/tables.rs @@ -0,0 +1,458 @@ +/* + * @Author: plucky + * @Date: 2022-10-14 17:43:39 + * @LastEditTime: 2022-10-15 00:21:14 + * @Description: + */ +#![allow(non_snake_case)] +use dioxus::prelude::*; + +use crate::modules::demo_data::USE_TABLE_DATA; + +pub fn view(cx: Scope)->Element{ + + cx.render(rsx!{ + div { + h3 { + class: "text-3xl font-medium text-gray-700", + "Tables" + } + // Simple Table + Simple_table{} + + // Table with pagination + Table_with_pagination{} + + // Wide Table + Wide_table{} + } + }) +} + +// Simple Table +fn Simple_table(cx: Scope)->Element{ + let simple_table_data = &use_read(&cx, USE_TABLE_DATA).simpleTableData; + + cx.render(rsx!{ + div { + class: "mt-4", + h4 { + class: "text-gray-600", + "Simple Table" + } + div { + class: "mt-6", + div { + class: "my-6 overflow-hidden bg-white rounded-md shadow", + table { + class: "w-full text-left border-collapse", + thead { + class: "border-b", + tr { + th { + class: "px-5 py-3 text-sm font-medium text-gray-100 uppercase bg-indigo-800", + "City" + } + th { + class: "px-5 py-3 text-sm font-medium text-gray-100 uppercase bg-indigo-800", + "Total orders" + } + } + } + // data + tbody { + simple_table_data.iter().enumerate().map(|(i,data)|{ + rsx!{ tr { + class: "hover:bg-gray-200", + key: "{i}", + td { + class: "px-6 py-4 text-lg text-gray-700 border-b", + "{data.city}" + } + td { + class: "px-6 py-4 text-gray-500 border-b", + "{data.totalOrders}" + } + } + } + }) + + } + } + } + } + } + }) +} + +// 分页 table +// Table with pagination +fn Table_with_pagination(cx: Scope)->Element{ + let paginated_table_data = &use_read(&cx, USE_TABLE_DATA).paginatedTableData; + + let status_color = |status: &str| { + match status { + "Active" => ("bg-green-100", "text-green-800"), + "Inactive" => ("bg-red-100", "text-red-800"), + "Suspended" => ("bg-orange-100", "text-orange-800"), + _ => ("bg-gray-100", "text-gray-800"), + } + }; + + cx.render(rsx!{ + div { + class: "mt-8", + h4 { + class: "text-gray-600", + "Table with pagination" + } + div { + class: "mt-6", + h2 { + class: "text-xl font-semibold leading-tight text-gray-700", + "Users" + } + // limit + div { + class: "flex flex-col mt-3 sm:flex-row", + div { + class: "flex", + div { + class: "relative", + select { + class: "block w-full h-full px-4 py-2 pr-8 leading-tight text-gray-700 bg-white border border-gray-400 rounded-l appearance-none focus:outline-none focus:bg-white focus:border-gray-500", + option { + "5" + } + option { + "10" + } + option { + "20" + } + } + div { + class: "absolute inset-y-0 right-0 flex items-center px-2 text-gray-700 pointer-events-none", + icons::icon_1 {} + } + } + + div { + class: "relative", + select { + class: "block w-full h-full px-4 py-2 pr-8 leading-tight text-gray-700 bg-white border-t border-b border-r border-gray-400 rounded-r appearance-none sm:rounded-r-none sm:border-r-0 focus:outline-none focus:border-l focus:border-r focus:bg-white focus:border-gray-500", + option { + "All" + } + option { + "Active" + } + option { + "Inactive" + } + } + div { + class: "absolute inset-y-0 right-0 flex items-center px-2 text-gray-700 pointer-events-none", + icons::icon_2 {} + } + } + } + div { + class: "relative block mt-2 sm:mt-0", + span { + class: "absolute inset-y-0 left-0 flex items-center pl-2", + icons::icon_3 {} + } + input { + class: "block w-full py-2 pl-8 pr-6 text-sm text-gray-700 placeholder-gray-400 bg-white border border-b border-gray-400 rounded-l rounded-r appearance-none sm:rounded-l-none focus:bg-white focus:placeholder-gray-600 focus:text-gray-700 focus:outline-none", + placeholder: "Search", + } + } + } + // table + div { + class: "px-4 py-4 -mx-4 overflow-x-auto sm:-mx-8 sm:px-8", + div { + class: "inline-block min-w-full overflow-hidden rounded-lg shadow", + table { + class: "min-w-full leading-normal", + // table header + thead { + tr { + th { + class: "px-5 py-3 text-xs font-semibold tracking-wider text-left text-gray-600 uppercase bg-gray-100 border-b-2 border-gray-200", + "User" + } + th { + class: "px-5 py-3 text-xs font-semibold tracking-wider text-left text-gray-600 uppercase bg-gray-100 border-b-2 border-gray-200", + "Role" + } + th { + class: "px-5 py-3 text-xs font-semibold tracking-wider text-left text-gray-600 uppercase bg-gray-100 border-b-2 border-gray-200", + "Created at" + } + th { + class: "px-5 py-3 text-xs font-semibold tracking-wider text-left text-gray-600 uppercase bg-gray-100 border-b-2 border-gray-200", + "Status" + } + } + } + // data + tbody { + // "" + paginated_table_data.iter().map(|u|{rsx!{ + tr{ + // key: "{u.id}", + td { + class: "px-5 py-5 text-sm bg-white border-b border-gray-200", + div { + class: "flex items-center", + div { + class: "flex-shrink-0 w-10 h-10", + img { + class: "w-full h-full rounded-full", + src: "{u.picture}", + alt: "profile pic", + } + } + div { + class: "ml-3", + p { + class: "text-gray-900 whitespace-nowrap", + "{ u.name }" + } + } + } + } + td { + class: "px-5 py-5 text-sm bg-white border-b border-gray-200", + p { + class: "text-gray-900 whitespace-nowrap", + "{ u.role }" + } + } + td { + class: "px-5 py-5 text-sm bg-white border-b border-gray-200", + p { + class: "text-gray-900 whitespace-nowrap", + "{ u.created }" + } + } + td { + class: "px-5 py-5 text-sm bg-white border-b border-gray-200", + span { + class: format_args!("inline-flex px-3 py-1 font-semibold leading-tight rounded-full {} {}",status_color(&u.status).0,status_color(&u.status).1), + "{ u.status }" + } + + // span { + // class: format_args!("relative inline-block px-3 py-1 font-semibold leading-tight {}", status_color(&u.status).1), + // span { + // aria_hidden: "true", + // class: { + // format_args!("absolute inset-0 opacity-50 rounded-full {}", status_color(&u.status).0) + // } + // } + // span { + // class: "relative", + // "{u.status}" + + // } + // } + + + } + //tr end + } + // iter end + }}) + + } + } + + div { + class: "flex flex-col items-center px-5 py-5 bg-white border-t xs:flex-row xs:justify-between", + span { + class: "text-xs text-gray-900 xs:text-sm", + "Showing 1 to 4 of 50 Entries" + } + div { + class: "inline-flex mt-2 xs:mt-0", + button { + class: "px-4 py-2 text-sm font-semibold text-gray-800 bg-gray-300 rounded-l hover:bg-gray-400", + "Prev" + } + button { + class: "px-4 py-2 text-sm font-semibold text-gray-800 bg-gray-300 rounded-r hover:bg-gray-400", + "Next" + } + } + } + } + } + } + } + }) +} + +// 宽表格 +fn Wide_table(cx: Scope)->Element{ + let wide_table_data = &use_read(&cx, USE_TABLE_DATA).wideTableData; + + cx.render(rsx!{ + div { + class: "mt-8", + h4 { + class: "text-gray-600", + "Wide Table" + } + div { + class: "flex flex-col mt-6", + div { + class: "py-2 -my-2 overflow-x-auto sm:-mx-6 sm:px-6 lg:-mx-8 lg:px-8", + div { + class: "inline-block min-w-full overflow-hidden align-middle border-b border-gray-200 shadow sm:rounded-lg", + table { + class: "min-w-full", + thead { + tr { + th { + class: "px-6 py-3 text-xs font-medium leading-4 tracking-wider text-left text-gray-500 uppercase bg-gray-100 border-b border-gray-200", + "Name" + } + th { + class: "px-6 py-3 text-xs font-medium leading-4 tracking-wider text-left text-gray-500 uppercase bg-gray-100 border-b border-gray-200", + "Title" + } + th { + class: "px-6 py-3 text-xs font-medium leading-4 tracking-wider text-left text-gray-500 uppercase bg-gray-100 border-b border-gray-200", + "Status" + } + th { + class: "px-6 py-3 text-xs font-medium leading-4 tracking-wider text-left text-gray-500 uppercase bg-gray-100 border-b border-gray-200", + "Role" + } + th { + class: "px-6 py-3 bg-gray-100 border-b border-gray-200", + + } + } + } + // data + tbody { + class: "bg-white", + // iter start + wide_table_data.iter().map(|u|{rsx!{tr{ + + td { + class: "px-6 py-4 border-b border-gray-200 whitespace-nowrap", + div { + class: "flex items-center", + div { + class: "flex-shrink-0 w-10 h-10", + img { + class: "w-10 h-10 rounded-full", + alt: "profile pic", + src: "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80", + } + } + div { + class: "ml-4", + div { + class: "text-sm font-medium leading-5 text-gray-900", + "{u.name}" + } + div { + class: "text-sm leading-5 text-gray-500", + "{ u.email }" + } + } + } + } + td { + class: "px-6 py-4 border-b border-gray-200 whitespace-nowrap", + div { + class: "text-sm leading-5 text-gray-900", + "{ u.title }" + } + div { + class: "text-sm leading-5 text-gray-500", + "{ u.title2 }" + } + } + td { + class: "px-6 py-4 border-b border-gray-200 whitespace-nowrap", + span { + class: "inline-flex px-2 text-xs font-semibold leading-5 text-green-800 bg-green-100 rounded-full", + "{ u.status }" + } + } + td { + class: "px-6 py-4 text-sm leading-5 text-gray-500 border-b border-gray-200 whitespace-nowrap", + "{ u.role }" + } + td { + class: "px-6 py-4 text-sm font-medium leading-5 text-right border-b border-gray-200 whitespace-nowrap", + a { + class: "text-indigo-600 hover:text-indigo-900", + href: "#","Edit" + } + } + + // iter end + }}}) + } + } + } + } + } + } + }) +} + +mod icons{ + use dioxus::prelude::*; + use dioxus_html_macro::html; + + pub fn icon_1(cx: Scope)->Element{ + cx.render(html!{ + + + + }) + } + + pub fn icon_2(cx: Scope)->Element{ + cx.render(html!{ + + + + }) + } + + pub fn icon_3(cx: Scope)->Element{ + cx.render(html!{ + + + + }) + } + +} \ No newline at end of file diff --git a/src/views/ui_elements.rs b/src/views/ui_elements.rs new file mode 100644 index 0000000..8f2a801 --- /dev/null +++ b/src/views/ui_elements.rs @@ -0,0 +1,365 @@ +/* + * @Author: plucky + * @Date: 2022-10-14 16:04:10 + * @LastEditTime: 2022-10-14 16:21:17 + * @Description: + */ + +use dioxus::prelude::*; + +pub fn view(cx: Scope)->Element{ + + cx.render(rsx!{ + div { + h3 { + class: "text-3xl font-medium text-gray-700", + "UI Elements" + } + // alerts + div { + class: "mt-4", + h4 { + class: "text-gray-600", + "Alerts" + } + div { + class: "mt-4", + div { + class: "px-4 py-4 overflow-x-auto bg-white rounded-md whitespace-nowrap", + div { + class: "inline-flex w-full max-w-sm ml-3 overflow-hidden bg-white rounded-lg shadow-md", + div { + class: "flex items-center justify-center w-12 bg-green-500", + icons::icon_1 {} + } + div { + class: "px-4 py-2 -mx-3", + div { + class: "mx-3", + span { + class: "font-semibold text-green-500", + "Success" + } + p { + class: "text-sm text-gray-600", + "Your account was registered!" + } + } + } + } + div { + class: "inline-flex w-full max-w-sm ml-3 overflow-hidden bg-white rounded-lg shadow-md", + div { + class: "flex items-center justify-center w-12 bg-blue-500", + icons::icon_2 {} + } + div { + class: "px-4 py-2 -mx-3", + div { + class: "mx-3", + span { + class: "font-semibold text-blue-500", + "Info" + } + p { + class: "text-sm text-gray-600", + "Channel archived by the owner." + } + } + } + } + div { + class: "inline-flex w-full max-w-sm ml-3 overflow-hidden bg-white rounded-lg shadow-md", + div { + class: "flex items-center justify-center w-12 bg-yellow-500", + icons::icon_3 {} + } + div { + class: "px-4 py-2 -mx-3", + div { + class: "mx-3", + span { + class: "font-semibold text-yellow-500", + "Warning" + } + p { + class: "text-sm text-gray-600", + "Image size is too large." + } + } + } + } + div { + class: "inline-flex w-full max-w-sm ml-3 overflow-hidden bg-white rounded-lg shadow-md", + div { + class: "flex items-center justify-center w-12 bg-red-500", + icons::icon_4 {} + } + div { + class: "px-4 py-2 -mx-3", + div { + class: "mx-3", + span { + class: "font-semibold text-red-500", + "Error" + } + p { + class: "text-sm text-gray-600", + "Your email is already used!" + } + } + } + } + } + } + } + // Inputs + div { + class: "mt-8", + h4 { + class: "text-gray-600", + "Inputs" + } + div { + class: "mt-4", + div { + class: "flex items-center px-4 py-4 space-x-4 overflow-x-auto bg-white rounded-md", + label { + input { + class: "w-5 h-5 text-indigo-600 focus:ring-indigo-500", + name: "radio", + r#type: "radio", + } + span { + class: "ml-2 text-gray-700", + "Radio" + } + } + label { + input { + class: "w-5 h-5 text-indigo-600 rounded-md focus:ring-indigo-500", + name: "radio", + r#type: "checkbox", + } + span { + class: "ml-2 text-gray-700", + "Checkbox" + } + } + label { + class: "block", + input { + class: "block w-full mt-1 border-gray-200 rounded-md focus:border-indigo-600 focus:ring focus:ring-opacity-40 focus:ring-indigo-500", + placeholder: "Email", + r#type: "email", + } + } + div { + class: "relative mx-4 lg:mx-0", + span { + class: "absolute inset-y-0 left-0 flex items-center pl-3", + icons::icon_5 {} + } + input { + class: "w-32 pl-10 pr-4 text-indigo-600 border-gray-200 rounded-md sm:w-64 focus:border-indigo-600 focus:ring focus:ring-opacity-40 focus:ring-indigo-500", + placeholder: "Search", + r#type: "text", + } + } + } + } + } + // Buttons + div { + class: "mt-8", + h4 { + class: "text-gray-600", + "Buttons" + } + div { + class: "mt-4", + div { + class: "flex px-4 py-4 space-x-4 overflow-x-auto bg-white rounded-md", + button { + class: "px-4 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-indigo-600 rounded-md hover:bg-indigo-500 focus:outline-none focus:bg-indigo-500", + "Primary" + } + button { + class: "flex items-center px-2 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-indigo-600 rounded-md hover:bg-indigo-500 focus:outline-none focus:bg-indigo-500", + icons::icon_6 {} + span { + class: "mx-1", + "Refresh" + } + } + div { + class: "flex items-center", + button { + class: "px-4 py-2 font-medium tracking-wide text-white capitalize transition-colors duration-200 transform bg-indigo-600 rounded-md hover:bg-indigo-500 focus:outline-none focus:bg-indigo-500", + "Download" + } + span { + class: "border border-transparent", + + } + div { + class: "relative", + button { + class: "relative z-10 block p-2 transition-colors duration-200 transform bg-indigo-600 rounded-md hover:bg-indigo-500 focus:outline-none focus:bg-indigo-500", + icons::icon_7 {} + } + div { + class: "absolute right-0 z-20 w-48 mt-2 overflow-hidden bg-white rounded-md shadow-xl dark:bg-gray-700", + + } + } + } + } + } + } + // Paginations + div { + class: "mt-8", + h4 { + class: "text-gray-600", + "Paginations" + } + div { + class: "mt-4", + div { + class: "flex px-4 py-4 overflow-x-auto bg-white rounded-md", + div { + class: "flex mr-4 rounded", + a { + class: "px-3 py-2 ml-0 leading-tight text-indigo-700 bg-white border border-r-0 border-gray-200 rounded-l hover:bg-indigo-500 hover:text-white", + href: "#",span { + "Previous" + } + } + a { + class: "px-3 py-2 leading-tight text-indigo-700 bg-white border border-r-0 border-gray-200 hover:bg-indigo-500 hover:text-white", + href: "#",span { + "1" + } + } + a { + class: "px-3 py-2 leading-tight text-indigo-700 bg-white border border-r-0 border-gray-200 hover:bg-indigo-500 hover:text-white", + href: "#",span { + "2" + } + } + a { + class: "px-3 py-2 leading-tight text-indigo-700 bg-white border border-r-0 border-gray-200 hover:bg-indigo-500 hover:text-white", + href: "#",span { + "3" + } + } + a { + class: "px-3 py-2 leading-tight text-indigo-700 bg-white border border-gray-200 rounded-r hover:bg-indigo-500 hover:text-white", + href: "#",span { + "Next" + } + } + } + } + } + } + } + }) +} + + +mod icons{ + use dioxus::prelude::*; + use dioxus_html_macro::html; + + pub fn icon_1(cx: Scope)->Element{ + cx.render(html!{ + + + + }) + } + + pub fn icon_2(cx: Scope)->Element{ + cx.render(html!{ + + + + }) + } + + pub fn icon_3(cx: Scope)->Element{ + cx.render(html!{ + + + + }) + } + + pub fn icon_4(cx: Scope)->Element{ + cx.render(html!{ + + + + }) + } + + pub fn icon_5(cx: Scope)->Element{ + cx.render(html!{ + + + + }) + } + + pub fn icon_6(cx: Scope)->Element{ + cx.render(html!{ + + + + }) + } + + pub fn icon_7(cx: Scope)->Element{ + cx.render(html!{ + + + + }) + } + +} \ No newline at end of file diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..df36fcf Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/screenshot.jpg b/static/screenshot.jpg new file mode 100644 index 0000000..7158c4b Binary files /dev/null and b/static/screenshot.jpg differ diff --git a/tailwind.config.js b/tailwind.config.js new file mode 100644 index 0000000..b882d3e --- /dev/null +++ b/tailwind.config.js @@ -0,0 +1,18 @@ +/** @type {import('tailwindcss').Config} */ +const defaultTheme = require('tailwindcss/defaultTheme') + +module.exports = { + content: ["./src/**/*.{rs,html}"], + theme: { + extend: { + fontFamily: { + sans: ['Inter var', ...defaultTheme.fontFamily.sans], + }, + }, + }, + plugins: [ + require('@tailwindcss/forms'), + require('@tailwindcss/typography'), + require('@tailwindcss/aspect-ratio'), + ], +} diff --git a/test.vue b/test.vue new file mode 100644 index 0000000..e69de29