diff --git a/examples/slide_puzzle/berlin.jpg b/examples/slide_puzzle/berlin.jpg new file mode 100644 index 00000000000..3ec4fb59048 Binary files /dev/null and b/examples/slide_puzzle/berlin.jpg differ diff --git a/examples/slide_puzzle/slide_puzzle.60 b/examples/slide_puzzle/slide_puzzle.60 index 6a80e1a5beb..e9fc1385292 100644 --- a/examples/slide_puzzle/slide_puzzle.60 +++ b/examples/slide_puzzle/slide_puzzle.60 @@ -75,7 +75,7 @@ export MainWindow := Window { }, { name: "BERLIN", - window-backround-color: #5b84a8, + window-backround-color: #ffffff88, game-background-color: #ffffffcc, game-border: 0px, game-radius: 2px, @@ -141,6 +141,12 @@ export MainWindow := Window { animate pieces_spacing { duration: 500ms; easing: ease-out; } + Image { + height: 100%; width: 100%; + // https://commons.wikimedia.org/wiki/File:Berlin_potsdamer_platz.jpg Belappetit, CC BY-SA 3.0 + source: img!"berlin.jpg"; + } + Rectangle { height: 100%; width: 100%; color: current-theme.window-backround-color; animate color { duration: 500ms; easing: ease-out; } @@ -203,6 +209,15 @@ export MainWindow := Window { animate px , py { duration: 200ms; easing: cubic-bezier(0.17,0.76,0.4,1.9); } animate border-width, border-radius { duration: 500ms; easing: ease-out; } + if (current-theme-index == 1) : Rectangle { + width: 50%; + height: 50%; + x: (parent.width - width) / 2; + y: (parent.height - height) / 2; + border-radius: width; + color: #fff8; + } + Text { text: i+1; color: i >= 8 ? current-theme.piece-text-color-2 : current-theme.piece-text-color-1; diff --git a/sixtyfps_runtime/corelib/Cargo.toml b/sixtyfps_runtime/corelib/Cargo.toml index ec908813541..6bd6ccd2bac 100644 --- a/sixtyfps_runtime/corelib/Cargo.toml +++ b/sixtyfps_runtime/corelib/Cargo.toml @@ -19,7 +19,7 @@ x11 = ["winit/x11", "copypasta/x11"] wayland = ["winit/wayland", "copypasta/wayland"] [dependencies] -image = { version = "0.23.4", default-features = false, features = [ "png" ] } +image = { version = "0.23.4", default-features = false, features = [ "png", "jpeg" ] } cgmath = "0.17.0" const-field-offset = { version = "0.1", path = "../../helper_crates/const-field-offset" } vtable = { version="0.1.1", path = "../../helper_crates/vtable" }