(delete) link jiggle animation
This commit is contained in:
parent
807c4b18ec
commit
c349afd80b
|
@ -7,7 +7,7 @@ block content
|
||||||
div#error
|
div#error
|
||||||
div
|
div
|
||||||
div#instance-info
|
div#instance-info
|
||||||
a.click-anime(href=url target='_blank')
|
a(href=url target='_blank')
|
||||||
img(src= icon || '/static-assets/splash.png')
|
img(src= icon || '/static-assets/splash.png')
|
||||||
span.sr-only(data-mi-i18n='aboutX' data-mi-i18n-ctx=`{"x": "${instanceName}"}`)
|
span.sr-only(data-mi-i18n='aboutX' data-mi-i18n-ctx=`{"x": "${instanceName}"}`)
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ block content
|
||||||
span(style="opacity: .5;") @#{displayUser.host}
|
span(style="opacity: .5;") @#{displayUser.host}
|
||||||
|
|
||||||
div#instance-info
|
div#instance-info
|
||||||
a.click-anime(href=config.url target='_blank')
|
a(href=config.url target='_blank')
|
||||||
img(src= icon || '/static-assets/splash.png')
|
img(src= icon || '/static-assets/splash.png')
|
||||||
span.sr-only(data-mi-i18n='aboutX' data-mi-i18n-ctx=`{"x": "${instanceName}"}`)
|
span.sr-only(data-mi-i18n='aboutX' data-mi-i18n-ctx=`{"x": "${instanceName}"}`)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ import { embedInitI18n } from './scripts/embed-i18n';
|
||||||
import '@/style.scss';
|
import '@/style.scss';
|
||||||
import './embed.scss';
|
import './embed.scss';
|
||||||
import 'iframe-resizer/js/iframeResizer.contentWindow';
|
import 'iframe-resizer/js/iframeResizer.contentWindow';
|
||||||
import { embedInitLinkAnime } from './scripts/link-anime';
|
|
||||||
import { parseMfm } from './scripts/parse-mfm';
|
import { parseMfm } from './scripts/parse-mfm';
|
||||||
import { renderNotFound } from './scripts/render-not-found';
|
import { renderNotFound } from './scripts/render-not-found';
|
||||||
import { parseEmoji } from './scripts/parse-emoji';
|
import { parseEmoji } from './scripts/parse-emoji';
|
||||||
|
@ -152,6 +151,4 @@ function afterPageInitialization() {
|
||||||
splash.style.pointerEvents = 'none';
|
splash.style.pointerEvents = 'none';
|
||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
embedInitLinkAnime();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,33 +0,0 @@
|
||||||
export function embedInitLinkAnime() {
|
|
||||||
const animeEl: NodeListOf<HTMLElement> = document.querySelectorAll("a.click-anime,button.click-anime");
|
|
||||||
if (animeEl.length > 0) {
|
|
||||||
animeEl.forEach((el: HTMLElement) => {
|
|
||||||
const target = el.children[0];
|
|
||||||
|
|
||||||
if (target == null) return;
|
|
||||||
|
|
||||||
target.classList.add('_anime_bounce_standBy');
|
|
||||||
|
|
||||||
el.addEventListener('mousedown', () => {
|
|
||||||
target.classList.remove('_anime_bounce');
|
|
||||||
|
|
||||||
target.classList.add('_anime_bounce_standBy');
|
|
||||||
target.classList.add('_anime_bounce_ready');
|
|
||||||
|
|
||||||
target.addEventListener('mouseleave', () => {
|
|
||||||
target.classList.remove('_anime_bounce_ready');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
el.addEventListener('click', () => {
|
|
||||||
target.classList.add('_anime_bounce');
|
|
||||||
target.classList.remove('_anime_bounce_ready');
|
|
||||||
});
|
|
||||||
|
|
||||||
el.addEventListener('animationend', () => {
|
|
||||||
target.classList.remove('_anime_bounce');
|
|
||||||
target.classList.add('_anime_bounce_standBy');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue