-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
📦 v1.2.5
- Loading branch information
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
(function () { | ||
document.querySelector(".js-replay-animations").addEventListener("click", replayAnimations); | ||
var animations = calcite.findElements(".js-animation") | ||
.map(function (el) { | ||
var animationClass = [].slice.apply(el.classList).filter(function (c) { | ||
return c !== "js-animation"; | ||
}); | ||
return { | ||
el: el, | ||
animationClass: animationClass[0] | ||
}; | ||
}) | ||
.filter(function (obj) { | ||
return obj.animationClass; | ||
}) | ||
function replayAnimations () { | ||
animations.forEach(function (animation) { | ||
animation.el.classList.remove(animation.animationClass); | ||
}); | ||
setTimeout(function () { | ||
animations.forEach(function (animation) { | ||
animation.el.classList.add(animation.animationClass); | ||
}); | ||
}, 50); | ||
} | ||
})(); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
Animation helper classes are used to provide character, visual richness, and tactile feedback for the user. Adding an `.animate-` class to any DOM node will animate that node. Using JavaScript to add `.animate-fade-in` to a DOM node when it enters the viewport will cause that node to fade in. | ||
|
||
**Note:** The animations probably already happened if you scrolled here from further up the page. Refresh the page to see them in action. | ||
<button class="btn js-replay-animations">Replay Animations</button> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<div class="{{modifier}}"> | ||
<div class="{{modifier}} js-animation"> | ||
<h3>Wakko packs away the snacks, while Bill Clinton plays the sax.</h3> | ||
</div> | ||
</div> |