You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
759 B
Vue

<template>
<div class="WEffectLight" :class="{ 'am': props.am }">
<slot></slot>
</div>
</template>
<script setup>
import { IdGenerator } from "@/util";
//唯一标识
const uid = IdGenerator.next();
const props = defineProps({
am: {
type: Boolean,
default: true
}
})
</script>
<style lang="scss" scoped>
@layer {
.WEffectLight {
--key: brightness(110%);
--time: 1.7s;
animation: am-WEffectLight var(--time) infinite alternate-reverse;
animation-play-state: paused;
&.am {
animation-play-state: running;
}
}
@keyframes am-WEffectLight {
0% {
// filter: brightness(100%);
}
40% {
filter: var(--key);
}
80% {
// filter: brightness(100%);
}
}
}
</style>