Author: Theodore Brown (theodorejb)
Committer: Derick Rethans (derickr)
Date: 2026-11-17T15:39:00Z

Commit: 
https://github.com/php/web-php/commit/13e026723860f866e923bd4244847f46ac772f20
Raw diff: 
https://github.com/php/web-php/commit/13e026723860f866e923bd4244847f46ac772f20.diff

Replace hero background video with compositor-friendly HTML orbs

The video backgrounds added in #2061 were downloaded in both themes (about 1.3 
MB total) and didn't follow the original animation. This restores the original 
orb animation, but renders each gradient once as a static SVG background image 
on nested HTML elements, so the x, y, and rotate animations only change 
transform and can run on the compositor instead of repainting the whole SVG 
every frame.

Rendering matches the original SVG version in light and dark mode. Under 
prefers-reduced-motion, the orbs are now paused on their first frame.

Changed paths:
  D  public/images/php8/hero-bg-dark.webm
  D  public/images/php8/hero-bg-light.webm
  M  public/styles/php85.css
  M  src/Themes/ReleasePage.php


Diff:

diff --git a/public/images/php8/hero-bg-dark.webm 
b/public/images/php8/hero-bg-dark.webm
deleted file mode 100644
index fcff1665a9..0000000000
Binary files a/public/images/php8/hero-bg-dark.webm and /dev/null differ
diff --git a/public/images/php8/hero-bg-light.webm 
b/public/images/php8/hero-bg-light.webm
deleted file mode 100644
index 70d4b16015..0000000000
Binary files a/public/images/php8/hero-bg-light.webm and /dev/null differ
diff --git a/public/styles/php85.css b/public/styles/php85.css
index 15f2aa0143..ff3cdbd60c 100644
--- a/public/styles/php85.css
+++ b/public/styles/php85.css
@@ -463,28 +463,75 @@ a {
 
 .hero .hero-bg {
     pointer-events: none;
-    top: calc(var(--spacing) * 0);
+    inset: 0;
     z-index: calc(10 * -1);
-    object-fit: cover;
-    width: 100%;
-    height: 100%;
+    overflow: hidden;
+    opacity: .35;
+    container-type: size;
     -webkit-user-select: none;
     user-select: none;
     position: absolute
 }
 
-.hero .hero-bg-dark,
-.hero .hero-bg-light:where(.dark,.dark *) {
-    display: none
+/*
+ * Each orb is a square the size of the larger hero dimension, centered in the 
hero
+ * (equivalent to an SVG viewBox with preserveAspectRatio="xMidYMid slice").
+ * The gradients are static images, so the browser only has to rasterize them 
once.
+ * The x/y/rotate animations are applied to nested HTML elements and only 
change
+ * transform, so they can run on the compositor instead of repainting every 
frame.
+ */
+.hero-orb {
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    width: max(100cqw, 100cqh);
+    aspect-ratio: 1;
+    translate: -50% -50%
+}
+
+.hero-orb div {
+    width: 100%;
+    height: 100%;
+    background-size: 100% 100%
+}
+
+.hero-orb-1-r {
+    background-image: url("data:image/svg+xml,<svg 
xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' 
preserveAspectRatio='none'><radialGradient id='g' cx='.5' cy='.5' 
fx='.00441602' fy='.5' r='.5'><stop offset='0' stop-color='rgba(210, 203, 255, 
1)'/><stop offset='1' stop-color='rgba(51, 63, 124, 0)'/></radialGradient><rect 
width='100' height='100' fill='url(%23g)'/></svg>")
 }
 
-.hero .hero-bg-dark:where(.dark,.dark *) {
-    display: block
+.hero-orb-2-r {
+    background-image: url("data:image/svg+xml,<svg 
xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' 
preserveAspectRatio='none'><radialGradient id='g' cx='.5' cy='.5' fx='.0268147' 
fy='.5' r='.5'><stop offset='0' stop-color='rgba(133, 109, 255, 1)'/><stop 
offset='1' stop-color='rgba(51, 63, 124, 0)'/></radialGradient><rect 
width='100' height='100' fill='url(%23g)'/></svg>")
 }
 
+.hero-orb-3-r {
+    background-image: url("data:image/svg+xml,<svg 
xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' 
preserveAspectRatio='none'><radialGradient id='g' cx='.5' cy='.5' 
fx='.00836536' fy='.5' r='.5'><stop offset='0' stop-color='rgba(210, 203, 255, 
1)'/><stop offset='1' stop-color='rgba(51, 63, 124, 0)'/></radialGradient><rect 
width='100' height='100' fill='url(%23g)'/></svg>")
+}
+
+.hero-orb-1-x { animation: hero-orb1-x 10s linear infinite alternate }
+.hero-orb-1-y { animation: hero-orb1-y 10.5s linear infinite alternate }
+.hero-orb-1-r { animation: hero-orb-rotate-fwd 7s linear infinite }
+
+.hero-orb-2-x { animation: hero-orb2-x 11.5s linear infinite alternate }
+.hero-orb-2-y { animation: hero-orb2-y 12s linear infinite alternate }
+.hero-orb-2-r { animation: hero-orb-rotate-fwd 12s linear infinite }
+
+.hero-orb-3-x { animation: hero-orb3-x 12.5s linear infinite alternate }
+.hero-orb-3-y { animation: hero-orb3-y 6s linear infinite alternate }
+.hero-orb-3-r { animation: hero-orb-rotate-rev 9s linear infinite }
+
+@keyframes hero-orb1-x { from { transform: translateX(25%) } to { transform: 
translateX(0%) } }
+@keyframes hero-orb1-y { from { transform: translateY(0%) } to { transform: 
translateY(25%) } }
+@keyframes hero-orb2-x { from { transform: translateX(-25%) } to { transform: 
translateX(0%) } }
+@keyframes hero-orb2-y { from { transform: translateY(0%) } to { transform: 
translateY(50%) } }
+@keyframes hero-orb3-x { from { transform: translateX(0%) } to { transform: 
translateX(25%) } }
+@keyframes hero-orb3-y { from { transform: translateY(0%) } to { transform: 
translateY(25%) } }
+@keyframes hero-orb-rotate-fwd { from { transform: rotate(0deg) } to { 
transform: rotate(360deg) } }
+@keyframes hero-orb-rotate-rev { from { transform: rotate(360deg) } to { 
transform: rotate(0deg) } }
+
 @media (prefers-reduced-motion: reduce) {
-    .hero .hero-bg {
-        display: none !important
+    .hero-orb,
+    .hero-orb div {
+        animation-play-state: paused
     }
 }
 
diff --git a/src/Themes/ReleasePage.php b/src/Themes/ReleasePage.php
index f63a4e9023..cc11737342 100644
--- a/src/Themes/ReleasePage.php
+++ b/src/Themes/ReleasePage.php
@@ -36,12 +36,11 @@ public static function getHeroSection(
 
         return <<<HTML
         <section class="hero">
-            <video class="hero-bg hero-bg-light" autoplay muted loop 
playsinline disablepictureinpicture aria-hidden="true" tabindex="-1">
-                <source src="/images/php8/hero-bg-light.webm" 
type="video/webm">
-            </video>
-            <video class="hero-bg hero-bg-dark" autoplay muted loop 
playsinline disablepictureinpicture aria-hidden="true" tabindex="-1">
-                <source src="/images/php8/hero-bg-dark.webm" type="video/webm">
-            </video>
+            <div class="hero-bg" aria-hidden="true">
+                <div class="hero-orb hero-orb-1-x"><div 
class="hero-orb-1-y"><div class="hero-orb-1-r"></div></div></div>
+                <div class="hero-orb hero-orb-2-x"><div 
class="hero-orb-2-y"><div class="hero-orb-2-r"></div></div></div>
+                <div class="hero-orb hero-orb-3-x"><div 
class="hero-orb-3-y"><div class="hero-orb-3-r"></div></div></div>
+            </div>
 
             <!-- hero background pattern -->
             <svg aria-hidden="true" class="hero-pattern">

Reply via email to