diff --git a/src/pages/index/components/home-demo-page/index.marko b/src/pages/index/components/home-demo-page/index.marko index 5ade4449..ce06594a 100644 --- a/src/pages/index/components/home-demo-page/index.marko +++ b/src/pages/index/components/home-demo-page/index.marko @@ -25,9 +25,11 @@ style { position:absolute; top:0; left:0; + right:0; height:0.5em; background: linear-gradient(90deg, #25dbd2, #33d5f4, #039fea); transform-origin: 0 0; + will-change: transform; } .demo-page-header { display: flex; @@ -38,6 +40,7 @@ style { .demo-page-logo { font-size:2em; font-weight: 800; + background: #fff; } .demo-page-cart { background: #1d1924; @@ -52,8 +55,22 @@ style { .demo-page-image { flex: 1; } + .demo-page-image-lowres { + background: + radial-gradient(closest-side circle at 35% 40%, rgba(0,0,0,0.3), rgba(0,0,0,0.15) 5%, rgba(0,0,0,0) 50%), + radial-gradient(50% 25% ellipse at 45% 45%, rgba(0,0,0,0.21), rgba(0,0,0,0) 70%); + /* opacity: 0.3; */ + position: absolute; + width: 50%; + } + .demo-page-image-lowres::before { + content: ""; + display: block; + padding-top: 100%; + } .demo-page-description { flex: 1; + background: #fff; } .demo-page-description-title { font-size: 1.2em; @@ -71,6 +88,7 @@ style { padding:0.5em 1em; display: inline-block; margin:0.25em 0; + z-index: 1; } .demo-page-description-text { font-size: 0.8em; @@ -89,21 +107,44 @@ style { padding:1em; background:#f4f2f4; } - .demo-page-footer > div { + .demo-page-footlink { font-size: 0.8em; + z-index: 1; } .demo-page-loading { opacity: 0; } - .demo-page-lowres { - filter: blur(1em) grayscale(0.6); - opacity: 0.3; - } .demo-page-hydrate-partial .demo-page-hydrated, - .demo-page-hydrate-all div { - animation-name: pulse-red; - animation-iteration-count: infinite; - animation-duration: 2s; + .demo-page-hydrate-all .demo-page-delay { + position: relative; + } + .demo-page-hydrate-partial .demo-page-hydrated::before, + .demo-page-hydrate-all .demo-page-delay::before { + content: ""; + position: absolute; + top: -15px; right: -15px; bottom: -15px; left: -15px; + border: 15px solid rgba(255, 50, 82, 0.7); + z-index: -1; + will-change: transform; + } + @media (prefers-reduced-motion: no-preference) { + .demo-page-hydrate-partial .demo-page-hydrated::before, + .demo-page-hydrate-all .demo-page-delay::before { + animation: pulse 2s infinite; + animation-delay: inherit; + border-width: 52px; + top: -30px; right: -30px; bottom: -30px; left: -30px; + opacity: 0; + } + } + @keyframes pulse { + 50% { + opacity: 0.8; + } + 100% { + opacity: 0; + transform: scale(1.1); + } } .demo-page-delay-1 { animation-delay: 100ms; @@ -157,24 +198,6 @@ style { animation-delay: 1700ms; } - @media (prefers-reduced-motion) { - .demo-page-hydrate-partial .demo-page-hydrated, - .demo-page-hydrate-all div { - animation: none; - box-shadow: 0 0 0 15px rgba(255, 50, 82, 0.7); - } - } - - @keyframes pulse-red { - 0% { - box-shadow: 0 0 0 0 rgba(255, 50, 82, 0.9); - } - - 100% { - box-shadow: 0 0 0px 90px rgba(255, 50, 82, 0); - } - } - .demo-page-marko, .demo-page-other { position: absolute; @@ -214,6 +237,10 @@ style { } } +$ function delay (n) { + return `demo-page-delay demo-page-delay-${n}`; +} + $ const progress = input.buffered ? Math.floor(input.progress / 0.9) : input.progress / 0.9;