@kawaiininja/layouts 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -70,7 +70,11 @@ export const LibraryHome = ({ config, search, isLoading, hasMore, filteredItems,
|
|
|
70
70
|
: item.preview })) : (_jsx(Package, { size: 20, className: "text-muted group-hover:text-accent" })) }), _jsxs("div", { className: "absolute bottom-full left-1/2 -translate-x-1/2 mb-3 px-3 py-1.5 bg-accent text-primary text-[10px] font-bold uppercase tracking-widest rounded-lg opacity-0 group-hover:opacity-100 animate-float pointer-events-none whitespace-nowrap z-50 shadow-lg shadow-accent/20", children: [item.name, _jsx("div", { className: "absolute top-full left-1/2 -translate-x-1/2 -mt-1 border-4 border-transparent border-t-accent" })] })] }, item.id))) })) : ["Wallpapers", "Marketing", "Motion & Media"].includes(activeCategory) ? (_jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8", children: (activeSubCategory
|
|
71
71
|
? displayedItems.filter((i) => (i.subCategory || "General") ===
|
|
72
72
|
activeSubCategory)
|
|
73
|
-
: displayedItems).map((item) => (_jsxs("div", { onClick: () => onSelect(item.id), onMouseEnter: (e) =>
|
|
73
|
+
: displayedItems).map((item) => (_jsxs("div", { onClick: () => onSelect(item.id), onMouseEnter: (e) => {
|
|
74
|
+
const video = e.currentTarget.querySelector("video");
|
|
75
|
+
if (video)
|
|
76
|
+
video.play().catch(() => { });
|
|
77
|
+
}, onMouseLeave: (e) => {
|
|
74
78
|
const v = e.currentTarget.querySelector("video");
|
|
75
79
|
if (v) {
|
|
76
80
|
v.pause();
|
|
@@ -90,7 +94,11 @@ export const LibraryHome = ({ config, search, isLoading, hasMore, filteredItems,
|
|
|
90
94
|
: "none" }) })] }, item.id))) })) : (_jsx("div", { className: "flex flex-col gap-16", children: (activeSubCategory
|
|
91
95
|
? displayedItems.filter((i) => (i.subCategory || "General") ===
|
|
92
96
|
activeSubCategory)
|
|
93
|
-
: displayedItems).map((item) => (_jsxs("div", { onClick: () => onSelect(item.id), className: "group cursor-pointer flex flex-col lg:flex-row gap-10 items-start transition-all", children: [_jsxs("div", { className: "shrink-0 w-full lg:w-64 aspect-[16/10] relative flex items-center justify-center transition-all bg-tertiary rounded-xl group-hover:bg-accent/5 border border-subtle group-hover:border-accent/30 overflow-hidden", onMouseEnter: (e) =>
|
|
97
|
+
: displayedItems).map((item) => (_jsxs("div", { onClick: () => onSelect(item.id), className: "group cursor-pointer flex flex-col lg:flex-row gap-10 items-start transition-all", children: [_jsxs("div", { className: "shrink-0 w-full lg:w-64 aspect-[16/10] relative flex items-center justify-center transition-all bg-tertiary rounded-xl group-hover:bg-accent/5 border border-subtle group-hover:border-accent/30 overflow-hidden", onMouseEnter: (e) => {
|
|
98
|
+
const video = e.currentTarget.querySelector("video");
|
|
99
|
+
if (video)
|
|
100
|
+
video.play().catch(() => { });
|
|
101
|
+
}, onMouseLeave: (e) => {
|
|
94
102
|
const v = e.currentTarget.querySelector("video");
|
|
95
103
|
if (v) {
|
|
96
104
|
v.pause();
|
|
@@ -8,19 +8,23 @@ export const MediaPreview = ({ product }) => {
|
|
|
8
8
|
const audioRef = useRef(null);
|
|
9
9
|
const toggleVideo = () => {
|
|
10
10
|
if (videoRef.current) {
|
|
11
|
-
if (isPlaying)
|
|
11
|
+
if (isPlaying) {
|
|
12
12
|
videoRef.current.pause();
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
videoRef.current.play().catch(() => { });
|
|
16
|
+
}
|
|
15
17
|
setIsPlaying(!isPlaying);
|
|
16
18
|
}
|
|
17
19
|
};
|
|
18
20
|
const toggleAudio = () => {
|
|
19
21
|
if (audioRef.current) {
|
|
20
|
-
if (isAudioPlaying)
|
|
22
|
+
if (isAudioPlaying) {
|
|
21
23
|
audioRef.current.pause();
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
audioRef.current.play().catch(() => { });
|
|
27
|
+
}
|
|
24
28
|
setIsAudioPlaying(!isAudioPlaying);
|
|
25
29
|
}
|
|
26
30
|
};
|
|
@@ -38,6 +42,7 @@ export const MediaPreview = ({ product }) => {
|
|
|
38
42
|
} })] })), _jsx("div", { className: "relative rounded-3xl overflow-hidden border border-subtle aspect-square md:aspect-video bg-black/40 backdrop-blur-xl flex items-center justify-center shadow-2xl", children: _jsxs("div", { className: "relative z-10 w-full max-w-xs md:max-w-md p-6 md:p-8 bg-surface/30 backdrop-blur-md rounded-3xl border border-white/10 shadow-xl flex flex-col items-center gap-6 md:gap-8 mx-4", children: [product.image && (_jsxs("div", { className: `relative w-40 h-40 rounded-full shadow-[0_0_40px_-5px_rgba(var(--color-accent),0.4)] transition-all duration-700 ${isAudioPlaying ? "animate-[spin_4s_linear_infinite]" : ""}`, children: [_jsx("img", { src: product.image, className: "w-full h-full rounded-full object-cover border-4 border-surface/50", alt: "Album Art" }), _jsx("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-8 h-8 bg-surface/80 rounded-full border border-white/20" })] })), _jsxs("div", { className: "w-full text-center space-y-4", children: [_jsx("h3", { className: "text-2xl font-black text-white mb-2 tracking-tight drop-shadow-md", children: product.name }), _jsx("button", { onClick: toggleAudio, className: "w-16 h-16 rounded-full bg-white text-black flex items-center justify-center mx-auto hover:scale-110 active:scale-95 transition-all shadow-lg shadow-white/20", children: isAudioPlaying ? (_jsx(Pause, { size: 24, className: "fill-black" })) : (_jsx(Play, { size: 24, className: "fill-black ml-1" })) }), _jsx("audio", { ref: audioRef, src: product.previewUrl, onEnded: () => setIsAudioPlaying(false), className: "hidden" })] })] }) })] }));
|
|
39
43
|
}
|
|
40
44
|
if ((product.type === "video" ||
|
|
45
|
+
product.type === "media" ||
|
|
41
46
|
product.type === "app" ||
|
|
42
47
|
product.type === "software") &&
|
|
43
48
|
product.previewUrl) {
|
package/dist/library/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export interface AssetProduct {
|
|
|
6
6
|
category: string;
|
|
7
7
|
framework: string;
|
|
8
8
|
description: string;
|
|
9
|
-
type?: "code" | "util" | "image" | "audio" | "video" | "book" | "app" | "software" | "glyph";
|
|
9
|
+
type?: "code" | "util" | "image" | "audio" | "video" | "media" | "book" | "app" | "software" | "glyph";
|
|
10
10
|
previewUrl?: string;
|
|
11
11
|
preview?: React.ReactNode;
|
|
12
12
|
tags?: string[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kawaiininja/layouts",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"category": "UI Components",
|
|
5
5
|
"framework": "React / Framer Motion",
|
|
6
6
|
"description": "High-performance, premium mobile-first layouts for the Onyx Framework, featuring gesture-driven navigation, radial quick actions, and integrated theme support.",
|