Skip to content

Commit 466f969

Browse files
committed
v2.16.7
1 parent 0314506 commit 466f969

3 files changed

Lines changed: 57 additions & 18 deletions

File tree

README.md

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,18 @@
1010
<span> <strong>Animate.css-Dynamic</strong> is an attempt to make Animate.css library dynamic in nature, in the sense, having control on animations, the basic idea is to animate the element when we want, and how we want, without need of changing anything in the source library <a href="https://animate.style/">{animate.css}</a>. </span>
1111

1212
<h2> Installation </h2>
13-
<pre>
14-
&lt;head>
15-
&lt;link
16-
rel = "stylesheet"
17-
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
18-
/>
19-
<script
20-
src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">
21-
</script>
22-
<script
23-
src = "https://cdn.jsdelivr.net/gh/KodingKhurram/animate.css-dynamic@main/animate.min.js">
24-
</script>
25-
&lt;/head>
26-
</pre>
13+
<pre>&lt;head>
14+
&lt;link
15+
rel = "stylesheet"
16+
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
17+
/>
18+
<script
19+
src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js">
20+
</script>
21+
<script
22+
src = "https://cdn.jsdelivr.net/gh/KodingKhurram/animate.css-dynamic@main/animate.min.js">
23+
</script>
24+
&lt;/head></pre>
2725

2826
<h2> Documentation and Demo </h2>
2927
<span> Documentation regarding usage and Demo is in the official <a href="https://animate-dynamic.ga" target="_blank"> website </a></span><br/>
@@ -35,7 +33,8 @@
3533
<li><a href="https://github.com/KodingKhurram/animate.css-dynamic/tree/v2.6.1/">v2.6.1</a></li>
3634
<li><a href="https://github.com/KodingKhurram/animate.css-dynamic/tree/v2.9.2/">v2.9.2</a></li>
3735
<li><a href="https://github.com/KodingKhurram/animate.css-dynamic/tree/v2.10.3/">v2.10.3</a></li>
38-
<li><a href="https://github.com/KodingKhurram/animate.css-dynamic/tree/v2.13.5/">v2.13.5</a> {latest}</li>
36+
<li><a href="https://github.com/KodingKhurram/animate.css-dynamic/tree/v2.13.5/">v2.13.5</a></li>
37+
<li><a href="https://github.com/KodingKhurram/animate.css-dynamic/tree/v2.16.7/">v2.16.7</a> {latest}</li>
3938
</ul>
4039

4140
<h2> License </h2>

animate.js

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
* animate.js - animate-dynamic.ga
3-
* Version - v2.13.5
3+
* Version - v2.16.7
44
* Licensed under the MIT license - https://opensource.org/licenses/MIT
55
66
* Copyright (c) 2021 Mohammed Khurram (KodingKhurram)
@@ -36,6 +36,7 @@ $(document).keyup(function(e){
3636
function aniUtil_dramatic(){
3737
//This function initializes element for dramatic animations
3838
$(".aniUtil_dramatic").each(function() {
39+
$(this).css("opacity", 100);
3940
if(!$(this).hasClass("aniUtil_disabled") && !$(this).hasClass("animate__animated")){
4041
$(this).css("opacity", 0);
4142
}
@@ -210,6 +211,27 @@ function hover_Animations(){
210211
$(this).css("opacity", 100);
211212
}
212213
$(this).addClass(ani_classes);
214+
if($(this).hasClass("aniUtil_onMouseRepeat")){
215+
//Add repeat class
216+
$(this).addClass("animate__infinite");
217+
}
218+
else if($(this).hasClass("aniUtil_active")){
219+
this.addEventListener('animationend', () => {
220+
$(this).removeClass(ani_classes);
221+
if($(this).hasClass("aniUtil_dramatic")){
222+
$(this).css("opacity", 0);
223+
}
224+
});
225+
}
226+
else{
227+
$(this).removeClass("aniUtil_onMouse");
228+
}
229+
}
230+
});
231+
$(this).mouseout(function(){
232+
//functional requirement for aniUtil_onMouseRepeat
233+
if($(this).hasClass("aniUtil_onMouseRepeat")){
234+
$(this).removeClass("animate__infinite");
213235
if($(this).hasClass("aniUtil_active")){
214236
this.addEventListener('animationend', () => {
215237
$(this).removeClass(ani_classes);
@@ -220,6 +242,7 @@ function hover_Animations(){
220242
}
221243
else{
222244
$(this).removeClass("aniUtil_onMouse");
245+
$(this).removeClass("aniUtil_onMouseRepeat");
223246
}
224247
}
225248
});
@@ -336,6 +359,7 @@ function key_Animations(e){
336359
//get animation class
337360
function get_aniClasses(elem){
338361
//This function returns the animate.css animation classes for the element
362+
elem = $(elem)[0];
339363
var ani_classes = '';
340364
var classname = elem.classList;
341365
$(classname).each(function(){
@@ -620,6 +644,8 @@ function aniUtil_disable(which){
620644
$(this).addClass("aniUtil_disabled");
621645
});
622646
}
647+
//Re-initializing dramatic animations
648+
aniUtil_dramatic();
623649
}
624650

625651
//aniUtil_enable()
@@ -704,6 +730,8 @@ function aniUtil_enable(which){
704730
$(this).removeClass("aniUtil_disabled");
705731
});
706732
}
733+
//Re-initializing dramatic animations
734+
aniUtil_dramatic();
707735
}
708736

709737
//aniUtil_animate()
@@ -713,8 +741,11 @@ function aniUtil_animate(elem, ani_Class){
713741
$(elem).removeClass('aniUtil_disabled');
714742
}
715743
$(elem).addClass(ani_Class);
744+
if(!$(elem).hasClass("aniUtil_onClick") && !$(elem).hasClass("aniUtil_onMouse"))
716745
view_Animations();
746+
if($(elem).hasClass("aniUtil_onClick"))
717747
click_Animations();
748+
if($(elem).hasClass("aniUtil_onMouse"))
718749
hover_Animations();
719750
}
720751

@@ -723,3 +754,12 @@ function aniUtil_inanimate(elem){
723754
//This function inanimates/disables the animation for a perticular element
724755
$(elem).addClass('aniUtil_disabled');
725756
}
757+
758+
//aniUtil_reset()
759+
function aniUtil_reset(elem){
760+
//This function resets the animation for a perticular element
761+
var reset_classes = get_aniClasses(elem);
762+
$(elem).removeClass(reset_classes);
763+
if(!$(elem).hasClass("aniUtil_onMouse") && !$(elem).hasClass("aniUtil_onClick") && !$(elem).is('[class*="aniCus_onKey"]'))
764+
view_Animations();
765+
}

0 commit comments

Comments
 (0)