Snippets Collections
// Color Animated Announcement Bar //

[data-header-theme] .sqs-announcement-bar-dropzone .sqs-announcement-bar {
  background: linear-gradient(99deg,#0d7d88,#708090,#add8e6);
  background-size: 400% 400%;
  -webkit-animation: AnimationName 6s ease infinite;
  -moz-animation: AnimationName 6s ease infinite;
  animation: AnimationName 6s ease infinite;
}

// Animation Keyframes - Do Not Edit or Delete //

@-webkit-keyframes AnimationName { 0% { background-position: 0% 51% } 50% { background-position: 100% 50% } 100% { background-position: 0% 51% } }

@-moz-keyframes AnimationName { 0% { background-position: 0% 51% } 50% { background-position: 100% 50% } 100% { background-position: 0% 51% } }

@keyframes AnimationName { 0% { background-position: 0% 51% } 50% { background-position: 100% 50% } 100% { background-position: 0% 51% } }

@-webkit-keyframes AnimationName { 0% { background-position: 0% 49% } 50% { background-position: 100% 52% } 100% { background-position: 0% 49% } }

@-moz-keyframes AnimationName { 0% { background-position: 0% 49% } 50% { background-position: 100% 52% } 100% { background-position: 0% 49% } }

@keyframes AnimationName { 0% { background-position: 0% 49% } 50% { background-position: 100% 52% } 100% { background-position: 0% 49% } }
/*CSS*/
.text__underline {
    transform: translateX(-300%);
    transition: 0.7s;
}
.header__nav-button {
    max-width: fit-content;
    overflow: hidden;
}
.header__nav-button:hover .text__underline {
    animation: toMiddlePos 0.7s;
    transform: translateX(0);
    opacity: 100%;
}
.header__nav-button:not(:hover) .text__underline {
    transform: translateX(300%);
    opacity: 0;
}
@keyframes toMiddlePos {
    from {
        transform: translateX(-300%);
    }
    to {
        transform: translateX(0);
    }
}
/*CSS*/

/*HTML markup*/
<a class="button header__nav-button">
  <span>Your text</span>
  <div class="content-list-item__line line-primary text__underline line__black" style="width: 0%; 	display: block; height: 1px;" />
</a>
/*HTML markup*/
<style>
 .spacer {
  height: 100vh;
}

a {
  color: #3d3d3d;
  font-family: Arial, Helvetica, sans-serif;
}
/* The magic one liner that allows for smooth scrolls */
html {
  scroll-behavior: smooth;
}

  /* Removes the animation for users that don't prefer it */
@media screen and (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
  
 </style>

<h1 id="top"><a href="#middle">Let's go to the middle of the page</a></h1> 

<div class="spacer">
  &nbsp;
</div>

<h1 id="middle"><a href="#bottom">Go to the bottom?</a></h1>

<div class="spacer">
  &nbsp;
</div>

<h1 id="bottom"><a href="#top">Nah, let's go back to the top</a></h1>
[su_animate type="bounceIn" duration="1"]Animated content[/su_animate]
JQUERY
function whichAnimationEvent(){
  var t,
      el = document.createElement("fakeelement");

  var animations = {
    "animation"      : "animationend",
    "OAnimation"     : "oAnimationEnd",
    "MozAnimation"   : "animationend",
    "WebkitAnimation": "webkitAnimationEnd"
  }

  for (t in animations){
    if (el.style[t] !== undefined){
      return animations[t];
    }
  }
}

var animationEvent = whichAnimationEvent();

$(".button").click(function(){
  $(this).addClass("animate");
  $(this).one(animationEvent,
              function(event) {
    // Do something when the animation ends
  });
});

/****************************/

JS ONLY
var button = document.querySelector(".button"),
    transitionEvent = whichTransitionEvent();

button.addEventListener("click", function() {
  if (button.classList) {
    button.classList.add("animate");
  } else {
    button.className += " " + "animate";
  }

  button.addEventListener(transitionEvent, customFunction);
});

function customFunction(event) {
  button.removeEventListener(transitionEvent, customFunction);

  // Do something when the transition ends
}
$('.button').click(function(){

  var buttonId = $(this).attr('id');

  $('#modal-container').removeAttr('class').addClass(buttonId);

  $('body').addClass('modal-active');

})

​

$('#modal-container').click(function(){

  $(this).addClass('out');

  $('body').removeClass('modal-active');

});
star

Wed Apr 20 2022 13:24:40 GMT+0000 (UTC) https://www.ghostplugins.com/steps/color-animated-announcement-bar

#announcement #bar #animation #colour
star

Sun Mar 20 2022 17:48:21 GMT+0000 (UTC) https://agency-website-c0d1e7.webflow.io/

#css #animation #text-underline
star

Wed Feb 23 2022 17:11:51 GMT+0000 (UTC) https://gomakethings.com/smooth-scrolling-links-with-only-css/

#html #css #scroll #animation
star

Sat Feb 19 2022 13:04:13 GMT+0000 (UTC) https://javascript.plainenglish.io/animate-when-element-is-in-view-with-framer-motion-63b254403bf

#react #animation
star

Sat Jan 08 2022 08:24:30 GMT+0000 (UTC) https://getshortcodes.com/docs/animation/

#animation #snippet
star

Wed Jan 20 2021 17:02:01 GMT+0000 (UTC)

#transition #animation
star

Thu Dec 24 2020 05:24:43 GMT+0000 (UTC) https://codepen.io/designcouch/pen/obvKxm

#js #modal #animation

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension