Olivier Goffart
132ed8155d
Respect the aspect ratio in the memory game
2020-12-08 16:37:20 +01:00
Olivier Goffart
5517b368eb
Todo: add a small spacing
2020-12-08 16:21:08 +01:00
Olivier Goffart
29771f9591
Slider demo: make sure that it is always fullscreen
2020-12-08 16:13:14 +01:00
Olivier Goffart
dbd27f150d
Memory: color scheme and size
2020-12-08 14:57:10 +01:00
Simon Hausmann
f77bdffc38
Prospective fix for aspect ratio preservation for the icons
2020-12-08 14:25:53 +01:00
Olivier Goffart
f53e52e403
Don't compile the printer demo as a lib by default
...
Reverts parts of commit b8b2a30853
that was commited by mistake
2020-12-08 13:54:12 +01:00
Simon Hausmann
82d6a679f5
Show a different color for solved tiles
2020-12-08 13:40:29 +01:00
Olivier Goffart
2e5007da32
memory: fix the file name in the index.html
2020-12-08 13:24:48 +01:00
Olivier Goffart
b8b2a30853
Add a note about wasm build in the example README
2020-12-08 13:10:52 +01:00
Olivier Goffart
d8680c33d0
Port more wasm example to the simplified wasm
2020-12-08 13:01:02 +01:00
Olivier Goffart
3f6f16c633
Also simplify wasm build for the slide puzzle
2020-12-08 12:39:47 +01:00
Simon Hausmann
199ae5f9d3
Simplify wasm startup
...
It is not necessary to call main because it's marked to be called on "startup".
2020-12-08 12:18:52 +01:00
Simon Hausmann
39b8691819
Switch to generating the SVG icons using rsvg-convert
...
The npm package is not maintained anymore and does not support newer
font-awesome versions with additional icons.
2020-12-08 12:03:51 +01:00
Olivier Goffart
91dcf00897
Memory: Ssmall design change
...
- Add some padding
- Better colors
- rounded corners
2020-12-08 11:59:47 +01:00
Olivier Goffart
6d112465d1
Attempt to simplify the wasm build
2020-12-08 11:51:10 +01:00
Simon Hausmann
9ac4cd851b
Open the memory tile from the center
2020-12-08 11:35:08 +01:00
Simon Hausmann
e602bc603a
A wasm port for the memory puzzle without npm and webpack
2020-12-08 11:15:54 +01:00
Simon Hausmann
d471ed566f
Fix tile positioning inside the window
...
Don't start at (0, 0) - leave some space
2020-12-08 10:39:26 +01:00
Simon Hausmann
574d17e698
Initial version of a small memory game
...
This is intended to form the basis for a tutorial.
2020-12-08 09:58:53 +01:00
Simon Hausmann
1e683de64d
Simplify Rust Timer API
...
Don't require the caller to Box the closure. With the assumption that
the majority of callers *want* the closure to be boxed (i.e. it's not
already boxed), the API becomes easier to use.
2020-12-04 10:57:19 +01:00
Simon Hausmann
7047856d4e
Replace FooRc with Foo and without ComponentHandle in examples and tests
2020-12-03 08:13:24 +01:00
Simon Hausmann
08b8a8cb83
Port the examples away from the ComponentHandle based API
2020-12-03 08:13:15 +01:00
Olivier Goffart
f3f18259ae
Some items default size is the parent size
...
Fixes #122
2020-12-02 18:36:23 +01:00
Olivier Goffart
f6188fe505
Implement validation in the booker example
2020-12-02 12:00:05 +01:00
Olivier Goffart
8b73cfab2d
Add a booker.rs
2020-12-02 09:21:17 +01:00
Olivier Goffart
8075958f88
Move the 7gui tests to the example folder
2020-12-02 09:21:17 +01:00
Simon Hausmann
6fba6aca56
Consistency fix for transitions API
...
Use "in" and "out" instead of "to" and "out".
2020-12-01 11:18:47 +01:00
Simon Hausmann
9360fc3c5a
Don't silently drop fields in object literals inside arrays
...
This patch tries to improve the ability to convert different kinds of
object literals in an array into a common type. We used to take the
first entry as the "shape" of all elements, which meant that if the
first element was missing a field it would be silently dropped from all
future fields.
Instead, this patch merges the fields.
2020-12-01 10:57:47 +01:00
Simon Hausmann
51eae642dc
Add one more item for the puzzle
2020-11-30 11:03:39 +01:00
Simon Hausmann
4c5e43c919
Move the plaster font into a sub-directory on its own
...
Otherwise it might look like the example is under the OFL license :)
2020-11-27 15:44:53 +01:00
Olivier Goffart
1712a19f98
Slide Puzzle Wasm: fix font loading
2020-11-27 15:23:44 +01:00
Simon Hausmann
002412ad68
Implement the hover effect on the auto-play checkbox
2020-11-27 14:59:48 +01:00
Simon Hausmann
2472eb51f0
Add the plaster font to plaster theme of the slide puzzle
...
For regular builds this is done by adding Rust API that allows
registering a font, and for the web the font is installed into the
browser using JavaScript API.
This is an initial approach to just add this ability. It might make
sense to introduce a syntax in the `.60` file to allow for the
registration of fonts and letting the compiler generate code that
performs this embedding and registration automatically.
2020-11-27 14:29:56 +01:00
Simon Hausmann
a5932c9f88
Remove the outline around the canvas in the wasm demos
2020-11-26 17:31:46 +01:00
Simon Hausmann
c73edd503b
Fix tapping on the quit icon in the wasm printer demo
...
Don't let that make the demo become dysfunctional.
2020-11-26 14:56:18 +01:00
Simon Hausmann
5a0239e557
Show the printer demo in fullscreen in a mobile browser in landscape
2020-11-26 14:55:48 +01:00
Simon Hausmann
859d83bb12
Fix up parent commit
...
The edit was intended for index.html, not the older test.html.
2020-11-26 13:34:41 +01:00
Simon Hausmann
66470f59b7
Wording tweak for the slide puzzle HTML
2020-11-26 13:25:48 +01:00
Simon Hausmann
94c758892a
Apply the mobile optimizations to the main slide puzzle html
2020-11-26 13:23:42 +01:00
Simon Hausmann
d3549b252c
Tweak responsible slide puzzle html
...
* Show the text and link always, only hide it in mobile landscape.
* Use the 100%/50% viewport scale for the canvas also on the desktop
2020-11-26 11:29:06 +01:00
Simon Hausmann
12bff05188
First try at a responsive slide puzzle for the web
...
Based on the bootstrap media queries, make the canvas basically
full-screen and adjust to landscape and portrait.
2020-11-26 10:42:04 +01:00
Simon Hausmann
303c645ace
Move the screenshots to the website
2020-11-25 09:30:50 +01:00
Olivier Goffart
68d6791814
slide puzzle: Fix the pressed state
2020-11-24 18:15:45 +01:00
Olivier Goffart
3ae7c6e0b5
Hover effect
2020-11-24 18:09:32 +01:00
Simon Hausmann
d80868bbf4
Add support for font_weight to Text and TextInput
...
This allows implementing another sliding puzzle theme feature, the
boldness of the tile number text in the simple theme when the tile is in
the correct position. For the other themes the weight is constant and
it's bold.
More cleanup to follow later: unify the font handle and FontCacheKey
handling, improve the API to allow for the use of symbolic constants
(normal, bold, etc.) instead of the CSS number values.
2020-11-24 10:10:00 +01:00
Olivier Goffart
55c21c71fa
Slide puzzle: add numbers
...
To infer the number of lines of code without comments:
```
cat ... | grep -v "^ *$" | grep -v "^ *//" | wc -l
```
This does not account for the `/* ... */` comments which we use for the lisense,
which are deduced manually
2020-11-23 18:06:24 +01:00
Olivier Goffart
ecd7f7dd7a
Some changes to the Changelog
2020-11-23 16:58:42 +01:00
Olivier Goffart
7c159c2284
slide_puzzle: Add the last tile on the image when the puzzle is finished
2020-11-23 16:39:43 +01:00
Olivier Goffart
34e555f422
Add the slide_puzzle in examples/README.md
2020-11-23 16:07:17 +01:00
Simon Hausmann
3d85e45ec3
Add support for source clipping to the Image element
...
This allows rendering only a sub-rectangle of the original image, which
we can use right away in the sliding puzzle demo.
2020-11-23 15:46:59 +01:00