slint/examples/slide_puzzle
Simon Hausmann a7ce64657c Restore source compatibility for drop-shadow-blur
Let's keep source compatibility and define `drop-shadow-blur` to be a radius.
The CSS spec says that the standard deviation is half of the radius.

We just need to scale again and increase the shadow rect to make sure that no borders are visible.
2021-05-20 12:14:05 +02:00
..
plaster-font Move the plaster font into a sub-directory on its own 2020-11-27 15:44:53 +01:00
berlin.jpg Slide Puzzle: add an image 2020-11-13 14:13:51 +01:00
build.rs Start experimenting with the sliding puzzle example 2020-11-10 14:30:36 +01:00
Cargo.toml Fix Cargo.toml 2021-01-28 22:12:48 +01:00
index.html Simplify wasm "startup" code 2021-04-14 09:36:33 +02:00
main.rs Port the slide puzzle over to specifying the custom font in .60 2021-04-14 09:49:51 +02:00
README.md Add one more item for the puzzle 2020-11-30 11:03:39 +01:00
slide_puzzle.60 Restore source compatibility for drop-shadow-blur 2021-05-20 12:14:05 +02:00

Slide Puzzle

Example based on the flutter slide_puzzle example: https://flutter.github.io/samples/slide_puzzle

This will allow to compare SixtyFPS and Flutter.

Remaining feature to implement to have parity:

  • "Spring" animation instead of a bezier curve.
  • Hover/Pressed effect on the auto-play checkbox.
  • When clicking on the auto-play checkbox, the gray hover circle bounces in the direction of the mouse cursor
  • The different styles are well separated in different files.
  • Shadow on the tiles
  • Some layout adjustment
  • startup animation

Comparison

Comparison with the flutter demo (as of commit ecd7f7d of this repository, and commit a23d035 of the flutter repository)

. SixtyFPS Flutter
UI files slide_puzzle.60 src/puzzle_controls.dart src/puzzle_flow_delegate.dart src/puzzle_home_state.dart src/shared_theme.dart src/theme_plaster.dart src/themes.dart src/theme_seattle.dart src/theme_simple.dart src/widgets/decoration_image_plus.dart src/widgets/material_interior_alt.dart
Line of codes for the UI 444 1140
Lines of code for the UI without empty lines and comments 386 831
Logic files main.rs main.dart src/flutter.dart src/app_state.dart src/core/body.dart src/core/point_int.dart src/core/puzzle_animator.dart src/core/puzzle.dart src/core/puzzle_proxy.dart src/core/puzzle_simple.dart src/core/puzzle_smart.dart src/core/util.dart
Lines of code of logic 238 962
Lines of code of logic without empty lines and comments 197 702
RAM use TBD TBD
binary size TBD TBD