UNPKG

jos-animation

Version:

An animation library package to instantly add beautiful/professional looking animation to your website

595 lines (535 loc) 11.1 kB
/* JOS v0.9.2 By Jesvi Jonathan */ /* jos default */ .jos { /* opacity: 1;*/ /* transition: opacity 0.4s, transform 0.4s; */ transition: all 0.4s ease-in-out; /* display: block; */ /* transition-timing-function: ease-in-out; transition-property: all; transition-delay: 0; transition-duration: 0.4s; */ } /* .jos:not([class]):not([class*="display"]):not(:has([class*="display"])) { display: block; } */ .jos-anchor { opacity: 0; /* transition: opacity 0.4s, transform 0.4s; */ transition: all 0.4s ease-in-out; transition-timing-function: ease-in-out; } .jos-static { transform: translate(0, 0); opacity: 1; } .jos-no-transition { transition-timing-function: linear; transition-duration: 0s; } .jos-none { } .jos-hidden { display: none; } .jos-visible { display: block; opacity: 1; } .jos-stagger { /* some cool transition */ /* do not nullify this */ } /* .jos-no-mirror { transition: 0s forwards !important; } */ /* fade */ .jos-fade { opacity: 0; } .jos-fade-right { opacity: 0; transform: translateX(-100px); } .jos-fade-left { opacity: 0; transform: translateX(100px); } .jos-fade-up { opacity: 0; transform: translateY(50px); } .jos-fade-down { opacity: 0; transform: translateY(-50px); } .jos-fade-right-up { opacity: 0; transform: translateX(-100px) translateY(50px); } .jos-fade-right-down { opacity: 0; transform: translateX(-100px) translateY(-50px); } .jos-fade-left-up { opacity: 0; transform: translateX(100px) translateY(50px); } .jos-fade-left-down { opacity: 0; transform: translateX(100px) translateY(-50px); } /* slide */ .jos-slide, .jos-slide-right { transform: translateX(-100px); } .jos-slide-left { transform: translateX(100px); } .jos-slide-up { transform: translateY(100px); } .jos-slide-down { transform: translateY(-100px); } .jos-slide-right-up { transform: translateX(-100px) translateY(100px); } .jos-slide-right-down { transform: translateX(-100px) translateY(-100px); } .jos-slide-left-up { transform: translateX(100px) translateY(100px); } .jos-slide-left-down { transform: translateX(100px) translateY(-100px); } /* zoom out */ .jos-zoom, .jos-zoom-out { opacity: 0; transform: scale(0.8); } .jos-zoom-out-right, .jos-zoom-right { opacity: 0; transform: scale(0.8) translate3d(-100px, 0px, -100px); } .jos-zoom-out-left, .jos-zoom-left { opacity: 0; transform: scale(0.8) translate3d(100px, 0px, -100px); } .jos-zoom-out-down, .jos-zoom-down { opacity: 0; transform: scale(0.8) translate3d(0px, -100px, 0px); } .jos-zoom-out-up, .jos-zoom-up { opacity: 0; transform: scale(0.8) translate3d(0px, 100px, 0px); } /* grow */ .jos-grow { transform: scale(0); } .jos-grow-right { transform: scale(0) translate3d(-100px, 0px, -100px); } .jos-grow-left { transform: scale(0) translate3d(100px, 0px, -100px); } .jos-grow-down { transform: scale(0) translate3d(0px, -100px, 0px); } .jos-grow-up { transform: scale(0) translate3d(0px, 100px, 0px); } /* zoom in */ .jos-zoom-in { opacity: 0; transform: scale(1.1); } .jos-zoom-in-down { opacity: 0; transform: scale(1.1) translate3d(0px, -100px, 0px); } .jos-zoom-in-up { opacity: 0; transform: scale(1.1) translate3d(0px, 100px, 0px); } .jos-zoom-in-right { opacity: 0; transform: scale(1.1) translate3d(-100px, 0px, -100px); } .jos-zoom-in-left { opacity: 0; transform: scale(1.1) translate3d(100px, 0px, -100px); } /* shrink */ .jos-shrink { transform: scale(1.4); } .jos-shrink-right { transform: scale(1.4) translate3d(-100px, 0px, -100px); } .jos-shrink-left { transform: scale(1.4) translate3d(100px, 0px, -100px); } .jos-shrink-down { transform: scale(1.4) translate3d(0px, -100px, 0px); } .jos-shrink-up { transform: scale(1.4) translate3d(0px, 100px, 0px); } /* flip */ .jos-flip, .jos-flip-right { transform: perspective(2500px) rotateY(-100deg); opacity: 0; } .jos-flip-left { transform: perspective(2500px) rotateY(100deg); opacity: 0; } .jos-flip-up { opacity: 0; transform: perspective(2500px) rotateX(-100deg); } .jos-flip-down { opacity: 0; transform: perspective(2500px) rotateX(100deg); } /* rotate */ .jos-rotate, .jos-rotate-right { opacity: 0; transform: rotate(-180deg); } .jos-rotate-left { opacity: 0; transform: rotate(180deg); } /* spin */ .jos-spin, .jos-spin-right { opacity: 0; transform: rotate(-180deg) scale(0); } .jos-spin-left { opacity: 0; transform: rotate(180deg) scale(0); } /* revolve */ .jos-revolve, .jos-revolve-right { opacity: 0; transform: rotate(-360deg) scale(0); } .jos-revolve-left { opacity: 0; transform: rotate(360deg) scale(0); } /* stretch */ .jos-stretch { opacity: 0; transform: scaleX(0); } .jos-stretch-vertical { opacity: 0; transform: scaleY(0); } /* skew */ .jos-skew { opacity: 0; transform: skew(20deg, 20deg); } .jos-skew-right { opacity: 0; transform: skew(20deg, 20deg) translate3d(-100px, 0px, -100px); } .jos-skew-left { opacity: 0; transform: skew(20deg, 20deg) translate3d(100px, 0px, -100px); } .jos-skew-down { opacity: 0; transform: skew(20deg, 20deg) translate3d(0px, -100px, 0px); } .jos-skew-up { opacity: 0; transform: skew(20deg, 20deg) translate3d(0px, 100px, 0px); } .jos-slant { transform: skew(25deg, 25deg); } .jos-slant-right { transform: skew(25deg, 0deg); } .jos-slant-left { transform: skew(0deg, 25deg); } .jos-bar, .jos-bar_vertical { transform: perspective(2500px) rotateY(-100deg); } .jos-bar_horizontal { transform: perspective(2500px) rotateX(-100deg); } .jos-grey { filter: grayscale(100%); } .jos-blur { filter: blur(7px); } .jos-backdrop { backdrop-filter: blur(7px); opacity: 0.8; } .jos-invert { filter: invert(100%); } .jos-sepia { filter: sepia(100%); } .jos-saturate { filter: saturate(100%); } .jos-hue-rotate { filter: hue-rotate(90deg); } .jos-brightness { filter: brightness(0.5); } /* timing function attribute */ [data-jos_timing_function="ease"] { transition-timing-function: ease !important; } [data-jos_timing_function="ease-in"] { transition-timing-function: ease-in !important; } [data-jos_timing_function="ease-out"] { transition-timing-function: ease-out !important; } [data-jos_timing_function="ease-in-out"] { transition-timing-function: ease-in-out !important; } [data-jos_timing_function="linear"] { transition-timing-function: linear !important; } [data-jos_timing_function="step-start"] { transition-timing-function: step-start !important; } [data-jos_timing_function="step-end"] { transition-timing-function: step-end !important; } [data-jos_timing_function="steps"] { transition-timing-function: steps(5, end) !important; } [data-jos_timing_function="frames"] { transition-timing-function: frames(5) !important; } /* Playable animations */ .jos-slide-play, .jos-slide-horizontal-play { transition: 1s; animation: jos-slide-play 0.7s ease-in-out infinite; animation-direction: alternate-reverse; } @keyframes jos-slide-play { 0% { transform: translateX(-100px); } 100% { transform: translateX(100px); } } .jos-slide-vertical-play { animation: jos-slide-vertical-play 0.7s ease-in-out infinite; animation-direction: alternate-reverse; } @keyframes jos-slide-vertical-play { 0% { transform: translateY(-100px); } 100% { transform: translateY(100px); } } .jos-zoom-in-play, .jos-pulse-play { animation: jos-zoom-in-play 1s infinite; animation-direction: alternate; } @keyframes jos-zoom-in-play { 0% { transform: scale(1); opacity: 0; } 100% { opacity: 1; transform: scale(0.8); } } .jos-zoom-play, .jos-zoom-out-play, .jos-pulse-out-play { animation: jos-zoom-play 0.5s linear infinite; animation-direction: alternate; } @keyframes jos-zoom-play { 0% { transform: scale(1); opacity: 0; } 100% { opacity: 1; transform: scale(1.1); } } .jos-flip-play { animation: jos-flip-play 0.7s infinite; animation-direction: alternate; } @keyframes jos-flip-play { 0% { transform: rotateY(0deg); } 100% { transform: rotateY(180deg); } } .jos-rotate-play { animation: jos-rotate-play 1s linear forwards infinite; border-radius: 0%; animation-direction: alternate-reverse; } @keyframes jos-rotate-play { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .jos-spin-play { animation: jos-spin-play 1.5s infinite; animation-direction: alternate; } @keyframes jos-spin-play { 0% { transform: rotate(0deg); opacity: 0; } 100% { transform: rotate(360deg); opacity: 1; } } .jos-revolve-play { animation: jos-revolve-play 1.5s infinite; animation-direction: alternate; } @keyframes jos-revolve-play { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } .jos-grow-play, .jos-shrink-play { animation: jos-grow-play 1s infinite; animation-direction: alternate; } @keyframes jos-grow-play { 0% { transform: scale(0); } 100% { transform: scale(1); } } .jos-shrink-play { animation-direction: alternate-reverse; } .jos-stretch-play { animation: jos-stretch-play 0.7s infinite; animation-direction: alternate; } @keyframes jos-stretch-play { 0% { transform: scaleX(1); } 100% { transform: scaleX(0); } } .jos-stretch-vertical-play { animation: jos-stretch-vertical-play 0.7s infinite; animation-direction: alternate-reverse; } @keyframes jos-stretch-vertical-play { 0% { transform: scaleY(1); } 100% { transform: scaleY(0); } } .jos-fade-play { animation: jos-fade-play 0.8s infinite; animation-direction: alternate; } @keyframes jos-fade-play { 0% { opacity: 0; } 100% { opacity: 1; } } .jos-fade-horizontal-play { animation: jos-fade-horizontal-play 1s infinite; animation-direction: alternate-reverse; } @keyframes jos-fade-horizontal-play { 0% { opacity: 0; transform: translateX(100px); } 100% { opacity: 1; transform: translateX(-100px); } } .jos-fade-vertical-play { animation: jos-fade-vertical-play 1s infinite; animation-direction: alternate-reverse; } @keyframes jos-fade-vertical-play { 0% { opacity: 0; transform: translateY(100px); } 100% { opacity: 1; transform: translateY(-100px); } } .jos-blink-play { animation: jos-blink-play 1s steps(1, end) infinite; } @keyframes jos-blink-play { 0% { opacity: 1; } 50% { opacity: 0; } }