Skip to content

Commit f6616ab

Browse files
committed
feat: add CyberpunkCordon component
1 parent a37c144 commit f6616ab

File tree

5 files changed

+73
-1
lines changed

5 files changed

+73
-1
lines changed

docs/.vitepress/config/locales/zh.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ function sidebarComponents(): DefaultTheme.SidebarItem[] {
8686
link: '/components/cyberpunk-glitch'
8787
},
8888
{
89-
text: '流光灯效果',
89+
text: '赛博朋克警戒线',
90+
link: '/components/cyberpunk-cordon'
91+
},
92+
{
93+
text: '流光灯',
9094
link: '/components/flowing-light'
9195
}
9296
]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# IxCyberpunkCordon
2+
3+
赛博朋克警戒线组件
4+
5+
## 基本
6+
7+
<div py-4 rounded-md bg-slate-950>
8+
<IxCyberpunkCordon>
9+
<div text-8 font-bold>POLICE</div>
10+
</IxCyberpunkCordon>
11+
</div>
12+
13+
```vue
14+
<template>
15+
<IxCyberpunkCordon>
16+
<div text-8 font-bold>
17+
POLICE
18+
</div>
19+
</IxCyberpunkCordon>
20+
</template>
21+
```
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { default as IxCyberpunkCordon } from './src/index.vue'
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<style lang="scss" scoped>
2+
.marquee {
3+
white-space: nowrap;
4+
overflow: hidden;
5+
position: relative;
6+
display: inline-block;
7+
padding-left: 100%;
8+
animation: marquee 10s linear infinite;
9+
}
10+
11+
.cyberpunk-cordon {
12+
.mask {
13+
mask: radial-gradient(#000, transparent) repeat 0 0 / 4px 4px;
14+
}
15+
}
16+
17+
@keyframes marquee {
18+
0% {
19+
transform: translate(0, 0);
20+
}
21+
22+
100% {
23+
transform: translate(-100%, 0);
24+
}
25+
}
26+
</style>
27+
28+
<template>
29+
<div pr w-full class="cyberpunk-cordon">
30+
<div class="mask" :class="props.bgClass">
31+
<div class="marquee" pt="1.5" leading-none blur-1>
32+
<slot />
33+
</div>
34+
</div>
35+
<div pa top-0 right-0 bottom-0 left-0 op-50 blur-md :class="props.bgClass" />
36+
</div>
37+
</template>
38+
39+
<script lang="ts" setup>
40+
const props = withDefaults(defineProps < {
41+
bgClass?: string
42+
} > (), {
43+
bgClass: 'bg-amber'
44+
})
45+
</script>

packages/components/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import 'virtual:uno.css'
22

3+
export * from './components/CyberpunkCordon'
34
export * from './components/CyberpunkGlitch'
45
export * from './components/FlowingLight'
56
export * from './components/IconText'

0 commit comments

Comments
 (0)