Line 1: | Line 1: | ||
− | {{ | + | <html> |
− | < | + | <head> |
− | < | + | <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/2.2.0/anime.js"></script> |
− | < | + | </head> |
− | < | + | <style> |
− | < | + | body { |
− | < | + | opacity: 1; |
− | + | display: flex; | |
− | < | + | flex-direction: column; |
− | < | + | justify-content: center; |
− | < | + | } |
− | < | + | body.ready { |
− | < | + | opacity: 1; |
− | < | + | } |
− | </ | + | .logo-animation { |
− | + | display: flex; | |
− | < | + | align-items: center; |
− | < | + | justify-content: center; |
− | < | + | width: 100%; |
− | + | margin-top: -40px; | |
− | + | } | |
− | + | .letters { | |
− | + | position: relative; | |
− | + | display: flex; | |
− | + | width: 682px; | |
− | + | height: 162px; | |
− | + | } | |
− | + | .letter { | |
− | + | position: relative; | |
− | + | width: 162px; | |
− | + | height: 162px; | |
− | + | } | |
− | + | .letter:not(:first-child) { | |
− | + | margin-left: -42px; | |
− | + | } | |
− | + | .letter-i { | |
− | + | z-index: 1; | |
− | + | width: 82px; | |
− | + | transform-origin: 100% 50%; | |
− | + | } | |
+ | .letter-u { | ||
+ | z-index: 1; | ||
+ | width: 142px; | ||
+ | transform-origin: 100% 50%; | ||
+ | } | ||
+ | .dot { | ||
+ | position: absolute; | ||
+ | width: 42px; | ||
+ | height: 42px; | ||
+ | transform: scale(0); | ||
+ | } | ||
+ | .dot-i { | ||
+ | top: 0; | ||
+ | left: 240px; | ||
+ | } | ||
+ | .dot-e { | ||
+ | bottom: 0; | ||
+ | right: 0; | ||
+ | } | ||
+ | .logo-icon { | ||
+ | display: flex; | ||
+ | position: absolute; | ||
+ | left: 230px; | ||
+ | top: -10px; | ||
+ | width: 222px; | ||
+ | height: 62px; | ||
+ | } | ||
+ | .icon { | ||
+ | width: 62px; | ||
+ | height: 62px; | ||
+ | opacity: 0; | ||
+ | } | ||
+ | .icon-text { | ||
+ | position: absolute; | ||
+ | top: 60px; | ||
+ | left: 60px; | ||
+ | width: 160px; | ||
+ | height: 62px; | ||
+ | } | ||
+ | .icon-text path, | ||
+ | .icon-text polygon { | ||
+ | opacity: 0; | ||
+ | } | ||
+ | </style> | ||
+ | <body> | ||
+ | <div class="logo-animation"> | ||
+ | <div class="letters"> | ||
+ | <div class="letter letter-b"> | ||
+ | <svg viewBox="0 0 162 262"> | ||
+ | <g fill="none" fill-rule="evenodd" stroke="#5E89FB"> | ||
+ | <path class="fill in" stroke-width="40" d="M21 1V185M101 241H81a60 60 0 1 1 0-120c33.14 0 59 26.86 60 60v80"/> | ||
+ | <path class="fill out" stroke-width="40" d="M141 261V181c-1-33.14-26.86-60-60-60a60 60 0 1 0 0 120h20M21 185V1"/> | ||
+ | <path class="line out" stroke-width="2" d="M121 261V181.33C120.18 158.59 102.7 141 81 141a40 40 0 1 0 0 80h20v40H81A80 80 1 0 1 2 181V1h40V121c13.8 -15 89.66 -50 118.5 59V261Z"/> | ||
+ | </g> | ||
+ | </svg> | ||
+ | </div> | ||
+ | <div class="letter letter-i"> | ||
+ | <svg viewBox="0 0 82 262"> | ||
+ | <g fill="none" fill-rule="evenodd" stroke="#18FF92"> | ||
+ | <path class="fill in" stroke-width="40" d="M21 161v20a60 60 0 0 0 60 60"/> | ||
+ | <path class="fill out" stroke-width="40" d="M81 241a60 60 0 0 1-60-60V161"/> | ||
+ | <path class="line out" stroke-width="2" d="M81 221a40 40 0 0 1-40-40V161H1V181a80 80 0 0 0 80 80v-40z"/> | ||
+ | </g> | ||
+ | </svg> | ||
+ | </div> | ||
+ | <div class="letter letter-o"> | ||
+ | <svg viewBox="0 0 162 262"> | ||
+ | <g fill="none" fill-rule="evenodd" stroke="#FB155A"> | ||
+ | <path class="fill in" stroke-width="40" d="M81 121a60 60 0 1 0 0 120a60 60 0 1 0 0 -120"/> | ||
+ | <path class="fill out" stroke-width="40" d="M81 121a60 60 0 1 1 0 120a60 60 0 1 1 0 -120"/> | ||
+ | <path class="line out" stroke-width="2" d="M81 141a40 40 0 0 0 0 80a40 40 0 1 0 0 -80v-40a80 80 0 0 0 0 160a80 80 0 1 0 0 -160Z"/> | ||
+ | </g> | ||
+ | </svg> | ||
+ | </div> | ||
+ | <div class="letter letter-h"> | ||
+ | <svg viewBox="0 0 162 262"> | ||
+ | <g fill="none" fill-rule="evenodd" stroke="#5E89FB"> | ||
+ | <path class="fill in" stroke-width="40" d="M21 261V1"/> | ||
+ | <path class="fill out" stroke-width="40" d="M21 1v260"/> | ||
+ | <path class="fill in" stroke-width="40" d="M21 261V181c1-33.14 26.86-60 60-60a60 60 0 0 1 60 60v80"/> | ||
+ | <path class="fill out" stroke-width="40" d="M141 261V181a60 60 0 0 0-60-60c-33.14 0-59 26.86-60 60v80"/> | ||
+ | <path class="line out" stroke-width="2" d="M41 261V1H1v260h40z"/> | ||
+ | <path class="line out" stroke-width="2" d="M1 261V180.4C2.35 136.27 37.2 101 81 101a80 80 0 0 1 80 80v80h-40V181a40 40 0 0 0-40-40c-21.7 0-39.18 17.59-40 40.33V161H1z"/> | ||
+ | </g> | ||
+ | </svg> | ||
+ | </div> | ||
+ | <div class="letter letter-u"> | ||
+ | <svg viewBox="0 0 142 262"> | ||
+ | <g fill="none" fill-rule="evenodd" stroke="#18FF92"> | ||
+ | <path class="fill in" stroke-width="40" d="M21 121v70a50 50 0 0 0 100 0v-70"/> | ||
+ | <path class="fill out" stroke-width="40" d="M121 121v70a50 50 0 0 1 -100 0v-70"/> | ||
+ | <path class="line out" stroke-width="2" d="M1 121v70a70 70 0 0 0 140 0v-70h-40v70a30 30 0 0 1 -60 0v-70z"/> | ||
+ | </g> | ||
+ | </svg> | ||
+ | </div> | ||
+ | <div class="letter letter-b"> | ||
+ | <svg viewBox="0 0 162 262"> | ||
+ | <g fill="none" fill-rule="evenodd" stroke="#FB155A"> | ||
+ | <path class="fill in" stroke-width="40" d="M21 1V185M81 241a60 60 0 1 1 0-120a60 60 0 1 1 0 120"/> | ||
+ | <path class="fill out" stroke-width="40" d="M81 241a60 60 0 1 0 0 -120a60 60 0 1 0 0 120M21 185V1"/> | ||
+ | <path class="line out" stroke-width="2" d="M1 1v181a80 80 0 1 0 160 0a80 80 0 0 0 -160 0h40a40 40 0 1 0 80 0a40 40 0 0 0 -80 0v-181z"/> | ||
+ | </g> | ||
+ | </svg> | ||
+ | </div> | ||
+ | <!--div class="logo-icon"> | ||
+ | <div class="icon"> | ||
+ | <svg viewBox="0 0 62 62"> | ||
+ | <g fill="none" fill-rule="evenodd" stroke-width="2" transform="translate(1 1)"> | ||
+ | <path class="icon-curve" stroke="#FF1554" d="M0 16a80.88 80.88 0 0 1 44 44"/> | ||
+ | <path class="icon-line" stroke="#5E89FB" d="M4 0h54a2 2 0 0 1 2 2.01V58A2 2 0 0 1 58 60H2a2 2 0 0 1-2-2.01V2A2 2 0 0 1 2 0h2z"/> | ||
+ | <rect width="40" height="40" x="10" y="10" stroke="#18FF92" rx="20"/> | ||
+ | </g> | ||
+ | </svg> | ||
+ | </div> | ||
+ | <div class="icon-text"> | ||
+ | <svg viewBox="0 0 160 62"> | ||
+ | <g fill="#FBF3FB" fill-rule="evenodd"> | ||
+ | <path d="M27.33 18h1.73l10.15 25.7h-1.69l-3.24-8.24H21.97l-3.28 8.24H17L27.33 18zm6.45 16.1l-5.51-14.55h-.07l-5.73 14.54h11.3z"/> | ||
+ | <polygon points="51.334 18 53.314 18 69.55 41.58 69.622 41.58 69.622 18 71.206 18 71.206 43.704 69.334 43.704 52.99 19.944 52.918 19.944 52.918 43.704 51.334 43.704"/> | ||
+ | <polygon points="86.027 18 87.611 18 87.611 43.704 86.027 43.704"/> | ||
+ | <polygon points="102.433 18 104.701 18 114.745 41.94 114.817 41.94 124.753 18 127.021 18 127.021 43.704 125.437 43.704 125.437 19.944 125.365 19.944 115.573 43.704 113.989 43.704 104.089 19.944 104.017 19.944 104.017 43.704 102.433 43.704"/> | ||
+ | <polygon points="141.843 18 159.123 18 159.123 19.368 143.427 19.368 143.427 29.664 158.187 29.664 158.187 31.032 143.427 31.032 143.427 42.336 159.303 42.336 159.303 43.704 141.843 43.704"/> | ||
+ | </g> | ||
+ | </svg> | ||
+ | </div> | ||
+ | </div> | ||
+ | <div class="dot dot-i"> | ||
+ | <svg viewBox="0 0 42 42"> | ||
+ | <g fill="none" fill-rule="evenodd"> | ||
+ | <rect width="40" height="40" x="1" y="1" fill="#17F28C" rx="20"/> | ||
+ | </g> | ||
+ | </svg> | ||
+ | </div> | ||
+ | <div class="dot dot-e"> | ||
+ | <svg viewBox="0 0 42 42"> | ||
+ | <g fill="none" fill-rule="evenodd"> | ||
+ | <rect width="40" height="40" x="1" y="1" fill="#FFFFFF" rx="20"/> | ||
+ | </g> | ||
+ | </svg> | ||
+ | </div--> | ||
+ | </div> | ||
</div> | </div> | ||
− | + | </body> | |
− | + | <script> | |
− | + | var logoEl = document.querySelector('.logo-animation'); | |
− | + | var pathEls = document.querySelectorAll('.logo-animation path:not(.icon-curve)'); | |
− | + | var innerWidth = window.innerWidth; | |
− | + | var maxWidth = 740; | |
− | + | var logoScale = innerWidth <= maxWidth ? innerWidth / maxWidth : 1; | |
− | + | var logoTimeline = anime.timeline(); | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | logoEl.style.transform = 'translateY(50px) scale('+logoScale+')'; | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
+ | for (var i = 0; i < pathEls.length; i++) { | ||
+ | var el = pathEls[i]; | ||
+ | el.setAttribute('stroke-dashoffset', anime.setDashoffset(el)); | ||
+ | } | ||
− | + | logoTimeline | |
− | + | .add({ | |
− | + | targets: '.dot-e', | |
− | }); | + | translateX: [ |
− | </script> | + | { value: -600, duration: 520, delay: 200, easing: 'easeInQuart' }, |
− | </ | + | { value: [-100, 0], duration: 500, delay: 1000, easing: 'easeOutQuart' } |
+ | ], | ||
+ | scale: [ | ||
+ | { value: [0, 1], duration: 200, easing: 'easeOutBack' }, | ||
+ | { value: 0, duration: 20, delay: 500, easing: 'easeInQuart' }, | ||
+ | { value: 1, duration: 200, delay: 1000, easing: 'easeOutQuart' }, | ||
+ | { value: 0, duration: 400, delay: 500, easing: 'easeInBack' } | ||
+ | ], | ||
+ | offset: 0 | ||
+ | }) | ||
+ | .add({ | ||
+ | targets: '.dot-i', | ||
+ | translateY: { value: [-200, 0], duration: 500, elasticity: 400 }, | ||
+ | scale: [ | ||
+ | { value: [0, 1], duration: 100, easing: 'easeOutQuart' }, | ||
+ | { value: 0, duration: 400, delay: 1400, easing: 'easeInBack' } | ||
+ | ], | ||
+ | delay: 1200, | ||
+ | offset: 0 | ||
+ | }) | ||
+ | .add({ | ||
+ | targets: '.fill.in', | ||
+ | strokeDashoffset: { | ||
+ | value: [anime.setDashoffset, 0], | ||
+ | duration: 600, | ||
+ | delay: function(el, i, t) { return 700 + ( i * 100 ); }, | ||
+ | easing: 'easeOutQuart' | ||
+ | }, | ||
+ | stroke: { | ||
+ | value: ['#FFF', function(el) { return anime.getValue(el.parentNode, 'stroke') } ], | ||
+ | duration: 500, | ||
+ | delay: 500, | ||
+ | easing: 'easeInQuad' | ||
+ | }, | ||
+ | opacity: { | ||
+ | value: 0, | ||
+ | duration: 1, | ||
+ | delay: function(el, i, t) { return 1900 + ( i * 80 ); }, | ||
+ | }, | ||
+ | offset: 0 | ||
+ | }) | ||
+ | .add({ | ||
+ | targets: '.fill.out', | ||
+ | strokeDashoffset: [ | ||
+ | { value: [anime.setDashoffset, anime.setDashoffset], duration: 1890 }, | ||
+ | { | ||
+ | value: [0, anime.setDashoffset], | ||
+ | duration: 800, | ||
+ | delay: function(el, i) { return (i * 80); }, | ||
+ | easing: 'easeInQuart' | ||
+ | } | ||
+ | ], | ||
+ | offset: 0 | ||
+ | }) | ||
+ | .add({ | ||
+ | targets: '.line.out', | ||
+ | strokeDashoffset: { | ||
+ | value: [0, anime.setDashoffset], | ||
+ | duration: 1200, | ||
+ | delay: function(el, i, t) { return 2500 + ( i * 100 ); }, | ||
+ | easing: 'easeInQuart' | ||
+ | }, | ||
+ | strokeWidth: { | ||
+ | value: [0, 2], | ||
+ | delay: function(el, i, t) { return 2000 + ( i * 100 ); }, | ||
+ | duration: 200, | ||
+ | easing: 'linear' | ||
+ | }, | ||
+ | offset: 0 | ||
+ | }) | ||
+ | .add({ | ||
+ | targets: '.icon', | ||
+ | opacity: { value: 1, duration: 10, delay: 2800, easing: 'linear' }, | ||
+ | translateY: { value: 60, duration: 800 }, | ||
+ | delay: 4200, | ||
+ | offset: 0 | ||
+ | }) | ||
+ | .add({ | ||
+ | targets: '.icon-line', | ||
+ | strokeDashoffset: [ | ||
+ | { value: [anime.setDashoffset, anime.setDashoffset], duration: 3000 }, | ||
+ | { value: 0, duration: 1200, easing: 'easeInOutQuart' } | ||
+ | ], | ||
+ | strokeWidth: { | ||
+ | value: [8, 2], | ||
+ | delay: 3000, | ||
+ | duration: 800, | ||
+ | easing: 'easeInQuad' | ||
+ | }, | ||
+ | stroke: { | ||
+ | value: ['#FFF', function(el) { return anime.getValue(el, 'stroke') } ], | ||
+ | duration: 800, | ||
+ | delay: 3400, | ||
+ | easing: 'easeInQuad' | ||
+ | }, | ||
+ | offset: 0 | ||
+ | }) | ||
+ | .add({ | ||
+ | targets: ['.icon-text path', '.icon-text polygon'], | ||
+ | translateY: [50, 0], | ||
+ | opacity: { value: [0, 1], duration: 100, easing: 'linear' }, | ||
+ | delay: function(el, i, t) { return 4200 + ( i * 20 ); }, | ||
+ | offset: 0 | ||
+ | });</script> | ||
+ | </html> |
Revision as of 09:58, 11 October 2018