chore(lib): update animate.css 3.7.2 -> 4.1.1

This commit is contained in:
Dillon 2022-05-07 02:22:58 +08:00
parent 09ea77eff1
commit 7930049e55
No known key found for this signature in database
GPG key ID: 0EF4AE57FB98F108
10 changed files with 39 additions and 43 deletions

View file

@ -7,8 +7,8 @@ libFiles:
normalizeCSS: normalize.css@8.0.1/normalize.min.css normalizeCSS: normalize.css@8.0.1/normalize.min.css
# fontawesome-free@6.1.1 https://fontawesome.com/ # fontawesome-free@6.1.1 https://fontawesome.com/
fontawesomeFreeCSS: '@fortawesome/fontawesome-free@6.1.1/css/all.min.css' fontawesomeFreeCSS: '@fortawesome/fontawesome-free@6.1.1/css/all.min.css'
# animate.css@3.7.2 https://github.com/daneden/animate.css # animate.css@4.1.1 https://github.com/daneden/animate.css
animateCSS: animate.css@3.7.2/animate.min.css animateCSS: animate.css@4.1.1/animate.min.css
# smooth-scroll@16.1.3 https://github.com/cferdinandi/smooth-scroll # smooth-scroll@16.1.3 https://github.com/cferdinandi/smooth-scroll
smoothScrollJS: smooth-scroll@16.1.3/dist/smooth-scroll.min.js smoothScrollJS: smooth-scroll@16.1.3/dist/smooth-scroll.min.js
# autocomplete.js@0.37.1 https://github.com/algolia/autocomplete.js # autocomplete.js@0.37.1 https://github.com/algolia/autocomplete.js

View file

