@hunterchen/canvas 0.1.0 → 0.1.2
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.
- package/LICENSE +21 -0
- package/README.md +242 -0
- package/dist/components/canvas/canvas.d.ts.map +1 -1
- package/dist/components/canvas/canvas.js +0 -15
- package/dist/components/canvas/canvas.js.map +1 -1
- package/dist/components/canvas/navbar/single-button.d.ts.map +1 -1
- package/dist/components/canvas/navbar/single-button.js +0 -26
- package/dist/components/canvas/navbar/single-button.js.map +1 -1
- package/dist/hooks/usePerformanceMode.d.ts +11 -3
- package/dist/hooks/usePerformanceMode.d.ts.map +1 -1
- package/dist/hooks/usePerformanceMode.js +37 -3
- package/dist/hooks/usePerformanceMode.js.map +1 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -9
- package/dist/index.js.map +1 -1
- package/package.json +50 -48
- package/src/components/canvas/canvas.tsx +0 -16
- package/src/components/canvas/navbar/single-button.tsx +0 -30
- package/src/hooks/usePerformanceMode.ts +53 -3
- package/src/index.ts +0 -10
- package/dist/components/canvas/cursor.d.ts +0 -8
- package/dist/components/canvas/cursor.d.ts.map +0 -1
- package/dist/components/canvas/cursor.js +0 -32
- package/dist/components/canvas/cursor.js.map +0 -1
- package/dist/components/ui/FolderIcon.d.ts +0 -9
- package/dist/components/ui/FolderIcon.d.ts.map +0 -1
- package/dist/components/ui/FolderIcon.js +0 -25
- package/dist/components/ui/FolderIcon.js.map +0 -1
- package/dist/components/ui/button.d.ts +0 -14
- package/dist/components/ui/button.d.ts.map +0 -1
- package/dist/components/ui/button.js +0 -54
- package/dist/components/ui/button.js.map +0 -1
- package/dist/components/ui/label.d.ts +0 -6
- package/dist/components/ui/label.d.ts.map +0 -1
- package/dist/components/ui/label.js +0 -10
- package/dist/components/ui/label.js.map +0 -1
- package/dist/components/ui/toast.d.ts +0 -16
- package/dist/components/ui/toast.d.ts.map +0 -1
- package/dist/components/ui/toast.js +0 -41
- package/dist/components/ui/toast.js.map +0 -1
- package/dist/components/ui/toaster.d.ts +0 -2
- package/dist/components/ui/toaster.d.ts.map +0 -1
- package/dist/components/ui/toaster.js +0 -10
- package/dist/components/ui/toaster.js.map +0 -1
- package/dist/hooks/use-mobile.d.ts +0 -2
- package/dist/hooks/use-mobile.d.ts.map +0 -1
- package/dist/hooks/use-mobile.js +0 -16
- package/dist/hooks/use-mobile.js.map +0 -1
- package/dist/hooks/use-toast.d.ts +0 -45
- package/dist/hooks/use-toast.d.ts.map +0 -1
- package/dist/hooks/use-toast.js +0 -126
- package/dist/hooks/use-toast.js.map +0 -1
- package/src/components/canvas/cursor.tsx +0 -161
- package/src/components/ui/FolderIcon.tsx +0 -116
- package/src/components/ui/button.tsx +0 -162
- package/src/components/ui/label.tsx +0 -24
- package/src/components/ui/toast.tsx +0 -136
- package/src/components/ui/toaster.tsx +0 -33
- package/src/hooks/use-mobile.ts +0 -21
- package/src/hooks/use-toast.ts +0 -186
- package/src/lib/copy.ts +0 -18
- package/src/lib/utils.ts +0 -18
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useToast } from "../../hooks/use-toast";
|
|
3
|
-
import { Toast, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, } from "./toast";
|
|
4
|
-
export function Toaster() {
|
|
5
|
-
const { toasts } = useToast();
|
|
6
|
-
return (_jsxs(ToastProvider, { children: [toasts.map(function ({ id, title, description, action, ...props }) {
|
|
7
|
-
return (_jsxs(Toast, { ...props, children: [_jsxs("div", { className: "grid gap-1", children: [title && _jsx(ToastTitle, { children: title }), description && (_jsx(ToastDescription, { children: description }))] }), action, _jsx(ToastClose, {})] }, id));
|
|
8
|
-
}), _jsx(ToastViewport, {})] }));
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=toaster.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"toaster.js","sourceRoot":"","sources":["../../../src/components/ui/toaster.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EACL,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,UAAU,EACV,aAAa,GACd,MAAM,SAAS,CAAC;AAEjB,MAAM,UAAU,OAAO;IACrB,MAAM,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,CAAC;IAE9B,OAAO,CACL,MAAC,aAAa,eACX,MAAM,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE;gBAChE,OAAO,CACL,MAAC,KAAK,OAAc,KAAK,aACvB,eAAK,SAAS,EAAC,YAAY,aACxB,KAAK,IAAI,KAAC,UAAU,cAAE,KAAK,GAAc,EACzC,WAAW,IAAI,CACd,KAAC,gBAAgB,cAAE,WAAW,GAAoB,CACnD,IACG,EACL,MAAM,EACP,KAAC,UAAU,KAAG,KARJ,EAAE,CASN,CACT,CAAC;YACJ,CAAC,CAAC,EACF,KAAC,aAAa,KAAG,IACH,CACjB,CAAC;AACJ,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-mobile.d.ts","sourceRoot":"","sources":["../../src/hooks/use-mobile.ts"],"names":[],"mappings":"AAIA,wBAAgB,WAAW,YAgB1B"}
|
package/dist/hooks/use-mobile.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
const MOBILE_BREAKPOINT = 768;
|
|
3
|
-
export function useIsMobile() {
|
|
4
|
-
const [isMobile, setIsMobile] = React.useState(undefined);
|
|
5
|
-
React.useEffect(() => {
|
|
6
|
-
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
7
|
-
const onChange = () => {
|
|
8
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
9
|
-
};
|
|
10
|
-
mql.addEventListener("change", onChange);
|
|
11
|
-
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
12
|
-
return () => mql.removeEventListener("change", onChange);
|
|
13
|
-
}, []);
|
|
14
|
-
return !!isMobile;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=use-mobile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-mobile.js","sourceRoot":"","sources":["../../src/hooks/use-mobile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAE9B,MAAM,UAAU,WAAW;IACzB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,KAAK,CAAC,QAAQ,CAC5C,SAAS,CACV,CAAC;IAEF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,MAAM,GAAG,GAAG,MAAM,CAAC,UAAU,CAAC,eAAe,iBAAiB,GAAG,CAAC,KAAK,CAAC,CAAC;QACzE,MAAM,QAAQ,GAAG,GAAG,EAAE;YACpB,WAAW,CAAC,MAAM,CAAC,UAAU,GAAG,iBAAiB,CAAC,CAAC;QACrD,CAAC,CAAC;QACF,GAAG,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACzC,WAAW,CAAC,MAAM,CAAC,UAAU,GAAG,iBAAiB,CAAC,CAAC;QACnD,OAAO,GAAG,EAAE,CAAC,GAAG,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CAAC,CAAC,QAAQ,CAAC;AACpB,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import type { ToastActionElement, ToastProps } from "../components/ui/toast";
|
|
3
|
-
type ToasterToast = ToastProps & {
|
|
4
|
-
id: string;
|
|
5
|
-
title?: React.ReactNode;
|
|
6
|
-
description?: React.ReactNode;
|
|
7
|
-
action?: ToastActionElement;
|
|
8
|
-
};
|
|
9
|
-
declare const actionTypes: {
|
|
10
|
-
readonly ADD_TOAST: "ADD_TOAST";
|
|
11
|
-
readonly UPDATE_TOAST: "UPDATE_TOAST";
|
|
12
|
-
readonly DISMISS_TOAST: "DISMISS_TOAST";
|
|
13
|
-
readonly REMOVE_TOAST: "REMOVE_TOAST";
|
|
14
|
-
};
|
|
15
|
-
type ActionType = typeof actionTypes;
|
|
16
|
-
type Action = {
|
|
17
|
-
type: ActionType["ADD_TOAST"];
|
|
18
|
-
toast: ToasterToast;
|
|
19
|
-
} | {
|
|
20
|
-
type: ActionType["UPDATE_TOAST"];
|
|
21
|
-
toast: Partial<ToasterToast>;
|
|
22
|
-
} | {
|
|
23
|
-
type: ActionType["DISMISS_TOAST"];
|
|
24
|
-
toastId?: ToasterToast["id"];
|
|
25
|
-
} | {
|
|
26
|
-
type: ActionType["REMOVE_TOAST"];
|
|
27
|
-
toastId?: ToasterToast["id"];
|
|
28
|
-
};
|
|
29
|
-
interface State {
|
|
30
|
-
toasts: ToasterToast[];
|
|
31
|
-
}
|
|
32
|
-
export declare const reducer: (state: State, action: Action) => State;
|
|
33
|
-
type Toast = Omit<ToasterToast, "id">;
|
|
34
|
-
export declare function toast({ ...props }: Toast): {
|
|
35
|
-
id: string;
|
|
36
|
-
dismiss: () => void;
|
|
37
|
-
update: (props: ToasterToast) => void;
|
|
38
|
-
};
|
|
39
|
-
export declare function useToast(): {
|
|
40
|
-
toast: typeof toast;
|
|
41
|
-
dismiss: (toastId?: string) => void;
|
|
42
|
-
toasts: ToasterToast[];
|
|
43
|
-
};
|
|
44
|
-
export {};
|
|
45
|
-
//# sourceMappingURL=use-toast.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-toast.d.ts","sourceRoot":"","sources":["../../src/hooks/use-toast.ts"],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B"}
|
package/dist/hooks/use-toast.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
const TOAST_LIMIT = 1;
|
|
3
|
-
const TOAST_REMOVE_DELAY = 5000;
|
|
4
|
-
const actionTypes = {
|
|
5
|
-
ADD_TOAST: "ADD_TOAST",
|
|
6
|
-
UPDATE_TOAST: "UPDATE_TOAST",
|
|
7
|
-
DISMISS_TOAST: "DISMISS_TOAST",
|
|
8
|
-
REMOVE_TOAST: "REMOVE_TOAST",
|
|
9
|
-
};
|
|
10
|
-
let count = 0;
|
|
11
|
-
function genId() {
|
|
12
|
-
count = (count + 1) % Number.MAX_SAFE_INTEGER;
|
|
13
|
-
return count.toString();
|
|
14
|
-
}
|
|
15
|
-
const toastTimeouts = new Map();
|
|
16
|
-
const addToRemoveQueue = (toastId) => {
|
|
17
|
-
if (toastTimeouts.has(toastId)) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
const timeout = setTimeout(() => {
|
|
21
|
-
toastTimeouts.delete(toastId);
|
|
22
|
-
dispatch({
|
|
23
|
-
type: "REMOVE_TOAST",
|
|
24
|
-
toastId: toastId,
|
|
25
|
-
});
|
|
26
|
-
}, TOAST_REMOVE_DELAY);
|
|
27
|
-
toastTimeouts.set(toastId, timeout);
|
|
28
|
-
};
|
|
29
|
-
export const reducer = (state, action) => {
|
|
30
|
-
switch (action.type) {
|
|
31
|
-
case "ADD_TOAST":
|
|
32
|
-
return {
|
|
33
|
-
...state,
|
|
34
|
-
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
|
|
35
|
-
};
|
|
36
|
-
case "UPDATE_TOAST":
|
|
37
|
-
return {
|
|
38
|
-
...state,
|
|
39
|
-
toasts: state.toasts.map((t) => t.id === action.toast.id ? { ...t, ...action.toast } : t),
|
|
40
|
-
};
|
|
41
|
-
case "DISMISS_TOAST": {
|
|
42
|
-
const { toastId } = action;
|
|
43
|
-
// ! Side effects ! - This could be extracted into a dismissToast() action,
|
|
44
|
-
// but I'll keep it here for simplicity
|
|
45
|
-
if (toastId) {
|
|
46
|
-
addToRemoveQueue(toastId);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
state.toasts.forEach((toast) => {
|
|
50
|
-
addToRemoveQueue(toast.id);
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
return {
|
|
54
|
-
...state,
|
|
55
|
-
toasts: state.toasts.map((t) => t.id === toastId || toastId === undefined
|
|
56
|
-
? {
|
|
57
|
-
...t,
|
|
58
|
-
open: false,
|
|
59
|
-
}
|
|
60
|
-
: t),
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
case "REMOVE_TOAST":
|
|
64
|
-
if (action.toastId === undefined) {
|
|
65
|
-
return {
|
|
66
|
-
...state,
|
|
67
|
-
toasts: [],
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
return {
|
|
71
|
-
...state,
|
|
72
|
-
toasts: state.toasts.filter((t) => t.id !== action.toastId),
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
const listeners = [];
|
|
77
|
-
let memoryState = { toasts: [] };
|
|
78
|
-
function dispatch(action) {
|
|
79
|
-
memoryState = reducer(memoryState, action);
|
|
80
|
-
listeners.forEach((listener) => {
|
|
81
|
-
listener(memoryState);
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
export function toast({ ...props }) {
|
|
85
|
-
const id = genId();
|
|
86
|
-
const update = (props) => dispatch({
|
|
87
|
-
type: "UPDATE_TOAST",
|
|
88
|
-
toast: { ...props, id },
|
|
89
|
-
});
|
|
90
|
-
const dismiss = () => dispatch({ type: "DISMISS_TOAST", toastId: id });
|
|
91
|
-
dispatch({
|
|
92
|
-
type: "ADD_TOAST",
|
|
93
|
-
toast: {
|
|
94
|
-
...props,
|
|
95
|
-
id,
|
|
96
|
-
open: true,
|
|
97
|
-
onOpenChange: (open) => {
|
|
98
|
-
if (!open)
|
|
99
|
-
dismiss();
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
});
|
|
103
|
-
return {
|
|
104
|
-
id: id,
|
|
105
|
-
dismiss,
|
|
106
|
-
update,
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
export function useToast() {
|
|
110
|
-
const [state, setState] = React.useState(memoryState);
|
|
111
|
-
React.useEffect(() => {
|
|
112
|
-
listeners.push(setState);
|
|
113
|
-
return () => {
|
|
114
|
-
const index = listeners.indexOf(setState);
|
|
115
|
-
if (index > -1) {
|
|
116
|
-
listeners.splice(index, 1);
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
}, [state]);
|
|
120
|
-
return {
|
|
121
|
-
...state,
|
|
122
|
-
toast,
|
|
123
|
-
dismiss: (toastId) => dispatch({ type: "DISMISS_TOAST", toastId }),
|
|
124
|
-
};
|
|
125
|
-
}
|
|
126
|
-
//# sourceMappingURL=use-toast.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-toast.js","sourceRoot":"","sources":["../../src/hooks/use-toast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,MAAM,WAAW,GAAG,CAAC,CAAC;AACtB,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAShC,MAAM,WAAW,GAAG;IAClB,SAAS,EAAE,WAAW;IACtB,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;IAC9B,YAAY,EAAE,cAAc;CACpB,CAAC;AAEX,IAAI,KAAK,GAAG,CAAC,CAAC;AAEd,SAAS,KAAK;IACZ,KAAK,GAAG,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,MAAM,CAAC,gBAAgB,CAAC;IAC9C,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;AAC1B,CAAC;AA0BD,MAAM,aAAa,GAAG,IAAI,GAAG,EAAyC,CAAC;AAEvE,MAAM,gBAAgB,GAAG,CAAC,OAAe,EAAE,EAAE;IAC3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@
|
|
|
1
|
-
import React, { useEffect, useState } from "react";
|
|
2
|
-
|
|
3
|
-
interface CursorProps {
|
|
4
|
-
isPanning?: boolean;
|
|
5
|
-
isVisible?: boolean;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
const Cursor: React.FC<CursorProps> = ({
|
|
9
|
-
isPanning = false,
|
|
10
|
-
isVisible = true,
|
|
11
|
-
}) => {
|
|
12
|
-
const [position, setPosition] = useState({ x: 0, y: 0 });
|
|
13
|
-
|
|
14
|
-
useEffect(() => {
|
|
15
|
-
const updateCursorPosition = (e: MouseEvent) => {
|
|
16
|
-
setPosition({ x: e.clientX, y: e.clientY });
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
if (isVisible) {
|
|
20
|
-
document.addEventListener("mousemove", updateCursorPosition);
|
|
21
|
-
// Hide default cursor
|
|
22
|
-
document.body.style.cursor = "none";
|
|
23
|
-
} else {
|
|
24
|
-
// Show default cursor
|
|
25
|
-
document.body.style.cursor = "auto";
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return () => {
|
|
29
|
-
document.removeEventListener("mousemove", updateCursorPosition);
|
|
30
|
-
document.body.style.cursor = "auto";
|
|
31
|
-
};
|
|
32
|
-
}, [isVisible]);
|
|
33
|
-
|
|
34
|
-
if (!isVisible) return null;
|
|
35
|
-
|
|
36
|
-
return (
|
|
37
|
-
<div
|
|
38
|
-
className="pointer-events-none fixed z-[9999] transition-transform"
|
|
39
|
-
style={{
|
|
40
|
-
left: position.x - 10, // Offset based on the cursor's hotspot
|
|
41
|
-
top: position.y - 5, // Offset based on the cursor's hotspot
|
|
42
|
-
transform: isPanning ? "scale(1.1)" : "scale(1)",
|
|
43
|
-
}}
|
|
44
|
-
>
|
|
45
|
-
<svg
|
|
46
|
-
width="50"
|
|
47
|
-
height="25"
|
|
48
|
-
viewBox="0 0 100 50"
|
|
49
|
-
fill="none"
|
|
50
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
51
|
-
className={`transition-all duration-150 ${isPanning ? "opacity-80" : "opacity-100"}`}
|
|
52
|
-
>
|
|
53
|
-
<g filter="url(#filter0_d_72_88)">
|
|
54
|
-
<path
|
|
55
|
-
d="M9.70481 20.4325L3.54745 4.42338C3.33259 3.86472 3.87251 3.31157 4.4362 3.51287L21.153 9.48239C21.8191 9.72026 21.7524 10.6833 21.0598 10.827L13.4303 12.4107C13.1672 12.4653 12.9586 12.6657 12.8934 12.9263L11.0373 20.351C10.8714 21.0145 9.95031 21.0708 9.70481 20.4325Z"
|
|
56
|
-
fill="#667799"
|
|
57
|
-
/>
|
|
58
|
-
<path
|
|
59
|
-
d="M9.70481 20.4325L3.54745 4.42338C3.33259 3.86472 3.87251 3.31157 4.4362 3.51287L21.153 9.48239C21.8191 9.72026 21.7524 10.6833 21.0598 10.827L13.4303 12.4107C13.1672 12.4653 12.9586 12.6657 12.8934 12.9263L11.0373 20.351C10.8714 21.0145 9.95031 21.0708 9.70481 20.4325Z"
|
|
60
|
-
stroke="#667799"
|
|
61
|
-
strokeWidth="2"
|
|
62
|
-
/>
|
|
63
|
-
<path
|
|
64
|
-
d="M9.70481 20.4325L3.54745 4.42338C3.33259 3.86472 3.87251 3.31157 4.4362 3.51287L21.153 9.48239C21.8191 9.72026 21.7524 10.6833 21.0598 10.827L13.4303 12.4107C13.1672 12.4653 12.9586 12.6657 12.8934 12.9263L11.0373 20.351C10.8714 21.0145 9.95031 21.0708 9.70481 20.4325Z"
|
|
65
|
-
stroke="white"
|
|
66
|
-
strokeWidth="2"
|
|
67
|
-
/>
|
|
68
|
-
</g>
|
|
69
|
-
<g filter="url(#filter1_d_72_88)">
|
|
70
|
-
<rect
|
|
71
|
-
x="19"
|
|
72
|
-
y="20"
|
|
73
|
-
width="77"
|
|
74
|
-
height="22"
|
|
75
|
-
rx="2"
|
|
76
|
-
fill="#667799"
|
|
77
|
-
shapeRendering="crispEdges"
|
|
78
|
-
/>
|
|
79
|
-
<path
|
|
80
|
-
d="M25.532 35V27.236L25.64 26.6H26.684V35H25.532ZM23.672 28.892V27.824C23.848 27.832 24.052 27.776 24.284 27.656C24.524 27.536 24.764 27.38 25.004 27.188C25.244 26.996 25.456 26.796 25.64 26.588L26.372 27.38C26.1 27.668 25.816 27.928 25.52 28.16C25.224 28.392 24.92 28.576 24.608 28.712C24.304 28.848 23.992 28.908 23.672 28.892ZM31.8442 35.144C31.1962 35.144 30.6202 34.96 30.1162 34.592C29.6122 34.216 29.2162 33.704 28.9282 33.056C28.6482 32.4 28.5082 31.648 28.5082 30.8C28.5082 29.952 28.6482 29.204 28.9282 28.556C29.2162 27.9 29.6082 27.388 30.1042 27.02C30.6082 26.644 31.1882 26.456 31.8442 26.456C32.5002 26.456 33.0762 26.644 33.5722 27.02C34.0762 27.388 34.4722 27.9 34.7602 28.556C35.0482 29.204 35.1922 29.952 35.1922 30.8C35.1922 31.648 35.0482 32.4 34.7602 33.056C34.4802 33.704 34.0882 34.216 33.5842 34.592C33.0802 34.96 32.5002 35.144 31.8442 35.144ZM31.8442 34.064C32.2682 34.064 32.6442 33.924 32.9722 33.644C33.3082 33.364 33.5682 32.98 33.7522 32.492C33.9362 32.004 34.0282 31.44 34.0282 30.8C34.0282 30.16 33.9362 29.596 33.7522 29.108C33.5682 28.612 33.3082 28.224 32.9722 27.944C32.6442 27.664 32.2682 27.524 31.8442 27.524C31.4202 27.524 31.0442 27.664 30.7162 27.944C30.3882 28.224 30.1322 28.612 29.9482 29.108C29.7642 29.596 29.6722 30.16 29.6722 30.8C29.6722 31.44 29.7642 32.008 29.9482 32.504C30.1322 32.992 30.3882 33.376 30.7162 33.656C31.0442 33.928 31.4202 34.064 31.8442 34.064ZM35.8231 35L38.2831 31.556L39.9991 29H41.3431L39.0271 32.276L37.1911 35H35.8231ZM40.1311 35L38.3191 32.276L35.9791 29H37.3231L39.0511 31.556L41.4871 35H40.1311ZM47.9831 35.144C47.3991 35.144 46.8831 35.012 46.4351 34.748C45.9871 34.476 45.6351 34.104 45.3791 33.632C45.1231 33.16 44.9951 32.616 44.9951 32C44.9951 31.384 45.1231 30.84 45.3791 30.368C45.6351 29.896 45.9871 29.528 46.4351 29.264C46.8911 28.992 47.4111 28.856 47.9951 28.856C48.5471 28.856 49.0311 28.996 49.4471 29.276C49.8631 29.548 50.1871 29.94 50.4191 30.452C50.6591 30.956 50.7791 31.552 50.7791 32.24H45.9311L46.1471 32.06C46.1471 32.484 46.2311 32.852 46.3991 33.164C46.5671 33.476 46.7951 33.716 47.0831 33.884C47.3711 34.044 47.6991 34.124 48.0671 34.124C48.4671 34.124 48.7991 34.032 49.0631 33.848C49.3351 33.656 49.5471 33.416 49.6991 33.128L50.6831 33.584C50.5231 33.896 50.3151 34.172 50.0591 34.412C49.8031 34.644 49.4991 34.824 49.1471 34.952C48.8031 35.08 48.4151 35.144 47.9831 35.144ZM46.2191 31.52L45.9911 31.31H49.7831L49.5671 31.52C49.5671 31.168 49.4951 30.868 49.3511 30.62C49.2071 30.364 49.0151 30.172 48.7751 30.044C48.5351 29.908 48.2671 29.84 47.9711 29.84C47.6831 29.84 47.4031 29.908 47.1311 30.044C46.8671 30.172 46.6471 30.36 46.4711 30.608C46.3031 30.856 46.2191 31.16 46.2191 31.52ZM51.9053 35V29H52.9733L53.0453 30.104V35H51.9053ZM56.0573 35V31.928H57.1973V35H56.0573ZM56.0573 31.928C56.0573 31.384 55.9933 30.972 55.8653 30.692C55.7453 30.404 55.5733 30.204 55.3493 30.092C55.1333 29.98 54.8813 29.92 54.5933 29.912C54.1053 29.912 53.7253 30.084 53.4533 30.428C53.1813 30.772 53.0453 31.256 53.0453 31.88H52.5533C52.5533 31.248 52.6453 30.708 52.8293 30.26C53.0213 29.804 53.2893 29.456 53.6333 29.216C53.9853 28.976 54.4013 28.856 54.8813 28.856C55.3533 28.856 55.7613 28.952 56.1053 29.144C56.4573 29.336 56.7253 29.636 56.9093 30.044C57.1013 30.444 57.1973 30.972 57.1973 31.628V31.928H56.0573ZM61.1158 37.556C60.7158 37.556 60.3518 37.516 60.0238 37.436C59.6958 37.364 59.4198 37.28 59.1958 37.184C58.9718 37.088 58.8038 37.004 58.6918 36.932L59.1238 36.008C59.2278 36.072 59.3758 36.144 59.5678 36.224C59.7598 36.312 59.9838 36.384 60.2398 36.44C60.4958 36.504 60.7798 36.536 61.0918 36.536C61.4598 36.536 61.7878 36.46 62.0758 36.308C62.3638 36.164 62.5878 35.936 62.7478 35.624C62.9158 35.312 62.9998 34.912 62.9998 34.424V29H64.1398V34.4C64.1398 35.088 64.0078 35.664 63.7438 36.128C63.4878 36.6 63.1318 36.956 62.6758 37.196C62.2278 37.436 61.7078 37.556 61.1158 37.556ZM61.0078 34.916C60.4638 34.916 59.9878 34.792 59.5798 34.544C59.1798 34.288 58.8638 33.936 58.6318 33.488C58.4078 33.032 58.2958 32.508 58.2958 31.916C58.2958 31.3 58.4078 30.764 58.6318 30.308C58.8638 29.852 59.1798 29.496 59.5798 29.24C59.9878 28.984 60.4638 28.856 61.0078 28.856C61.5038 28.856 61.9358 28.984 62.3038 29.24C62.6798 29.496 62.9678 29.856 63.1678 30.32C63.3758 30.776 63.4798 31.312 63.4798 31.928C63.4798 32.52 63.3758 33.044 63.1678 33.5C62.9678 33.948 62.6798 34.296 62.3038 34.544C61.9358 34.792 61.5038 34.916 61.0078 34.916ZM61.2958 33.956C61.6318 33.956 61.9238 33.868 62.1718 33.692C62.4198 33.508 62.6158 33.264 62.7598 32.96C62.9038 32.648 62.9758 32.292 62.9758 31.892C62.9758 31.492 62.9038 31.14 62.7598 30.836C62.6158 30.532 62.4158 30.296 62.1598 30.128C61.9118 29.952 61.6198 29.864 61.2838 29.864C60.9318 29.864 60.6198 29.952 60.3478 30.128C60.0838 30.296 59.8758 30.532 59.7238 30.836C59.5718 31.14 59.4958 31.492 59.4958 31.892C59.4958 32.292 59.5718 32.648 59.7238 32.96C59.8838 33.264 60.0958 33.508 60.3598 33.692C60.6318 33.868 60.9438 33.956 61.2958 33.956ZM65.7937 35V29H66.9337V35H65.7937ZM66.3697 27.728C66.1857 27.728 66.0257 27.66 65.8897 27.524C65.7537 27.38 65.6857 27.216 65.6857 27.032C65.6857 26.84 65.7537 26.68 65.8897 26.552C66.0257 26.416 66.1857 26.348 66.3697 26.348C66.5617 26.348 66.7217 26.416 66.8497 26.552C66.9857 26.68 67.0537 26.84 67.0537 27.032C67.0537 27.216 66.9857 27.38 66.8497 27.524C66.7217 27.66 66.5617 27.728 66.3697 27.728ZM68.6045 35V29H69.6725L69.7445 30.104V35H68.6045ZM72.7565 35V31.928H73.8965V35H72.7565ZM72.7565 31.928C72.7565 31.384 72.6925 30.972 72.5645 30.692C72.4445 30.404 72.2725 30.204 72.0485 30.092C71.8325 29.98 71.5805 29.92 71.2925 29.912C70.8045 29.912 70.4245 30.084 70.1525 30.428C69.8805 30.772 69.7445 31.256 69.7445 31.88H69.2525C69.2525 31.248 69.3445 30.708 69.5285 30.26C69.7205 29.804 69.9885 29.456 70.3325 29.216C70.6845 28.976 71.1005 28.856 71.5805 28.856C72.0525 28.856 72.4605 28.952 72.8045 29.144C73.1565 29.336 73.4245 29.636 73.6085 30.044C73.8005 30.444 73.8965 30.972 73.8965 31.628V31.928H72.7565ZM77.9831 35.144C77.3991 35.144 76.8831 35.012 76.4351 34.748C75.9871 34.476 75.6351 34.104 75.3791 33.632C75.1231 33.16 74.9951 32.616 74.9951 32C74.9951 31.384 75.1231 30.84 75.3791 30.368C75.6351 29.896 75.9871 29.528 76.4351 29.264C76.8911 28.992 77.4111 28.856 77.9951 28.856C78.5471 28.856 79.0311 28.996 79.4471 29.276C79.8631 29.548 80.1871 29.94 80.4191 30.452C80.6591 30.956 80.7791 31.552 80.7791 32.24H75.9311L76.1471 32.06C76.1471 32.484 76.2311 32.852 76.3991 33.164C76.5671 33.476 76.7951 33.716 77.0831 33.884C77.3711 34.044 77.6991 34.124 78.0671 34.124C78.4671 34.124 78.7991 34.032 79.0631 33.848C79.3351 33.656 79.5471 33.416 79.6991 33.128L80.6831 33.584C80.5231 33.896 80.3151 34.172 80.0591 34.412C79.8031 34.644 79.4991 34.824 79.1471 34.952C78.8031 35.08 78.4151 35.144 77.9831 35.144ZM76.2191 31.52L75.9911 31.34H79.7831L79.5671 31.52C79.5671 31.168 79.4951 30.868 79.3511 30.62C79.2071 30.364 79.0151 30.172 78.7751 30.044C78.5351 29.908 78.2671 29.84 77.9711 29.84C77.6831 29.84 77.4031 29.908 77.1311 30.044C76.8671 30.172 76.6471 30.36 76.4711 30.608C76.3031 30.856 76.2191 31.16 76.2191 31.52ZM84.5573 35.144C83.9733 35.144 83.4573 35.012 83.0093 34.748C82.5613 34.476 82.2093 34.104 81.9533 33.632C81.6973 33.16 81.5693 32.616 81.5693 32C81.5693 31.384 81.6973 30.84 81.9533 30.368C82.2093 29.896 82.5613 29.528 83.0093 29.264C83.4653 28.992 83.9853 28.856 84.5693 28.856C85.1213 28.856 85.6053 28.996 86.0213 29.276C86.4373 29.548 86.7613 29.94 86.9933 30.452C87.2333 30.956 87.3533 31.552 87.3533 32.24H82.5053L82.7213 32.06C82.7213 32.484 82.8053 32.852 82.9733 33.164C83.1413 33.476 83.3693 33.716 83.6573 33.884C83.9453 34.044 84.2733 34.124 84.6413 34.124C85.0413 34.124 85.3733 34.032 85.6373 33.848C85.9093 33.656 86.1213 33.416 86.2733 33.128L87.2573 33.584C87.0973 33.896 86.8893 34.172 86.6333 34.412C86.3773 34.644 86.0733 34.824 85.7213 34.952C85.3773 35.08 84.9893 35.144 84.5573 35.144ZM82.7933 31.52L82.5653 31.34H86.3573L86.1413 31.52C86.1413 31.168 86.0693 30.868 85.9253 30.62C85.7813 30.364 85.5893 30.172 85.3493 30.044C85.1093 29.908 84.8413 29.84 84.5453 29.84C84.2573 29.84 83.9773 29.908 83.7053 30.044C83.4413 30.172 83.2213 30.36 83.0453 30.608C82.8773 30.856 82.7933 31.16 82.7933 31.52ZM89.1755 31.772C89.1755 31.124 89.2995 30.596 89.5475 30.188C89.7955 29.78 90.1155 29.476 90.5075 29.276C90.8995 29.076 91.3115 28.976 91.7435 28.976V30.056C91.3835 30.056 91.0395 30.112 90.7115 30.224C90.3915 30.328 90.1275 30.504 89.9195 30.752C89.7195 30.992 89.6195 31.32 89.6195 31.736L89.1755 31.772ZM88.4795 35V29H89.6195V35H88.4795Z"
|
|
81
|
-
fill="white"
|
|
82
|
-
/>
|
|
83
|
-
</g>
|
|
84
|
-
<defs>
|
|
85
|
-
<filter
|
|
86
|
-
id="filter0_d_72_88"
|
|
87
|
-
x="0.496948"
|
|
88
|
-
y="0.468506"
|
|
89
|
-
width="28.1208"
|
|
90
|
-
height="27.4128"
|
|
91
|
-
filterUnits="userSpaceOnUse"
|
|
92
|
-
colorInterpolationFilters="sRGB"
|
|
93
|
-
>
|
|
94
|
-
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
95
|
-
<feColorMatrix
|
|
96
|
-
in="SourceAlpha"
|
|
97
|
-
type="matrix"
|
|
98
|
-
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
99
|
-
result="hardAlpha"
|
|
100
|
-
/>
|
|
101
|
-
<feOffset dx="2" dy="2" />
|
|
102
|
-
<feGaussianBlur stdDeviation="2" />
|
|
103
|
-
<feComposite in2="hardAlpha" operator="out" />
|
|
104
|
-
<feColorMatrix
|
|
105
|
-
type="matrix"
|
|
106
|
-
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"
|
|
107
|
-
/>
|
|
108
|
-
<feBlend
|
|
109
|
-
mode="normal"
|
|
110
|
-
in2="BackgroundImageFix"
|
|
111
|
-
result="effect1_dropShadow_72_88"
|
|
112
|
-
/>
|
|
113
|
-
<feBlend
|
|
114
|
-
mode="normal"
|
|
115
|
-
in="SourceGraphic"
|
|
116
|
-
in2="effect1_dropShadow_72_88"
|
|
117
|
-
result="shape"
|
|
118
|
-
/>
|
|
119
|
-
</filter>
|
|
120
|
-
<filter
|
|
121
|
-
id="filter1_d_72_88"
|
|
122
|
-
x="15"
|
|
123
|
-
y="20"
|
|
124
|
-
width="85"
|
|
125
|
-
height="30"
|
|
126
|
-
filterUnits="userSpaceOnUse"
|
|
127
|
-
colorInterpolationFilters="sRGB"
|
|
128
|
-
>
|
|
129
|
-
<feFlood floodOpacity="0" result="BackgroundImageFix" />
|
|
130
|
-
<feColorMatrix
|
|
131
|
-
in="SourceAlpha"
|
|
132
|
-
type="matrix"
|
|
133
|
-
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
|
|
134
|
-
result="hardAlpha"
|
|
135
|
-
/>
|
|
136
|
-
<feOffset dy="4" />
|
|
137
|
-
<feGaussianBlur stdDeviation="2" />
|
|
138
|
-
<feComposite in2="hardAlpha" operator="out" />
|
|
139
|
-
<feColorMatrix
|
|
140
|
-
type="matrix"
|
|
141
|
-
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0"
|
|
142
|
-
/>
|
|
143
|
-
<feBlend
|
|
144
|
-
mode="normal"
|
|
145
|
-
in2="BackgroundImageFix"
|
|
146
|
-
result="effect1_dropShadow_72_88"
|
|
147
|
-
/>
|
|
148
|
-
<feBlend
|
|
149
|
-
mode="normal"
|
|
150
|
-
in="SourceGraphic"
|
|
151
|
-
in2="effect1_dropShadow_72_88"
|
|
152
|
-
result="shape"
|
|
153
|
-
/>
|
|
154
|
-
</filter>
|
|
155
|
-
</defs>
|
|
156
|
-
</svg>
|
|
157
|
-
</div>
|
|
158
|
-
);
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
export default Cursor;
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { motion } from "framer-motion";
|
|
2
|
-
import useWindowDimensions from "../../hooks/useWindowDimensions";
|
|
3
|
-
|
|
4
|
-
type FolderIconProps = {
|
|
5
|
-
className?: string;
|
|
6
|
-
gradientId?: string;
|
|
7
|
-
strokeColor?: string;
|
|
8
|
-
isOpen?: boolean;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const AnimatedFolderIcon = ({
|
|
12
|
-
className = "",
|
|
13
|
-
gradientId = "defaultGradient",
|
|
14
|
-
strokeColor = "rgba(119, 103, 128, 0.1)",
|
|
15
|
-
isOpen = false,
|
|
16
|
-
}: FolderIconProps) => {
|
|
17
|
-
const { width } = useWindowDimensions();
|
|
18
|
-
|
|
19
|
-
return (
|
|
20
|
-
<svg
|
|
21
|
-
viewBox="0 0 208 163"
|
|
22
|
-
className={className}
|
|
23
|
-
fill="none"
|
|
24
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
25
|
-
>
|
|
26
|
-
<g filter="url(#folderShadow)">
|
|
27
|
-
{/* Closed Folder */}
|
|
28
|
-
<motion.g
|
|
29
|
-
initial={false}
|
|
30
|
-
animate={{
|
|
31
|
-
opacity: !isOpen || width < 640 ? 1 : 0,
|
|
32
|
-
scale: isOpen ? 1 : 1,
|
|
33
|
-
y: isOpen ? 5 : 0,
|
|
34
|
-
x: isOpen ? 15 : 15,
|
|
35
|
-
}}
|
|
36
|
-
transition={{
|
|
37
|
-
duration: 0.2,
|
|
38
|
-
ease: "easeInOut",
|
|
39
|
-
}}
|
|
40
|
-
>
|
|
41
|
-
<path
|
|
42
|
-
d="M4.34444 14.3331C4.1561 8.68286 8.68546 4 14.3389 4L76.1646 4C80.3832 4 84.4311 5.66604 87.4274 8.63558L98.3226 19.4333C101.319 22.4028 105.367 24.0689 109.585 24.0689H173.601C179.277 24.0689 183.815 28.7881 183.593 34.4601L179.876 129.391C179.666 134.758 175.255 139 169.884 139H18.1722C12.7791 139 8.35744 134.723 8.17777 129.333L4.34444 14.3331Z"
|
|
43
|
-
fill={`url(#${gradientId})`}
|
|
44
|
-
stroke={strokeColor}
|
|
45
|
-
strokeWidth="0.75"
|
|
46
|
-
fillOpacity={width < 640 ? "1" : "0.8"}
|
|
47
|
-
/>
|
|
48
|
-
</motion.g>
|
|
49
|
-
|
|
50
|
-
{/* Open Folder */}
|
|
51
|
-
<motion.g
|
|
52
|
-
initial={false}
|
|
53
|
-
animate={{
|
|
54
|
-
opacity: isOpen ? 1 : 0,
|
|
55
|
-
scale: isOpen ? 1.15 : 1.15,
|
|
56
|
-
y: isOpen ? 20 : 20,
|
|
57
|
-
x: isOpen ? 23 : 23,
|
|
58
|
-
}}
|
|
59
|
-
transition={{
|
|
60
|
-
duration: 0.2,
|
|
61
|
-
ease: "easeInOut",
|
|
62
|
-
}}
|
|
63
|
-
>
|
|
64
|
-
<path
|
|
65
|
-
d="M3.72714 12.7562C3.28295 7.78306 7.20051 3.5 12.1934 3.5L67.2044 3.5C70.2086 3.5 73.1283 4.49474 75.5076 6.32893L89.3807 17.0235C91.76 18.8577 94.6797 19.8524 97.6839 19.8524H154.462C159.507 19.8524 163.442 24.2216 162.916 29.2393L154.874 105.887C154.42 110.214 150.772 113.5 146.421 113.5H20.5C16.0986 113.5 12.4253 110.14 12.0337 105.756L3.72714 12.7562Z"
|
|
66
|
-
fill={`url(#${gradientId})`}
|
|
67
|
-
stroke={strokeColor}
|
|
68
|
-
strokeOpacity="1"
|
|
69
|
-
strokeWidth="0.85"
|
|
70
|
-
fillOpacity="1"
|
|
71
|
-
/>
|
|
72
|
-
</motion.g>
|
|
73
|
-
</g>
|
|
74
|
-
<defs>
|
|
75
|
-
<linearGradient id="red" x1="0" y1="0" x2="0" y2="1">
|
|
76
|
-
<stop offset="0%" stopColor="rgba(226, 141, 159, 1)" />
|
|
77
|
-
<stop offset="100%" stopColor="rgba(244, 193, 204, 1)" />
|
|
78
|
-
</linearGradient>
|
|
79
|
-
<linearGradient id="blue" x1="0" y1="0" x2="0" y2="1">
|
|
80
|
-
<stop offset="0%" stopColor="rgba(90, 149, 208, 1)" />
|
|
81
|
-
<stop offset="100%" stopColor="rgba(158, 202, 246, 1)" />
|
|
82
|
-
</linearGradient>
|
|
83
|
-
<linearGradient id="green" x1="0" y1="0" x2="0" y2="1">
|
|
84
|
-
<stop offset="0%" stopColor="rgba(127, 202, 132, 1)" />
|
|
85
|
-
<stop offset="100%" stopColor="rgba(185, 227, 188, 1)" />
|
|
86
|
-
</linearGradient>
|
|
87
|
-
<linearGradient id="purple" x1="0" y1="0" x2="0" y2="1">
|
|
88
|
-
<stop offset="0%" stopColor="rgba(143, 87, 173, 1)" />
|
|
89
|
-
<stop offset="100%" stopColor="rgba(209, 154, 238, 1)" />
|
|
90
|
-
</linearGradient>
|
|
91
|
-
<linearGradient id="orange" x1="0" y1="0" x2="0" y2="1">
|
|
92
|
-
<stop offset="0%" stopColor="rgba(233, 148, 111, 1)" />
|
|
93
|
-
<stop offset="100%" stopColor="rgba(246, 185, 158, 1)" />
|
|
94
|
-
</linearGradient>
|
|
95
|
-
|
|
96
|
-
<filter
|
|
97
|
-
id="folderShadow"
|
|
98
|
-
x="-10"
|
|
99
|
-
y="-10"
|
|
100
|
-
width="208"
|
|
101
|
-
height="163"
|
|
102
|
-
filterUnits="userSpaceOnUse"
|
|
103
|
-
>
|
|
104
|
-
<feDropShadow
|
|
105
|
-
dx="0"
|
|
106
|
-
dy="0"
|
|
107
|
-
stdDeviation="3"
|
|
108
|
-
floodColor="rgba(119, 115, 149, 0.35)"
|
|
109
|
-
/>
|
|
110
|
-
</filter>
|
|
111
|
-
</defs>
|
|
112
|
-
</svg>
|
|
113
|
-
);
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
export default AnimatedFolderIcon;
|