Skip to content

Commit 8ef0564

Browse files
✨ Add new moving bands pattern
1 parent 06a07f0 commit 8ef0564

File tree

3 files changed

+61
-4
lines changed

3 files changed

+61
-4
lines changed

src/lib/cuicui-components/other-components.tsx

+27-4
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import { AirpodsPro } from "#/src/ui/cuicui/other/mock-ups/airpods/airpods-pro";
1515
import MacbookVariant1 from "#/src/ui/cuicui/other/mock-ups/laptops/variant1";
1616
import { GooglePixelVariant1 } from "#/src/ui/cuicui/other/mock-ups/smartphone/variant1";
1717
import { IPhone14ProVariant2 } from "#/src/ui/cuicui/other/mock-ups/smartphone/variant2";
18-
import { DotsPatternVariant1 } from "#/src/ui/cuicui/other/patterns/dots-pattern/variant1";
18+
import { DotsPatternPreview } from "#/src/ui/cuicui/other/patterns/dots-pattern/dots-pattern-preview";
19+
import MovingBandsPreview from "#/src/ui/cuicui/other/patterns/moving-bands/moving-bands-preview";
1920
import BlurAppearVariant1 from "#/src/ui/cuicui/other/transition-wrappers/blur-appear/variant1";
2021

2122
export const otherCategoriesList: CategoryType[] = [
@@ -135,6 +136,7 @@ export const otherCategoriesList: CategoryType[] = [
135136
sizePreview: "lg",
136137
slug: "airpods",
137138
isIframed: true,
139+
lastUpdatedDateComponent: new Date("2024-09-10"),
138140
isChildUsingHeightFull: true,
139141
title: "Airpods mock-up",
140142
description:
@@ -164,7 +166,7 @@ export const otherCategoriesList: CategoryType[] = [
164166
releaseDateCategory: new Date("2024-08-10"),
165167
icon: GripIcon,
166168
previewCategory: {
167-
component: <DotsPatternVariant1 />,
169+
component: <MovingBandsPreview />,
168170
previewScale: 1,
169171
},
170172
componentList: [
@@ -179,13 +181,34 @@ export const otherCategoriesList: CategoryType[] = [
179181
variantList: [
180182
{
181183
name: "Variant 1",
182-
component: <DotsPatternVariant1 />,
183-
slugPreviewFile: "variant1",
184+
component: <DotsPatternPreview />,
185+
slugPreviewFile: "dots-pattern-preview",
186+
slugComponentFile: "dots-pattern",
184187
},
185188
],
186189
inspiration: "Magic UI",
187190
inspirationLink: "https://magicui.design/docs/components/dot-pattern",
188191
},
192+
{
193+
sizePreview: "sm",
194+
slug: "moving-bands",
195+
isIframed: false,
196+
isChildUsingHeightFull: true,
197+
lastUpdatedDateComponent: new Date("2024-09-10"),
198+
title: "Moving bands pattern",
199+
description:
200+
"Create a moving bands pattern without images, just with CSS and HTML for better performance.",
201+
variantList: [
202+
{
203+
name: "Variant 1",
204+
component: <MovingBandsPreview />,
205+
slugComponentFile: "moving-bands",
206+
slugPreviewFile: "moving-bands-preview",
207+
},
208+
],
209+
// inspiration: "Magic UI",
210+
// inspirationLink: "https://magicui.design/docs/components/dot-pattern",
211+
},
189212
],
190213
},
191214
{
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import React from "react";
2+
import MovingBands from "#/src/ui/cuicui/other/patterns/moving-bands/moving-bands";
3+
4+
export default function MovingBandsPreview() {
5+
return <MovingBands size={30} />;
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
export default function MovingBands({
2+
size = 20,
3+
}: Readonly<{ size?: number }>) {
4+
return (
5+
<>
6+
<style>
7+
{`
8+
@keyframes move {
9+
0% {
10+
background-position: 0 0;
11+
}
12+
100% {
13+
background-position: ${size}px ${size}px;
14+
}
15+
}`}
16+
</style>
17+
<div
18+
className="w-full h-full flex justify-center items-center bg-transparent"
19+
style={{
20+
background:
21+
"linear-gradient(135deg, rgb(126,126,126,0.3) 25%, rgb(126,126,126,0.1) 25%, rgb(126,126,126,0.1) 50%, rgb(126,126,126,0.3) 50%, rgb(126,126,126,0.3) 75%, rgb(126,126,126,0.1) 75%, rgb(126,126,126,0.1) 100%)",
22+
backgroundSize: `${size}px ${size}px`,
23+
animation: "move 4s linear infinite",
24+
}}
25+
/>
26+
</>
27+
);
28+
}

0 commit comments

Comments
 (0)