@ -58,12 +58,12 @@ var Util = /*#__PURE__*/function () {
if (!Array.isArray(animation)) animation = [animation]; if (!Array.isArray(animation)) animation = [animation];
(_element$classList = element.classList).add.apply(_element$classList, ['animated'].concat(_toConsumableArray(animation))); (_element$classList = element.classList).add.apply(_element$classList, ['animate__animated'].concat(_toConsumableArray(animation)));
var handler = function handler() { var handler = function handler() {
var _element$classList2; var _element$classList2;
(_element$classList2 = element.classList).remove.apply(_element$classList2, ['animated'].concat(_toConsumableArray(animation))); (_element$classList2 = element.classList).remove.apply(_element$classList2, ['animate__animated'].concat(_toConsumableArray(animation)));
element.removeEventListener('animationend', handler); element.removeEventListener('animationend', handler);
if (typeof callback === 'function') callback(); if (typeof callback === 'function') callback();
@ -507,7 +507,7 @@ var Theme = /*#__PURE__*/function () {
$copy.title = _this5.config.code.copyTitle; $copy.title = _this5.config.code.copyTitle;
var clipboard = new ClipboardJS($copy); var clipboard = new ClipboardJS($copy);
clipboard.on('success', function (_e) { clipboard.on('success', function (_e) {
_this5.util.animateCSS($code, 'flash'); _this5.util.animateCSS($code, 'animate__flash');
}); });
$header.appendChild($copy); $header.appendChild($copy);
} }
@ -883,32 +883,32 @@ var Theme = /*#__PURE__*/function () {
_this12.util.forEach($headers, function ($header) { _this12.util.forEach($headers, function ($header) {
if (scroll > ACCURACY) { if (scroll > ACCURACY) {
$header.classList.remove('fadeInDown'); $header.classList.remove('animate__fadeInDown');
_this12.util.animateCSS($header, ['fadeOutUp', 'faster'], true); _this12.util.animateCSS($header, ['animate__fadeOutUp', 'animate__faster'], true);
} else if (scroll < -ACCURACY) { } else if (scroll < -ACCURACY) {
$header.classList.remove('fadeOutUp'); $header.classList.remove('animate__fadeOutUp');
_this12.util.animateCSS($header, ['fadeInDown', 'faster'], true); _this12.util.animateCSS($header, ['animate__fadeInDown', 'animate__faster'], true);
} }
}); });
if (_this12.newScrollTop > MINIMUM) { if (_this12.newScrollTop > MINIMUM) {
if (isMobile && scroll > ACCURACY) { if (isMobile && scroll > ACCURACY) {
$fixedButtons.classList.remove('fadeIn'); $fixedButtons.classList.remove('animate__fadeIn');
_this12.util.animateCSS($fixedButtons, ['fadeOut', 'faster'], true); _this12.util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
} else if (!isMobile || scroll < -ACCURACY) { } else if (!isMobile || scroll < -ACCURACY) {
$fixedButtons.style.display = 'block'; $fixedButtons.style.display = 'block';
$fixedButtons.classList.remove('fadeOut'); $fixedButtons.classList.remove('animate__fadeOut');
_this12.util.animateCSS($fixedButtons, ['fadeIn', 'faster'], true); _this12.util.animateCSS($fixedButtons, ['animate__fadeIn', 'animate__faster'], true);
} }
} else { } else {
if (!isMobile) { if (!isMobile) {
$fixedButtons.classList.remove('fadeIn'); $fixedButtons.classList.remove('animate__fadeIn');
_this12.util.animateCSS($fixedButtons, ['fadeOut', 'faster'], true); _this12.util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
} }
$fixedButtons.style.display = 'none'; $fixedButtons.style.display = 'none';

View file

@ -1,7 +1,7 @@
normalize.css@8.0.1 https://github.com/necolas/normalize.css normalize.css@8.0.1 https://github.com/necolas/normalize.css
fontawesome-free@6.1.1 https://fontawesome.com/ fontawesome-free@6.1.1 https://fontawesome.com/
simple-icons@6.20.0 https://github.com/simple-icons/simple-icons simple-icons@6.20.0 https://github.com/simple-icons/simple-icons
animate.css@3.7.2 https://github.com/daneden/animate.css animate.css@4.1.1 https://github.com/daneden/animate.css
smooth-scroll@16.1.3 https://github.com/cferdinandi/smooth-scroll smooth-scroll@16.1.3 https://github.com/cferdinandi/smooth-scroll
autocomplete.js@0.37.1 https://github.com/algolia/autocomplete.js autocomplete.js@0.37.1 https://github.com/algolia/autocomplete.js
lunr.js@2.3.8 https://lunrjs.com/ lunr.js@2.3.8 https://lunrjs.com/

14
assets/lib/animate/animate.min.css vendored Normal file → Executable file

File diff suppressed because one or more lines are too long

View file

@ -5,7 +5,7 @@
{{- define "content" -}} {{- define "content" -}}
<div class="page archive"> <div class="page archive">
{{- /* Title */ -}} {{- /* Title */ -}}
<h2 class="single-title animated pulse faster"> <h2 class="single-title animate__animated animate__pulse animate__faster">
{{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "allSome" -}} {{- .Params.Title | default (T .Section) | default .Section | dict "Some" | T "allSome" -}}
</h2> </h2>

View file

@ -4,7 +4,7 @@
{{- $params := .Scratch.Get "params" -}} {{- $params := .Scratch.Get "params" -}}
<div class="page single special"> <div class="page single special">
{{- /* Title */ -}} {{- /* Title */ -}}
<h1 class="single-title animated pulse faster"> <h1 class="single-title animate__animated animate__pulse animate__faster">
{{- .Title -}} {{- .Title -}}
</h1> </h1>

View file

@ -20,7 +20,7 @@
<article class="page single"> <article class="page single">
{{- /* Title */ -}} {{- /* Title */ -}}
<h1 class="single-title animated flipInX">{{ .Title }}</h1> <h1 class="single-title animate__animated animate__flipInX">{{ .Title }}</h1>
{{- /* Subtitle */ -}} {{- /* Subtitle */ -}}
{{- with $params.subtitle -}} {{- with $params.subtitle -}}

View file

@ -5,7 +5,7 @@
{{- define "content" -}} {{- define "content" -}}
<div class="page archive"> <div class="page archive">
{{- /* Title */ -}} {{- /* Title */ -}}
<h2 class="single-title animated pulse faster"> <h2 class="single-title animate__animated animate__pulse animate__faster">
{{- $taxonomy := .Data.Singular -}} {{- $taxonomy := .Data.Singular -}}
{{- if eq $taxonomy "category" -}} {{- if eq $taxonomy "category" -}}
<i class="far fa-folder-open fa-fw" aria-hidden="true"></i>&nbsp;{{ .Title }} <i class="far fa-folder-open fa-fw" aria-hidden="true"></i>&nbsp;{{ .Title }}

View file

@ -9,7 +9,7 @@
<div class="page archive"> <div class="page archive">
{{- /* Title */ -}} {{- /* Title */ -}}
<h2 class="single-title animated pulse faster"> <h2 class="single-title animate__animated animate__pulse animate__faster">
{{- .Params.Title | default (T $taxonomies) | default $taxonomies | dict "Some" | T "allSome" -}} {{- .Params.Title | default (T $taxonomies) | default $taxonomies | dict "Some" | T "allSome" -}}
</h2> </h2>

View file

@ -18,9 +18,9 @@ class Util {
animateCSS(element, animation, reserved, callback) { animateCSS(element, animation, reserved, callback) {
if (!Array.isArray(animation)) animation = [animation]; if (!Array.isArray(animation)) animation = [animation];
element.classList.add('animated', ...animation); element.classList.add('animate__animated', ...animation);
const handler = () => { const handler = () => {
element.classList.remove('animated', ...animation); element.classList.remove('animate__animated', ...animation);
element.removeEventListener('animationend', handler); element.removeEventListener('animationend', handler);
if (typeof callback === 'function') callback(); if (typeof callback === 'function') callback();
}; };
@ -373,7 +373,7 @@ class Theme {
$copy.title = this.config.code.copyTitle; $copy.title = this.config.code.copyTitle;
const clipboard = new ClipboardJS($copy); const clipboard = new ClipboardJS($copy);
clipboard.on('success', _e => { clipboard.on('success', _e => {
this.util.animateCSS($code, 'flash'); this.util.animateCSS($code, 'animate__flash');
}); });
$header.appendChild($copy); $header.appendChild($copy);
} }
@ -658,26 +658,26 @@ class Theme {
const isMobile = this.util.isMobile(); const isMobile = this.util.isMobile();
this.util.forEach($headers, $header => { this.util.forEach($headers, $header => {
if (scroll > ACCURACY) { if (scroll > ACCURACY) {
$header.classList.remove('fadeInDown'); $header.classList.remove('animate__fadeInDown');
this.util.animateCSS($header, ['fadeOutUp', 'faster'], true); this.util.animateCSS($header, ['animate__fadeOutUp', 'animate__faster'], true);
} else if (scroll < - ACCURACY) { } else if (scroll < - ACCURACY) {
$header.classList.remove('fadeOutUp'); $header.classList.remove('animate__fadeOutUp');
this.util.animateCSS($header, ['fadeInDown', 'faster'], true); this.util.animateCSS($header, ['animate__fadeInDown', 'animate__faster'], true);
} }
}); });
if (this.newScrollTop > MINIMUM) { if (this.newScrollTop > MINIMUM) {
if (isMobile && scroll > ACCURACY) { if (isMobile && scroll > ACCURACY) {
$fixedButtons.classList.remove('fadeIn'); $fixedButtons.classList.remove('animate__fadeIn');
this.util.animateCSS($fixedButtons, ['fadeOut', 'faster'], true); this.util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
} else if (!isMobile || scroll < - ACCURACY) { } else if (!isMobile || scroll < - ACCURACY) {
$fixedButtons.style.display = 'block'; $fixedButtons.style.display = 'block';
$fixedButtons.classList.remove('fadeOut'); $fixedButtons.classList.remove('animate__fadeOut');
this.util.animateCSS($fixedButtons, ['fadeIn', 'faster'], true); this.util.animateCSS($fixedButtons, ['animate__fadeIn', 'animate__faster'], true);
} }
} else { } else {
if (!isMobile) { if (!isMobile) {
$fixedButtons.classList.remove('fadeIn'); $fixedButtons.classList.remove('animate__fadeIn');
this.util.animateCSS($fixedButtons, ['fadeOut', 'faster'], true); this.util.animateCSS($fixedButtons, ['animate__fadeOut', 'animate__faster'], true);
} }
$fixedButtons.style.display = 'none'; $fixedButtons.style.display = 'none';
} }