Files
Ely-GPUI-Components/examples/gallery/pages/motion/mod.rs
T
ZacharyZhang-NY 48c7b09d8d 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.
2026-09-29 19:16:41 -04:00

92 lines
2.6 KiB
Rust

mod effects;
mod loading;
mod moves;
mod progress;
use gpui::{AnyElement, App, IntoElement, ParentElement, Window, div};
use super::Page;
use crate::step::Step;
pub const PAGE: Page = Page {
number: 11,
slug: "motion",
title: "Loading & Motion",
summary: "Waiting, shown honestly, and the motion everything else moves with.",
render,
script: SCRIPT,
};
const SCRIPT: &[Step] = &[
Step::Rest,
Step::Click("save"),
Step::Wait(250),
Step::Shot("loading-button"),
Step::Click("load-more"),
Step::Wait(300),
Step::Shot("load-more-busy"),
Step::Wait(1200),
Step::Shot("load-more-done"),
Step::Click("shimmer-load"),
Step::Wait(500),
Step::Shot("shimmer-loaded"),
Step::Click("shimmer-load"),
Step::Click("progress-step"),
Step::Wait(400),
Step::Shot("progress"),
Step::Click("overlay-reload"),
Step::Wait(300),
Step::Shot("overlay"),
Step::Wait(1500),
Step::Click("refresh-run"),
Step::Wait(300),
Step::Shot("refreshing"),
Step::Click("uploads-tick"),
Step::Wait(400),
Step::Shot("uploads"),
Step::Click("transition-toggle"),
Step::Wait(80),
Step::Shot("transition-leaving"),
Step::Click("transition-toggle"),
Step::Click("presence-add"),
Step::Wait(80),
Step::Shot("presence-arriving"),
Step::Click("flip-shuffle"),
Step::Wait(100),
Step::Shot("flip-gliding"),
Step::Click("ripple"),
Step::Wait(120),
Step::Shot("ripple"),
Step::Click("flash-tick"),
Step::Click("shake-try"),
Step::Wait(100),
Step::Shot("cues"),
Step::Rest,
];
fn render(window: &mut Window, cx: &mut App) -> AnyElement {
div()
.child(loading::spinners(cx))
.child(loading::skeletons(cx))
.child(loading::shimmer(window, cx))
.child(loading::buttons(window, cx))
.child(loading::more(window, cx))
.child(progress::bars(window, cx))
.child(progress::overlay(window, cx))
.child(progress::lazy(cx))
.child(progress::suspense(window, cx))
.child(progress::refresh(window, cx))
.child(progress::uploads(window, cx))
.child(moves::transitions(window, cx))
.child(moves::stagger(window, cx))
.child(moves::presence(window, cx))
.child(moves::flip(window, cx))
.child(moves::reorder(window, cx))
.child(effects::marquee(cx))
.child(effects::ripple(window, cx))
.child(effects::light(cx))
.child(effects::cues(window, cx))
.child(effects::backdrops(cx))
.into_any_element()
}