summaryrefslogtreecommitdiff
path: root/webapp
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2022-09-03 18:52:40 -0400
committerKjetil Orbekk <kj@orbekk.com>2022-09-03 19:14:16 -0400
commit1c2d88434021f25c43c2503cfce72ef5336c288e (patch)
tree98af21e2a4187d32bad5a3e75a972f6369256ecd /webapp
parent5abdd7c876e821fa6b7be0f8e7298b9a4c9e1d20 (diff)
Yew skeleton project
Diffstat (limited to 'webapp')
-rw-r--r--webapp/Cargo.toml3
-rw-r--r--webapp/Trunk.toml3
-rw-r--r--webapp/index.html7
-rw-r--r--webapp/src/default.css17
-rw-r--r--webapp/src/main.rs21
5 files changed, 48 insertions, 3 deletions
diff --git a/webapp/Cargo.toml b/webapp/Cargo.toml
index 0c4d9de..7478aea 100644
--- a/webapp/Cargo.toml
+++ b/webapp/Cargo.toml
@@ -3,6 +3,5 @@ name = "webapp"
version = "0.1.0"
edition = "2021"
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
[dependencies]
+yew = "0.19"
diff --git a/webapp/Trunk.toml b/webapp/Trunk.toml
new file mode 100644
index 0000000..842cc2f
--- /dev/null
+++ b/webapp/Trunk.toml
@@ -0,0 +1,3 @@
+[build]
+target = "index.html"
+dist = "dist"
diff --git a/webapp/index.html b/webapp/index.html
new file mode 100644
index 0000000..54e7990
--- /dev/null
+++ b/webapp/index.html
@@ -0,0 +1,7 @@
+<!doctype html>
+<html lang="en">
+ <head>
+ <link data-trunk rel="css" href="src/default.css"/>
+ </head>
+ <body></body>
+</html>
diff --git a/webapp/src/default.css b/webapp/src/default.css
new file mode 100644
index 0000000..11d1193
--- /dev/null
+++ b/webapp/src/default.css
@@ -0,0 +1,17 @@
+@charset "utf-8";
+
+.card {
+ box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2);
+ width: 5em;
+ height: 5em;
+ border: 1px solid #000;
+ transition: 0.1s;
+}
+
+.card:after {
+ content: "8♦";
+}
+
+.card:hover {
+ box-shadow: 0 4px 8px 0 rgba(0,0,0,0.5);
+}
diff --git a/webapp/src/main.rs b/webapp/src/main.rs
index e7a11a9..baeeff9 100644
--- a/webapp/src/main.rs
+++ b/webapp/src/main.rs
@@ -1,3 +1,22 @@
+use yew::prelude::*;
+
+#[function_component(App)]
+fn app() -> Html {
+ html! {
+ <>
+ <h1>{ "Hello, World" }</h1>
+ <Card/>
+ </>
+ }
+}
+
+#[function_component(Card)]
+fn card() -> Html {
+ html! {
+ <div class="card" draggable="true" />
+ }
+}
+
fn main() {
- println!("Hello, world!");
+ yew::start_app::<App>();
}