| @@ -1,29 +1,30 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Desktop Mode — First-run welcome dialog. | |
| 3 | + * OpenStation — First-run welcome dialog. | |
| 4 | 4 | * |
| 5 | - * Renders a one-time, self-contained modal inside the *classic* WordPress | |
| 6 | - * admin (never inside the desktop shell or a chromeless iframe) telling | |
| 7 | - * the user where the "Switch to Desktop Mode" button lives in the admin | |
| 8 | - * bar. Dismissal is persisted via the existing seen-intros registry | |
| 5 | + * Renders a one-time, self-contained modal inside the *classic* | |
| 6 | + * WordPress admin (never inside the desktop shell or a chromeless | |
| 7 | + * iframe) that introduces OpenStation and offers to switch it on. | |
| 8 | + * Dismissal is persisted via the existing seen-intros registry | |
| 9 | 9 | * (`desktop_mode_seen_intros` user meta, slug `activation-welcome`), |
| 10 | - * which means the "Reset what's-new dialogs" button in OS Settings → | |
| 11 | - * Features brings it back exactly like every other intro dialog. | |
| 10 | + * which means the "Reset what's-new dialogs" button in OpenStation | |
| 11 | + * Preferences → Features brings it back exactly like every other intro | |
| 12 | + * dialog. | |
| 12 | 13 | * |
| 13 | 14 | * The dialog is intentionally self-contained — all HTML, CSS and JS are |
| 14 | 15 | * inlined into `admin_footer`. We deliberately do NOT use any of the |
| 15 | - * `<wpd-*>` shell components here because they only ship inside the | |
| 16 | + * `<os-*>` shell components here because they only ship inside the | |
| 16 | 17 | * desktop bundle, which is precisely *not* loaded on the classic admin |
| 17 | 18 | * screens where this dialog is allowed to appear. |
| 18 | 19 | * |
| 19 | - * @package Desktop_Mode | |
| 20 | + * @package OpenStation | |
| 20 | 21 | */ |
| 21 | 22 | |
| 22 | 23 | defined( 'ABSPATH' ) || exit; |
| 23 | 24 | |
| 24 | 25 | /** Slug stored in `desktop_mode_seen_intros` for this dialog. */ |
| 25 | -const DESKTOP_MODE_WELCOME_INTRO_SLUG = 'activation-welcome'; | |
| 26 | +const OPENSTATION_WELCOME_INTRO_SLUG = 'activation-welcome'; | |
| 26 | 27 | |
| 27 | 28 | /** |
| 28 | 29 | * Decides whether the welcome dialog should render on the current request. |
| 29 | 30 | * |
| @@ -34,23 +35,24 @@ | ||
| 34 | 35 | * no destructive surface, but anonymous output makes no sense). |
| 35 | 36 | * 3. The request is NOT chromeless — chromeless pages are iframes |
| 36 | 37 | * rendering inside the desktop shell; the parent shell already shows |
| 37 | 38 | * its own UX. |
| 38 | - * 4. Desktop Mode is NOT already enabled for the user. This is a | |
| 39 | - * "switch to Desktop Mode" promo, so it has nothing to say once the | |
| 39 | + * 4. OpenStation is NOT already enabled for the user. This is a | |
| 40 | + * "switch to OpenStation" promo, so it has nothing to say once the | |
| 40 | 41 | * user is in the shell. The desktop shell's *parent* page is admin |
| 41 | 42 | * context and is not chromeless, so without this gate the dialog |
| 42 | - * re-renders there the moment the user clicks "Enable it now" — read | |
| 43 | - * as a duplicate dialog, because the fire-and-forget seen-intro POST | |
| 44 | - * races the redirect into the shell and often loses. | |
| 43 | + * re-renders there the moment the user clicks "Switch to | |
| 44 | + * OpenStation", which reads as a duplicate dialog because the | |
| 45 | + * fire-and-forget seen-intro POST races the redirect into the shell | |
| 46 | + * and often loses. | |
| 45 | 47 | * 5. The user has not already dismissed this intro. |
| 46 | - * 6. The `desktop_mode_show_welcome_dialog` filter returns truthy, so | |
| 48 | + * 6. The `openstation_show_welcome_dialog` filter returns truthy, so | |
| 47 | 49 | * sites can suppress the dialog entirely (e.g. managed-host onboarding |
| 48 | 50 | * flows that ship their own). |
| 49 | 51 | * |
| 50 | 52 | * @return bool |
| 51 | 53 | */ |
| 52 | -function desktop_mode_should_show_welcome_dialog() { | |
| 54 | +function openstation_should_show_welcome_dialog() { | |
| 53 | 55 | if ( ! is_admin() || ! is_user_logged_in() ) { |
| 54 | 56 | return false; |
| 55 | 57 | } |
| 56 | 58 | if ( ! current_user_can( 'read' ) ) { |
| @@ -55,16 +57,16 @@ | ||
| 55 | 57 | } |
| 56 | 58 | if ( ! current_user_can( 'read' ) ) { |
| 57 | 59 | return false; |
| 58 | 60 | } |
| 59 | - if ( function_exists( 'desktop_mode_is_chromeless_request' ) && desktop_mode_is_chromeless_request() ) { | |
| 61 | + if ( function_exists( 'openstation_is_chromeless_request' ) && openstation_is_chromeless_request() ) { | |
| 60 | 62 | return false; |
| 61 | 63 | } |
| 62 | - if ( function_exists( 'desktop_mode_is_enabled' ) && desktop_mode_is_enabled() ) { | |
| 64 | + if ( function_exists( 'openstation_is_enabled' ) && openstation_is_enabled() ) { | |
| 63 | 65 | return false; |
| 64 | 66 | } |
| 65 | 67 | $user_id = get_current_user_id(); |
| 66 | - if ( desktop_mode_has_seen_intro( $user_id, DESKTOP_MODE_WELCOME_INTRO_SLUG ) ) { | |
| 68 | + if ( openstation_has_seen_intro( $user_id, OPENSTATION_WELCOME_INTRO_SLUG ) ) { | |
| 67 | 69 | return false; |
| 68 | 70 | } |
| 69 | 71 | |
| 70 | 72 | /** |
| @@ -75,528 +77,582 @@ | ||
| 75 | 77 | * |
| 76 | 78 | * @param bool $show Whether to render the dialog. Default true. |
| 77 | 79 | * @param int $user_id Current user ID. |
| 78 | 80 | */ |
| 79 | - return (bool) apply_filters( 'desktop_mode_show_welcome_dialog', true, $user_id ); | |
| 81 | + return (bool) apply_filters( 'openstation_show_welcome_dialog', true, $user_id ); | |
| 80 | 82 | } |
| 81 | 83 | |
| 82 | 84 | /** |
| 85 | + * Returns one of OpenStation's own icons as inline SVG markup. | |
| 86 | + * | |
| 87 | + * Reads the outlined copies in `assets/icons/` (the ones registered with | |
| 88 | + * Core's icon registry), which paint with `currentColor`, so the dialog's | |
| 89 | + * CSS decides their colour. Returns an empty string for a missing file, | |
| 90 | + * which leaves an empty icon slot rather than breaking the dialog. | |
| 91 | + * | |
| 92 | + * @param string $slug Icon slug, e.g. `windows`. | |
| 93 | + * @return string Sanitised SVG markup. | |
| 94 | + */ | |
| 95 | +function openstation_welcome_dialog_icon( $slug ) { | |
| 96 | + $path = OPENSTATION_DIR . 'assets/icons/' . sanitize_key( $slug ) . '.svg'; | |
| 97 | + if ( ! is_readable( $path ) ) { | |
| 98 | + return ''; | |
| 99 | + } | |
| 100 | + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- local plugin file, not a remote URL. | |
| 101 | + $svg = (string) file_get_contents( $path ); | |
| 102 | + | |
| 103 | + return wp_kses( | |
| 104 | + $svg, | |
| 105 | + array( | |
| 106 | + 'svg' => array( | |
| 107 | + 'xmlns' => true, | |
| 108 | + 'viewbox' => true, | |
| 109 | + 'width' => true, | |
| 110 | + 'height' => true, | |
| 111 | + 'aria-hidden' => true, | |
| 112 | + 'focusable' => true, | |
| 113 | + ), | |
| 114 | + 'path' => array( | |
| 115 | + 'd' => true, | |
| 116 | + 'fill' => true, | |
| 117 | + ), | |
| 118 | + ) | |
| 119 | + ); | |
| 120 | +} | |
| 121 | + | |
| 122 | +/** | |
| 83 | 123 | * Prints the welcome dialog markup, styles and dismiss script into |
| 84 | 124 | * `admin_footer`. |
| 85 | 125 | * |
| 86 | 126 | * Self-contained on purpose: everything is scoped under the |
| 87 | - * `.desktop-mode-welcome` namespace so it cannot collide with the host | |
| 127 | + * `.os-welcome` namespace so it cannot collide with the host | |
| 88 | 128 | * admin theme. The dismiss button POSTs to the seen-intros REST route, |
| 89 | 129 | * which is exactly the same endpoint the in-shell intros use. |
| 130 | + * | |
| 131 | + * The look is deliberately quiet: a light card with a dark panel that | |
| 132 | + * shows two OpenStation windows, the holo mark, and Pulse kept to the | |
| 133 | + * feature icons. Every colour is a literal from the brand palette rather | |
| 134 | + * than a `--os-*` token, because `variables.css` is not loaded in classic | |
| 135 | + * admin. Spacing sits on an 8px grid. | |
| 90 | 136 | */ |
| 91 | -function desktop_mode_render_welcome_dialog() { | |
| 92 | - if ( ! desktop_mode_should_show_welcome_dialog() ) { | |
| 137 | +function openstation_render_welcome_dialog() { | |
| 138 | + if ( ! openstation_should_show_welcome_dialog() ) { | |
| 93 | 139 | return; |
| 94 | 140 | } |
| 95 | 141 | |
| 96 | - $rest_url = esc_url_raw( rest_url( 'desktop-mode/v1/intros/seen' ) ); | |
| 97 | - $rest_nonce = wp_create_nonce( 'wp_rest' ); | |
| 98 | - $ajax_url = esc_url_raw( admin_url( 'admin-ajax.php' ) ); | |
| 99 | - $ajax_nonce = wp_create_nonce( 'save-desktop-mode' ); | |
| 100 | - $slug = DESKTOP_MODE_WELCOME_INTRO_SLUG; | |
| 142 | + $rest_url = esc_url_raw( rest_url( 'desktop-mode/v1/intros/seen' ) ); | |
| 143 | + $rest_nonce = wp_create_nonce( 'wp_rest' ); | |
| 144 | + $ajax_url = esc_url_raw( admin_url( 'admin-ajax.php' ) ); | |
| 145 | + $ajax_nonce = wp_create_nonce( 'save-openstation' ); | |
| 146 | + $slug = OPENSTATION_WELCOME_INTRO_SLUG; | |
| 147 | + $font_url = OPENSTATION_URL . 'assets/fonts/Geist-Variable.woff2'; | |
| 148 | + $mono_url = OPENSTATION_URL . 'assets/fonts/GeistMono-Variable.woff2'; | |
| 149 | + $mark_url = OPENSTATION_URL . 'assets/images/openstation-mark-holo.svg'; | |
| 101 | 150 | |
| 102 | 151 | // All user-facing strings are passed through translation; the dialog |
| 103 | 152 | // is keyboard-dismissible (Escape) and moves initial focus to the |
| 104 | 153 | // primary CTA. |
| 105 | - $title = __( 'Welcome to Desktop Mode', 'desktop-mode' ); | |
| 106 | - $subtitle = __( 'A floating, window-based workspace for the WordPress admin — more like a real OS, less like a webpage.', 'desktop-mode' ); | |
| 107 | - $body = __( 'Desktop Mode reimagines the WordPress admin as a true desktop environment. Open multiple admin screens side-by-side, drag and drop content between windows, and keep your work in view as you move between tasks.', 'desktop-mode' ); | |
| 108 | - $cta = __( 'Got it', 'desktop-mode' ); | |
| 109 | - $enable = __( 'Enable it now', 'desktop-mode' ); | |
| 110 | - $enabling = __( 'Enabling…', 'desktop-mode' ); | |
| 111 | - $close_a = __( 'Close', 'desktop-mode' ); | |
| 154 | + $title = __( 'Welcome to OpenStation', 'desktop-mode' ); | |
| 155 | + $body = __( 'Your admin, as a desktop. Keep several screens open at once and move between tasks without losing your place.', 'desktop-mode' ); | |
| 156 | + $later = __( 'Not now', 'desktop-mode' ); | |
| 157 | + $enable = __( 'Switch to OpenStation', 'desktop-mode' ); | |
| 158 | + $enabling = __( 'Switching…', 'desktop-mode' ); | |
| 112 | 159 | |
| 113 | 160 | $features = array( |
| 114 | 161 | array( |
| 115 | - 'icon' => '🪟', | |
| 116 | - 'title' => __( 'Multi-window workspace', 'desktop-mode' ), | |
| 117 | - 'desc' => __( 'Open Posts, Media and Plugins in their own draggable, resizable windows. Tile, cascade or stack them however you work best.', 'desktop-mode' ), | |
| 162 | + 'icon' => 'windows', | |
| 163 | + 'title' => __( 'Work in windows', 'desktop-mode' ), | |
| 164 | + 'desc' => __( 'Posts, media and settings side by side.', 'desktop-mode' ), | |
| 118 | 165 | ), |
| 119 | 166 | array( |
| 120 | - 'icon' => '⚡', | |
| 121 | - 'title' => __( 'Native, table-driven apps', 'desktop-mode' ), | |
| 122 | - 'desc' => __( 'Posts, Pages, Users and Plugins are reimplemented as fast native windows with sticky headers, bulk actions, multi-select and inline previews.', 'desktop-mode' ), | |
| 167 | + 'icon' => 'apps', | |
| 168 | + 'title' => __( 'Apps for everyday tasks', 'desktop-mode' ), | |
| 169 | + 'desc' => __( 'Fast lists with bulk actions and previews.', 'desktop-mode' ), | |
| 123 | 170 | ), |
| 124 | 171 | array( |
| 125 | - 'icon' => '🎨', | |
| 126 | - 'title' => __( 'Wallpapers, dock & themes', 'desktop-mode' ), | |
| 127 | - 'desc' => __( 'Make it yours. Choose a wallpaper, pin your favorite screens to the dock, and switch accent colors — all from OS Settings.', 'desktop-mode' ), | |
| 172 | + 'icon' => 'dock', | |
| 173 | + 'title' => __( 'A dock for your screens', 'desktop-mode' ), | |
| 174 | + 'desc' => __( 'Pin what you use most, one click away.', 'desktop-mode' ), | |
| 128 | 175 | ), |
| 129 | 176 | array( |
| 130 | - 'icon' => '🤖', | |
| 131 | - 'title' => __( 'AI Copilot, built in', 'desktop-mode' ), | |
| 132 | - 'desc' => __( 'Press ⌘K anywhere to ask the AI Assistant — it can run commands, navigate windows and answer questions about your site.', 'desktop-mode' ), | |
| 177 | + 'icon' => 'command', | |
| 178 | + /* translators: %s: the keyboard shortcut that opens search, e.g. ⌘K. */ | |
| 179 | + 'title' => __( 'Search with %s', 'desktop-mode' ), | |
| 180 | + 'desc' => __( 'Jump to any screen or run a command.', 'desktop-mode' ), | |
| 181 | + 'kbd' => true, | |
| 133 | 182 | ), |
| 134 | 183 | ); |
| 135 | 184 | ?> |
| 136 | -<style id="desktop-mode-welcome-style"> | |
| 137 | - .desktop-mode-welcome, | |
| 138 | - .desktop-mode-welcome * { | |
| 185 | +<style id="os-welcome-style"> | |
| 186 | + @font-face { | |
| 187 | + font-family: "OpenStation Geist"; | |
| 188 | + src: url( "<?php echo esc_url( $font_url ); ?>" ) format( "woff2" ); | |
| 189 | + font-weight: 100 900; | |
| 190 | + font-style: normal; | |
| 191 | + font-display: swap; | |
| 192 | + } | |
| 193 | + @font-face { | |
| 194 | + font-family: "OpenStation Geist Mono"; | |
| 195 | + src: url( "<?php echo esc_url( $mono_url ); ?>" ) format( "woff2" ); | |
| 196 | + font-weight: 100 900; | |
| 197 | + font-style: normal; | |
| 198 | + font-display: swap; | |
| 199 | + } | |
| 200 | + .os-welcome, | |
| 201 | + .os-welcome * { | |
| 139 | 202 | box-sizing: border-box; |
| 140 | 203 | } |
| 141 | - .desktop-mode-welcome { | |
| 204 | + .os-welcome { | |
| 205 | + /* Brand palette, as literals: see the render function's docblock. */ | |
| 206 | + --_void: #0c0b0f; | |
| 207 | + --_obsidian: #1a1721; | |
| 208 | + --_astro: #33303a; | |
| 209 | + --_silver: #4d4a52; | |
| 210 | + --_pewter: #66636b; | |
| 211 | + --_osmium: #99969c; | |
| 212 | + --_ash: #b3afb5; | |
| 213 | + --_cloud: #ccc8ce; | |
| 214 | + --_mist: #e6e2e6; | |
| 215 | + --_haze: #f4f1f4; | |
| 216 | + --_starlight: #fffbff; | |
| 217 | + --_pulse: #f252fc; | |
| 218 | + | |
| 142 | 219 | position: fixed; |
| 143 | 220 | inset: 0; |
| 144 | 221 | z-index: 100000; |
| 145 | 222 | display: flex; |
| 146 | - align-items: center; | |
| 147 | - justify-content: center; | |
| 148 | 223 | padding: 24px; |
| 149 | - background: radial-gradient( | |
| 150 | - ellipse at 30% 20%, | |
| 151 | - rgba( 56, 189, 248, 0.32 ), | |
| 152 | - transparent 60% | |
| 153 | - ), | |
| 154 | - radial-gradient( | |
| 155 | - ellipse at 70% 80%, | |
| 156 | - rgba( 16, 185, 129, 0.26 ), | |
| 157 | - transparent 55% | |
| 158 | - ), | |
| 159 | - rgba( 8, 14, 26, 0.62 ); | |
| 160 | - backdrop-filter: blur( 14px ) saturate( 140% ); | |
| 161 | - -webkit-backdrop-filter: blur( 14px ) saturate( 140% ); | |
| 162 | - animation: desktop-mode-welcome-fade 360ms cubic-bezier( 0.22, 1, 0.36, 1 ); | |
| 163 | - font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, | |
| 164 | - "Helvetica Neue", Arial, sans-serif; | |
| 224 | + overflow-y: auto; | |
| 225 | + background: rgba( 12, 11, 15, 0.72 ); | |
| 226 | + backdrop-filter: blur( 16px ); | |
| 227 | + -webkit-backdrop-filter: blur( 16px ); | |
| 228 | + animation: os-welcome-fade 240ms ease-out; | |
| 229 | + font-family: "OpenStation Geist", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; | |
| 230 | + font-size: 16px; | |
| 231 | + line-height: 1.5; | |
| 232 | + color: var( --_obsidian ); | |
| 165 | 233 | -webkit-font-smoothing: antialiased; |
| 166 | 234 | -moz-osx-font-smoothing: grayscale; |
| 167 | 235 | } |
| 168 | - @keyframes desktop-mode-welcome-fade { | |
| 236 | + @keyframes os-welcome-fade { | |
| 169 | 237 | from { opacity: 0; } |
| 170 | 238 | to { opacity: 1; } |
| 171 | 239 | } |
| 172 | - @keyframes desktop-mode-welcome-pop { | |
| 173 | - 0% { opacity: 0; transform: translateY( 14px ) scale( 0.96 ); } | |
| 174 | - 100% { opacity: 1; transform: translateY( 0 ) scale( 1 ); } | |
| 240 | + @keyframes os-welcome-pop { | |
| 241 | + from { opacity: 0; transform: translateY( 8px ); } | |
| 242 | + to { opacity: 1; transform: translateY( 0 ); } | |
| 175 | 243 | } |
| 176 | - @keyframes desktop-mode-welcome-arrow { | |
| 177 | - 0%, 100% { transform: translateX( 0 ); opacity: 0.85; } | |
| 178 | - 50% { transform: translateX( 6px ); opacity: 1; } | |
| 179 | - } | |
| 180 | - @keyframes desktop-mode-welcome-shimmer { | |
| 181 | - 0% { background-position: 0% 50%; } | |
| 182 | - 100% { background-position: 200% 50%; } | |
| 183 | - } | |
| 184 | - .desktop-mode-welcome__card { | |
| 185 | - position: relative; | |
| 244 | + .os-welcome__card { | |
| 245 | + /* margin:auto centres the card and still lets a short viewport scroll to its top. */ | |
| 246 | + margin: auto; | |
| 186 | 247 | width: 100%; |
| 187 | - max-width: 760px; | |
| 188 | - border-radius: 22px; | |
| 248 | + max-width: 820px; | |
| 249 | + min-height: 544px; | |
| 250 | + display: grid; | |
| 251 | + grid-template-columns: 5fr 6fr; | |
| 189 | 252 | overflow: hidden; |
| 190 | - background: linear-gradient( | |
| 191 | - 145deg, | |
| 192 | - rgba( 255, 255, 255, 0.98 ) 0%, | |
| 193 | - rgba( 244, 250, 253, 0.98 ) 100% | |
| 194 | - ); | |
| 253 | + background: var( --_starlight ); | |
| 254 | + border-radius: 13px; | |
| 195 | 255 | box-shadow: |
| 196 | - 0 1px 0 rgba( 255, 255, 255, 0.85 ) inset, | |
| 197 | - 0 30px 60px -20px rgba( 8, 47, 73, 0.55 ), | |
| 198 | - 0 18px 36px -18px rgba( 14, 165, 233, 0.45 ); | |
| 199 | - animation: desktop-mode-welcome-pop 460ms cubic-bezier( 0.22, 1, 0.36, 1 ) both; | |
| 200 | - animation-delay: 60ms; | |
| 256 | + 0 0 0 1px rgba( 12, 11, 15, 0.08 ), | |
| 257 | + 0 32px 64px -24px rgba( 12, 11, 15, 0.48 ); | |
| 258 | + animation: os-welcome-pop 320ms cubic-bezier( 0.22, 1, 0.36, 1 ) both; | |
| 201 | 259 | } |
| 202 | - .desktop-mode-welcome__card::before { | |
| 203 | - content: ""; | |
| 204 | - position: absolute; | |
| 205 | - inset: -1px; | |
| 206 | - border-radius: inherit; | |
| 207 | - padding: 1px; | |
| 208 | - background: linear-gradient( | |
| 209 | - 135deg, | |
| 210 | - rgba( 14, 165, 233, 0.65 ), | |
| 211 | - rgba( 6, 182, 212, 0.55 ), | |
| 212 | - rgba( 16, 185, 129, 0.55 ) | |
| 213 | - ); | |
| 214 | - -webkit-mask: linear-gradient( #000 0 0 ) content-box, | |
| 215 | - linear-gradient( #000 0 0 ); | |
| 216 | - -webkit-mask-composite: xor; | |
| 217 | - mask-composite: exclude; | |
| 218 | - pointer-events: none; | |
| 219 | - } | |
| 220 | - .desktop-mode-welcome__hero { | |
| 260 | + | |
| 261 | + /* ---- Dark panel: two windows on the station ------------------- */ | |
| 262 | + | |
| 263 | + .os-welcome__art { | |
| 221 | 264 | position: relative; |
| 222 | - padding: 36px 36px 24px; | |
| 223 | - background: linear-gradient( | |
| 224 | - 135deg, | |
| 225 | - #0f172a 0%, | |
| 226 | - #0e7490 45%, | |
| 227 | - #06b6d4 100% | |
| 228 | - ); | |
| 229 | - background-size: 200% 200%; | |
| 230 | - animation: desktop-mode-welcome-shimmer 14s ease infinite alternate; | |
| 231 | - color: #fff; | |
| 232 | 265 | overflow: hidden; |
| 266 | + isolation: isolate; | |
| 267 | + background: | |
| 268 | + radial-gradient( 1px 1px at 12% 18%, rgba( 255, 251, 255, 0.55 ) 50%, transparent 51% ), | |
| 269 | + radial-gradient( 1px 1px at 78% 12%, rgba( 255, 251, 255, 0.4 ) 50%, transparent 51% ), | |
| 270 | + radial-gradient( 1px 1px at 64% 44%, rgba( 255, 251, 255, 0.3 ) 50%, transparent 51% ), | |
| 271 | + radial-gradient( 1.5px 1.5px at 88% 62%, rgba( 255, 251, 255, 0.45 ) 50%, transparent 51% ), | |
| 272 | + radial-gradient( 1px 1px at 22% 72%, rgba( 255, 251, 255, 0.35 ) 50%, transparent 51% ), | |
| 273 | + radial-gradient( 1px 1px at 46% 88%, rgba( 255, 251, 255, 0.3 ) 50%, transparent 51% ), | |
| 274 | + radial-gradient( 1px 1px at 8% 48%, rgba( 255, 251, 255, 0.3 ) 50%, transparent 51% ), | |
| 275 | + radial-gradient( 1px 1px at 94% 90%, rgba( 255, 251, 255, 0.35 ) 50%, transparent 51% ), | |
| 276 | + radial-gradient( 1px 1px at 36% 8%, rgba( 255, 251, 255, 0.35 ) 50%, transparent 51% ), | |
| 277 | + radial-gradient( 60% 45% at 85% 100%, rgba( 236, 155, 255, 0.1 ), transparent 70% ), | |
| 278 | + radial-gradient( 50% 40% at 0% 30%, rgba( 159, 152, 255, 0.07 ), transparent 70% ), | |
| 279 | + var( --_void ); | |
| 233 | 280 | } |
| 234 | - .desktop-mode-welcome__hero::after { | |
| 281 | + .os-welcome__art::after { | |
| 235 | 282 | content: ""; |
| 236 | 283 | position: absolute; |
| 237 | 284 | inset: 0; |
| 285 | + pointer-events: none; | |
| 238 | 286 | background: |
| 239 | - radial-gradient( circle at 85% 15%, rgba( 56, 189, 248, 0.35 ), transparent 45% ), | |
| 240 | - radial-gradient( circle at 15% 90%, rgba( 16, 185, 129, 0.22 ), transparent 50% ), | |
| 241 | - linear-gradient( rgba( 255, 255, 255, 0.05 ) 1px, transparent 1px ) 0 0 / 28px 28px, | |
| 242 | - linear-gradient( 90deg, rgba( 255, 255, 255, 0.05 ) 1px, transparent 1px ) 0 0 / 28px 28px; | |
| 243 | - pointer-events: none; | |
| 244 | - mask-image: radial-gradient( ellipse at 50% 40%, #000 35%, transparent 80% ); | |
| 245 | - -webkit-mask-image: radial-gradient( ellipse at 50% 40%, #000 35%, transparent 80% ); | |
| 287 | + linear-gradient( 180deg, rgba( 12, 11, 15, 0.85 ) 0%, rgba( 12, 11, 15, 0 ) 22% ), | |
| 288 | + linear-gradient( 0deg, rgba( 12, 11, 15, 0.6 ) 0%, rgba( 12, 11, 15, 0 ) 26% ); | |
| 246 | 289 | } |
| 247 | - .desktop-mode-welcome__eyebrow { | |
| 248 | - display: inline-flex; | |
| 290 | + .os-welcome .os-welcome__mark { | |
| 291 | + position: absolute; | |
| 292 | + top: 32px; | |
| 293 | + inset-inline-start: 32px; | |
| 294 | + z-index: 2; | |
| 295 | + display: block; | |
| 296 | + width: 40px; | |
| 297 | + height: 40px; | |
| 298 | + max-width: none; | |
| 299 | + } | |
| 300 | + .os-welcome__pair { | |
| 301 | + position: absolute; | |
| 302 | + left: 50%; | |
| 303 | + top: 50%; | |
| 304 | + width: 300px; | |
| 305 | + height: 276px; | |
| 306 | + transform: translate( -50%, -44% ); | |
| 307 | + direction: ltr; | |
| 308 | + } | |
| 309 | + .os-welcome__win { | |
| 310 | + position: absolute; | |
| 311 | + overflow: hidden; | |
| 312 | + border-radius: 9px; | |
| 313 | + /* The window greys sit a step above the palette's dark ramp so the art reads against Void. */ | |
| 314 | + background: #201d28; | |
| 315 | + border: 1px solid rgba( 255, 251, 255, 0.12 ); | |
| 316 | + box-shadow: 0 18px 36px -12px rgba( 0, 0, 0, 0.7 ); | |
| 317 | + font-size: 9px; | |
| 318 | + line-height: 1; | |
| 319 | + } | |
| 320 | + .os-welcome__win--posts { left: 0; top: 0; width: 236px; height: 184px; } | |
| 321 | + .os-welcome__win--media { right: 0; bottom: 0; width: 236px; height: 160px; } | |
| 322 | + .os-welcome__bar { | |
| 323 | + display: flex; | |
| 249 | 324 | align-items: center; |
| 325 | + justify-content: space-between; | |
| 326 | + height: 24px; | |
| 327 | + padding: 0 8px; | |
| 328 | + font-weight: 500; | |
| 329 | + color: var( --_mist ); | |
| 330 | + border-bottom: 1px solid rgba( 255, 251, 255, 0.08 ); | |
| 331 | + } | |
| 332 | + .os-welcome__bar-title { display: flex; align-items: center; gap: 8px; } | |
| 333 | + .os-welcome__bar-title i { width: 7px; height: 7px; border: 1px solid var( --_osmium ); border-radius: 50%; } | |
| 334 | + .os-welcome__bar-ctl { display: flex; gap: 8px; } | |
| 335 | + .os-welcome__bar-ctl i { display: block; width: 6px; height: 6px; border: 1px solid #77747c; border-radius: 1.5px; } | |
| 336 | + .os-welcome__bar-ctl i:first-child { height: 0; border-width: 1px 0 0; margin-top: 3px; border-radius: 0; } | |
| 337 | + .os-welcome__rows { padding: 8px; } | |
| 338 | + .os-welcome__row { | |
| 339 | + display: grid; | |
| 340 | + grid-template-columns: 7px 1fr 34px; | |
| 341 | + align-items: center; | |
| 250 | 342 | gap: 8px; |
| 251 | - padding: 5px 12px; | |
| 252 | - font-size: 11px; | |
| 253 | - font-weight: 600; | |
| 254 | - letter-spacing: 0.12em; | |
| 255 | - text-transform: uppercase; | |
| 256 | - color: #fff; | |
| 257 | - background: rgba( 255, 255, 255, 0.18 ); | |
| 258 | - border: 1px solid rgba( 255, 255, 255, 0.28 ); | |
| 259 | - border-radius: 999px; | |
| 260 | - backdrop-filter: blur( 6px ); | |
| 261 | - -webkit-backdrop-filter: blur( 6px ); | |
| 343 | + height: 24px; | |
| 344 | + border-bottom: 1px solid rgba( 255, 251, 255, 0.07 ); | |
| 262 | 345 | } |
| 263 | - .desktop-mode-welcome__eyebrow-dot { | |
| 264 | - width: 6px; | |
| 265 | - height: 6px; | |
| 266 | - border-radius: 50%; | |
| 267 | - background: #22d3ee; | |
| 268 | - box-shadow: 0 0 0 4px rgba( 34, 211, 238, 0.28 ); | |
| 346 | + .os-welcome__row i { width: 7px; height: 7px; border: 1px solid #5c5963; border-radius: 2px; } | |
| 347 | + .os-welcome__row b { height: 5px; border-radius: 3px; background: #5c5963; } | |
| 348 | + .os-welcome__row em { height: 9px; border-radius: 999px; background: #3e3b46; } | |
| 349 | + .os-welcome__row--head b, | |
| 350 | + .os-welcome__row--head em { background: #3e3b46; } | |
| 351 | + .os-welcome__row--selected { background: rgba( 255, 251, 255, 0.05 ); } | |
| 352 | + .os-welcome__thumbs { padding: 8px; display: grid; grid-template-columns: repeat( 4, 1fr ); gap: 8px; } | |
| 353 | + .os-welcome__thumbs i { | |
| 354 | + display: block; | |
| 355 | + aspect-ratio: 1; | |
| 356 | + border-radius: 4px; | |
| 357 | + background: linear-gradient( 150deg, #34303d, #27242f ); | |
| 358 | + border: 1px solid rgba( 255, 251, 255, 0.06 ); | |
| 269 | 359 | } |
| 270 | - .desktop-mode-welcome__title { | |
| 271 | - margin: 14px 0 6px; | |
| 272 | - font-size: 26px; | |
| 273 | - line-height: 1.2; | |
| 274 | - font-weight: 700; | |
| 360 | + .os-welcome__thumbs i:nth-child( 3n + 1 ) { background: linear-gradient( 150deg, #3a3444, #2a2633 ); } | |
| 361 | + .os-welcome__thumbs i:nth-child( 5 ) { | |
| 362 | + background: | |
| 363 | + radial-gradient( circle at 70% 30%, rgba( 236, 155, 255, 0.22 ), transparent 60% ), | |
| 364 | + linear-gradient( 150deg, #36313f, #25222c ); | |
| 365 | + } | |
| 366 | + | |
| 367 | + /* ---- Content column ------------------------------------------- */ | |
| 368 | + | |
| 369 | + .os-welcome__main { | |
| 370 | + display: flex; | |
| 371 | + flex-direction: column; | |
| 372 | + min-width: 0; | |
| 373 | + text-align: start; | |
| 374 | + } | |
| 375 | + .os-welcome__content { | |
| 376 | + display: grid; | |
| 377 | + gap: 24px; | |
| 378 | + padding: 32px; | |
| 379 | + } | |
| 380 | + .os-welcome__head { | |
| 381 | + display: grid; | |
| 382 | + gap: 8px; | |
| 383 | + } | |
| 384 | + .os-welcome .os-welcome__title { | |
| 385 | + margin: 0; | |
| 386 | + padding: 0; | |
| 387 | + font-family: inherit; | |
| 388 | + font-size: 24px; | |
| 389 | + line-height: 1.3; | |
| 390 | + font-weight: 500; | |
| 275 | 391 | letter-spacing: -0.01em; |
| 276 | - color: #fff; | |
| 392 | + color: var( --_obsidian ); | |
| 393 | + text-wrap: balance; | |
| 277 | 394 | } |
| 278 | - .desktop-mode-welcome__subtitle { | |
| 395 | + .os-welcome .os-welcome__lede { | |
| 279 | 396 | margin: 0; |
| 280 | - font-size: 14px; | |
| 397 | + font-size: 16px; | |
| 281 | 398 | line-height: 1.5; |
| 282 | - color: rgba( 255, 255, 255, 0.85 ); | |
| 399 | + color: var( --_silver ); | |
| 283 | 400 | } |
| 284 | - .desktop-mode-welcome__body { | |
| 285 | - padding: 24px 36px 24px; | |
| 286 | - font-size: 14.5px; | |
| 287 | - line-height: 1.6; | |
| 288 | - color: #1f2937; | |
| 289 | - } | |
| 290 | - .desktop-mode-welcome__lede { | |
| 401 | + .os-welcome .os-welcome__features { | |
| 402 | + display: grid; | |
| 403 | + gap: 16px; | |
| 291 | 404 | margin: 0; |
| 292 | - font-size: 14.5px; | |
| 293 | - color: #374151; | |
| 294 | - } | |
| 295 | - .desktop-mode-welcome__features { | |
| 296 | - display: grid; | |
| 297 | - grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); | |
| 298 | - gap: 14px; | |
| 299 | - margin: 20px 0 0; | |
| 300 | 405 | padding: 0; |
| 301 | 406 | list-style: none; |
| 302 | 407 | } |
| 303 | - .desktop-mode-welcome__feature { | |
| 304 | - position: relative; | |
| 305 | - padding: 14px 14px 14px 52px; | |
| 306 | - background: linear-gradient( | |
| 307 | - 145deg, | |
| 308 | - rgba( 255, 255, 255, 0.85 ), | |
| 309 | - rgba( 240, 249, 255, 0.85 ) | |
| 310 | - ); | |
| 311 | - border: 1px solid rgba( 14, 165, 233, 0.18 ); | |
| 312 | - border-radius: 12px; | |
| 313 | - box-shadow: 0 1px 0 rgba( 255, 255, 255, 0.9 ) inset, | |
| 314 | - 0 2px 6px -2px rgba( 8, 47, 73, 0.08 ); | |
| 408 | + .os-welcome .os-welcome__feature { | |
| 409 | + display: flex; | |
| 410 | + gap: 16px; | |
| 411 | + margin: 0; | |
| 315 | 412 | } |
| 316 | - .desktop-mode-welcome__feature-icon { | |
| 317 | - position: absolute; | |
| 318 | - top: 12px; | |
| 319 | - left: 12px; | |
| 320 | - width: 30px; | |
| 321 | - height: 30px; | |
| 322 | - display: inline-flex; | |
| 323 | - align-items: center; | |
| 324 | - justify-content: center; | |
| 325 | - border-radius: 9px; | |
| 326 | - background: linear-gradient( 135deg, rgba( 14, 165, 233, 0.16 ), rgba( 16, 185, 129, 0.16 ) ); | |
| 327 | - border: 1px solid rgba( 14, 165, 233, 0.22 ); | |
| 328 | - font-size: 16px; | |
| 329 | - line-height: 1; | |
| 413 | + .os-welcome__icon { | |
| 414 | + flex: none; | |
| 415 | + width: 20px; | |
| 416 | + height: 20px; | |
| 417 | + color: var( --_pulse ); | |
| 330 | 418 | } |
| 331 | - .desktop-mode-welcome__feature-title { | |
| 419 | + .os-welcome__icon svg { | |
| 332 | 420 | display: block; |
| 333 | - margin: 0 0 2px; | |
| 334 | - font-size: 13.5px; | |
| 335 | - font-weight: 700; | |
| 336 | - color: #0f172a; | |
| 421 | + width: 20px; | |
| 422 | + height: 20px; | |
| 337 | 423 | } |
| 338 | - .desktop-mode-welcome__feature-desc { | |
| 424 | + .os-welcome__feature-title { | |
| 425 | + display: block; | |
| 426 | + font-size: 14px; | |
| 427 | + font-weight: 600; | |
| 428 | + line-height: 1.4; | |
| 429 | + color: var( --_obsidian ); | |
| 430 | + } | |
| 431 | + .os-welcome .os-welcome__feature-desc { | |
| 339 | 432 | margin: 0; |
| 340 | - font-size: 12.5px; | |
| 433 | + font-size: 14px; | |
| 341 | 434 | line-height: 1.5; |
| 342 | - color: #475569; | |
| 435 | + color: var( --_pewter ); | |
| 343 | 436 | } |
| 344 | - .desktop-mode-welcome__hint { | |
| 345 | - display: flex; | |
| 346 | - align-items: center; | |
| 347 | - gap: 12px; | |
| 348 | - margin: 18px 0 0; | |
| 349 | - padding: 14px 16px; | |
| 350 | - background: linear-gradient( | |
| 351 | - 135deg, | |
| 352 | - rgba( 14, 165, 233, 0.08 ), | |
| 353 | - rgba( 16, 185, 129, 0.08 ) | |
| 354 | - ); | |
| 355 | - border: 1px solid rgba( 14, 165, 233, 0.22 ); | |
| 356 | - border-radius: 12px; | |
| 357 | - font-size: 13.5px; | |
| 358 | - color: #0c4a6e; | |
| 359 | - } | |
| 360 | - .desktop-mode-welcome__hint-icon { | |
| 361 | - flex-shrink: 0; | |
| 362 | - width: 24px; | |
| 363 | - height: 24px; | |
| 364 | - border-radius: 50%; | |
| 365 | - display: inline-flex; | |
| 366 | - align-items: center; | |
| 367 | - justify-content: center; | |
| 368 | - background: linear-gradient( 135deg, #0ea5e9, #06b6d4 ); | |
| 369 | - color: #fff; | |
| 370 | - font-size: 14px; | |
| 371 | - line-height: 1; | |
| 372 | - animation: desktop-mode-welcome-arrow 1.8s ease-in-out infinite; | |
| 373 | - } | |
| 374 | - .desktop-mode-welcome__hint-icon::before { | |
| 375 | - content: "→"; | |
| 376 | - font-weight: 700; | |
| 377 | - } | |
| 378 | - .desktop-mode-welcome__hint code { | |
| 437 | + .os-welcome .os-welcome__kbd { | |
| 379 | 438 | display: inline-block; |
| 380 | - padding: 2px 6px; | |
| 381 | - margin: 0 2px; | |
| 382 | - background: rgba( 255, 255, 255, 0.85 ); | |
| 383 | - border: 1px solid rgba( 14, 165, 233, 0.28 ); | |
| 439 | + margin: 0; | |
| 440 | + padding: 0 8px; | |
| 441 | + font-family: "OpenStation Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace; | |
| 442 | + font-size: 12px; | |
| 443 | + font-weight: 500; | |
| 444 | + line-height: 16px; | |
| 445 | + color: var( --_astro ); | |
| 446 | + background: var( --_haze ); | |
| 447 | + border: 1px solid var( --_mist ); | |
| 448 | + border-bottom-color: var( --_cloud ); | |
| 384 | 449 | border-radius: 5px; |
| 385 | - font-family: ui-monospace, SFMono-Regular, Menlo, monospace; | |
| 386 | - font-size: 12px; | |
| 387 | - color: #0369a1; | |
| 450 | + white-space: nowrap; | |
| 388 | 451 | } |
| 389 | - .desktop-mode-welcome__actions { | |
| 452 | + | |
| 453 | + /* Anchored to the bottom of the card, however long the copy runs. */ | |
| 454 | + .os-welcome__actions { | |
| 455 | + margin-top: auto; | |
| 390 | 456 | display: flex; |
| 391 | - align-items: center; | |
| 457 | + flex-wrap: wrap; | |
| 392 | 458 | justify-content: flex-end; |
| 393 | - gap: 10px; | |
| 394 | - padding: 0 36px 28px; | |
| 459 | + gap: 8px; | |
| 460 | + padding: 0 32px 32px; | |
| 395 | 461 | } |
| 396 | - .desktop-mode-welcome__btn { | |
| 462 | + .os-welcome .os-welcome__btn { | |
| 397 | 463 | display: inline-flex; |
| 398 | 464 | align-items: center; |
| 399 | 465 | justify-content: center; |
| 400 | - gap: 6px; | |
| 401 | - min-height: 38px; | |
| 402 | - padding: 8px 18px; | |
| 466 | + min-height: 40px; | |
| 467 | + margin: 0; | |
| 468 | + padding: 0 16px; | |
| 469 | + font-family: inherit; | |
| 403 | 470 | font-size: 14px; |
| 404 | - font-weight: 600; | |
| 405 | - font-family: inherit; | |
| 471 | + font-weight: 500; | |
| 406 | 472 | line-height: 1; |
| 407 | - border-radius: 10px; | |
| 408 | - border: 1px solid transparent; | |
| 473 | + border-radius: 8px; | |
| 474 | + border: 1px solid var( --_obsidian ); | |
| 475 | + box-shadow: none; | |
| 409 | 476 | cursor: pointer; |
| 410 | - transition: transform 120ms ease, box-shadow 120ms ease, | |
| 411 | - background 120ms ease, color 120ms ease; | |
| 477 | + transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease; | |
| 412 | 478 | } |
| 413 | - .desktop-mode-welcome__btn:focus-visible { | |
| 414 | - outline: 2px solid #0ea5e9; | |
| 479 | + .os-welcome .os-welcome__btn:focus-visible { | |
| 480 | + outline: 2px solid var( --_obsidian ); | |
| 415 | 481 | outline-offset: 2px; |
| 416 | 482 | } |
| 417 | - .desktop-mode-welcome__btn--ghost { | |
| 418 | - background: transparent; | |
| 419 | - color: #475569; | |
| 420 | - border-color: transparent; | |
| 483 | + .os-welcome .os-welcome__btn--primary { | |
| 484 | + color: var( --_starlight ); | |
| 485 | + background: var( --_obsidian ); | |
| 421 | 486 | } |
| 422 | - .desktop-mode-welcome__btn--ghost:hover { | |
| 423 | - background: rgba( 15, 23, 42, 0.06 ); | |
| 424 | - color: #0f172a; | |
| 487 | + .os-welcome .os-welcome__btn--primary:hover { | |
| 488 | + background: var( --_astro ); | |
| 489 | + border-color: var( --_astro ); | |
| 425 | 490 | } |
| 426 | - .desktop-mode-welcome__btn--secondary { | |
| 427 | - color: #0369a1; | |
| 428 | - background: rgba( 14, 165, 233, 0.10 ); | |
| 429 | - border-color: rgba( 14, 165, 233, 0.28 ); | |
| 491 | + .os-welcome .os-welcome__btn--secondary { | |
| 492 | + color: var( --_obsidian ); | |
| 493 | + background: transparent; | |
| 430 | 494 | } |
| 431 | - .desktop-mode-welcome__btn--secondary:hover { | |
| 432 | - background: rgba( 14, 165, 233, 0.16 ); | |
| 433 | - color: #075985; | |
| 495 | + .os-welcome .os-welcome__btn--secondary:hover { | |
| 496 | + background: var( --_haze ); | |
| 434 | 497 | } |
| 435 | - .desktop-mode-welcome__btn--primary { | |
| 436 | - color: #fff; | |
| 437 | - background: linear-gradient( 135deg, #0369a1, #0ea5e9 55%, #06b6d4 ); | |
| 438 | - background-size: 180% 180%; | |
| 439 | - box-shadow: 0 10px 24px -10px rgba( 14, 165, 233, 0.75 ), | |
| 440 | - 0 4px 10px -4px rgba( 6, 182, 212, 0.55 ); | |
| 441 | - } | |
| 442 | - .desktop-mode-welcome__btn--primary:hover { | |
| 443 | - transform: translateY( -1px ); | |
| 444 | - background-position: 100% 50%; | |
| 445 | - box-shadow: 0 14px 30px -12px rgba( 14, 165, 233, 0.85 ), | |
| 446 | - 0 6px 14px -4px rgba( 6, 182, 212, 0.65 ); | |
| 447 | - } | |
| 448 | - .desktop-mode-welcome__btn--primary:active { | |
| 449 | - transform: translateY( 0 ); | |
| 450 | - } | |
| 451 | - .desktop-mode-welcome__btn[disabled] { | |
| 452 | - opacity: 0.65; | |
| 498 | + .os-welcome .os-welcome__btn[disabled] { | |
| 499 | + opacity: 0.64; | |
| 453 | 500 | cursor: progress; |
| 454 | 501 | } |
| 455 | - .desktop-mode-welcome__close { | |
| 456 | - position: absolute; | |
| 457 | - top: 14px; | |
| 458 | - right: 14px; | |
| 459 | - width: 32px; | |
| 460 | - height: 32px; | |
| 461 | - display: inline-flex; | |
| 462 | - align-items: center; | |
| 463 | - justify-content: center; | |
| 464 | - padding: 0; | |
| 465 | - background: rgba( 255, 255, 255, 0.18 ); | |
| 466 | - color: #fff; | |
| 467 | - border: 1px solid rgba( 255, 255, 255, 0.25 ); | |
| 468 | - border-radius: 50%; | |
| 469 | - cursor: pointer; | |
| 470 | - font-size: 18px; | |
| 471 | - line-height: 1; | |
| 472 | - transition: background 120ms ease, transform 120ms ease; | |
| 473 | - } | |
| 474 | - .desktop-mode-welcome__close:hover { | |
| 475 | - background: rgba( 255, 255, 255, 0.32 ); | |
| 476 | - transform: rotate( 90deg ); | |
| 477 | - } | |
| 478 | - .desktop-mode-welcome__close:focus-visible { | |
| 479 | - outline: 2px solid #fff; | |
| 480 | - outline-offset: 2px; | |
| 481 | - } | |
| 482 | - body.desktop-mode-welcome-open { | |
| 502 | + body.os-welcome-open { | |
| 483 | 503 | overflow: hidden; |
| 484 | 504 | } |
| 505 | + | |
| 506 | + /* ---- Narrow screens ------------------------------------------- */ | |
| 507 | + | |
| 485 | 508 | @media ( max-width: 760px ) { |
| 486 | - .desktop-mode-welcome__features { | |
| 509 | + .os-welcome__card { | |
| 487 | 510 | grid-template-columns: 1fr; |
| 511 | + min-height: 0; | |
| 488 | 512 | } |
| 513 | + .os-welcome__art { | |
| 514 | + height: 216px; | |
| 515 | + } | |
| 516 | + .os-welcome__pair { | |
| 517 | + transform: translate( -50%, -44% ) scale( 0.64 ); | |
| 518 | + } | |
| 489 | 519 | } |
| 490 | - @media ( max-width: 600px ) { | |
| 491 | - .desktop-mode-welcome__hero { | |
| 492 | - padding: 28px 24px 20px; | |
| 520 | + @media ( max-width: 480px ) { | |
| 521 | + .os-welcome { | |
| 522 | + padding: 16px; | |
| 493 | 523 | } |
| 494 | - .desktop-mode-welcome__body, | |
| 495 | - .desktop-mode-welcome__actions { | |
| 496 | - padding-left: 24px; | |
| 497 | - padding-right: 24px; | |
| 524 | + .os-welcome .os-welcome__mark { | |
| 525 | + top: 24px; | |
| 526 | + inset-inline-start: 24px; | |
| 498 | 527 | } |
| 499 | - .desktop-mode-welcome__title { | |
| 500 | - font-size: 22px; | |
| 528 | + .os-welcome__content { | |
| 529 | + padding: 24px; | |
| 501 | 530 | } |
| 502 | - .desktop-mode-welcome__actions { | |
| 503 | - flex-direction: column-reverse; | |
| 504 | - align-items: stretch; | |
| 531 | + .os-welcome__actions { | |
| 532 | + padding: 0 24px 24px; | |
| 505 | 533 | } |
| 506 | - .desktop-mode-welcome__btn { | |
| 507 | - width: 100%; | |
| 534 | + .os-welcome .os-welcome__btn { | |
| 535 | + flex: 1 1 auto; | |
| 508 | 536 | } |
| 509 | 537 | } |
| 510 | 538 | @media ( prefers-reduced-motion: reduce ) { |
| 511 | - .desktop-mode-welcome, | |
| 512 | - .desktop-mode-welcome__card, | |
| 513 | - .desktop-mode-welcome__hero, | |
| 514 | - .desktop-mode-welcome__hint-icon { | |
| 539 | + .os-welcome, | |
| 540 | + .os-welcome__card { | |
| 515 | 541 | animation: none !important; |
| 516 | 542 | } |
| 543 | + .os-welcome .os-welcome__btn { | |
| 544 | + transition: none; | |
| 545 | + } | |
| 517 | 546 | } |
| 518 | 547 | </style> |
| 519 | 548 | <div |
| 520 | - class="desktop-mode-welcome" | |
| 549 | + class="os-welcome" | |
| 521 | 550 | role="dialog" |
| 522 | 551 | aria-modal="true" |
| 523 | - aria-labelledby="desktop-mode-welcome-title" | |
| 524 | - aria-describedby="desktop-mode-welcome-desc" | |
| 552 | + aria-labelledby="os-welcome-title" | |
| 553 | + aria-describedby="os-welcome-desc" | |
| 525 | 554 | data-slug="<?php echo esc_attr( $slug ); ?>" |
| 526 | 555 | > |
| 527 | - <div class="desktop-mode-welcome__card"> | |
| 528 | - <button | |
| 529 | - type="button" | |
| 530 | - class="desktop-mode-welcome__close" | |
| 531 | - aria-label="<?php echo esc_attr( $close_a ); ?>" | |
| 532 | - data-desktop-mode-welcome-dismiss | |
| 533 | - >×</button> | |
| 534 | - <div class="desktop-mode-welcome__hero"> | |
| 535 | - <span class="desktop-mode-welcome__eyebrow"> | |
| 536 | - <span class="desktop-mode-welcome__eyebrow-dot" aria-hidden="true"></span> | |
| 537 | - <?php echo esc_html__( 'New here', 'desktop-mode' ); ?> | |
| 538 | - </span> | |
| 539 | - <h2 id="desktop-mode-welcome-title" class="desktop-mode-welcome__title"> | |
| 540 | - <?php echo esc_html( $title ); ?> | |
| 541 | - </h2> | |
| 542 | - <p class="desktop-mode-welcome__subtitle"> | |
| 543 | - <?php echo esc_html( $subtitle ); ?> | |
| 544 | - </p> | |
| 556 | + <div class="os-welcome__card"> | |
| 557 | + <div class="os-welcome__art" aria-hidden="true"> | |
| 558 | + <img class="os-welcome__mark" src="<?php echo esc_url( $mark_url ); ?>" alt="" width="40" height="40" /> | |
| 559 | + <div class="os-welcome__pair"> | |
| 560 | + <div class="os-welcome__win os-welcome__win--posts"> | |
| 561 | + <div class="os-welcome__bar"> | |
| 562 | + <span class="os-welcome__bar-title"><i></i><?php echo esc_html__( 'Posts', 'desktop-mode' ); ?></span> | |
| 563 | + <span class="os-welcome__bar-ctl"><i></i><i></i><i></i></span> | |
| 564 | + </div> | |
| 565 | + <div class="os-welcome__rows"> | |
| 566 | + <div class="os-welcome__row os-welcome__row--head"><i></i><b style="width:40%"></b><em></em></div> | |
| 567 | + <div class="os-welcome__row"><i></i><b style="width:78%"></b><em></em></div> | |
| 568 | + <div class="os-welcome__row os-welcome__row--selected"><i></i><b style="width:62%"></b><em></em></div> | |
| 569 | + <div class="os-welcome__row"><i></i><b style="width:84%"></b><em></em></div> | |
| 570 | + <div class="os-welcome__row"><i></i><b style="width:55%"></b><em></em></div> | |
| 571 | + <div class="os-welcome__row"><i></i><b style="width:70%"></b><em></em></div> | |
| 572 | + </div> | |
| 573 | + </div> | |
| 574 | + <div class="os-welcome__win os-welcome__win--media"> | |
| 575 | + <div class="os-welcome__bar"> | |
| 576 | + <span class="os-welcome__bar-title"><i></i><?php echo esc_html__( 'Media', 'desktop-mode' ); ?></span> | |
| 577 | + <span class="os-welcome__bar-ctl"><i></i><i></i><i></i></span> | |
| 578 | + </div> | |
| 579 | + <div class="os-welcome__thumbs"> | |
| 580 | + <i></i><i></i><i></i><i></i> | |
| 581 | + <i></i><i></i><i></i><i></i> | |
| 582 | + </div> | |
| 583 | + </div> | |
| 584 | + </div> | |
| 545 | 585 | </div> |
| 546 | - <div class="desktop-mode-welcome__body"> | |
| 547 | - <p id="desktop-mode-welcome-desc" class="desktop-mode-welcome__lede"> | |
| 548 | - <?php echo esc_html( $body ); ?> | |
| 549 | - </p> | |
| 550 | - <ul class="desktop-mode-welcome__features"> | |
| 551 | - <?php foreach ( $features as $feature ) : ?> | |
| 552 | - <li class="desktop-mode-welcome__feature"> | |
| 553 | - <span class="desktop-mode-welcome__feature-icon" aria-hidden="true"> | |
| 554 | - <?php echo esc_html( $feature['icon'] ); ?> | |
| 555 | - </span> | |
| 556 | - <strong class="desktop-mode-welcome__feature-title"> | |
| 557 | - <?php echo esc_html( $feature['title'] ); ?> | |
| 558 | - </strong> | |
| 559 | - <p class="desktop-mode-welcome__feature-desc"> | |
| 560 | - <?php echo esc_html( $feature['desc'] ); ?> | |
| 561 | - </p> | |
| 562 | - </li> | |
| 563 | - <?php endforeach; ?> | |
| 564 | - </ul> | |
| 565 | - <p class="desktop-mode-welcome__hint"> | |
| 566 | - <span class="desktop-mode-welcome__hint-icon" aria-hidden="true"></span> | |
| 567 | - <?php | |
| 568 | - printf( | |
| 569 | - /* translators: %s: the label of the admin bar button. */ | |
| 570 | - esc_html__( 'Prefer to switch yourself? Click %s in the top-right of your admin bar.', 'desktop-mode' ), | |
| 571 | - '<code>' . esc_html__( 'Switch to Desktop Mode', 'desktop-mode' ) . '</code>' | |
| 572 | - ); | |
| 573 | - ?> | |
| 574 | - </p> | |
| 586 | + <div class="os-welcome__main"> | |
| 587 | + <div class="os-welcome__content"> | |
| 588 | + <div class="os-welcome__head"> | |
| 589 | + <h2 id="os-welcome-title" class="os-welcome__title"> | |
| 590 | + <?php echo esc_html( $title ); ?> | |
| 591 | + </h2> | |
| 592 | + <p id="os-welcome-desc" class="os-welcome__lede"> | |
| 593 | + <?php echo esc_html( $body ); ?> | |
| 594 | + </p> | |
| 595 | + </div> | |
| 596 | + <ul class="os-welcome__features"> | |
| 597 | + <?php foreach ( $features as $feature ) : ?> | |
| 598 | + <li class="os-welcome__feature"> | |
| 599 | + <span class="os-welcome__icon" aria-hidden="true"> | |
| 600 | + <?php echo openstation_welcome_dialog_icon( $feature['icon'] ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- sanitised with wp_kses() in the helper. ?> | |
| 601 | + </span> | |
| 602 | + <div> | |
| 603 | + <strong class="os-welcome__feature-title"> | |
| 604 | + <?php | |
| 605 | + if ( ! empty( $feature['kbd'] ) ) { | |
| 606 | + echo wp_kses( | |
| 607 | + sprintf( | |
| 608 | + esc_html( $feature['title'] ), | |
| 609 | + '<kbd class="os-welcome__kbd" data-os-welcome-shortcut>⌘K</kbd>' | |
| 610 | + ), | |
| 611 | + array( | |
| 612 | + 'kbd' => array( | |
| 613 | + 'class' => true, | |
| 614 | + 'data-*' => true, | |
| 615 | + ), | |
| 616 | + ) | |
| 617 | + ); | |
| 618 | + } else { | |
| 619 | + echo esc_html( $feature['title'] ); | |
| 620 | + } | |
| 621 | + ?> | |
| 622 | + </strong> | |
| 623 | + <p class="os-welcome__feature-desc"> | |
| 624 | + <?php echo esc_html( $feature['desc'] ); ?> | |
| 625 | + </p> | |
| 626 | + </div> | |
| 627 | + </li> | |
| 628 | + <?php endforeach; ?> | |
| 629 | + </ul> | |
| 630 | + </div> | |
| 631 | + <div class="os-welcome__actions"> | |
| 632 | + <button | |
| 633 | + type="button" | |
| 634 | + class="os-welcome__btn os-welcome__btn--secondary" | |
| 635 | + data-os-welcome-cta | |
| 636 | + > | |
| 637 | + <?php echo esc_html( $later ); ?> | |
| 638 | + </button> | |
| 639 | + <button | |
| 640 | + type="button" | |
| 641 | + class="os-welcome__btn os-welcome__btn--primary" | |
| 642 | + data-os-welcome-enable | |
| 643 | + data-label-idle="<?php echo esc_attr( $enable ); ?>" | |
| 644 | + data-label-busy="<?php echo esc_attr( $enabling ); ?>" | |
| 645 | + > | |
| 646 | + <?php echo esc_html( $enable ); ?> | |
| 647 | + </button> | |
| 648 | + </div> | |
| 575 | 649 | </div> |
| 576 | - <div class="desktop-mode-welcome__actions"> | |
| 577 | - <button | |
| 578 | - type="button" | |
| 579 | - class="desktop-mode-welcome__btn desktop-mode-welcome__btn--secondary" | |
| 580 | - data-desktop-mode-welcome-cta | |
| 581 | - > | |
| 582 | - <?php echo esc_html( $cta ); ?> | |
| 583 | - </button> | |
| 584 | - <button | |
| 585 | - type="button" | |
| 586 | - class="desktop-mode-welcome__btn desktop-mode-welcome__btn--primary" | |
| 587 | - data-desktop-mode-welcome-enable | |
| 588 | - data-label-idle="<?php echo esc_attr( $enable ); ?>" | |
| 589 | - data-label-busy="<?php echo esc_attr( $enabling ); ?>" | |
| 590 | - > | |
| 591 | - <?php echo esc_html( $enable ); ?> | |
| 592 | - </button> | |
| 593 | - </div> | |
| 594 | 650 | </div> |
| 595 | 651 | </div> |
| 596 | -<script id="desktop-mode-welcome-script"> | |
| 652 | +<script id="os-welcome-script"> | |
| 597 | 653 | ( function () { |
| 598 | - var root = document.querySelector( '.desktop-mode-welcome' ); | |
| 654 | + var root = document.querySelector( '.os-welcome' ); | |
| 599 | 655 | if ( ! root ) { |
| 600 | 656 | return; |
| 601 | 657 | } |
| 602 | 658 | var cfg = { |
| @@ -606,13 +662,19 @@ | ||
| 606 | 662 | ajaxUrl: <?php echo wp_json_encode( $ajax_url ); ?>, |
| 607 | 663 | ajaxNonce: <?php echo wp_json_encode( $ajax_nonce ); ?>, |
| 608 | 664 | }; |
| 609 | 665 | |
| 610 | - document.body.classList.add( 'desktop-mode-welcome-open' ); | |
| 666 | + document.body.classList.add( 'os-welcome-open' ); | |
| 611 | 667 | |
| 668 | + // The shell answers Cmd+K and Ctrl+K alike; show the one this keyboard has. | |
| 669 | + var shortcut = root.querySelector( '[data-os-welcome-shortcut]' ); | |
| 670 | + if ( shortcut && ! /Mac|iPhone|iPad|iPod/.test( navigator.platform || navigator.userAgent ) ) { | |
| 671 | + shortcut.textContent = 'Ctrl K'; | |
| 672 | + } | |
| 673 | + | |
| 612 | 674 | // Focus the primary CTA so keyboard users land somewhere meaningful. |
| 613 | - var primary = root.querySelector( '[data-desktop-mode-welcome-enable]' ) | |
| 614 | - || root.querySelector( '[data-desktop-mode-welcome-cta]' ); | |
| 675 | + var primary = root.querySelector( '[data-os-welcome-enable]' ) | |
| 676 | + || root.querySelector( '[data-os-welcome-cta]' ); | |
| 615 | 677 | if ( primary ) { |
| 616 | 678 | try { primary.focus( { preventScroll: true } ); } catch ( e ) {} |
| 617 | 679 | } |
| 618 | 680 | |
| @@ -620,9 +682,9 @@ | ||
| 620 | 682 | if ( ! root || ! root.parentNode ) { |
| 621 | 683 | return; |
| 622 | 684 | } |
| 623 | 685 | root.parentNode.removeChild( root ); |
| 624 | - document.body.classList.remove( 'desktop-mode-welcome-open' ); | |
| 686 | + document.body.classList.remove( 'os-welcome-open' ); | |
| 625 | 687 | document.removeEventListener( 'keydown', onKey ); |
| 626 | 688 | } |
| 627 | 689 | |
| 628 | 690 | // Rebuilds an absolute URL onto the origin the admin page was actually |
| @@ -656,13 +718,14 @@ | ||
| 656 | 718 | var url = sameOrigin( cfg.url ); |
| 657 | 719 | var payload = JSON.stringify( { slug: cfg.slug } ); |
| 658 | 720 | |
| 659 | 721 | // Prefer `navigator.sendBeacon`: it is queued by the browser and |
| 660 | - // survives the navigation that "Enable it now" triggers without the | |
| 661 | - // keepalive caveats, and it is inherently same-origin-credentialed. | |
| 662 | - // The `wp_rest` nonce rides along as `_wpnonce` (REST cookie auth | |
| 663 | - // reads it from `$_REQUEST`), and the Blob's `application/json` type | |
| 664 | - // lets the REST server parse the `slug` body param. | |
| 722 | + // survives the navigation that "Switch to OpenStation" triggers | |
| 723 | + // without the keepalive caveats, and it is inherently | |
| 724 | + // same-origin-credentialed. The `wp_rest` nonce rides along as | |
| 725 | + // `_wpnonce` (REST cookie auth reads it from `$_REQUEST`), and the | |
| 726 | + // Blob's `application/json` type lets the REST server parse the | |
| 727 | + // `slug` body param. | |
| 665 | 728 | try { |
| 666 | 729 | if ( navigator.sendBeacon ) { |
| 667 | 730 | var beaconUrl = url + |
| 668 | 731 | ( url.indexOf( '?' ) === -1 ? '?' : '&' ) + |
| @@ -674,9 +737,9 @@ | ||
| 674 | 737 | } |
| 675 | 738 | } catch ( e ) {} |
| 676 | 739 | |
| 677 | 740 | // Fallback: `keepalive: true` keeps the POST alive across the |
| 678 | - // "Enable it now" redirect on browsers without sendBeacon. | |
| 741 | + // "Switch to OpenStation" redirect on browsers without sendBeacon. | |
| 679 | 742 | try { |
| 680 | 743 | var headers = { 'Content-Type': 'application/json' }; |
| 681 | 744 | if ( cfg.nonce ) { |
| 682 | 745 | headers[ 'X-WP-Nonce' ] = cfg.nonce; |
| @@ -713,9 +776,9 @@ | ||
| 713 | 776 | // need to see the welcome again. |
| 714 | 777 | persist(); |
| 715 | 778 | |
| 716 | 779 | var form = new FormData(); |
| 717 | - form.append( 'action', 'save-desktop-mode' ); | |
| 780 | + form.append( 'action', 'save-openstation' ); | |
| 718 | 781 | form.append( 'nonce', cfg.ajaxNonce ); |
| 719 | 782 | form.append( 'enabled', '1' ); |
| 720 | 783 | |
| 721 | 784 | fetch( sameOrigin( cfg.ajaxUrl ), { |
| @@ -733,9 +796,9 @@ | ||
| 733 | 796 | return; |
| 734 | 797 | } |
| 735 | 798 | // Fallback — reload so the shell takes over (the AJAX endpoint |
| 736 | 799 | // already wrote the user meta, so this request will boot |
| 737 | - // straight into Desktop Mode via the portal flow). | |
| 800 | + // straight into OpenStation via the portal flow). | |
| 738 | 801 | window.location.reload(); |
| 739 | 802 | } ).catch( function () { |
| 740 | 803 | enabling = false; |
| 741 | 804 | btn.disabled = false; |
| @@ -747,16 +810,15 @@ | ||
| 747 | 810 | var target = event.target; |
| 748 | 811 | if ( ! ( target instanceof Element ) ) { |
| 749 | 812 | return; |
| 750 | 813 | } |
| 751 | - var enableBtn = target.closest( '[data-desktop-mode-welcome-enable]' ); | |
| 814 | + var enableBtn = target.closest( '[data-os-welcome-enable]' ); | |
| 752 | 815 | if ( enableBtn ) { |
| 753 | 816 | event.preventDefault(); |
| 754 | 817 | enableNow( enableBtn ); |
| 755 | 818 | return; |
| 756 | 819 | } |
| 757 | - if ( target.closest( '[data-desktop-mode-welcome-dismiss]' ) || | |
| 758 | - target.closest( '[data-desktop-mode-welcome-cta]' ) ) { | |
| 820 | + if ( target.closest( '[data-os-welcome-cta]' ) ) { | |
| 759 | 821 | event.preventDefault(); |
| 760 | 822 | dismiss(); |
| 761 | 823 | return; |
| 762 | 824 | } |
| @@ -777,5 +839,5 @@ | ||
| 777 | 839 | } )(); |
| 778 | 840 | </script> |
| 779 | 841 | <?php |
| 780 | 842 | } |
| 781 | -add_action( 'admin_footer', 'desktop_mode_render_welcome_dialog' ); | |
| 843 | +add_action( 'admin_footer', 'openstation_render_welcome_dialog' ); | |