T44d Web · Gallery builds for wasm32: one story per section by URL, themed by the host
The gallery's entry runs natively or, on wasm32, from a wasm_bindgen start through gpui_web, single-threaded with WebGL2 fallback. ?page, ?story and ?theme choose what shows; an unknown one fails in the page and the log. set_theme switches the mode later. Pictures load from ELY_GALLERY_ASSETS. scripts/stories.py writes examples/gallery/stories.json from the pages.
This commit is contained in:
83 files changed
+1000
-455
No files matched your search
@@ -4,7 +4,7 @@ mod parts;
|
||||
use gpui::{AnyElement, App, IntoElement, ParentElement, Window, div};
|
||||
|
||||
use super::Page;
|
||||
use crate::script::Step;
|
||||
use crate::step::Step;
|
||||
|
||||
pub const PAGE: Page = Page {
|
||||
number: 1,
|
||||
|
||||
@@ -15,13 +15,10 @@ use gpui::{
|
||||
|
||||
use crate::{
|
||||
probe::probe,
|
||||
ui::{blocked, code, row, section, specimen, specimens},
|
||||
ui::{blocked, code, picture, row, section, specimen, specimens},
|
||||
};
|
||||
|
||||
const ATRIUM: &str = concat!(
|
||||
env!("CARGO_MANIFEST_DIR"),
|
||||
"/examples/gallery/assets/atrium.jpg"
|
||||
);
|
||||
const ATRIUM: &str = asset!("atrium.jpg");
|
||||
|
||||
fn counter(window: &mut Window, cx: &mut App, key: &'static str) -> gpui::Entity<u32> {
|
||||
window.use_keyed_state(key, cx, |_, _| 0u32)
|
||||
@@ -104,7 +101,7 @@ pub fn image(cx: &App) -> impl IntoElement + use<> {
|
||||
specimens()
|
||||
.child(specimen(
|
||||
"loaded",
|
||||
tile(Image::new("img-atrium", Path::new(ATRIUM)), cx),
|
||||
tile(Image::new("img-atrium", picture(ATRIUM)), cx),
|
||||
cx,
|
||||
))
|
||||
.child(specimen(
|
||||
|
||||
Reference in new issue
Block a user