PluginProbe
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin / 0.9.6
OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin v0.9.6
1.1.10 1.1.9 1.1.8 1.1.7 1.1.6 1.1.5 1.1.4 1.1.3 1.1.2 1.1.1 1.1.0 1.0.1 1.0.0 0.9.8 0.9.7 0.9.6 0.9.4 0.9.5 0.9.3 0.9.2 0.9.1 0.9.0 0.8.9 0.8.8 0.8.7 All 34 releases
desktop-mode / includes / wallpapers.php

wallpapers.php in OpenStation: Desktop Windows, Dock & Virtual Desktops for WP Admin 0.9.6, at includes/wallpapers.php

106 lines 4.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Desktop Mode — Built-in wallpaper presets.
4 *
5 * The built-in wallpapers that ship with the plugin — five gradient /
6 * solid CSS presets plus the Animated WordPress Logo canvas wallpaper —
7 * each registered through the same public API third-party plugins use
8 * (`desktop_mode_register_wallpaper()`). Dogfooding the registration
9 * surface for the built-ins is how we discover whether the API is
10 * expressive enough for plugin authors — if we couldn't describe our
11 * own presets through it, the API is broken.
12 *
13 * Hooked on `init` priority 5 so the presets land in the registry
14 * before the shell config is built (shell render runs on
15 * `admin_enqueue_scripts`, which fires after `init`), and before any
16 * late third-party plugin that wants to react via the
17 * `desktop_mode_wallpaper_registered` action.
18 *
19 * @package WPDesktopMode
20 * @since 0.5.0
21 */
22
23 defined( 'ABSPATH' ) || exit;
24
25 /**
26 * Registers the built-in wallpapers: five gradient / solid CSS presets
27 * plus the Animated WordPress Logo canvas wallpaper.
28 *
29 * @since 0.5.0
30 */
31 function desktop_mode_register_builtin_wallpapers() {
32 $presets = array(
33 array(
34 'id' => 'dark',
35 'label' => __( 'Graphite', 'desktop-mode' ),
36 'value' => 'linear-gradient(135deg, #1d2327 0%, #2c3338 50%, #1d2327 100%)',
37 'description' => __( 'A quiet charcoal gradient that keeps every eye on your windows — the classic dark desk WordPress admins know by heart.', 'desktop-mode' ),
38 ),
39 array(
40 'id' => 'aurora',
41 'label' => __( 'Aurora', 'desktop-mode' ),
42 'value' => 'linear-gradient(135deg, #1a2980 0%, #26d0ce 100%)',
43 'description' => __( 'Deep indigo melting into arctic teal — northern lights over a midnight horizon.', 'desktop-mode' ),
44 ),
45 array(
46 'id' => 'sunset',
47 'label' => __( 'Sunset', 'desktop-mode' ),
48 'value' => 'linear-gradient(135deg, #ff512f 0%, #dd2476 100%)',
49 'description' => __( 'A warm blaze from ember orange to magenta — golden hour, frozen mid-fade.', 'desktop-mode' ),
50 ),
51 array(
52 'id' => 'forest',
53 'label' => __( 'Forest', 'desktop-mode' ),
54 'value' => 'linear-gradient(135deg, #134e5e 0%, #71b280 100%)',
55 'description' => __( 'Cool pine greens for calm, unhurried work under the canopy.', 'desktop-mode' ),
56 ),
57 array(
58 'id' => 'mono',
59 'label' => __( 'Mono', 'desktop-mode' ),
60 'value' => '#1d2327',
61 'description' => __( 'One flat graphite tone. No gradient, no noise — nothing but your work.', 'desktop-mode' ),
62 ),
63 );
64
65 foreach ( $presets as $preset ) {
66 desktop_mode_register_wallpaper( $preset['id'], array(
67 'label' => $preset['label'],
68 'preview' => $preset['value'],
69 'value' => $preset['value'],
70 'type' => 'css',
71 'description' => $preset['description'],
72 ) );
73 }
74
75 // Animated WordPress Logo — built-in PixiJS canvas wallpaper.
76 // Moved out of `desktop.min.js` in 0.8.4. Same registration
77 // surface third-party canvas wallpapers use: `script` is an
78 // enqueued handle (registered in `includes/assets.php`); the
79 // shell's wallpaper sync injects its URL when the wallpaper
80 // def is needed (selected, or shown in the OS Settings picker).
81 desktop_mode_register_wallpaper( 'wp-animated-logo', array(
82 'label' => __( 'Animated WordPress Logo', 'desktop-mode' ),
83 'preview' => 'radial-gradient(circle at 50% 50%, #1e3a8a 0%, #0b0f25 100%)',
84 'type' => 'canvas',
85 'script' => 'desktop-mode-animated-logo-wallpaper',
86 'description' => __( 'Thousands of luminous particles holding the shape of the WordPress W. Sweep your cursor through and they scatter like sand, then drift home again.', 'desktop-mode' ),
87 ) );
88
89 // Snow — built-in PixiJS canvas wallpaper. The preview gradient
90 // must match the default backdrop the JS side paints behind the
91 // canvas (`backdropCss()` in `src/plugins/snow-wallpaper/settings.ts`)
92 // — the swatch renders before the wallpaper script has ever
93 // loaded, so a mismatch would show one sky in the picker and a
94 // different one once selected. First built-in wallpaper with a
95 // `renderConfig` settings dialog (wind, snowflake count, flake
96 // size, background colour).
97 desktop_mode_register_wallpaper( 'wp-snow', array(
98 'label' => __( 'Snow', 'desktop-mode' ),
99 'preview' => 'linear-gradient(180deg, #0c1a36 0%, #1d355e 55%, #425d8a 100%)',
100 'type' => 'canvas',
101 'script' => 'desktop-mode-snow-wallpaper',
102 'description' => __( 'Snow falling over a midnight sky. Flakes settle on the top edge of every window, pile into little drifts, then quietly melt away. Open the wallpaper settings to tune the wind, the snowfall, the flake size, and the colour of the night.', 'desktop-mode' ),
103 ) );
104 }
105 add_action( 'init', 'desktop_mode_register_builtin_wallpapers', 5 );
106