diff --git a/beta/src/components/Layout/HomeContent.js b/beta/src/components/Layout/HomeContent.js index a43d6ab9a..3bcd0b111 100644 --- a/beta/src/components/Layout/HomeContent.js +++ b/beta/src/components/Layout/HomeContent.js @@ -619,21 +619,27 @@ function ExamplePanel({children, noPadding, noShadow, height}) { } function BrowserChrome({children, setPostPromise, setAlbumsPromise}) { + const [restartId, setRestartId] = useState(0); + + const simulatedArtistMs = 200; + const simulatedAlbumsMs = 2200; + function handleRestart() { const artistPromise = new Promise((resolve) => { setTimeout(() => { artistPromise._resolved = true; resolve(); - }, 200); + }, simulatedArtistMs); }); const albumsPromise = new Promise((resolve) => { setTimeout(() => { albumsPromise._resolved = true; resolve(); - }, 2200); + }, simulatedAlbumsMs); }); setPostPromise(artistPromise); setAlbumsPromise(albumsPromise); + setRestartId((id) => id + 1); } return ( @@ -645,7 +651,11 @@ function BrowserChrome({children, setPostPromise, setAlbumsPromise}) { example.com /artists/the-beatles -
+
0 ? '' : 'animation-pulse') + }>
-
+ {restartId > 0 && ( +
+ )}
{children}
diff --git a/beta/src/styles/index.css b/beta/src/styles/index.css index 2e42accc9..6819229e5 100644 --- a/beta/src/styles/index.css +++ b/beta/src/styles/index.css @@ -351,3 +351,12 @@ ol.mdx-illustration-block { transform: scale(0.9); } } + +@keyframes progressbar { + from { + width: 0; + } + to { + width: 100%; + } +}