<template>
<div class="border-style">
<slot name="contain" />
</div>
</template>
<script>
export default {
name: 'BorderStyle',
};
</script>
<style scoped lang="scss">
.border-style {
width: 100%;
height: 100%;
background: rgba(2, 19, 21);
box-shadow: 0 9px 41px 0px rgba(39, 205, 241, 0.4) inset;
position: relative;
&::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
border: 2px solid #ffffff;
animation: clippath 5s infinite linear;
}
}
@keyframes clippath {
0%,
100% {
clip-path: inset(0 0 95% 0);
}
25% {
clip-path: inset(0 95% 0 0);
}
50% {
clip-path: inset(95% 0 0 0);
}
75% {
clip-path: inset(0 0 0 95%);
}
}
</style>
*************************** 不** 华** 丽** 的** 分** 割** 线***************************
<template>
<div class="border-style">
<slot name="contain" />
</div>
</template>
<script>
export default defineComponent({
name: 'BorderStyleNew',
});
</script>
<style scoped lang="scss">
*,
*::before,
*::after {
box-sizing: border-box;
}
@keyframes rotate {
100% {
transform: rotate(1turn);
}
}
.border-style {
width: 100%;
height: 100%;
background: rgba(2, 19, 21);
box-shadow: 0 9px 41px 0px rgba(39, 205, 241, 0.4) inset;
position: relative;
z-index: 0;
//margin: 20px;
border-radius: 10px;
overflow: hidden;
padding: 24px;
&::before {
content: '';
position: absolute;
z-index: -2;
left: -50%;
top: -50%;
width: 200%;
height: 200%;
background-color: #1a232a;
background-repeat: no-repeat;
background-position: 0 0;
background-image: conic-gradient(transparent, rgba(168, 239, 255, 1), transparent 30%);
animation: rotate 5s linear infinite;
}
&::after {
content: '';
position: absolute;
z-index: -1;
left: 2px;
top: 2px;
width: calc(100% - 4px);
height: calc(100% - 4px);
background: rgba(2, 19, 21);
box-shadow: 0 9px 41px 0px rgba(39, 205, 241, 0.4) inset;
border-radius: 5px;
}
}
</style>
网友评论