summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/README.md5
-rw-r--r--examples/solar_system/src/main.rs8
-rw-r--r--examples/tour/README.md9
3 files changed, 11 insertions, 11 deletions
diff --git a/examples/README.md b/examples/README.md
index 137d134c..2b4919df 100644
--- a/examples/README.md
+++ b/examples/README.md
@@ -27,10 +27,6 @@ You can run the native version with `cargo run`:
cargo run --package tour
```
-The web version can be run by following [the usage instructions of `iced_web`] or by accessing [iced.rs](https://iced.rs/)!
-
-[the usage instructions of `iced_web`]: https://github.com/iced-rs/iced_web#usage
-
## [Todos](todos)
A todos tracker inspired by [TodoMVC]. It showcases dynamic layout, text input, checkboxes, scrollables, icons, and async actions! It automatically saves your tasks in the background, even if you did not finish typing them.
@@ -46,7 +42,6 @@ You can run the native version with `cargo run`:
```
cargo run --package todos
```
-We have not yet implemented a `LocalStorage` version of the auto-save feature. Therefore, it does not work on web _yet_!
[TodoMVC]: http://todomvc.com/
diff --git a/examples/solar_system/src/main.rs b/examples/solar_system/src/main.rs
index 12184dd1..e96b53ff 100644
--- a/examples/solar_system/src/main.rs
+++ b/examples/solar_system/src/main.rs
@@ -48,6 +48,10 @@ impl Application for SolarSystem {
String::from("Solar system - Iced")
}
+ fn background_color(&self) -> Color {
+ Color::BLACK
+ }
+
fn update(&mut self, message: Message) -> Command<Message> {
match message {
Message::Tick(instant) => {
@@ -137,16 +141,12 @@ impl<Message> canvas::Program<Message> for State {
use std::f32::consts::PI;
let background = self.space_cache.draw(bounds.size(), |frame| {
- let space = Path::rectangle(Point::new(0.0, 0.0), frame.size());
-
let stars = Path::new(|path| {
for (p, size) in &self.stars {
path.rectangle(*p, Size::new(*size, *size));
}
});
- frame.fill(&space, Color::BLACK);
-
frame.translate(frame.center() - Point::ORIGIN);
frame.fill(&stars, Color::WHITE);
});
diff --git a/examples/tour/README.md b/examples/tour/README.md
index e7cd2d5c..731e7e66 100644
--- a/examples/tour/README.md
+++ b/examples/tour/README.md
@@ -23,6 +23,11 @@ You can run the native version with `cargo run`:
cargo run --package tour
```
-The web version can be run by following [the usage instructions of `iced_web`] or by accessing [iced.rs](https://iced.rs/)!
+The web version can be run with [`trunk`]:
-[the usage instructions of `iced_web`]: https://github.com/iced-rs/iced_web#usage
+```
+cd examples/tour
+trunk serve
+```
+
+[`trunk`]: https://trunkrs.dev/