Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

feat(gpui): cinematic welcome screen in the landing page's sky

Richie McIlroyddfe29586c52
diff --git a/apps/desktop-gpui/assets/fonts/SourceSerif4-Light.ttf b/apps/desktop-gpui/assets/fonts/SourceSerif4-Light.ttf
new file mode 100644
index 000000000..066c857a2
Binary files /dev/null and b/apps/desktop-gpui/assets/fonts/SourceSerif4-Light.ttf differ
diff --git a/apps/desktop-gpui/src/assets.rs b/apps/desktop-gpui/src/assets.rs
index 1cf6aee94..7eac2663f 100644
--- a/apps/desktop-gpui/src/assets.rs
+++ b/apps/desktop-gpui/src/assets.rs
@@ -31,6 +31,8 @@ const FONTS: &[(&str, &[u8])] = assets!("fonts":
"Geist.ttf",
"Geist-Medium.ttf",
"Geist-Bold.ttf",
+ // Adobe, SIL Open Font License 1.1 (the licence is embedded in the font).
+ "SourceSerif4-Light.ttf",
);
/// Mostly Cap's own icon set, lifted from `packages/ui-solid/icons`. gpui
@@ -224,16 +226,27 @@ const IMAGES: &[(&str, &[u8])] = assets!("images":
);
const ONBOARDING: &[(&str, &[u8])] = &[
- ("onboarding/cloud-1.png", include_bytes!("../../desktop/src/assets/illustrations/cloud-1.png")),
- ("onboarding/cloud-2.png", include_bytes!("../../desktop/src/assets/illustrations/cloud-2.png")),
- ("onboarding/cloud-3.png", include_bytes!("../../desktop/src/assets/illustrations/cloud-3.png")),
- ("onboarding/logo.svg", include_bytes!("../../../packages/ui-solid/icons/logo.svg")),
+ // Grain is one sheet, never tiled: snapped tiles overlap and draw seams.
+ ("onboarding/clouds/cumulus-a.webp", include_bytes!("../../web/public/backgrounds/clouds/cumulus-a.webp")),
+ ("onboarding/clouds/cumulus-b.webp", include_bytes!("../../web/public/backgrounds/clouds/cumulus-b.webp")),
+ ("onboarding/clouds/tuft-a.webp", include_bytes!("../../web/public/backgrounds/clouds/tuft-a.webp")),
+ ("onboarding/clouds/bank-a.webp", include_bytes!("../../web/public/backgrounds/clouds/bank-a.webp")),
+ ("onboarding/clouds/wisp-a.webp", include_bytes!("../../web/public/backgrounds/clouds/wisp-a.webp")),
+ ("onboarding/sky.svg", br##"<svg viewBox="0 0 100 100" width="400" height="300" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="base" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#A3BFEA"/><stop offset="0.38" stop-color="#C8DBF4"/><stop offset="0.74" stop-color="#E2EAF5"/><stop offset="1" stop-color="#EDF1F6"/></linearGradient><radialGradient id="sun" cx="0.7" cy="0.02" r="0.36" gradientTransform="translate(0.7 0.02) scale(1 0.889) translate(-0.7 -0.02)"><stop offset="0" stop-color="#FFE0C0" stop-opacity="0.8"/><stop offset="0.7" stop-color="#FFE0C0" stop-opacity="0"/></radialGradient><radialGradient id="low" cx="0.5" cy="0.74" r="0.8" gradientTransform="translate(0.5 0.74) scale(1 0.525) translate(-0.5 -0.74)"><stop offset="0" stop-color="#FFF0E0" stop-opacity="0.5"/><stop offset="0.72" stop-color="#FFF0E0" stop-opacity="0"/></radialGradient></defs><rect width="100" height="100" fill="url(#base)"/><rect width="100" height="100" fill="url(#low)"/><rect width="100" height="100" fill="url(#sun)"/></svg>"##),
+ ("onboarding/grain.svg", br##"<svg viewBox="0 0 1300 1000" width="1300" height="1000" xmlns="http://www.w3.org/2000/svg"><filter id="n" x="0" y="0" width="100%" height="100%"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="2"/><feColorMatrix type="saturate" values="0"/><feComponentTransfer><feFuncA type="linear" slope="0.26"/></feComponentTransfer></filter><rect width="1300" height="1000" filter="url(#n)"/></svg>"##),
+ // These are drawn with their edges outside the window: gpui shows an
+ // image's edge as a faint line where it falls on screen.
+ ("onboarding/rays-far.svg", br##"<svg viewBox="0 0 100 100" width="400" height="300" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="r" gradientUnits="userSpaceOnUse" x1="84" y1="-6" x2="30" y2="104"><stop offset="0" stop-color="#FFF6E6" stop-opacity="1"/><stop offset="0.55" stop-color="#FFF6E6" stop-opacity="0.5"/><stop offset="1" stop-color="#FFF4E2" stop-opacity="0"/></linearGradient><filter id="b" x="-20%" y="-20%" width="140%" height="140%"><feGaussianBlur stdDeviation="1.2"/></filter></defs><g filter="url(#b)" fill="url(#r)"><polygon points="84,-6 -20,104 -8,104" opacity="0.45"/><polygon points="84,-6 2,104 10,104" opacity="0.7"/><polygon points="84,-6 18,104 24,104" opacity="0.5"/><polygon points="84,-6 30,104 38,104" opacity="0.85"/><polygon points="84,-6 46,104 50,104" opacity="0.55"/><polygon points="84,-6 58,104 66,104" opacity="0.75"/><polygon points="84,-6 74,104 78,104" opacity="0.4"/></g></svg>"##),
+ ("onboarding/rays-near.svg", br##"<svg viewBox="0 0 100 100" width="400" height="300" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><defs><linearGradient id="r" gradientUnits="userSpaceOnUse" x1="84" y1="-6" x2="30" y2="104"><stop offset="0" stop-color="#FFF6E6" stop-opacity="1"/><stop offset="0.55" stop-color="#FFF6E6" stop-opacity="0.5"/><stop offset="1" stop-color="#FFF4E2" stop-opacity="0"/></linearGradient><filter id="b" x="-20%" y="-20%" width="140%" height="140%"><feGaussianBlur stdDeviation="2.2"/></filter></defs><g filter="url(#b)" fill="url(#r)"><polygon points="84,-6 -12,104 -2,104" opacity="0.5"/><polygon points="84,-6 10,104 16,104" opacity="0.6"/><polygon points="84,-6 26,104 30,104" opacity="0.8"/><polygon points="84,-6 40,104 46,104" opacity="0.45"/><polygon points="84,-6 52,104 56,104" opacity="0.7"/><polygon points="84,-6 66,104 72,104" opacity="0.5"/></g></svg>"##),
+ ("onboarding/sun.svg", br##"<svg viewBox="0 0 200 200" width="200" height="200" xmlns="http://www.w3.org/2000/svg"><defs><radialGradient id="g" r="0.1875"><stop offset="0" stop-color="#FFF8EC" stop-opacity="0.95"/><stop offset="0.35" stop-color="#FFE3C4" stop-opacity="0.5"/><stop offset="1" stop-color="#FFE3C4" stop-opacity="0"/></radialGradient></defs><rect width="200" height="200" fill="url(#g)"/></svg>"##),
+ ("onboarding/mist.svg", br##"<svg viewBox="0 0 100 150" width="300" height="450" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><defs><radialGradient id="m"><stop offset="0" stop-color="#FFFFFF" stop-opacity="0.8"/><stop offset="0.5" stop-color="#F4F8FD" stop-opacity="0.35"/><stop offset="1" stop-color="#F4F8FD" stop-opacity="0"/></radialGradient></defs><ellipse cx="41.7" cy="52.5" rx="66.7" ry="22.5" fill="url(#m)" opacity="0.35"/><ellipse cx="62.5" cy="84.5" rx="66.7" ry="22.5" fill="url(#m)" opacity="0.28"/></svg>"##),
+ ("onboarding/vignette.svg", br##"<svg viewBox="0 0 100 100" width="200" height="200" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg"><defs><radialGradient id="g" r="0.75"><stop offset="0.5" stop-color="#34507A" stop-opacity="0"/><stop offset="1" stop-color="#34507A" stop-opacity="0.5"/></radialGradient></defs><rect width="100" height="100" fill="url(#g)"/></svg>"##),
+ ("onboarding/wordmark.svg", br##"<svg viewBox="0 0 120 40" width="480" height="160" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill="#4785FF" d="M20 36c8.837 0 16-7.163 16-16 0-8.836-7.163-16-16-16-8.836 0-16 7.164-16 16 0 8.837 7.164 16 16 16z"/><path fill="#ADC9FF" d="M20 33c7.18 0 13-5.82 13-13S27.18 7 20 7 7 12.82 7 20s5.82 13 13 13z"/><path fill="#fff" d="M20 30c5.523 0 10-4.477 10-10s-4.477-10-10-10-10 4.477-10 10 4.477 10 10 10z"/><path fill="#1E2A40" d="M58.416 30.448c-5.404 0-9.212-3.864-9.212-10.36 0-6.384 3.668-10.416 9.268-10.416 5.068 0 7.784 2.66 8.624 7.168l-3.808.196c-.476-2.604-2.072-4.2-4.816-4.2-3.388 0-5.488 2.828-5.488 7.252 0 4.48 2.156 7.196 5.46 7.196 2.94 0 4.508-1.708 4.956-4.564l3.808.196c-.784 4.676-3.752 7.532-8.792 7.532zm16.23-.112c-3.137 0-5.209-1.484-5.209-4.088 0-2.576 1.596-3.948 4.872-4.592l4.956-.98c0-2.1-.98-3.192-2.856-3.192-1.764 0-2.716.812-3.052 2.324l-3.668-.168c.588-3.136 2.996-4.928 6.72-4.928 4.256 0 6.44 2.24 6.44 6.216v5.432c0 .812.28 1.036.84 1.036h.476V30c-.224.056-.812.112-1.288.112-1.624 0-2.828-.588-3.136-2.436-.728 1.596-2.632 2.66-5.096 2.66zm.727-2.604c2.38 0 3.892-1.512 3.892-3.78v-.84l-3.864.784c-1.596.308-2.24.98-2.24 2.016 0 1.176.784 1.82 2.212 1.82zM86.874 34.2V15.048h3.444l.056 2.212c.868-1.652 2.52-2.548 4.48-2.548 4.256 0 6.356 3.5 6.356 7.812s-2.128 7.812-6.384 7.812c-1.904 0-3.556-.924-4.368-2.38V34.2h-3.584zm7.112-6.776c2.184 0 3.5-1.82 3.5-4.9s-1.316-4.9-3.5-4.9-3.528 1.652-3.528 4.9 1.316 4.9 3.528 4.9z"/></svg>"##),
("onboarding/music.mp3", include_bytes!("../../desktop/src/assets/tears-and-fireflies-adi-goldstein.mp3")),
("onboarding/cursor-macos.svg", include_bytes!("../../../packages/ui-solid/icons/cursor-macos.svg")),
("onboarding/cursor-windows.svg", include_bytes!("../../../packages/ui-solid/icons/cursor-windows.svg")),
("onboarding/volume-2.svg", include_bytes!("../assets/icons/volume-2.svg")),
("onboarding/volume-x.svg", include_bytes!("../assets/icons/volume-x.svg")),
- ("onboarding/grain.svg", br##"<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><filter id="noiseFilter"><feTurbulence type="fractalNoise" baseFrequency="1.5" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(#noiseFilter)"/></svg>"##),
];
pub struct Assets;
diff --git a/apps/desktop-gpui/src/camera_loading.rs b/apps/desktop-gpui/src/camera_loading.rs
index be0c1d94d..d10aba247 100644
--- a/apps/desktop-gpui/src/camera_loading.rs
+++ b/apps/desktop-gpui/src/camera_loading.rs
@@ -1,15 +1,13 @@
mod script_outline;
-use std::cell::RefCell;
use std::time::Instant;
use gpui::{
- Bounds, BoxShadow, ContentMask, Corners, FillOptions, FillRule, Hsla, IntoElement, Path,
- PathBuilder, PathStyle, Pixels, Styled, Window, canvas, fill, hsla, linear_color_stop,
- linear_gradient, point, px, size,
+ Bounds, BoxShadow, ContentMask, Corners, Hsla, IntoElement, Pixels, Styled, Window, canvas,
+ fill, hsla, linear_color_stop, linear_gradient, point, px, size,
};
-use script_outline::{SCRIPT_BOUNDS, SCRIPT_OUTLINE};
+use script_outline::LOADING;
const STATIC_PHASE_SECONDS: f32 = 3.;
const FADE_IN_SECONDS: f32 = 0.3;
@@ -22,13 +20,6 @@ const SWEEP_HALF_WIDTH: f32 = 0.26;
const SCRIPT_REST_ALPHA: f32 = 0.12;
const SCRIPT_PEAK_ALPHA: f32 = 0.42;
-enum Segment {
- Move(f32, f32),
- Line(f32, f32),
- Quad(f32, f32, f32, f32),
- Close,
-}
-
struct Cloud {
lightness: f32,
alpha: f32,
@@ -148,53 +139,14 @@ fn sweep_alpha(position: f32, center: f32) -> f32 {
ease_in_out(1. - (position - center).abs() / SWEEP_HALF_WIDTH)
}
-/// The glyph contours overlap where the letters join; a non-zero fill
-/// tessellates them as one union, so the translucent word never doubles up.
-fn script_path(origin: (f32, f32), scale: f32) -> Option<Path<Pixels>> {
- thread_local! {
- static CACHE: RefCell<Option<([u32; 3], Path<Pixels>)>> = const { RefCell::new(None) };
- }
- let key = [origin.0.to_bits(), origin.1.to_bits(), scale.to_bits()];
- CACHE.with_borrow_mut(|cache| {
- if let Some((cached, path)) = cache.as_ref()
- && *cached == key
- {
- return Some(path.clone());
- }
- let place = |x: f32, y: f32| point(px(origin.0 + x * scale), px(origin.1 - y * scale));
- let mut builder = PathBuilder::fill().with_style(PathStyle::Fill(
- FillOptions::default()
- .with_fill_rule(FillRule::NonZero)
- .with_tolerance(0.02),
- ));
- for segment in SCRIPT_OUTLINE {
- match *segment {
- Segment::Move(x, y) => builder.move_to(place(x, y)),
- Segment::Line(x, y) => builder.line_to(place(x, y)),
- Segment::Quad(cx, cy, x, y) => builder.curve_to(place(x, y), place(cx, cy)),
- Segment::Close => builder.close(),
- }
- }
- let path = builder.build().ok()?;
- *cache = Some((key, path.clone()));
- Some(path)
- })
-}
-
fn paint_script(area: Bounds<Pixels>, elapsed: f32, opacity: f32, window: &mut Window) {
- let ((min_x, min_y), (max_x, max_y)) = SCRIPT_BOUNDS;
- let word_width = max_x - min_x;
- let word_height = max_y - min_y;
- let scale =
- (f32::from(area.size.width) / word_width).min(f32::from(area.size.height) / word_height);
- if scale <= 0. || opacity <= 0. {
+ if opacity <= 0. {
return;
}
- let origin = (
- f32::from(area.center().x) - (min_x + word_width / 2.) * scale,
- f32::from(area.center().y) + (min_y + word_height / 2.) * scale,
- );
- let Some(path) = script_path(origin, scale) else {
+ let Some((origin, scale)) = LOADING.fit(area) else {
+ return;
+ };
+ let Some(path) = LOADING.path(origin, scale) else {
return;
};
window.paint_path(path.clone(), hsla(0., 0., 1., SCRIPT_REST_ALPHA * opacity));
diff --git a/apps/desktop-gpui/src/camera_loading/script_outline.rs b/apps/desktop-gpui/src/camera_loading/script_outline.rs
index 29a94bc74..44f5ececf 100644
--- a/apps/desktop-gpui/src/camera_loading/script_outline.rs
+++ b/apps/desktop-gpui/src/camera_loading/script_outline.rs
@@ -3,354 +3,358 @@
// Authors (https://github.com/googlefonts/damionFont), licensed under the
// SIL Open Font License 1.1 (https://openfontlicense.org).
-use super::Segment::{self, Close, Line, Move, Quad};
+use crate::script_text::{
+ Script,
+ Segment::{Close, Line, Move, Quad},
+};
-pub(super) const SCRIPT_BOUNDS: ((f32, f32), (f32, f32)) = ((51., -594.), (5923., 1323.9));
-
-pub(super) const SCRIPT_OUTLINE: &[Segment] = &[
- Move(194., -25.),
- Quad(112., -25., 81.5, 16.),
- Quad(51., 57., 51., 116.),
- Quad(51., 165., 65.5, 216.5),
- Quad(80., 268., 100., 311.),
- Quad(135., 389., 171., 466.),
- Quad(207., 543., 237., 607.),
- Line(540., 1252.),
- Quad(563., 1302., 609., 1317.),
- Quad(655., 1332., 693.5, 1314.5),
- Quad(732., 1297., 732., 1251.),
- Quad(732., 1233., 723.5, 1213.),
- Quad(715., 1193., 702., 1170.),
- Quad(666., 1102., 610.5, 991.),
- Quad(555., 880., 488., 741.),
- Quad(415., 588., 365.5, 484.5),
- Quad(316., 381., 273., 289.),
- Quad(262., 266., 251.5, 235.5),
- Quad(241., 205., 241., 181.),
- Quad(241., 148., 270., 148.),
- Quad(302., 148., 355.5, 174.5),
- Quad(409., 201., 467., 241.),
- Quad(526., 280., 581., 322.5),
- Quad(636., 365., 683., 405.),
- Quad(699., 418., 721., 418.),
- Quad(767., 418., 767., 367.),
- Quad(767., 346., 753., 320.),
- Quad(739., 294., 704., 269.),
- Quad(640., 210., 575.5, 157.5),
- Quad(511., 105., 446., 64.),
- Quad(382., 24., 318., -0.5),
- Quad(254., -25., 194., -25.),
- Close,
- Move(779., -25.),
- Quad(739., -25., 688.5, -3.5),
- Quad(638., 18., 601., 65.),
- Quad(564., 112., 564., 189.),
- Quad(564., 251., 593.5, 341.),
- Quad(623., 431., 684., 519.),
- Quad(746., 608., 843., 667.5),
- Quad(940., 727., 1068., 727.),
- Quad(1119., 727., 1176.5, 708.),
- Quad(1234., 689., 1275., 644.5),
- Quad(1316., 600., 1316., 522.),
- Quad(1316., 458., 1284., 373.),
- Quad(1302., 351., 1335., 351.),
- Quad(1366., 351., 1407., 376.),
- Quad(1448., 401., 1488., 437.),
- Quad(1529., 473., 1562.5, 509.),
- Quad(1596., 545., 1615., 567.),
- Quad(1622., 574., 1632., 574.),
- Quad(1654., 574., 1664., 546.),
- Quad(1674., 518., 1660., 475.5),
- Quad(1646., 433., 1595., 388.),
- Quad(1565., 356., 1521.5, 309.5),
- Quad(1478., 263., 1427.5, 227.5),
- Quad(1377., 192., 1325., 192.),
- Quad(1272., 192., 1225., 226.),
- Quad(1151., 110., 1037., 42.5),
- Quad(923., -25., 779., -25.),
- Close,
- Move(866., 150.),
- Quad(929., 150., 984., 192.),
- Quad(1039., 234., 1073., 298.),
- Quad(1107., 362., 1107., 429.),
- Quad(1107., 455., 1101.5, 483.5),
- Quad(1096., 512., 1077., 531.5),
- Quad(1058., 551., 1016., 551.),
- Quad(954., 551., 899., 511.5),
- Quad(844., 472., 809.5, 409.5),
- Quad(775., 347., 775., 279.),
- Quad(775., 254., 781., 223.5),
- Quad(787., 193., 806.5, 171.5),
- Quad(826., 150., 866., 150.),
- Close,
- Move(1637., -25.),
- Quad(1603., -25., 1556., -6.),
- Quad(1509., 13., 1473.5, 57.),
- Quad(1438., 101., 1438., 175.),
- Quad(1438., 237., 1466., 330.),
- Quad(1494., 423., 1554., 513.),
- Quad(1614., 605., 1707.5, 666.),
- Quad(1801., 727., 1924., 727.),
- Quad(1968., 727., 2001., 716.),
- Quad(2034., 705., 2057., 692.),
- Quad(2070., 684., 2081.5, 675.5),
- Quad(2093., 667., 2103., 657.),
- Line(2138., 674.),
- Quad(2153., 681., 2169.5, 686.5),
- Quad(2186., 692., 2198., 692.),
- Quad(2236., 692., 2260., 671.),
- Quad(2284., 650., 2284., 625.),
- Quad(2284., 617., 2283., 614.),
- Quad(2276., 586., 2257.5, 537.),
- Quad(2239., 488., 2218., 428.),
- Quad(2197., 370., 2182.5, 316.),
- Quad(2168., 262., 2168., 227.),
- Quad(2168., 197., 2178., 177.5),
- Quad(2188., 158., 2212., 158.),
- Quad(2241., 158., 2290., 191.5),
- Quad(2339., 225., 2391., 271.),
- Quad(2419., 296., 2449., 324.5),
- Quad(2479., 353., 2510., 385.),
- Quad(2526., 398., 2541., 398.),
- Quad(2561., 398., 2574.5, 378.5),
- Quad(2588., 359., 2588., 335.),
- Quad(2588., 307., 2569., 288.),
- Quad(2529., 251., 2487., 209.),
- Quad(2445., 167., 2371., 106.),
- Quad(2305., 52., 2235., 13.5),
- Quad(2165., -25., 2109., -25.),
- Quad(2039., -25., 2007., 29.5),
- Quad(1975., 84., 1975., 146.),
- Quad(1975., 191., 1988., 226.),
- Quad(1947., 171., 1891., 112.5),
- Quad(1835., 54., 1770., 14.5),
- Quad(1705., -25., 1637., -25.),
- Close,
- Move(1717., 151.),
- Quad(1749., 151., 1797.5, 192.),
- Quad(1846., 233., 1891., 288.),
- Quad(1941., 348., 1970., 397.),
- Quad(1999., 446., 1999., 463.),
- Quad(1999., 501., 1955., 523.5),
- Quad(1911., 546., 1876., 546.),
- Quad(1814., 546., 1758.5, 506.),
- Quad(1703., 466., 1668., 403.5),
- Quad(1633., 341., 1633., 274.),
- Quad(1633., 235., 1647.5, 193.),
- Quad(1662., 151., 1717., 151.),
- Close,
- Move(2583., -25.),
- Quad(2510., -25., 2462., 16.5),
- Quad(2414., 58., 2414., 155.),
- Quad(2414., 278., 2469., 385.),
- Quad(2524., 492., 2608., 568.),
- Quad(2691., 644., 2783.5, 685.5),
- Quad(2876., 727., 2949., 727.),
- Quad(3008., 727., 3047., 708.),
- Quad(3069., 696., 3084., 681.),
- Line(3092., 698.),
- Line(3110., 740.),
- Line(3121., 765.),
- Quad(3123., 773., 3147., 829.),
- Quad(3171., 885., 3211., 980.),
- Quad(3248., 1068., 3272., 1129.5),
- Quad(3296., 1191., 3297., 1195.),
- Quad(3311., 1245., 3344., 1284.),
- Quad(3377., 1323., 3433., 1323.),
- Quad(3471., 1323., 3496., 1306.5),
- Quad(3521., 1290., 3521., 1243.),
- Quad(3521., 1207., 3505., 1166.),
- Quad(3489., 1125., 3477., 1093.),
- Quad(3429., 997., 3373.5, 880.),
- Quad(3318., 763., 3263., 640.),
- Quad(3208., 517., 3159., 403.5),
- Quad(3110., 290., 3074., 203.),
- Quad(3073., 202., 3073., 198.),
- Quad(3073., 194., 3072., 193.),
- Quad(3072., 175., 3081., 155.5),
- Quad(3090., 136., 3110., 136.),
- Quad(3116., 136., 3122., 138.),
- Quad(3196., 160., 3274., 215.),
- Quad(3352., 270., 3418.5, 333.5),
- Quad(3485., 397., 3525., 445.),
- Quad(3539., 462., 3556., 462.),
- Quad(3571., 462., 3582.5, 448.),
- Quad(3594., 434., 3594., 410.),
- Quad(3594., 391., 3583.5, 365.),
- Quad(3573., 339., 3549., 309.),
- Quad(3471., 223., 3387., 146.5),
- Quad(3303., 70., 3219., 22.5),
- Quad(3135., -25., 3055., -25.),
- Quad(2982., -25., 2940., 16.5),
- Quad(2898., 58., 2898., 141.),
- Line(2898., 152.),
- Quad(2898., 159., 2899., 162.),
- Quad(2853., 79., 2761.5, 27.),
- Quad(2670., -25., 2583., -25.),
- Close,
- Move(2657., 152.),
- Quad(2718., 152., 2773., 189.),
- Quad(2828., 226., 2874., 284.),
- Quad(2920., 342., 2954.5, 405.),
- Quad(2989., 468., 3011., 520.),
- Line(3025., 551.),
- Line(3044., 594.),
- Quad(2985., 593., 2918., 568.),
- Quad(2803., 529., 2717.5, 430.5),
- Quad(2632., 332., 2623., 192.),
- Quad(2623., 152., 2657., 152.),
- Close,
- Move(3788., 794.),
- Quad(3726., 794., 3701., 813.5),
- Quad(3676., 833., 3673., 865.),
- Quad(3673., 912., 3707.5, 957.5),
- Quad(3742., 1003., 3810., 1003.),
- Quad(3868., 1003., 3891., 980.5),
- Quad(3914., 958., 3914., 924.),
- Quad(3914., 886., 3884.5, 840.),
- Quad(3855., 794., 3788., 794.),
- Close,
- Move(3543., -25.),
- Quad(3462., -25., 3415.5, 16.5),
- Quad(3369., 58., 3369., 146.),
- Quad(3369., 207., 3391.5, 267.5),
- Quad(3414., 328., 3441.5, 381.5),
- Quad(3469., 435., 3485., 475.),
- Quad(3490., 488., 3502.5, 515.),
- Quad(3515., 542., 3529., 570.),
- Line(3563., 640.),
- Quad(3580., 668., 3602., 680.),
- Quad(3624., 692., 3647., 692.),
- Quad(3685., 692., 3712.5, 667.5),
- Quad(3740., 643., 3740., 605.),
- Quad(3739., 596., 3737.5, 587.),
- Quad(3736., 578., 3731., 569.),
- Quad(3709., 529., 3693., 494.5),
- Quad(3677., 460., 3660., 425.),
- Quad(3646., 396., 3625., 354.),
- Quad(3604., 312., 3588., 269.5),
- Quad(3572., 227., 3572., 194.),
- Quad(3572., 167., 3585.5, 158.5),
- Quad(3599., 150., 3624., 150.),
- Quad(3664., 150., 3712.5, 175.),
- Quad(3761., 200., 3805., 237.),
- Quad(3851., 274., 3890., 312.5),
- Quad(3929., 351., 3948., 375.),
- Quad(3967., 394., 3988., 394.),
- Quad(4006., 394., 4017.5, 378.),
- Quad(4029., 362., 4029., 337.),
- Quad(4029., 314., 4017.5, 288.),
- Quad(4006., 262., 3980., 239.),
- Quad(3914., 172., 3842., 111.5),
- Quad(3770., 51., 3694.5, 13.),
- Quad(3619., -25., 3543., -25.),
- Close,
- Move(3899., -25.),
- Quad(3864., -25., 3844., -3.),
- Quad(3824., 19., 3824., 51.),
- Quad(3824., 77., 3854., 148.5),
- Quad(3884., 220., 3924., 302.),
- Quad(3975., 409., 4014., 487.5),
- Quad(4053., 566., 4072., 607.),
- Quad(4092., 650., 4122., 671.),
- Quad(4152., 692., 4181., 692.),
- Quad(4205., 692., 4224., 674.5),
- Quad(4243., 657., 4243., 623.),
- Quad(4243., 610., 4240., 595.),
- Quad(4237., 580., 4229., 563.),
- Quad(4260., 602., 4321., 639.5),
- Quad(4382., 677., 4453., 702.),
- Quad(4524., 727., 4584., 727.),
- Quad(4637., 727., 4672.5, 701.5),
- Quad(4708., 676., 4708., 615.),
- Quad(4708., 563., 4685., 502.5),
- Quad(4662., 442., 4630., 386.),
- Quad(4596., 327., 4566.5, 282.5),
- Quad(4537., 238., 4521., 209.),
- Quad(4508., 193., 4508., 172.),
- Quad(4508., 152., 4529., 152.),
- Quad(4536., 152., 4545., 153.5),
- Quad(4554., 155., 4567., 164.),
- Quad(4642., 192., 4716.5, 235.),
- Quad(4791., 278., 4853.5, 324.),
- Quad(4916., 370., 4954., 405.),
- Quad(4970., 418., 4985., 418.),
- Quad(5021., 418., 5021., 372.),
- Quad(5021., 341., 5001.5, 303.),
- Quad(4982., 265., 4940., 232.),
- Quad(4867., 180., 4803.5, 135.5),
- Quad(4740., 91., 4669., 55.),
- Quad(4598., 19., 4500., -9.),
- Quad(4449., -25., 4413., -25.),
- Quad(4311., -25., 4311., 87.),
- Quad(4311., 94., 4311.5, 100.5),
- Quad(4312., 107., 4313., 115.),
- Quad(4316., 160., 4345., 219.5),
- Quad(4374., 279., 4408., 337.),
- Quad(4442., 393., 4469., 442.),
- Quad(4496., 491., 4496., 515.),
- Quad(4496., 551., 4462., 551.),
- Quad(4399., 551., 4341.5, 514.),
- Quad(4284., 477., 4233.5, 420.5),
- Quad(4183., 364., 4141., 302.5),
- Quad(4099., 241., 4067., 191.),
- Quad(4044., 153., 4022.5, 102.),
- Quad(4001., 51., 3972.5, 13.),
- Quad(3944., -25., 3899., -25.),
- Close,
- Move(5012., -594.),
- Quad(4973., -594., 4950.5, -567.),
- Quad(4928., -540., 4928., -502.),
- Quad(4928., -462., 4947.5, -408.5),
- Quad(4967., -355., 5001., -294.),
- Quad(5070., -171., 5193., -28.),
- Line(5317., 130.),
- Quad(5240., 59., 5171., 29.5),
- Quad(5102., 0., 5056., 0.),
- Quad(4976., 0., 4923.5, 70.),
- Quad(4871., 140., 4871., 246.),
- Quad(4871., 356., 4913.5, 445.),
- Quad(4956., 534., 5023., 597.),
- Quad(5089., 659., 5169.5, 693.),
- Quad(5250., 727., 5327., 727.),
- Quad(5371., 727., 5404., 716.),
- Quad(5437., 705., 5460., 692.),
- Quad(5473., 684., 5484.5, 675.5),
- Quad(5496., 667., 5506., 657.),
- Quad(5522., 668., 5536., 674.),
- Quad(5550., 681., 5567., 686.5),
- Quad(5584., 692., 5601., 692.),
- Quad(5645., 692., 5669., 674.),
- Quad(5693., 656., 5693., 631.),
- Quad(5693., 618., 5686., 605.),
- Line(5452., 162.),
- Line(5471., 179.),
- Quad(5589., 248., 5665., 287.5),
- Quad(5741., 327., 5786., 346.),
- Quad(5821., 361., 5844., 367.5),
- Quad(5867., 374., 5875., 374.),
- Quad(5898., 374., 5910.5, 356.5),
- Quad(5923., 339., 5923., 313.),
- Quad(5923., 284., 5906.5, 254.),
- Quad(5890., 224., 5856., 211.),
- Quad(5797., 181., 5714.5, 144.5),
- Quad(5632., 108., 5542.5, 59.5),
- Quad(5453., 11., 5373., -56.),
- Line(5179., -407.),
- Quad(5133., -517., 5097., -557.),
- Quad(5064., -594., 5012., -594.),
- Close,
- Move(5130., 168.),
- Quad(5161., 168., 5208., 206.5),
- Quad(5255., 245., 5298., 297.),
- Quad(5342., 349., 5372., 396.),
- Quad(5402., 443., 5402., 463.),
- Quad(5402., 507., 5360.5, 529.),
- Quad(5319., 551., 5289., 551.),
- Quad(5226., 551., 5170.5, 511.5),
- Quad(5115., 472., 5080.5, 408.5),
- Quad(5046., 345., 5046., 274.),
- Quad(5046., 240., 5060., 204.),
- Quad(5074., 168., 5130., 168.),
- Close,
-];
+pub(crate) const LOADING: Script = Script {
+ bounds: ((51., -594.), (5923., 1323.9)),
+ outline: &[
+ Move(194., -25.),
+ Quad(112., -25., 81.5, 16.),
+ Quad(51., 57., 51., 116.),
+ Quad(51., 165., 65.5, 216.5),
+ Quad(80., 268., 100., 311.),
+ Quad(135., 389., 171., 466.),
+ Quad(207., 543., 237., 607.),
+ Line(540., 1252.),
+ Quad(563., 1302., 609., 1317.),
+ Quad(655., 1332., 693.5, 1314.5),
+ Quad(732., 1297., 732., 1251.),
+ Quad(732., 1233., 723.5, 1213.),
+ Quad(715., 1193., 702., 1170.),
+ Quad(666., 1102., 610.5, 991.),
+ Quad(555., 880., 488., 741.),
+ Quad(415., 588., 365.5, 484.5),
+ Quad(316., 381., 273., 289.),
+ Quad(262., 266., 251.5, 235.5),
+ Quad(241., 205., 241., 181.),
+ Quad(241., 148., 270., 148.),
+ Quad(302., 148., 355.5, 174.5),
+ Quad(409., 201., 467., 241.),
+ Quad(526., 280., 581., 322.5),
+ Quad(636., 365., 683., 405.),
+ Quad(699., 418., 721., 418.),
+ Quad(767., 418., 767., 367.),
+ Quad(767., 346., 753., 320.),
+ Quad(739., 294., 704., 269.),
+ Quad(640., 210., 575.5, 157.5),
+ Quad(511., 105., 446., 64.),
+ Quad(382., 24., 318., -0.5),
+ Quad(254., -25., 194., -25.),
+ Close,
+ Move(779., -25.),
+ Quad(739., -25., 688.5, -3.5),
+ Quad(638., 18., 601., 65.),
+ Quad(564., 112., 564., 189.),
+ Quad(564., 251., 593.5, 341.),
+ Quad(623., 431., 684., 519.),
+ Quad(746., 608., 843., 667.5),
+ Quad(940., 727., 1068., 727.),
+ Quad(1119., 727., 1176.5, 708.),
+ Quad(1234., 689., 1275., 644.5),
+ Quad(1316., 600., 1316., 522.),
+ Quad(1316., 458., 1284., 373.),
+ Quad(1302., 351., 1335., 351.),
+ Quad(1366., 351., 1407., 376.),
+ Quad(1448., 401., 1488., 437.),
+ Quad(1529., 473., 1562.5, 509.),
+ Quad(1596., 545., 1615., 567.),
+ Quad(1622., 574., 1632., 574.),
+ Quad(1654., 574., 1664., 546.),
+ Quad(1674., 518., 1660., 475.5),
+ Quad(1646., 433., 1595., 388.),
+ Quad(1565., 356., 1521.5, 309.5),
+ Quad(1478., 263., 1427.5, 227.5),
+ Quad(1377., 192., 1325., 192.),
+ Quad(1272., 192., 1225., 226.),
+ Quad(1151., 110., 1037., 42.5),
+ Quad(923., -25., 779., -25.),
+ Close,
+ Move(866., 150.),
+ Quad(929., 150., 984., 192.),
+ Quad(1039., 234., 1073., 298.),
+ Quad(1107., 362., 1107., 429.),
+ Quad(1107., 455., 1101.5, 483.5),
+ Quad(1096., 512., 1077., 531.5),
+ Quad(1058., 551., 1016., 551.),
+ Quad(954., 551., 899., 511.5),
+ Quad(844., 472., 809.5, 409.5),
+ Quad(775., 347., 775., 279.),
+ Quad(775., 254., 781., 223.5),
+ Quad(787., 193., 806.5, 171.5),
+ Quad(826., 150., 866., 150.),
+ Close,
+ Move(1637., -25.),
+ Quad(1603., -25., 1556., -6.),
+ Quad(1509., 13., 1473.5, 57.),
+ Quad(1438., 101., 1438., 175.),
+ Quad(1438., 237., 1466., 330.),
+ Quad(1494., 423., 1554., 513.),
+ Quad(1614., 605., 1707.5, 666.),
+ Quad(1801., 727., 1924., 727.),
+ Quad(1968., 727., 2001., 716.),
+ Quad(2034., 705., 2057., 692.),
+ Quad(2070., 684., 2081.5, 675.5),
+ Quad(2093., 667., 2103., 657.),
+ Line(2138., 674.),
+ Quad(2153., 681., 2169.5, 686.5),
+ Quad(2186., 692., 2198., 692.),
+ Quad(2236., 692., 2260., 671.),
+ Quad(2284., 650., 2284., 625.),
+ Quad(2284., 617., 2283., 614.),
+ Quad(2276., 586., 2257.5, 537.),
+ Quad(2239., 488., 2218., 428.),
+ Quad(2197., 370., 2182.5, 316.),
+ Quad(2168., 262., 2168., 227.),
+ Quad(2168., 197., 2178., 177.5),
+ Quad(2188., 158., 2212., 158.),
+ Quad(2241., 158., 2290., 191.5),
+ Quad(2339., 225., 2391., 271.),
+ Quad(2419., 296., 2449., 324.5),
+ Quad(2479., 353., 2510., 385.),
+ Quad(2526., 398., 2541., 398.),
+ Quad(2561., 398., 2574.5, 378.5),
+ Quad(2588., 359., 2588., 335.),
+ Quad(2588., 307., 2569., 288.),
+ Quad(2529., 251., 2487., 209.),
+ Quad(2445., 167., 2371., 106.),
+ Quad(2305., 52., 2235., 13.5),
+ Quad(2165., -25., 2109., -25.),
+ Quad(2039., -25., 2007., 29.5),
+ Quad(1975., 84., 1975., 146.),
+ Quad(1975., 191., 1988., 226.),
+ Quad(1947., 171., 1891., 112.5),
+ Quad(1835., 54., 1770., 14.5),
+ Quad(1705., -25., 1637., -25.),
+ Close,
+ Move(1717., 151.),
+ Quad(1749., 151., 1797.5, 192.),
+ Quad(1846., 233., 1891., 288.),
+ Quad(1941., 348., 1970., 397.),
+ Quad(1999., 446., 1999., 463.),
+ Quad(1999., 501., 1955., 523.5),
+ Quad(1911., 546., 1876., 546.),
+ Quad(1814., 546., 1758.5, 506.),
+ Quad(1703., 466., 1668., 403.5),
+ Quad(1633., 341., 1633., 274.),
+ Quad(1633., 235., 1647.5, 193.),
+ Quad(1662., 151., 1717., 151.),
+ Close,
+ Move(2583., -25.),
+ Quad(2510., -25., 2462., 16.5),
+ Quad(2414., 58., 2414., 155.),
+ Quad(2414., 278., 2469., 385.),
+ Quad(2524., 492., 2608., 568.),
+ Quad(2691., 644., 2783.5, 685.5),
+ Quad(2876., 727., 2949., 727.),
+ Quad(3008., 727., 3047., 708.),
+ Quad(3069., 696., 3084., 681.),
+ Line(3092., 698.),
+ Line(3110., 740.),
+ Line(3121., 765.),
+ Quad(3123., 773., 3147., 829.),
+ Quad(3171., 885., 3211., 980.),
+ Quad(3248., 1068., 3272., 1129.5),
+ Quad(3296., 1191., 3297., 1195.),
+ Quad(3311., 1245., 3344., 1284.),
+ Quad(3377., 1323., 3433., 1323.),
+ Quad(3471., 1323., 3496., 1306.5),
+ Quad(3521., 1290., 3521., 1243.),
+ Quad(3521., 1207., 3505., 1166.),
+ Quad(3489., 1125., 3477., 1093.),
+ Quad(3429., 997., 3373.5, 880.),
+ Quad(3318., 763., 3263., 640.),
+ Quad(3208., 517., 3159., 403.5),
+ Quad(3110., 290., 3074., 203.),
+ Quad(3073., 202., 3073., 198.),
+ Quad(3073., 194., 3072., 193.),
+ Quad(3072., 175., 3081., 155.5),
+ Quad(3090., 136., 3110., 136.),
+ Quad(3116., 136., 3122., 138.),
+ Quad(3196., 160., 3274., 215.),
+ Quad(3352., 270., 3418.5, 333.5),
+ Quad(3485., 397., 3525., 445.),
+ Quad(3539., 462., 3556., 462.),
+ Quad(3571., 462., 3582.5, 448.),
+ Quad(3594., 434., 3594., 410.),
+ Quad(3594., 391., 3583.5, 365.),
+ Quad(3573., 339., 3549., 309.),
+ Quad(3471., 223., 3387., 146.5),
+ Quad(3303., 70., 3219., 22.5),
+ Quad(3135., -25., 3055., -25.),
+ Quad(2982., -25., 2940., 16.5),
+ Quad(2898., 58., 2898., 141.),
+ Line(2898., 152.),
+ Quad(2898., 159., 2899., 162.),
+ Quad(2853., 79., 2761.5, 27.),
+ Quad(2670., -25., 2583., -25.),
+ Close,
+ Move(2657., 152.),
+ Quad(2718., 152., 2773., 189.),
+ Quad(2828., 226., 2874., 284.),
+ Quad(2920., 342., 2954.5, 405.),
+ Quad(2989., 468., 3011., 520.),
+ Line(3025., 551.),
+ Line(3044., 594.),
+ Quad(2985., 593., 2918., 568.),
+ Quad(2803., 529., 2717.5, 430.5),
+ Quad(2632., 332., 2623., 192.),
+ Quad(2623., 152., 2657., 152.),
+ Close,
+ Move(3788., 794.),
+ Quad(3726., 794., 3701., 813.5),
+ Quad(3676., 833., 3673., 865.),
+ Quad(3673., 912., 3707.5, 957.5),
+ Quad(3742., 1003., 3810., 1003.),
+ Quad(3868., 1003., 3891., 980.5),
+ Quad(3914., 958., 3914., 924.),
+ Quad(3914., 886., 3884.5, 840.),
+ Quad(3855., 794., 3788., 794.),
+ Close,
+ Move(3543., -25.),
+ Quad(3462., -25., 3415.5, 16.5),
+ Quad(3369., 58., 3369., 146.),
+ Quad(3369., 207., 3391.5, 267.5),
+ Quad(3414., 328., 3441.5, 381.5),
+ Quad(3469., 435., 3485., 475.),
+ Quad(3490., 488., 3502.5, 515.),
+ Quad(3515., 542., 3529., 570.),
+ Line(3563., 640.),
+ Quad(3580., 668., 3602., 680.),
+ Quad(3624., 692., 3647., 692.),
+ Quad(3685., 692., 3712.5, 667.5),
+ Quad(3740., 643., 3740., 605.),
+ Quad(3739., 596., 3737.5, 587.),
+ Quad(3736., 578., 3731., 569.),
+ Quad(3709., 529., 3693., 494.5),
+ Quad(3677., 460., 3660., 425.),
+ Quad(3646., 396., 3625., 354.),
+ Quad(3604., 312., 3588., 269.5),
+ Quad(3572., 227., 3572., 194.),
+ Quad(3572., 167., 3585.5, 158.5),
+ Quad(3599., 150., 3624., 150.),
+ Quad(3664., 150., 3712.5, 175.),
+ Quad(3761., 200., 3805., 237.),
+ Quad(3851., 274., 3890., 312.5),
+ Quad(3929., 351., 3948., 375.),
+ Quad(3967., 394., 3988., 394.),
+ Quad(4006., 394., 4017.5, 378.),
+ Quad(4029., 362., 4029., 337.),
+ Quad(4029., 314., 4017.5, 288.),
+ Quad(4006., 262., 3980., 239.),
+ Quad(3914., 172., 3842., 111.5),
+ Quad(3770., 51., 3694.5, 13.),
+ Quad(3619., -25., 3543., -25.),
+ Close,
+ Move(3899., -25.),
+ Quad(3864., -25., 3844., -3.),
+ Quad(3824., 19., 3824., 51.),
+ Quad(3824., 77., 3854., 148.5),
+ Quad(3884., 220., 3924., 302.),
+ Quad(3975., 409., 4014., 487.5),
+ Quad(4053., 566., 4072., 607.),
+ Quad(4092., 650., 4122., 671.),
+ Quad(4152., 692., 4181., 692.),
+ Quad(4205., 692., 4224., 674.5),
+ Quad(4243., 657., 4243., 623.),
+ Quad(4243., 610., 4240., 595.),
+ Quad(4237., 580., 4229., 563.),
+ Quad(4260., 602., 4321., 639.5),
+ Quad(4382., 677., 4453., 702.),
+ Quad(4524., 727., 4584., 727.),
+ Quad(4637., 727., 4672.5, 701.5),
+ Quad(4708., 676., 4708., 615.),
+ Quad(4708., 563., 4685., 502.5),
+ Quad(4662., 442., 4630., 386.),
+ Quad(4596., 327., 4566.5, 282.5),
+ Quad(4537., 238., 4521., 209.),
+ Quad(4508., 193., 4508., 172.),
+ Quad(4508., 152., 4529., 152.),
+ Quad(4536., 152., 4545., 153.5),
+ Quad(4554., 155., 4567., 164.),
+ Quad(4642., 192., 4716.5, 235.),
+ Quad(4791., 278., 4853.5, 324.),
+ Quad(4916., 370., 4954., 405.),
+ Quad(4970., 418., 4985., 418.),
+ Quad(5021., 418., 5021., 372.),
+ Quad(5021., 341., 5001.5, 303.),
+ Quad(4982., 265., 4940., 232.),
+ Quad(4867., 180., 4803.5, 135.5),
+ Quad(4740., 91., 4669., 55.),
+ Quad(4598., 19., 4500., -9.),
+ Quad(4449., -25., 4413., -25.),
+ Quad(4311., -25., 4311., 87.),
+ Quad(4311., 94., 4311.5, 100.5),
+ Quad(4312., 107., 4313., 115.),
+ Quad(4316., 160., 4345., 219.5),
+ Quad(4374., 279., 4408., 337.),
+ Quad(4442., 393., 4469., 442.),
+ Quad(4496., 491., 4496., 515.),
+ Quad(4496., 551., 4462., 551.),
+ Quad(4399., 551., 4341.5, 514.),
+ Quad(4284., 477., 4233.5, 420.5),
+ Quad(4183., 364., 4141., 302.5),
+ Quad(4099., 241., 4067., 191.),
+ Quad(4044., 153., 4022.5, 102.),
+ Quad(4001., 51., 3972.5, 13.),
+ Quad(3944., -25., 3899., -25.),
+ Close,
+ Move(5012., -594.),
+ Quad(4973., -594., 4950.5, -567.),
+ Quad(4928., -540., 4928., -502.),
+ Quad(4928., -462., 4947.5, -408.5),
+ Quad(4967., -355., 5001., -294.),
+ Quad(5070., -171., 5193., -28.),
+ Line(5317., 130.),
+ Quad(5240., 59., 5171., 29.5),
+ Quad(5102., 0., 5056., 0.),
+ Quad(4976., 0., 4923.5, 70.),
+ Quad(4871., 140., 4871., 246.),
+ Quad(4871., 356., 4913.5, 445.),
+ Quad(4956., 534., 5023., 597.),
+ Quad(5089., 659., 5169.5, 693.),
+ Quad(5250., 727., 5327., 727.),
+ Quad(5371., 727., 5404., 716.),
+ Quad(5437., 705., 5460., 692.),
+ Quad(5473., 684., 5484.5, 675.5),
+ Quad(5496., 667., 5506., 657.),
+ Quad(5522., 668., 5536., 674.),
+ Quad(5550., 681., 5567., 686.5),
+ Quad(5584., 692., 5601., 692.),
+ Quad(5645., 692., 5669., 674.),
+ Quad(5693., 656., 5693., 631.),
+ Quad(5693., 618., 5686., 605.),
+ Line(5452., 162.),
+ Line(5471., 179.),
+ Quad(5589., 248., 5665., 287.5),
+ Quad(5741., 327., 5786., 346.),
+ Quad(5821., 361., 5844., 367.5),
+ Quad(5867., 374., 5875., 374.),
+ Quad(5898., 374., 5910.5, 356.5),
+ Quad(5923., 339., 5923., 313.),
+ Quad(5923., 284., 5906.5, 254.),
+ Quad(5890., 224., 5856., 211.),
+ Quad(5797., 181., 5714.5, 144.5),
+ Quad(5632., 108., 5542.5, 59.5),
+ Quad(5453., 11., 5373., -56.),
+ Line(5179., -407.),
+ Quad(5133., -517., 5097., -557.),
+ Quad(5064., -594., 5012., -594.),
+ Close,
+ Move(5130., 168.),
+ Quad(5161., 168., 5208., 206.5),
+ Quad(5255., 245., 5298., 297.),
+ Quad(5342., 349., 5372., 396.),
+ Quad(5402., 443., 5402., 463.),
+ Quad(5402., 507., 5360.5, 529.),
+ Quad(5319., 551., 5289., 551.),
+ Quad(5226., 551., 5170.5, 511.5),
+ Quad(5115., 472., 5080.5, 408.5),
+ Quad(5046., 345., 5046., 274.),
+ Quad(5046., 240., 5060., 204.),
+ Quad(5074., 168., 5130., 168.),
+ Close,
+ ],
+};
diff --git a/apps/desktop-gpui/src/main.rs b/apps/desktop-gpui/src/main.rs
index 8a7e21433..066acdd74 100644
--- a/apps/desktop-gpui/src/main.rs
+++ b/apps/desktop-gpui/src/main.rs
@@ -63,6 +63,7 @@ mod screenshot_annotations;
mod screenshot_crop;
mod screenshot_editor;
mod screenshot_export;
+mod script_text;
mod session;
mod settings_pages;
mod settings_window;
diff --git a/apps/desktop-gpui/src/onboarding_window.rs b/apps/desktop-gpui/src/onboarding_window.rs
index a95f130bb..ccdc399ac 100644
--- a/apps/desktop-gpui/src/onboarding_window.rs
+++ b/apps/desktop-gpui/src/onboarding_window.rs
@@ -20,6 +20,7 @@ use crate::{
use crate::ui;
mod stage;
+mod welcome_script;
pub use stage::Paper;
@@ -29,7 +30,81 @@ pub const ONBOARDING_HEADER_HEIGHT: f32 = 36.;
const POLL_INTERVAL: Duration = Duration::from_secs(1);
const REQUEST_GRACE: Duration = Duration::from_secs(2);
-const WELCOME_EXIT: Duration = Duration::from_millis(600);
+const WELCOME_EXIT: Duration = Duration::from_millis(1100);
+const WELCOME_REVEAL_DELAY: Duration = Duration::from_millis(450);
+struct Cloud {
+ art: &'static str,
+ aspect: f32,
+ top: f32,
+ width: f32,
+ phase: f32,
+}
+
+struct CloudLayer {
+ scale: f32,
+ pace: f32,
+ opacity: f32,
+ clouds: &'static [Cloud],
+}
+
+const fn cloud(art: (&'static str, f32), top: f32, width: f32, phase: f32) -> Cloud {
+ Cloud {
+ art: art.0,
+ aspect: art.1,
+ top,
+ width,
+ phase,
+ }
+}
+
+const CUMULUS_A: (&str, f32) = ("onboarding/clouds/cumulus-a.webp", 387. / 896.);
+const CUMULUS_B: (&str, f32) = ("onboarding/clouds/cumulus-b.webp", 360. / 760.);
+const TUFT: (&str, f32) = ("onboarding/clouds/tuft-a.webp", 300. / 600.);
+const BANK: (&str, f32) = ("onboarding/clouds/bank-a.webp", 241. / 864.);
+const WISP: (&str, f32) = ("onboarding/clouds/wisp-a.webp", 203. / 860.);
+/// The landing page's cloud art (`HomeTwo/HeroSky.tsx`) at three depths, far
+/// to near. `pace` is in points per second and stays brisk enough that pixel
+/// snapping never shows as stepping.
+const WELCOME_CLOUD_LAYERS: [CloudLayer; 3] = [
+ CloudLayer {
+ scale: 0.6,
+ pace: 7.,
+ opacity: 0.45,
+ clouds: &[
+ cloud(CUMULUS_B, 0.06, 380., 0.1),
+ cloud(WISP, 0.15, 420., 0.45),
+ cloud(TUFT, 0.28, 300., 0.7),
+ cloud(BANK, 0.38, 400., 0.25),
+ cloud(CUMULUS_A, 0.47, 450., 0.85),
+ cloud(WISP, 0.02, 360., 0.6),
+ ],
+ },
+ CloudLayer {
+ scale: 0.9,
+ pace: 12.,
+ opacity: 0.75,
+ clouds: &[
+ cloud(CUMULUS_A, 0.12, 520., 0.3),
+ cloud(BANK, 0.34, 480., 0.75),
+ cloud(TUFT, 0.5, 320., 0.05),
+ cloud(CUMULUS_B, 0.58, 440., 0.55),
+ cloud(WISP, 0.24, 380., 0.95),
+ ],
+ },
+ CloudLayer {
+ scale: 1.5,
+ pace: 20.,
+ opacity: 0.85,
+ clouds: &[
+ cloud(CUMULUS_A, 0.74, 620., 0.2),
+ cloud(BANK, 0.82, 600., 0.7),
+ cloud(CUMULUS_B, -0.2, 520., 0.45),
+ ],
+ },
+];
+/// The entrance's length; frames are requested until it ends even while the
+/// window is inactive, so it never freezes half-faded.
+const WELCOME_ENTRANCE_SECS: f32 = 3.4;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(usize)]
@@ -187,9 +262,13 @@ pub struct OnboardingWindow {
welcome: bool,
welcome_exiting: bool,
welcome_exit: Option<gpui::Task<()>>,
+ /// The welcome choreography's clocks; `welcome_at` stays `None` under
+ /// Reduce Motion, which renders the settled frame instead.
+ welcome_at: Option<std::time::Instant>,
+ welcome_exit_at: Option<std::time::Instant>,
+ step_delay: Duration,
audio: Option<OnboardingAudio>,
muted: bool,
- bounce: usize,
demo_task: Option<gpui::Task<()>>,
demo_phase: usize,
demo_cycle: usize,
@@ -236,9 +315,11 @@ impl OnboardingWindow {
welcome,
welcome_exiting: false,
welcome_exit: None,
+ welcome_at: None,
+ welcome_exit_at: None,
+ step_delay: Duration::ZERO,
audio: welcome.then(|| OnboardingAudio::new(muted, cx)),
muted,
- bounce: 0,
demo_task: None,
demo_phase: 0,
demo_cycle: 0,
@@ -420,14 +501,19 @@ impl OnboardingWindow {
return;
}
self.welcome_exiting = true;
+ self.welcome_exit_at = Some(std::time::Instant::now());
+ self.step_at = std::time::Instant::now();
+ self.step_revision = self.step_revision.wrapping_add(1);
+ self.step_delay = WELCOME_REVEAL_DELAY;
+ self.transition_direction = 1.;
+ cx.notify();
self.welcome_exit = Some(cx.spawn_in(window, async move |this, cx| {
cx.background_executor().timer(WELCOME_EXIT).await;
this.update_in(cx, |this, window, cx| {
this.welcome = false;
this.welcome_exiting = false;
- this.step_at = std::time::Instant::now();
+ this.welcome_exit_at = None;
this.audio = None;
- this.step_revision = this.step_revision.wrapping_add(1);
this.focus_root(window, cx);
if this.permissions_visible() {
this.refresh_permissions(window, cx);
@@ -453,6 +539,7 @@ impl OnboardingWindow {
self.step = step;
self.step_at = std::time::Instant::now();
self.step_revision = self.step_revision.wrapping_add(1);
+ self.step_delay = Duration::ZERO;
self.poll = None;
self.verify = None;
self.refresh = None;
@@ -731,6 +818,101 @@ fn ease(value: f32) -> f32 {
value * value * (3. - 2. * value)
}
+fn ease_in_out(value: f32) -> f32 {
+ if value < 0.5 {
+ 4. * value.powi(3)
+ } else {
+ 1. - (-2. * value + 2.).powi(3) / 2.
+ }
+}
+
+fn welcome_script(written: f32, opacity: f32) -> impl IntoElement {
+ const FEATHER: f32 = 0.16;
+ const EDGE: f32 = 2.4;
+ const SHADOW_DROP: f32 = 2.;
+ gpui::canvas(
+ |_, _, _| {},
+ move |bounds, _, window, _| {
+ if opacity <= 0. || written <= 0. {
+ return;
+ }
+ let script = &welcome_script::WELCOME;
+ let Some((origin, scale)) = script.fit(bounds) else {
+ return;
+ };
+ let shadow_origin = (origin.0, origin.1 + SHADOW_DROP);
+ let (Some(fill), Some(edge), Some(shadow)) = (
+ script.path(origin, scale),
+ script.stroke(origin, scale, EDGE),
+ script.stroke(shadow_origin, scale, EDGE),
+ ) else {
+ return;
+ };
+ // Shadow, then the edge, then the white over it: the fill hides
+ // the inner half of every stroke, joins included.
+ let layers = [
+ (shadow, Hsla::from(rgba(0x3f5a821f))),
+ (edge, Hsla::from(rgba(0x5f7fae73))),
+ (fill.clone(), Hsla::from(rgba(0xfffffff2))),
+ ];
+ let left = f32::from(fill.bounds.left()) - EDGE;
+ let width = f32::from(fill.bounds.size.width) + 2. * EDGE;
+ let top = fill.bounds.top() - px(EDGE);
+ let height = fill.bounds.size.height + px(2. * EDGE + SHADOW_DROP);
+ let mask = |from: f32, to: f32| gpui::ContentMask {
+ bounds: gpui::Bounds {
+ origin: gpui::point(px(left + from * width), top),
+ size: gpui::size(px((to - from) * width), height),
+ },
+ };
+ let reach = written * (1. + FEATHER);
+ let solid = (reach - FEATHER).clamp(0., 1.);
+ let (start, end) = (solid, reach.min(1.));
+ for (path, color) in layers {
+ let color = color.opacity(opacity);
+ if solid > 0. {
+ window.with_content_mask(Some(mask(0., solid)), |window| {
+ window.paint_path(path.clone(), color);
+ });
+ }
+ // Path gradients span the path's bounds clipped to the
+ // content mask, so the feather's stops run across its strip.
+ if end > start {
+ let fade = (1. - (end - start) / FEATHER).max(0.);
+ window.with_content_mask(Some(mask(start, end)), |window| {
+ window.paint_path(
+ path,
+ linear_gradient(
+ 90.,
+ linear_color_stop(color, 0.),
+ linear_color_stop(color.opacity(fade), 1.),
+ ),
+ );
+ });
+ }
+ }
+ },
+ )
+ .size_full()
+}
+
+fn ease_out(value: f32) -> f32 {
+ 1. - (1. - value).powi(3)
+}
+
+fn beat(elapsed: f32, delay: f32, duration: f32) -> f32 {
+ ((elapsed - delay) / duration).clamp(0., 1.)
+}
+
+#[derive(Clone, Copy)]
+struct WelcomeMotion {
+ t: f32,
+ exit: f32,
+ /// 0 under Reduce Motion: fades only.
+ travel: f32,
+ idle: f32,
+}
+
impl OnboardingWindow {
fn card(&self) -> Div {
div()
@@ -782,286 +964,338 @@ impl OnboardingWindow {
)
}
- fn ambient(&self, width: f32, height: f32, welcome: bool) -> AnyElement {
- let cloud_width = width * 0.8;
- let exiting = welcome && self.welcome_exiting;
- let first = div()
+ fn tick_welcome(&mut self, window: &mut Window, cx: &mut Context<Self>) {
+ let reduce_motion = cx.reduce_motion();
+ if self.welcome_at.is_none() && !reduce_motion {
+ self.welcome_at = Some(std::time::Instant::now());
+ }
+ let entering = self
+ .welcome_at
+ .is_some_and(|at| at.elapsed().as_secs_f32() < WELCOME_ENTRANCE_SECS);
+ if self.welcome_exit_at.is_some() || entering || (self.animated && !reduce_motion) {
+ window.request_animation_frame();
+ }
+ }
+
+ fn welcome_motion(&self) -> WelcomeMotion {
+ let moving = self.welcome_at.is_some();
+ WelcomeMotion {
+ t: self
+ .welcome_at
+ .map_or(WELCOME_ENTRANCE_SECS, |at| at.elapsed().as_secs_f32()),
+ exit: self.welcome_exit_at.map_or(0., |at| {
+ (at.elapsed().as_secs_f32() / WELCOME_EXIT.as_secs_f32()).clamp(0., 1.)
+ }),
+ travel: if moving { 1. } else { 0. },
+ idle: if moving && self.animated { 1. } else { 0. },
+ }
+ }
+
+ fn welcome_sky(&self, width: f32, height: f32, m: WelcomeMotion) -> AnyElement {
+ let travel = m.travel;
+ let gone = ease(m.exit);
+ let unit = width / 1100.;
+ let clouds_in = ease(beat(m.t, 0.4, 2.2));
+ // Constant pace, never eased: images snap to device pixels, so an even
+ // speed is what keeps the steps invisible.
+ let layer = |depth: usize| {
+ let CloudLayer {
+ scale,
+ pace,
+ opacity,
+ clouds,
+ } = WELCOME_CLOUD_LAYERS[depth];
+ let lift = (120. + 140. * depth as f32) * gone * travel;
+ clouds.iter().map(move |cloud| {
+ let Cloud {
+ art,
+ aspect,
+ top,
+ width: cloud_width,
+ phase,
+ } = *cloud;
+ let cloud_width = cloud_width * scale * unit * (1. + 0.25 * gone * travel);
+ let span = width + cloud_width;
+ let x = (phase * span + m.t * pace * travel).rem_euclid(span) - cloud_width;
+ div()
+ .absolute()
+ .left(px(x))
+ .top(px(top * height - lift))
+ .opacity(opacity * clouds_in * (1. - gone))
+ .child(img(art).w(px(cloud_width)).h(px(cloud_width * aspect)))
+ })
+ };
+ let mist = img("onboarding/mist.svg")
.absolute()
- .top_0()
- .right(px(-160.))
- .opacity(0.7)
- .child(
- img("onboarding/cloud-1.png")
- .w(px(cloud_width))
- .h(px(cloud_width * 1138. / 1657.)),
- );
- let second = div().absolute().top_0().left(px(-160.)).opacity(0.7).child(
- img("onboarding/cloud-2.png")
- .w(px(cloud_width))
- .h(px(cloud_width * 892. / 1923.)),
- );
- let third_width = width;
- let third = div()
+ .left(px(-width * 0.1 + 20. * (m.idle * m.t / 7.).sin() * travel))
+ .top(px(-200. * gone * travel))
+ .w(px(width * 1.2))
+ .h(px(height * 1.5))
+ .object_fit(ObjectFit::Fill)
+ .opacity(clouds_in * (1. - gone));
+ let wave =
+ |period: f32, phase: f32| (m.idle * std::f32::consts::TAU * m.t / period + phase).sin();
+ let light_in = ease(beat(m.t, 0.6, 3.)) * (1. - gone);
+ // Twice the window's width so the sheet's edges stay off screen.
+ let sun_size = width * 2.;
+ let sun = img("onboarding/sun.svg")
.absolute()
- .left_0()
- .bottom(px(-height * 0.15))
- .opacity(0.7)
- .child(
- img("onboarding/cloud-3.png")
- .w(px(third_width))
- .h(px(third_width * 703. / 3007.)),
- );
- let clouds = if !self.animated {
- div().size_full().child(first).child(second).child(third)
- } else if exiting {
- div()
- .size_full()
- .child(first.with_animation(
- "welcome-cloud-one-exit",
- Animation::new(WELCOME_EXIT).with_easing(ease),
- |el, t| {
- el.right(px(-160. + 200. * t))
- .top(px(-150. * t))
- .opacity(0.7 * (1. - t))
- },
- ))
- .child(second.with_animation(
- "welcome-cloud-two-exit",
- Animation::new(WELCOME_EXIT).with_easing(ease),
- |el, t| {
- el.left(px(-160. + 200. * t))
- .top(px(-150. * t))
- .opacity(0.7 * (1. - t))
- },
- ))
- .child(third.with_animation(
- "welcome-cloud-three-exit",
- Animation::new(WELCOME_EXIT).with_easing(ease),
- move |el, t| {
- el.bottom(px(-height * 0.15 - 200. * t))
- .opacity(0.7 * (1. - t))
- },
- ))
- } else {
- div()
- .size_full()
- .child(first.with_animation(
- if welcome {
- "welcome-cloud-one"
- } else {
- "ambient-cloud-one"
- },
- Animation::new(Duration::from_secs(30)).repeat(),
- |el, t| {
- let amount = 1. - (2. * t - 1.).abs();
- el.right(px(-160. + 20. * amount)).top(px(10. * amount))
- },
- ))
- .child(second.with_animation(
- if welcome {
- "welcome-cloud-two"
- } else {
- "ambient-cloud-two"
- },
- Animation::new(Duration::from_secs(35)).repeat(),
- |el, t| {
- let amount = 1. - (2. * t - 1.).abs();
- el.left(px(-160. + 20. * amount)).top(px(10. * amount))
- },
- ))
- .child(third.with_animation(
- if welcome {
- "welcome-cloud-three"
- } else {
- "ambient-cloud-three"
- },
- if welcome {
- Animation::new(Duration::from_secs(60)).with_easing(ease)
- } else {
- Animation::new(Duration::from_secs(120)).repeat()
- },
- move |el, t| {
- let t = if welcome { t } else { 1. - (2. * t - 1.).abs() };
- let (x, y) = if t < 0.5 {
- (width * 0.04 * t, 20. * (1. - t * 2.))
- } else {
- (width * 0.04 * (1. - t), 0.)
- };
- el.left(px(x)).bottom(px(-height * 0.15 - y))
- },
- ))
+ .left(px(width * 0.84 - sun_size / 2.))
+ .top(px(-height * 0.06 - sun_size / 2.))
+ .size(px(sun_size))
+ .object_fit(ObjectFit::Fill)
+ .opacity(light_in * (0.85 + 0.15 * wave(9., 0.)));
+ const RAY_BLEED: f32 = 40.;
+ let rays = |art: &'static str, sway: f32, period: f32, phase: f32, strength: f32| {
+ img(art)
+ .absolute()
+ .top_0()
+ .left(px(-RAY_BLEED + sway * wave(period * 1.6, phase) * travel))
+ .w(px(width + 2. * RAY_BLEED))
+ .h(px(height))
+ .object_fit(ObjectFit::Fill)
+ .opacity(light_in * strength * (0.62 + 0.38 * wave(period, phase)))
};
+
+ const GRAIN_JITTER: f32 = 200.;
+ let film_frame = if m.idle > 0. { (m.t * 24.) as u32 } else { 0 };
+ let shift = |salt: u32| ((film_frame.wrapping_mul(salt) >> 7) % 200) as f32;
+ let grain = img("onboarding/grain.svg")
+ .absolute()
+ .left(px(-shift(2_654_435_761)))
+ .top(px(-shift(2_246_822_519)))
+ .w(px(width + GRAIN_JITTER))
+ .h(px(height + GRAIN_JITTER))
+ .object_fit(ObjectFit::Cover);
+ let wash = (std::f32::consts::PI * beat(m.exit, 0.1, 0.75)).sin();
+ let fill =
+ |color: Hsla, opacity: f32| div().absolute().inset_0().bg(color).opacity(opacity);
+
div()
.absolute()
.inset_0()
.overflow_hidden()
- .bg(linear_gradient(
- 180.,
- linear_color_stop(rgb(0x3b82f6), 0.),
- linear_color_stop(rgb(0x2563eb), 1.),
- ))
- .opacity(if welcome { 1. } else { 0.1 })
- .child(clouds)
+ .bg(rgb(0xedf1f6))
+ .child(
+ img("onboarding/sky.svg")
+ .absolute()
+ .inset_0()
+ .size_full()
+ .object_fit(ObjectFit::Fill),
+ )
+ .child(rays("onboarding/rays-far.svg", 14., 10., 0., 0.9))
+ .children(layer(0))
+ .child(mist)
+ .children(layer(1))
+ .children(layer(2))
+ .child(
+ div()
+ .absolute()
+ .left_0()
+ .right_0()
+ .bottom_0()
+ .h(relative(0.4))
+ .bg(linear_gradient(
+ 180.,
+ linear_color_stop(gpui::hsla(0.59, 0.36, 0.95, 0.), 0.),
+ linear_color_stop(gpui::hsla(0.59, 0.36, 0.95, 0.55), 1.),
+ )),
+ )
.child(
- img("onboarding/grain.svg")
+ img("onboarding/vignette.svg")
.absolute()
.inset_0()
.size_full()
.object_fit(ObjectFit::Fill)
- .opacity(0.14),
+ .opacity(1. - gone),
)
+ // Over the vignette, which otherwise darkens the sun's corner.
+ .child(sun)
+ .child(rays("onboarding/rays-near.svg", -18., 13., 2.1, 0.85))
+ .child(fill(gpui::white(), 0.6 * wash))
+ .child(grain)
+ .child(fill(rgb(0xf6f8fb).into(), 1. - ease(beat(m.t, 0.1, 2.4))))
.into_any_element()
}
+ /// Drawn over the whole window, header included, so no strip of the page
+ /// shows above the sky as it fades. `height` is the full window's.
fn render_welcome(&self, width: f32, height: f32, cx: &mut Context<Self>) -> AnyElement {
- let theme = self.theme;
- let glass = theme
- .material
- .filter(|material| material.kind == crate::platform::MaterialKind::LiquidGlass);
- let button_fill = glass
- .map(|material| Hsla::from(material.control_fill))
- .unwrap_or_else(gpui::white);
- let button_hover = glass
- .map(|material| Hsla::from(material.control_hover))
- .unwrap_or_else(|| rgba(0xfffffff2).into());
- let button_text = glass
- .map(|material| Hsla::from(material.text))
- .unwrap_or_else(|| rgb(0x161b26).into());
- // The hint under the label tracks the label: on the Liquid Glass
- // control that text is light, so the white button's navy would vanish.
- let hint_text = button_text.opacity(0.58);
- let (kbd_text, kbd_border, kbd_fill) = match glass {
- Some(_) => (
- button_text,
- button_text.opacity(0.3),
- gpui::transparent_black(),
- ),
- None => (
- Hsla::from(theme.gray_11),
- Hsla::from(theme.gray_6),
- if theme.is_dark() {
- Hsla::from(theme.body_fill(3))
- } else {
- gpui::white()
- },
- ),
+ let m = self.welcome_motion();
+ let travel = m.travel;
+ let ink = Hsla::from(rgb(0x1e2a40));
+
+ let rise = |delay: f32, exit_delay: f32| {
+ let arrive = ease_out(beat(m.t, delay, 1.3));
+ let leave = ease(beat(m.exit, exit_delay, 0.4));
+ let offset = (10. * (1. - arrive) - 24. * leave) * travel;
+ (offset, ease(beat(m.t, delay, 1.2)) * (1. - leave))
};
- let logo = img("onboarding/logo.svg")
- .w(px(80.))
- .h(px(96.))
- .object_fit(ObjectFit::Contain);
- let logo = if self.bounce == 0 || !self.animated {
- logo.into_any_element()
+ let (title_y, title_opacity) = rise(1.0, 0.06);
+ let written = if travel > 0. {
+ ease_in_out(beat(m.t, 1.0, 1.8))
} else {
- div()
- .relative()
- .child(logo)
- .with_animation(
- ("onboarding-logo", self.bounce),
- Animation::new(Duration::from_secs(1)),
- |el, t| el.top(px(-20. * (std::f32::consts::PI * t).sin())),
- )
- .into_any_element()
+ 1.
};
- let content = div()
+ let (subtitle_y, subtitle_opacity) = rise(1.35, 0.03);
+ let (button_y, button_opacity) = rise(1.8, 0.);
+ let logo_leave = ease(beat(m.exit, 0.09, 0.4));
+ let logo_y = -24. * logo_leave * travel;
+ let logo_opacity = ease(beat(m.t, 0.6, 1.2)) * (1. - logo_leave);
+
+ let logo = img("onboarding/wordmark.svg")
+ .w(px(120.))
+ .h(px(40.))
+ .object_fit(ObjectFit::Contain);
+
+ let shadow = |color: u32, y: f32, blur: f32, spread: f32, inset: bool| gpui::BoxShadow {
+ color: rgba(color).into(),
+ offset: gpui::point(px(0.), px(y)),
+ blur_radius: px(blur),
+ spread_radius: px(spread),
+ inset,
+ };
+ let button_shadow = move |lift: bool| {
+ vec![
+ shadow(0xffffffcc, 2., 3., -1., true),
+ shadow(0x3d77c233, -1., 1., 0., true),
+ shadow(
+ if lift { 0x3d77c238 } else { 0x3d77c233 },
+ if lift { 2. } else { 1. },
+ if lift { 4. } else { 2. },
+ 0.,
+ false,
+ ),
+ shadow(
+ if lift { 0x78b2f0a6 } else { 0x78b2f08c },
+ if lift { 14. } else { 10. },
+ if lift { 30. } else { 24. },
+ -10.,
+ false,
+ ),
+ ]
+ };
+ let button = div()
+ .id("onboarding-get-started")
+ .tab_index(0)
+ .cursor_pointer()
.relative()
- .size_full()
+ .top(px(button_y))
+ .opacity(button_opacity)
+ .mt(px(52.))
+ .w(px(274.))
+ .h(px(58.))
+ .rounded(px(14.))
+ .border_1()
+ .border_color(rgba(0x3f7fcda6))
+ .bg(linear_gradient(
+ 180.,
+ linear_color_stop(rgb(0xf5fafe), 0.),
+ linear_color_stop(rgb(0xcfe2f6), 1.),
+ ))
+ .shadow(button_shadow(false))
+ .hover(move |el| {
+ el.border_color(rgba(0x3474c4c7))
+ .shadow(button_shadow(true))
+ })
.flex()
.flex_col()
.items_center()
.justify_center()
- .px(px(16.))
+ .gap(px(2.))
+ .on_click(cx.listener(|this, _, window, cx| this.continue_from_welcome(window, cx)))
.child(
div()
- .id("onboarding-logo")
- .cursor_pointer()
- .on_click(cx.listener(|this, _, _, cx| {
- this.bounce = this.bounce.wrapping_add(1);
- cx.notify();
- }))
- .child(logo),
- )
- .child(
- copy("Welcome to Cap", 48., gpui::white())
- .font_weight(FontWeight::BOLD)
- .line_height(px(48.))
- .mt(px(40.))
- .mb(px(16.)),
+ .absolute()
+ .top(px(3.))
+ .left(px(3.))
+ .right(px(3.))
+ .h(relative(0.44))
+ .rounded_t(px(11.))
+ .bg(linear_gradient(
+ 180.,
+ linear_color_stop(rgba(0xffffff59), 0.),
+ linear_color_stop(rgba(0xffffff00), 1.),
+ )),
)
.child(
- copy(
- "Beautiful screen recordings, owned by you.",
- 24.,
- gpui::white(),
- )
- .line_height(px(32.))
- .opacity(0.8)
- .whitespace_nowrap(),
+ copy("Get Started", 16., ink)
+ .line_height(px(20.))
+ .font_weight(FontWeight::MEDIUM),
)
.child(
div()
- .id("onboarding-get-started")
- .tab_index(0)
- .cursor_pointer()
- .mt(px(56.))
- .w(px(274.))
- .h(px(60.))
- .px(px(64.))
- .py(px(8.))
- .rounded_full()
- .border_1()
- .border_color(if glass.is_some() {
- gpui::transparent_black()
- } else {
- rgba(0xffffff4d).into()
- })
- .bg(button_fill)
- .hover(move |el| el.bg(button_hover))
.flex()
- .flex_col()
.items_center()
.justify_center()
- .gap(px(2.))
- .on_click(
- cx.listener(|this, _, window, cx| this.continue_from_welcome(window, cx)),
- )
+ .gap(px(4.))
.child(
- copy("Get Started", 14., button_text)
- .line_height(px(20.))
- .font_weight(FontWeight::MEDIUM),
+ copy("Click here, or press", 11., ink.opacity(0.55))
+ .font_weight(FontWeight::NORMAL)
+ .line_height(px(14.)),
)
.child(
- div()
- .flex()
- .items_center()
- .justify_center()
- .gap(px(4.))
- .child(
- copy("Click here, or press", 11., hint_text)
- .font_weight(FontWeight::NORMAL)
- .line_height(px(14.)),
- )
- .child(
- copy("Space", 10., kbd_text)
- .font_weight(FontWeight::MEDIUM)
- .line_height(px(14.))
- .px(px(4.))
- .py(px(1.))
- .rounded(px(3.))
- .border_1()
- .border_color(kbd_border)
- .bg(kbd_fill),
- ),
+ copy("Space", 10., ink.opacity(0.7))
+ .font_weight(FontWeight::MEDIUM)
+ .line_height(px(14.))
+ .px(px(4.))
+ .py(px(1.))
+ .rounded(px(3.))
+ .border_1()
+ .border_color(rgba(0x3f7fcd40))
+ .bg(rgba(0xffffffcc)),
),
+ );
+
+ let content = div()
+ .relative()
+ .size_full()
+ .pt(px(ONBOARDING_HEADER_HEIGHT))
+ .flex()
+ .flex_col()
+ .items_center()
+ .justify_center()
+ .px(px(16.))
+ .child(
+ div()
+ .relative()
+ .top(px(logo_y))
+ .opacity(logo_opacity)
+ .child(logo),
+ )
+ .child(
+ div()
+ .relative()
+ .top(px(title_y))
+ .mt(px(30.))
+ .mb(px(18.))
+ .w(px(380.))
+ .h(px(96.))
+ .child(welcome_script(written, title_opacity)),
)
+ .child(
+ copy(
+ "The open source screen sharing app for everyone.",
+ 22.,
+ ink.opacity(0.75),
+ )
+ .relative()
+ .top(px(subtitle_y))
+ .opacity(subtitle_opacity)
+ .font_family("Source Serif 4")
+ .font_weight(FontWeight::LIGHT)
+ .line_height(px(32.))
+ .whitespace_nowrap(),
+ )
+ .child(button)
.when_some(self.error.clone(), |el, error| {
- el.child(copy(error, 12., gpui::white()).mt(px(12.)))
+ el.child(copy(error, 12., ink).mt(px(12.)))
});
let mute = div()
.id("onboarding-mute")
.tab_index(0)
.absolute()
- .top(px(12.))
+ .top(px(ONBOARDING_HEADER_HEIGHT + 12.))
.p(px(4.))
.when(cfg!(target_os = "macos"), |el| el.right(px(16.)))
.when(!cfg!(target_os = "macos"), |el| el.left(px(16.)))
@@ -1075,26 +1309,19 @@ impl OnboardingWindow {
"onboarding/volume-2.svg"
},
24.,
- gpui::white(),
+ ink.opacity(0.55),
));
- let overlay = div()
+ let dissolve = ease(beat(m.exit, 0.45, 0.55));
+ div()
+ .id("onboarding-welcome")
.absolute()
.inset_0()
.overflow_hidden()
- .child(self.ambient(width, height, true))
+ .opacity(1. - dissolve)
+ .child(self.welcome_sky(width, height, m))
.child(content)
- .when(!self.welcome_exiting, |el| el.child(mute));
- if self.welcome_exiting && self.animated {
- overlay
- .with_animation(
- "onboarding-welcome-exit",
- Animation::new(WELCOME_EXIT).with_easing(ease),
- |el, t| el.opacity(1. - t),
- )
- .into_any_element()
- } else {
- overlay.into_any_element()
- }
+ .when(!self.welcome_exiting, |el| el.child(mute))
+ .into_any_element()
}
fn render_overview(&self) -> AnyElement {
@@ -2391,11 +2618,13 @@ impl Render for OnboardingWindow {
if self.permissions_visible() {
self.sync_stage(window, cx);
}
+ if self.welcome {
+ self.tick_welcome(window, cx);
+ }
let theme = self.theme;
let paper = stage::Paper::new(&theme);
let viewport = window.viewport_size();
let width = f32::from(viewport.width);
- let height = (f32::from(viewport.height) - ONBOARDING_HEADER_HEIGHT).max(0.);
let content = match self.step {
Step::Permissions => self.render_permissions(cx),
Step::Overview => self.render_overview(),
@@ -2407,13 +2636,18 @@ impl Render for OnboardingWindow {
Step::Faq => self.render_faq(cx),
};
let content = div().relative().min_h_full().w_full().child(content);
- let content = if self.animated && !self.welcome {
+ let step_visible = !self.welcome || self.welcome_exiting;
+ let content = if self.animated && step_visible {
let direction = self.transition_direction;
+ let delay = self.step_delay.as_secs_f32();
content
.with_animation(
("onboarding-step", self.step_revision),
- Animation::new(Duration::from_millis(500)).with_easing(ease),
- move |el, t| el.left(px(direction * 24. * (1. - t))).opacity(t),
+ Animation::new(Duration::from_secs_f32(0.5 + delay)),
+ move |el, t| {
+ let t = ease(((t * (0.5 + delay) - delay) / 0.5).clamp(0., 1.));
+ el.left(px(direction * 24. * (1. - t))).opacity(t)
+ },
)
.into_any_element()
} else {
@@ -2427,11 +2661,7 @@ impl Render for OnboardingWindow {
.flex()
.items_center()
.justify_between()
- .bg(if self.welcome {
- rgb(0x3b82f6).into()
- } else {
- paper.bg
- })
+ .when(!self.welcome, |el| el.bg(paper.bg))
.window_control_area(gpui::WindowControlArea::Drag);
#[cfg(target_os = "windows")]
let header = header.justify_end().child(ui::windows_caption_controls(
@@ -2471,52 +2701,60 @@ impl Render for OnboardingWindow {
.group_hover("onboarding-close", |el| el.visible()),
),
);
- div()
+ let body = div()
+ .relative()
+ .flex_1()
+ .min_h_0()
+ .w_full()
+ .overflow_hidden()
+ .when(step_visible, |el| {
+ el.bg(paper.bg).child(
+ div()
+ .relative()
+ .size_full()
+ .flex()
+ .flex_col()
+ .child(
+ div()
+ .id("onboarding-scroll")
+ .flex_1()
+ .min_h_0()
+ .w_full()
+ .overflow_y_scroll()
+ .child(content),
+ )
+ .child(self.render_navigation(cx)),
+ )
+ });
+ let root = div()
.id("onboarding")
.track_focus(&self.focus)
.key_context("OnboardingWindow")
.capture_key_down(cx.listener(Self::on_key))
+ .relative()
.size_full()
- .flex()
- .flex_col()
.overflow_hidden()
.rounded(px(16.))
.bg(theme.shell_bg())
.font_family(crate::theme::UI_FONT)
.font_weight(FontWeight::MEDIUM)
- .text_color(theme.body_text())
- .child(header)
- .child(
+ .text_color(theme.body_text());
+ if self.welcome {
+ let full_height = f32::from(viewport.height);
+ root.child(
div()
- .relative()
- .flex_1()
- .min_h_0()
- .w_full()
- .overflow_hidden()
- .when(!self.welcome, |el| el.bg(paper.bg))
- .when(!self.welcome, |el| {
- el.child(
- div()
- .relative()
- .size_full()
- .flex()
- .flex_col()
- .child(
- div()
- .id("onboarding-scroll")
- .flex_1()
- .min_h_0()
- .w_full()
- .overflow_y_scroll()
- .child(content),
- )
- .child(self.render_navigation(cx)),
- )
- })
- .when(self.welcome, |el| {
- el.child(self.render_welcome(width, height, cx))
- }),
+ .size_full()
+ .flex()
+ .flex_col()
+ .bg(paper.bg)
+ .child(div().h(px(ONBOARDING_HEADER_HEIGHT)).flex_shrink_0())
+ .child(body),
)
+ .child(self.render_welcome(width, full_height, cx))
+ .child(header.absolute().top_0().left_0().right_0())
+ } else {
+ root.flex().flex_col().child(header).child(body)
+ }
}
}
diff --git a/apps/desktop-gpui/src/onboarding_window/welcome_script.rs b/apps/desktop-gpui/src/onboarding_window/welcome_script.rs
new file mode 100644
index 000000000..82debca28
--- /dev/null
+++ b/apps/desktop-gpui/src/onboarding_window/welcome_script.rs
@@ -0,0 +1,352 @@
+// "Welcome" set in Damion -- the camera preview's script face -- shaped with
+// HarfBuzz and flattened to outlines in font units (2048 per em, y up), the
+// same way as `camera_loading/script_outline.rs`. Damion is Copyright 2014
+// The Damion Project Authors (https://github.com/googlefonts/damionFont),
+// licensed under the SIL Open Font License 1.1 (https://openfontlicense.org).
+
+use crate::script_text::{
+ Script,
+ Segment::{Close, Line, Move, Quad},
+};
+
+pub(super) const WELCOME: Script = Script {
+ bounds: ((199., -26.), (6325., 1323.9)),
+ outline: &[
+ Move(380., -25.),
+ Quad(337., -25., 308.5, 0.),
+ Quad(280., 25., 280., 73.),
+ Quad(280., 215., 285., 420.),
+ Quad(290., 625., 322., 937.),
+ Quad(287., 896., 263., 878.),
+ Quad(239., 860., 224., 860.),
+ Quad(199., 860., 199., 901.),
+ Quad(199., 934., 216., 985.),
+ Quad(233., 1036., 265., 1094.),
+ Quad(297., 1152., 344.5, 1209.5),
+ Quad(392., 1267., 454., 1312.),
+ Quad(467., 1320., 481., 1320.),
+ Quad(516., 1320., 544., 1274.),
+ Quad(572., 1228., 572., 1175.),
+ Quad(572., 1152., 569., 1135.),
+ Line(550., 1055.),
+ Quad(540., 1012., 525., 889.),
+ Quad(514., 793., 506.5, 672.),
+ Quad(499., 551., 494.5, 430.),
+ Quad(490., 309., 485., 212.),
+ Quad(514., 248., 556., 310.5),
+ Quad(598., 373., 640., 440.),
+ Quad(682., 507., 711., 554.),
+ Line(750., 616.),
+ Line(764., 641.),
+ Line(839., 826.),
+ Line(914., 1007.),
+ Quad(950., 1095., 990., 1143.),
+ Quad(1030., 1191., 1077., 1191.),
+ Quad(1115., 1191., 1138., 1177.5),
+ Quad(1161., 1164., 1161., 1143.),
+ Quad(1161., 1098., 1133., 1030.5),
+ Quad(1105., 963., 1072., 887.),
+ Quad(1039., 811., 1024., 739.),
+ Quad(1019., 652., 1016., 591.),
+ Quad(1013., 530., 1013., 479.),
+ Quad(1013., 416., 1014., 347.),
+ Quad(1015., 278., 1023., 215.),
+ Quad(1083., 301., 1149.5, 408.),
+ Quad(1216., 515., 1276., 628.),
+ Quad(1337., 742., 1382.5, 854.),
+ Quad(1428., 966., 1447., 1064.),
+ Line(1460., 1139.),
+ Quad(1460., 1144., 1461., 1147.),
+ Quad(1462., 1150., 1462., 1155.),
+ Quad(1474., 1214., 1493.5, 1249.),
+ Quad(1513., 1284., 1566., 1284.),
+ Quad(1609., 1284., 1628.5, 1275.),
+ Quad(1648., 1266., 1648., 1235.),
+ Quad(1648., 1222., 1647., 1215.),
+ Line(1643., 1191.),
+ Quad(1595., 923., 1372., 487.),
+ Quad(1291., 321., 1230.5, 209.),
+ Quad(1170., 97., 1113., 40.5),
+ Quad(1056., -16., 984., -16.),
+ Quad(947., -16., 921., 2.),
+ Quad(895., 20., 876., 72.),
+ Quad(857., 123., 844., 216.),
+ Quad(831., 309., 821., 460.),
+ Line(598., 133.),
+ Quad(539., 47., 491., 11.),
+ Quad(443., -25., 380., -25.),
+ Close,
+ Move(1653., -25.),
+ Quad(1573., -25., 1516.5, 14.5),
+ Quad(1460., 54., 1430.5, 118.5),
+ Quad(1401., 183., 1401., 257.),
+ Quad(1401., 322., 1438.5, 402.5),
+ Quad(1476., 483., 1546., 557.),
+ Quad(1616., 631., 1713.5, 679.5),
+ Quad(1811., 728., 1926., 728.),
+ Quad(2009., 728., 2050., 688.),
+ Quad(2091., 648., 2091., 577.),
+ Quad(2091., 535., 2069., 489.),
+ Quad(2047., 443., 1993., 396.),
+ Quad(1939., 348., 1848.5, 298.5),
+ Quad(1758., 249., 1622., 199.),
+ Quad(1633., 137., 1722., 137.),
+ Quad(1791., 137., 1871., 165.5),
+ Quad(1951., 194., 2025., 231.),
+ Quad(2099., 267., 2152., 299.),
+ Quad(2205., 331., 2215., 335.),
+ Quad(2224., 341., 2231.5, 342.),
+ Quad(2239., 343., 2245., 343.),
+ Quad(2269., 343., 2278.5, 324.5),
+ Quad(2288., 306., 2288., 294.),
+ Quad(2288., 285., 2286., 272.5),
+ Quad(2284., 260., 2271., 244.),
+ Quad(2258., 231., 2195., 187.),
+ Quad(2132., 143., 2060., 102.),
+ Quad(1972., 53., 1864., 14.),
+ Quad(1756., -25., 1653., -25.),
+ Close,
+ Move(1607., 314.),
+ Quad(1672., 348., 1739.5, 393.5),
+ Quad(1807., 439., 1842., 460.),
+ Quad(1889., 490., 1904., 513.),
+ Quad(1921., 538., 1921., 555.),
+ Quad(1921., 570., 1911.5, 579.),
+ Quad(1902., 588., 1890., 590.),
+ Line(1881., 591.),
+ Line(1872., 591.),
+ Quad(1817., 591., 1770.5, 559.5),
+ Quad(1724., 528., 1692., 481.),
+ Quad(1658., 432., 1637.5, 389.),
+ Quad(1617., 346., 1607., 314.),
+ Close,
+ Move(2270., -25.),
+ Quad(2188., -25., 2157.5, 16.),
+ Quad(2127., 57., 2127., 116.),
+ Quad(2127., 165., 2141.5, 216.5),
+ Quad(2156., 268., 2176., 311.),
+ Quad(2211., 389., 2247., 466.),
+ Quad(2283., 543., 2313., 607.),
+ Line(2616., 1252.),
+ Quad(2639., 1302., 2685., 1317.),
+ Quad(2731., 1332., 2769.5, 1314.5),
+ Quad(2808., 1297., 2808., 1251.),
+ Quad(2808., 1233., 2799.5, 1213.),
+ Quad(2791., 1193., 2778., 1170.),
+ Quad(2742., 1102., 2686.5, 991.),
+ Quad(2631., 880., 2564., 741.),
+ Quad(2491., 588., 2441.5, 484.5),
+ Quad(2392., 381., 2349., 289.),
+ Quad(2338., 266., 2327.5, 235.5),
+ Quad(2317., 205., 2317., 181.),
+ Quad(2317., 148., 2346., 148.),
+ Quad(2378., 148., 2431.5, 174.5),
+ Quad(2485., 201., 2543., 241.),
+ Quad(2602., 280., 2657., 322.5),
+ Quad(2712., 365., 2759., 405.),
+ Quad(2775., 418., 2797., 418.),
+ Quad(2843., 418., 2843., 367.),
+ Quad(2843., 346., 2829., 320.),
+ Quad(2815., 294., 2780., 269.),
+ Quad(2716., 210., 2651.5, 157.5),
+ Quad(2587., 105., 2522., 64.),
+ Quad(2458., 24., 2394., -0.5),
+ Quad(2330., -25., 2270., -25.),
+ Close,
+ Move(2853., -25.),
+ Quad(2751., -25., 2696., 34.5),
+ Quad(2641., 94., 2641., 177.),
+ Quad(2641., 245., 2686.5, 338.5),
+ Quad(2732., 432., 2807., 520.),
+ Quad(2883., 610., 2977.5, 668.5),
+ Quad(3072., 727., 3166., 727.),
+ Quad(3212., 727., 3242.5, 706.),
+ Quad(3273., 685., 3273., 635.),
+ Quad(3273., 593., 3260., 542.5),
+ Quad(3247., 492., 3218., 455.5),
+ Quad(3189., 419., 3140., 419.),
+ Quad(3120., 419., 3114.5, 425.),
+ Quad(3109., 431., 3109., 446.),
+ Line(3110., 473.),
+ Line(3110., 506.),
+ Quad(3110., 524., 3105., 536.5),
+ Quad(3100., 549., 3080., 549.),
+ Quad(3048., 549., 3004., 514.5),
+ Quad(2960., 480., 2916., 423.),
+ Quad(2875., 368., 2848., 313.5),
+ Quad(2821., 259., 2821., 222.),
+ Quad(2821., 187., 2845.5, 167.),
+ Quad(2870., 147., 2912., 147.),
+ Quad(2978., 147., 3057., 178.),
+ Quad(3136., 209., 3207., 250.),
+ Quad(3276., 290., 3328.5, 325.),
+ Quad(3381., 360., 3391., 365.),
+ Quad(3409., 373., 3421., 373.),
+ Quad(3446., 373., 3455., 355.),
+ Quad(3464., 337., 3464., 324.),
+ Quad(3464., 315., 3462., 302.5),
+ Quad(3460., 290., 3447., 274.),
+ Quad(3433., 257., 3374., 210.),
+ Quad(3315., 163., 3244., 116.),
+ Quad(3159., 59., 3054., 17.),
+ Quad(2949., -25., 2853., -25.),
+ Close,
+ Move(3500., -25.),
+ Quad(3460., -25., 3409.5, -3.5),
+ Quad(3359., 18., 3322., 65.),
+ Quad(3285., 112., 3285., 189.),
+ Quad(3285., 251., 3314.5, 341.),
+ Quad(3344., 431., 3405., 519.),
+ Quad(3467., 608., 3564., 667.5),
+ Quad(3661., 727., 3789., 727.),
+ Quad(3840., 727., 3897.5, 708.),
+ Quad(3955., 689., 3996., 644.5),
+ Quad(4037., 600., 4037., 522.),
+ Quad(4037., 458., 4005., 373.),
+ Quad(4023., 351., 4056., 351.),
+ Quad(4087., 351., 4128., 376.),
+ Quad(4169., 401., 4209., 437.),
+ Quad(4250., 473., 4283.5, 509.),
+ Quad(4317., 545., 4336., 567.),
+ Quad(4343., 574., 4353., 574.),
+ Quad(4375., 574., 4385., 546.),
+ Quad(4395., 518., 4381., 475.5),
+ Quad(4367., 433., 4316., 388.),
+ Quad(4286., 356., 4242.5, 309.5),
+ Quad(4199., 263., 4148.5, 227.5),
+ Quad(4098., 192., 4046., 192.),
+ Quad(3993., 192., 3946., 226.),
+ Quad(3872., 110., 3758., 42.5),
+ Quad(3644., -25., 3500., -25.),
+ Close,
+ Move(3587., 150.),
+ Quad(3650., 150., 3705., 192.),
+ Quad(3760., 234., 3794., 298.),
+ Quad(3828., 362., 3828., 429.),
+ Quad(3828., 455., 3822.5, 483.5),
+ Quad(3817., 512., 3798., 531.5),
+ Quad(3779., 551., 3737., 551.),
+ Quad(3675., 551., 3620., 511.5),
+ Quad(3565., 472., 3530.5, 409.5),
+ Quad(3496., 347., 3496., 279.),
+ Quad(3496., 254., 3502., 223.5),
+ Quad(3508., 193., 3527.5, 171.5),
+ Quad(3547., 150., 3587., 150.),
+ Close,
+ Move(4195., -26.),
+ Quad(4159., -26., 4138., -3.),
+ Quad(4117., 20., 4117., 52.),
+ Quad(4117., 78., 4145., 150.),
+ Quad(4173., 222., 4210., 304.),
+ Quad(4250., 391., 4287.5, 473.),
+ Quad(4325., 555., 4347., 607.),
+ Quad(4365., 650., 4394.5, 671.),
+ Quad(4424., 692., 4453., 692.),
+ Quad(4478., 692., 4497.5, 673.5),
+ Quad(4517., 655., 4517., 620.),
+ Quad(4517., 595., 4505., 563.),
+ Quad(4541., 596., 4583.5, 634.5),
+ Quad(4626., 673., 4682., 700.),
+ Quad(4738., 727., 4813., 727.),
+ Quad(4869., 727., 4911., 698.),
+ Quad(4953., 669., 4957., 601.),
+ Quad(5004., 648., 5066., 687.5),
+ Quad(5128., 727., 5216., 727.),
+ Quad(5283., 727., 5333., 696.5),
+ Quad(5383., 666., 5383., 590.),
+ Quad(5383., 530., 5355.5, 476.),
+ Quad(5328., 422., 5291., 377.),
+ Quad(5277., 360., 5248.5, 327.),
+ Quad(5220., 294., 5196.5, 256.),
+ Quad(5173., 218., 5173., 185.),
+ Quad(5173., 163., 5186.5, 157.),
+ Quad(5200., 151., 5222., 151.),
+ Quad(5264., 151., 5312.5, 175.5),
+ Quad(5361., 200., 5408.5, 236.),
+ Quad(5456., 272., 5495.5, 310.),
+ Quad(5535., 348., 5560., 375.),
+ Quad(5572., 388., 5590., 388.),
+ Quad(5608., 388., 5622.5, 372.),
+ Quad(5637., 356., 5637., 330.),
+ Quad(5637., 310., 5625., 286.),
+ Quad(5613., 262., 5584., 239.),
+ Quad(5515., 172., 5438.5, 111.5),
+ Quad(5362., 51., 5284., 13.),
+ Quad(5206., -25., 5130., -25.),
+ Quad(5056., -25., 5010.5, 10.),
+ Quad(4965., 45., 4965., 121.),
+ Quad(4965., 189., 4998.5, 248.5),
+ Quad(5032., 308., 5074.5, 359.5),
+ Quad(5117., 411., 5144., 454.),
+ Quad(5154., 470., 5160., 484.5),
+ Quad(5166., 499., 5166., 514.),
+ Quad(5166., 551., 5131., 551.),
+ Quad(5072., 551., 5016., 514.5),
+ Quad(4960., 478., 4913., 422.),
+ Quad(4864., 365., 4826.5, 305.),
+ Quad(4789., 245., 4758., 196.),
+ Quad(4739., 161., 4719., 108.5),
+ Quad(4699., 56., 4670.5, 15.),
+ Quad(4642., -26., 4598., -26.),
+ Quad(4572., -26., 4546.5, -9.),
+ Quad(4521., 8., 4519., 34.),
+ Quad(4519., 99., 4559., 173.),
+ Quad(4599., 247., 4651.5, 320.),
+ Quad(4704., 393., 4741., 454.),
+ Quad(4751., 470., 4757., 484.5),
+ Quad(4763., 499., 4763., 514.),
+ Quad(4763., 551., 4728., 551.),
+ Quad(4669., 551., 4613., 514.5),
+ Quad(4557., 478., 4510., 422.),
+ Quad(4461., 365., 4423.5, 305.),
+ Quad(4386., 245., 4355., 196.),
+ Quad(4336., 161., 4316., 108.5),
+ Quad(4296., 56., 4267.5, 15.),
+ Quad(4239., -26., 4195., -26.),
+ Close,
+ Move(5690., -25.),
+ Quad(5610., -25., 5553.5, 14.5),
+ Quad(5497., 54., 5467.5, 118.5),
+ Quad(5438., 183., 5438., 257.),
+ Quad(5438., 322., 5475.5, 402.5),
+ Quad(5513., 483., 5583., 557.),
+ Quad(5653., 631., 5750.5, 679.5),
+ Quad(5848., 728., 5963., 728.),
+ Quad(6046., 728., 6087., 688.),
+ Quad(6128., 648., 6128., 577.),
+ Quad(6128., 535., 6106., 489.),
+ Quad(6084., 443., 6030., 396.),
+ Quad(5976., 348., 5885.5, 298.5),
+ Quad(5795., 249., 5659., 199.),
+ Quad(5670., 137., 5759., 137.),
+ Quad(5828., 137., 5908., 165.5),
+ Quad(5988., 194., 6062., 231.),
+ Quad(6136., 267., 6189., 299.),
+ Quad(6242., 331., 6252., 335.),
+ Quad(6261., 341., 6268.5, 342.),
+ Quad(6276., 343., 6282., 343.),
+ Quad(6306., 343., 6315.5, 324.5),
+ Quad(6325., 306., 6325., 294.),
+ Quad(6325., 285., 6323., 272.5),
+ Quad(6321., 260., 6308., 244.),
+ Quad(6295., 231., 6232., 187.),
+ Quad(6169., 143., 6097., 102.),
+ Quad(6009., 53., 5901., 14.),
+ Quad(5793., -25., 5690., -25.),
+ Close,
+ Move(5644., 314.),
+ Quad(5709., 348., 5776.5, 393.5),
+ Quad(5844., 439., 5879., 460.),
+ Quad(5926., 490., 5941., 513.),
+ Quad(5958., 538., 5958., 555.),
+ Quad(5958., 570., 5948.5, 579.),
+ Quad(5939., 588., 5927., 590.),
+ Line(5918., 591.),
+ Line(5909., 591.),
+ Quad(5854., 591., 5807.5, 559.5),
+ Quad(5761., 528., 5729., 481.),
+ Quad(5695., 432., 5674.5, 389.),
+ Quad(5654., 346., 5644., 314.),
+ Close,
+ ],
+};
diff --git a/apps/desktop-gpui/src/script_text.rs b/apps/desktop-gpui/src/script_text.rs
new file mode 100644
index 000000000..8338ff628
--- /dev/null
+++ b/apps/desktop-gpui/src/script_text.rs
@@ -0,0 +1,93 @@
+//! Script lettering drawn from pre-shaped glyph outlines (Damion, set with
+//! HarfBuzz offline), so the face needs no font loading: the camera
+//! preview's "loading" and the welcome screen's "Welcome".
+
+use std::cell::RefCell;
+
+use gpui::{Bounds, FillOptions, FillRule, Path, PathBuilder, PathStyle, Pixels, point, px};
+
+pub(crate) enum Segment {
+ Move(f32, f32),
+ Line(f32, f32),
+ Quad(f32, f32, f32, f32),
+ Close,
+}
+
+type PathCache = Vec<(usize, [u32; 4], Path<Pixels>)>;
+
+/// Outlines are in font units: 2048 per em, y up.
+pub(crate) struct Script {
+ pub bounds: ((f32, f32), (f32, f32)),
+ pub outline: &'static [Segment],
+}
+
+impl Script {
+ pub fn fit(&self, area: Bounds<Pixels>) -> Option<((f32, f32), f32)> {
+ let ((min_x, min_y), (max_x, max_y)) = self.bounds;
+ let word_width = max_x - min_x;
+ let word_height = max_y - min_y;
+ let scale = (f32::from(area.size.width) / word_width)
+ .min(f32::from(area.size.height) / word_height);
+ (scale > 0.).then(|| {
+ let origin = (
+ f32::from(area.center().x) - (min_x + word_width / 2.) * scale,
+ f32::from(area.center().y) + (min_y + word_height / 2.) * scale,
+ );
+ (origin, scale)
+ })
+ }
+
+ /// The glyph contours overlap where the letters join; a non-zero fill
+ /// tessellates them as one union, so a translucent word never doubles up.
+ pub fn path(&self, origin: (f32, f32), scale: f32) -> Option<Path<Pixels>> {
+ self.build(origin, scale, 0.)
+ }
+
+ /// Every contour stroked `width` wide. Strokes run through the joins
+ /// too, so paint the fill over this: only the word's outer edge stays.
+ pub fn stroke(&self, origin: (f32, f32), scale: f32, width: f32) -> Option<Path<Pixels>> {
+ self.build(origin, scale, width)
+ }
+
+ fn build(&self, origin: (f32, f32), scale: f32, stroke: f32) -> Option<Path<Pixels>> {
+ thread_local! {
+ static CACHE: RefCell<PathCache> = const { RefCell::new(Vec::new()) };
+ }
+ let id = self.outline.as_ptr() as usize;
+ let key = [
+ origin.0.to_bits(),
+ origin.1.to_bits(),
+ scale.to_bits(),
+ stroke.to_bits(),
+ ];
+ CACHE.with_borrow_mut(|cache| {
+ if let Some((_, _, path)) = cache.iter().find(|(i, k, _)| *i == id && *k == key) {
+ return Some(path.clone());
+ }
+ let place = |x: f32, y: f32| point(px(origin.0 + x * scale), px(origin.1 - y * scale));
+ let mut builder = if stroke > 0. {
+ PathBuilder::stroke(px(stroke))
+ } else {
+ PathBuilder::fill().with_style(PathStyle::Fill(
+ FillOptions::default()
+ .with_fill_rule(FillRule::NonZero)
+ .with_tolerance(0.02),
+ ))
+ };
+ for segment in self.outline {
+ match *segment {
+ Segment::Move(x, y) => builder.move_to(place(x, y)),
+ Segment::Line(x, y) => builder.line_to(place(x, y)),
+ Segment::Quad(cx, cy, x, y) => builder.curve_to(place(x, y), place(cx, cy)),
+ Segment::Close => builder.close(),
+ }
+ }
+ let path = builder.build().ok()?;
+ if cache.len() >= 8 {
+ cache.remove(0);
+ }
+ cache.push((id, key, path.clone()));
+ Some(path)
+ })
+ }
+}