Fixed #32051 -- Fixed rocket animation on the 'Congrats' page.

- Fixed congratulations smoke being cropped.
- Refactored congratulation rocket so the animation can be stopped.
- Made animation respect user preference for reduced animation.
- Made rocket animation stop after 7s.
This commit is contained in:
Thibaud Colas 2020-09-29 20:49:01 +01:00 committed by Mariusz Felisiak
parent 838e115ab1
commit b807298c66
1 changed files with 25 additions and 38 deletions

View File

@ -8,9 +8,6 @@
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="/static/admin/css/fonts.css"> <link rel="stylesheet" type="text/css" href="/static/admin/css/fonts.css">
<style type="text/css"> <style type="text/css">
.body, .tip {
stroke: #fff;
}
html { html {
line-height: 1.15; line-height: 1.15;
} }
@ -60,53 +57,36 @@
} }
.figure { .figure {
margin-top: 19vh; margin-top: 19vh;
height: 181px;
} }
.figure__animation { .figure__animation {
max-width: 265px; max-width: 265px;
position: relative; position: relative;
z-index: -9; z-index: -9;
} overflow: visible;
.tip {
stroke-width: 3px;
transform: translateY(-7px);
}
.body {
fill: #6DDCBD;
transform: scaleX(1.25);
transform-origin: center;
stroke-width: 3px;
}
.circle {
fill: #6DDCBD;
stroke: #fff;
stroke-width: 7px;
} }
.exhaust__line { .exhaust__line {
animation: thrust 70ms infinite ease-in-out alternate; animation: thrust 70ms 100 ease-in-out alternate;
} }
.smoke { .smoke {
animation: smoke .1s infinite ease-in-out alternate; animation: smoke .1s 70 ease-in-out alternate;
transform-origin: center;
opacity: .8;
} }
@keyframes smoke { @keyframes smoke {
0% { 0% {
transform: scale(1.58, 1.2) translateY(-55px) skew(3deg); transform: translate3d(-5px, 0, 0);
} }
100% { 100% {
transform: scale(1.6, 1.22) translateY(-55px) skew(-3deg); transform: translate3d(5px, 0, 0);
} }
} }
.flame { .flame {
animation: burnInner2 .1s infinite ease-in-out alternate; animation: burnInner2 .1s 70 ease-in-out alternate;
} }
@keyframes burnInner2 { @keyframes burnInner2 {
0% { 0% {
transform: translate(265px, 249px) scale(1.9) rotate(180deg) skew(5deg); transform: translate3d(0, 0, 0);
} }
100% { 100% {
transform: translate(265px, 253px) scale(2.2) rotate(180deg) skew(-5deg); transform: translate3d(0, 3px, 0);
} }
} }
@keyframes thrust { @keyframes thrust {
@ -117,6 +97,13 @@
opacity: .5; opacity: .5;
} }
} }
@media (prefers-reduced-motion: reduce) {
.exhaust__line,
.smoke,
.flame {
animation: none;
}
}
h2 { h2 {
font-size: 22px; font-size: 22px;
max-width: 500px; max-width: 500px;
@ -250,16 +237,16 @@
</header> </header>
<main> <main>
<div class="figure"> <div class="figure">
<svg class="figure__animation" viewBox="0 0 512 512"> <svg class="figure__animation" viewBox="0 0 508 268">
<path d="M307.2 224.6c0 4.6-.5 9-1.6 13.2-2.5-4.4-5.6-8.4-9.2-12-4.6-4.6-10-8.4-16-11.2 2.8-11.2 4.5-22.9 5-34.6 1.8 1.4 3.5 2.9 5 4.5 10.5 10.3 16.8 24.5 16.8 40.1zM232.2 214.6c-6 2.8-11.4 6.6-16 11.2-3.5 3.6-6.6 7.6-9.1 12-1-4.3-1.6-8.7-1.6-13.2 0-15.7 6.3-29.9 16.6-40.1 1.6-1.6 3.3-3.1 5.1-4.5.6 11.8 2.2 23.4 5 34.6z" fill="#2E3B39"></path> <path d="M305.2 156.6c0 4.6-.5 9-1.6 13.2-2.5-4.4-5.6-8.4-9.2-12-4.6-4.6-10-8.4-16-11.2 2.8-11.2 4.5-22.9 5-34.6 1.8 1.4 3.5 2.9 5 4.5 10.5 10.3 16.8 24.5 16.8 40.1zm-75-10c-6 2.8-11.4 6.6-16 11.2-3.5 3.6-6.6 7.6-9.1 12-1-4.3-1.6-8.7-1.6-13.2 0-15.7 6.3-29.9 16.6-40.1 1.6-1.6 3.3-3.1 5.1-4.5.6 11.8 2.2 23.4 5 34.6z" fill="#2E3B39" fill-rule="nonzero"/>
<path class="body" d="M279.7 217.6c12.9-48.1 5.1-104-23.4-142.6-28.5 38.5-36.2 94.5-23.4 142.6h46.8z" fill="#FF7058"></path> <path d="M282.981 152.6c16.125-48.1 6.375-104-29.25-142.6-35.625 38.5-45.25 94.5-29.25 142.6h58.5z" stroke="#FFF" stroke-width="3.396" fill="#6DDCBD"/>
<path class="tip" d="M273 104.7c-4.4-10.6-9.9-20.6-16.6-29.7-6.7 9-12.2 19-16.6 29.7H273z" fill="#2E3B39"></path> <path d="M271 29.7c-4.4-10.6-9.9-20.6-16.6-29.7-6.7 9-12.2 19-16.6 29.7H271z" stroke="#FFF" stroke-width="3" fill="#2E3B39"/>
<circle cx="256.3" cy="144.8" fill="#FFF" r="15.5"></circle> <circle fill="#FFF" cx="254.3" cy="76.8" r="15.5"/>
<circle class="circle" cx="256.3" cy="144.8" fill="#84DBFF" r="12.2"></circle> <circle stroke="#FFF" stroke-width="7" fill="#6DDCBD" cx="254.3" cy="76.8" r="12.2"/>
<path class="smoke" d="M416.6 358.8c0-1.8-.4-3.6-1-5.2-2.1-5.6-7.5-9.6-13.8-9.6-.7 0-1.4.1-2.1.2-.3-9.6-8.2-17.3-17.9-17.3-2.1 0-4.2.4-6.1 1.1-3-5.6-8.9-9.4-15.7-9.4-.5 0-1 0-1.5.1-.5 0-1-.1-1.5-.1-6.8 0-12.7 3.8-15.7 9.4-1.9-.7-3.9-1.1-6.1-1.1-9.9 0-17.9 8-17.9 17.9 0 1.1.1 2.3.3 3.3-.9-.2-1.8-.3-2.8-.3-5.1 0-9.5 2.6-12.1 6.5-2.2-1.4-4.9-2.3-7.8-2.3-7.6 0-13.8 5.9-14.4 13.3h-.1c-5.9 0-11 3.6-13.2 8.7-2.6-3-6.5-5-10.9-5h-.1-.5-.1-.1c-4.3 0-8.2 1.9-10.9 5-2.2-5.1-7.3-8.7-13.2-8.7h-.1c-.6-7.5-6.8-13.3-14.4-13.3-2.9 0-5.5.8-7.8 2.3-2.6-3.9-7-6.5-12.1-6.5-.9 0-1.9.1-2.8.3.2-1.1.3-2.2.3-3.3 0-9.9-8-17.9-17.9-17.9-2.1 0-4.2.4-6.1 1.1-3-5.6-8.9-9.4-15.7-9.4-.5 0-1 0-1.5.1-.5 0-1-.1-1.5-.1-6.8 0-12.7 3.8-15.7 9.4-1.9-.7-3.9-1.1-6.1-1.1-9.7 0-17.6 7.7-17.9 17.3-.7-.1-1.4-.2-2.1-.2-6.3 0-11.7 4-13.8 9.6-.6 1.6-1 3.4-1 5.2 0 4 1.6 7.6 4.2 10.3-.5 1.2-.8 2.6-.8 4 0 6 4.9 10.9 10.9 10.9H402c6 0 10.9-4.9 10.9-10.9 0-1.4-.3-2.8-.8-4 2.9-2.7 4.5-6.3 4.5-10.3z" fill="#E6E9EE"></path> <path class="smoke" d="M507.812 234.24c0-2.16-.632-4.32-1.58-6.24-3.318-6.72-11.85-11.52-21.804-11.52-1.106 0-2.212.12-3.318.24-.474-11.52-12.956-20.76-28.282-20.76-3.318 0-6.636.48-9.638 1.32-4.74-6.72-14.062-11.28-24.806-11.28-.79 0-1.58 0-2.37.12-.79 0-1.58-.12-2.37-.12-10.744 0-20.066 4.56-24.806 11.28a35.326 35.326 0 00-9.638-1.32c-15.642 0-28.282 9.6-28.282 21.48 0 1.32.158 2.76.474 3.96a26.09 26.09 0 00-4.424-.36c-8.058 0-15.01 3.12-19.118 7.8-3.476-1.68-7.742-2.76-12.324-2.76-12.008 0-21.804 7.08-22.752 15.96h-.158c-9.322 0-17.38 4.32-20.856 10.44-4.108-3.6-10.27-6-17.222-6h-1.264c-6.794 0-12.956 2.28-17.222 6-3.476-6.12-11.534-10.44-20.856-10.44h-.158c-.948-9-10.744-15.96-22.752-15.96-4.582 0-8.69.96-12.324 2.76-4.108-4.68-11.06-7.8-19.118-7.8-1.422 0-3.002.12-4.424.36.316-1.32.474-2.64.474-3.96 0-11.88-12.64-21.48-28.282-21.48-3.318 0-6.636.48-9.638 1.32-4.74-6.72-14.062-11.28-24.806-11.28-.79 0-1.58 0-2.37.12-.79 0-1.58-.12-2.37-.12-10.744 0-20.066 4.56-24.806 11.28a35.326 35.326 0 00-9.638-1.32c-15.326 0-27.808 9.24-28.282 20.76-1.106-.12-2.212-.24-3.318-.24-9.954 0-18.486 4.8-21.804 11.52-.948 1.92-1.58 4.08-1.58 6.24 0 4.8 2.528 9.12 6.636 12.36-.79 1.44-1.264 3.12-1.264 4.8 0 7.2 7.742 13.08 17.222 13.08h462.15c9.48 0 17.222-5.88 17.222-13.08 0-1.68-.474-3.36-1.264-4.8 4.582-3.24 7.11-7.56 7.11-12.36z" fill="#E6E9EE"/>
<rect class="exhaust" fill="#6DDCBD" x="241" y="220" width="30" height="8"></rect> <path fill="#6DDCBD" d="M239 152h30v8h-30z"/>
<rect class="exhaust__line" fill="#E6E9EE" x="252" y="240" width="7" height="90"></rect> <path class="exhaust__line" fill="#E6E9EE" d="M250 172h7v90h-7z"/>
<path class="flame" d="M 6.7 1.14 l 2.8 4.7 s 1.3 3 -1.82 3.22 l -5.4 0 s -3.28 -.14 -1.74 -3.26 l 2.76 -4.7 s 1.7 -2.3 3.4 0 z" fill="#AA2247"></path> <path class="flame" d="M250.27 178.834l-5.32-8.93s-2.47-5.7 3.458-6.118h10.26s6.232.266 3.306 6.194l-5.244 8.93s-3.23 4.37-6.46 0v-.076z" fill="#AA2247"/>
</svg> </svg>
</div> </div>
<h2>{% translate "The install worked successfully! Congratulations!" %}</h2> <h2>{% translate "The install worked successfully! Congratulations!" %}</h2>