summaryrefslogtreecommitdiffstats
path: root/examples/counter
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-11-29 22:28:31 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2023-11-29 22:28:31 +0100
commite09b4e24dda51b8212d8ece52431dacaa3922a7b (patch)
tree7005e181528134ebdde5bbbe5909273db9f30174 /examples/counter
parent83c7870c569a2976923ee6243a19813094d44673 (diff)
parent7f8b17604a31e00becc43130ec516c1a53552c88 (diff)
downloadiced-e09b4e24dda51b8212d8ece52431dacaa3922a7b.tar.gz
iced-e09b4e24dda51b8212d8ece52431dacaa3922a7b.tar.bz2
iced-e09b4e24dda51b8212d8ece52431dacaa3922a7b.zip
Merge branch 'master' into feat/multi-window-support
Diffstat (limited to 'examples/counter')
-rw-r--r--examples/counter/Cargo.toml6
-rw-r--r--examples/counter/README.md12
2 files changed, 14 insertions, 4 deletions
diff --git a/examples/counter/Cargo.toml b/examples/counter/Cargo.toml
index e31f440f..22f86064 100644
--- a/examples/counter/Cargo.toml
+++ b/examples/counter/Cargo.toml
@@ -6,4 +6,8 @@ edition = "2021"
publish = false
[dependencies]
-iced = { path = "../.." }
+iced.workspace = true
+
+[target.'cfg(target_arch = "wasm32")'.dependencies]
+iced.workspace = true
+iced.features = ["webgl"]
diff --git a/examples/counter/README.md b/examples/counter/README.md
index 4d9fc5b9..18761bba 100644
--- a/examples/counter/README.md
+++ b/examples/counter/README.md
@@ -5,9 +5,7 @@ The classic counter example explained in the [`README`](../../README.md).
The __[`main`]__ file contains all the code of the example.
<div align="center">
- <a href="https://gfycat.com/fairdeadcatbird">
- <img src="https://thumbs.gfycat.com/FairDeadCatbird-small.gif">
- </a>
+ <img src="https://iced.rs/examples/counter.gif">
</div>
You can run it with `cargo run`:
@@ -15,4 +13,12 @@ You can run it with `cargo run`:
cargo run --package counter
```
+The web version can be run with [`trunk`]:
+
+```
+cd examples/counter
+trunk serve
+```
+
[`main`]: src/main.rs
+[`trunk`]: https://trunkrs.dev/