refactor
This commit is contained in:
parent
c2097f9244
commit
df7c71b1b4
|
@ -104,7 +104,7 @@
|
||||||
</MkA>
|
</MkA>
|
||||||
</template>
|
</template>
|
||||||
<template #reason>
|
<template #reason>
|
||||||
<b>{{ muted.matched.join(", ") }}</b>
|
<b class="_blur_text">{{ muted.matched.join(", ") }}</b>
|
||||||
</template>
|
</template>
|
||||||
</I18n>
|
</I18n>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -110,7 +110,7 @@
|
||||||
</MkA>
|
</MkA>
|
||||||
</template>
|
</template>
|
||||||
<template #reason>
|
<template #reason>
|
||||||
<b class="_mfm_blur_">{{ muted.matched.join(", ") }}</b>
|
<b class="_blur_text">{{ muted.matched.join(", ") }}</b>
|
||||||
</template>
|
</template>
|
||||||
</I18n>
|
</I18n>
|
||||||
</div>
|
</div>
|
||||||
|
@ -354,15 +354,6 @@ onUnmounted(() => {
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
._mfm_blur_ {
|
|
||||||
filter: blur(6px);
|
|
||||||
transition: filter 0.3s;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
filter: blur(0px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.lxwezrsl {
|
.lxwezrsl {
|
||||||
font-size: 1.05em;
|
font-size: 1.05em;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
|
@ -22,15 +22,6 @@ const props = withDefaults(defineProps<{
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
._mfm_blur_ {
|
|
||||||
filter: blur(6px);
|
|
||||||
transition: filter 0.3s;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
filter: blur(0px);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.mfm-x2 {
|
.mfm-x2 {
|
||||||
--mfm-zoom-size: 200%;
|
--mfm-zoom-size: 200%;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ import MkA from "@/components/global/MkA.vue";
|
||||||
import { host } from "@/config";
|
import { host } from "@/config";
|
||||||
import { MFM_TAGS } from "@/scripts/mfm-tags";
|
import { MFM_TAGS } from "@/scripts/mfm-tags";
|
||||||
import { reducedMotion } from "@/scripts/reduced-motion";
|
import { reducedMotion } from "@/scripts/reduced-motion";
|
||||||
|
import { defaultStore } from "@/store";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
|
@ -103,7 +104,7 @@ export default defineComponent({
|
||||||
case "tada": {
|
case "tada": {
|
||||||
const speed = validTime(token.props.args.speed) || "1s";
|
const speed = validTime(token.props.args.speed) || "1s";
|
||||||
style = `font-size: 150%;${
|
style = `font-size: 150%;${
|
||||||
this.$store.state.animatedMfm
|
defaultStore.state.animatedMfm
|
||||||
? `animation: tada ${speed} linear infinite both;`
|
? `animation: tada ${speed} linear infinite both;`
|
||||||
: ""
|
: ""
|
||||||
}`;
|
}`;
|
||||||
|
@ -112,7 +113,7 @@ export default defineComponent({
|
||||||
case "jelly": {
|
case "jelly": {
|
||||||
const speed = validTime(token.props.args.speed) || "1s";
|
const speed = validTime(token.props.args.speed) || "1s";
|
||||||
style =
|
style =
|
||||||
this.$store.state.animatedMfm && !reducedMotion()
|
defaultStore.state.animatedMfm && !reducedMotion()
|
||||||
? `animation: mfm-rubberBand ${speed} linear infinite both;`
|
? `animation: mfm-rubberBand ${speed} linear infinite both;`
|
||||||
: "";
|
: "";
|
||||||
break;
|
break;
|
||||||
|
@ -120,7 +121,7 @@ export default defineComponent({
|
||||||
case "twitch": {
|
case "twitch": {
|
||||||
const speed = validTime(token.props.args.speed) || "0.5s";
|
const speed = validTime(token.props.args.speed) || "0.5s";
|
||||||
style =
|
style =
|
||||||
this.$store.state.animatedMfm && !reducedMotion()
|
defaultStore.state.animatedMfm && !reducedMotion()
|
||||||
? `animation: mfm-twitch ${speed} ease infinite;`
|
? `animation: mfm-twitch ${speed} ease infinite;`
|
||||||
: "";
|
: "";
|
||||||
break;
|
break;
|
||||||
|
@ -128,7 +129,7 @@ export default defineComponent({
|
||||||
case "shake": {
|
case "shake": {
|
||||||
const speed = validTime(token.props.args.speed) || "0.5s";
|
const speed = validTime(token.props.args.speed) || "0.5s";
|
||||||
style =
|
style =
|
||||||
this.$store.state.animatedMfm && !reducedMotion()
|
defaultStore.state.animatedMfm && !reducedMotion()
|
||||||
? `animation: mfm-shake ${speed} ease infinite;`
|
? `animation: mfm-shake ${speed} ease infinite;`
|
||||||
: "";
|
: "";
|
||||||
break;
|
break;
|
||||||
|
@ -146,7 +147,7 @@ export default defineComponent({
|
||||||
: "mfm-spin";
|
: "mfm-spin";
|
||||||
const speed = validTime(token.props.args.speed) || "1.5s";
|
const speed = validTime(token.props.args.speed) || "1.5s";
|
||||||
style =
|
style =
|
||||||
this.$store.state.animatedMfm && !reducedMotion()
|
defaultStore.state.animatedMfm && !reducedMotion()
|
||||||
? `animation: ${anime} ${speed} linear infinite; animation-direction: ${direction};`
|
? `animation: ${anime} ${speed} linear infinite; animation-direction: ${direction};`
|
||||||
: "";
|
: "";
|
||||||
break;
|
break;
|
||||||
|
@ -154,7 +155,7 @@ export default defineComponent({
|
||||||
case "jump": {
|
case "jump": {
|
||||||
const speed = validTime(token.props.args.speed) || "0.75s";
|
const speed = validTime(token.props.args.speed) || "0.75s";
|
||||||
style =
|
style =
|
||||||
this.$store.state.animatedMfm && !reducedMotion()
|
defaultStore.state.animatedMfm && !reducedMotion()
|
||||||
? `animation: mfm-jump ${speed} linear infinite;`
|
? `animation: mfm-jump ${speed} linear infinite;`
|
||||||
: "";
|
: "";
|
||||||
break;
|
break;
|
||||||
|
@ -162,7 +163,7 @@ export default defineComponent({
|
||||||
case "bounce": {
|
case "bounce": {
|
||||||
const speed = validTime(token.props.args.speed) || "0.75s";
|
const speed = validTime(token.props.args.speed) || "0.75s";
|
||||||
style =
|
style =
|
||||||
this.$store.state.animatedMfm && !reducedMotion()
|
defaultStore.state.animatedMfm && !reducedMotion()
|
||||||
? `animation: mfm-bounce ${speed} linear infinite; transform-origin: center bottom;`
|
? `animation: mfm-bounce ${speed} linear infinite; transform-origin: center bottom;`
|
||||||
: "";
|
: "";
|
||||||
break;
|
break;
|
||||||
|
@ -170,13 +171,13 @@ export default defineComponent({
|
||||||
case "rainbow": {
|
case "rainbow": {
|
||||||
const speed = validTime(token.props.args.speed) || "1s";
|
const speed = validTime(token.props.args.speed) || "1s";
|
||||||
style =
|
style =
|
||||||
this.$store.state.animatedMfm && !reducedMotion()
|
defaultStore.state.animatedMfm && !reducedMotion()
|
||||||
? `animation: mfm-rainbow ${speed} linear infinite;`
|
? `animation: mfm-rainbow ${speed} linear infinite;`
|
||||||
: "";
|
: "";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "sparkle": {
|
case "sparkle": {
|
||||||
if (!(this.$store.state.animatedMfm || reducedMotion())) {
|
if (!(defaultStore.state.animatedMfm || reducedMotion())) {
|
||||||
return genEl(token.children);
|
return genEl(token.children);
|
||||||
}
|
}
|
||||||
return h(MkSparkle, {}, genEl(token.children));
|
return h(MkSparkle, {}, genEl(token.children));
|
||||||
|
@ -239,7 +240,7 @@ export default defineComponent({
|
||||||
return h(
|
return h(
|
||||||
"span",
|
"span",
|
||||||
{
|
{
|
||||||
class: "_mfm_blur_",
|
class: "_blur_text",
|
||||||
},
|
},
|
||||||
genEl(token.children),
|
genEl(token.children),
|
||||||
);
|
);
|
||||||
|
|
|
@ -689,6 +689,14 @@ hr {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
._blur_text {
|
||||||
|
filter: blur(6px);
|
||||||
|
transition: filter 0.3s;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
filter: blur(0px);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@media(prefers-reduced-motion: no-preference) {
|
@media(prefers-reduced-motion: no-preference) {
|
||||||
@keyframes scaleIn {
|
@keyframes scaleIn {
|
||||||
|
|
Loading…
Reference in New Issue