@edu-tosel/design 1.0.118 → 1.0.119
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/interface/Property.d.ts +1 -1
- package/layout/index.d.ts +1 -0
- package/layout/index.js +1 -0
- package/layout/template/Olympiad/Banner.d.ts +1 -0
- package/layout/template/Olympiad/Banner.js +31 -0
- package/layout/template/Olympiad/Features.d.ts +1 -0
- package/layout/template/Olympiad/Features.js +19 -0
- package/layout/template/Olympiad/index.d.ts +7 -0
- package/layout/template/Olympiad/index.js +7 -0
- package/layout/template/home/layout/Carousel.js +48 -14
- package/modal/template/Confirm/Reimage.d.ts +2 -2
- package/package.json +3 -1
- package/version.txt +1 -1
package/interface/Property.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ export type Click<REQ = unknown, RES = any> = (prop?: REQ) => RES;
|
|
|
45
45
|
export type OnClick<Request = unknown, Response = unknown> = (prop?: Request) => Response | ((prop?: Request) => Promise<Response>);
|
|
46
46
|
export interface Button extends LabelWidget {
|
|
47
47
|
}
|
|
48
|
-
export type FileRead = string | ArrayBuffer | null;
|
|
48
|
+
export type FileRead = File | string | ArrayBuffer | null;
|
|
49
49
|
export type Disabled = boolean | OnClick;
|
|
50
50
|
export type Scripts = {
|
|
51
51
|
script?: string;
|
package/layout/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export { default as Announcement } from "./template/Announcement";
|
|
|
4
4
|
export { default as Home } from "./template/home";
|
|
5
5
|
export * from "./template/dashboard";
|
|
6
6
|
export { default as Promotion } from "./template/Promotion";
|
|
7
|
+
export { default as Olympiad } from "./template/Olympiad";
|
|
7
8
|
export { default as Sign } from "./template/Sign";
|
|
8
9
|
export { default as DataField } from "./template/DataField";
|
|
9
10
|
export { default as Gallery } from "./template/Gallery";
|
package/layout/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export { default as Announcement } from "./template/Announcement";
|
|
|
4
4
|
export { default as Home } from "./template/home";
|
|
5
5
|
export * from "./template/dashboard";
|
|
6
6
|
export { default as Promotion } from "./template/Promotion";
|
|
7
|
+
export { default as Olympiad } from "./template/Olympiad";
|
|
7
8
|
export { default as Sign } from "./template/Sign";
|
|
8
9
|
export { default as DataField } from "./template/DataField";
|
|
9
10
|
export { default as Gallery } from "./template/Gallery";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Banner(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../util";
|
|
3
|
+
export default function Banner() {
|
|
4
|
+
const container = {
|
|
5
|
+
sizes: "w-full h-screen",
|
|
6
|
+
displays: "flex justify-center items-center",
|
|
7
|
+
spacings: "px-5",
|
|
8
|
+
textstyles: "antialiased",
|
|
9
|
+
backgrounds: "bg-[url('images/olympiad/img-oly-bg-a.png')] bg-cover bg-center",
|
|
10
|
+
};
|
|
11
|
+
const explainer = {
|
|
12
|
+
textstyles: "text-xl md:text-2xl font-pretendard-medium text-gray-light mix-blend-difference sm:text-green-dark sm:mix-blend-normal",
|
|
13
|
+
};
|
|
14
|
+
const brandTextCore = {
|
|
15
|
+
textstyles: "text-7xl md:text-8xl font-pretendard-bold text-green-dark leading-none mt-6 mix-blend-plus-darker",
|
|
16
|
+
animations: "duration-300",
|
|
17
|
+
};
|
|
18
|
+
const brandTextSub = {
|
|
19
|
+
textstyles: "text-2xl md:text-3xl font-pretendard-bold text-green-dark",
|
|
20
|
+
animations: "duration-300",
|
|
21
|
+
};
|
|
22
|
+
const AdvertButton = {
|
|
23
|
+
sizes: "h-fit w-full xxxs:w-fit rounded-lg",
|
|
24
|
+
backgrounds: "bg-green-light",
|
|
25
|
+
textstyles: "text-lg text-green-dark font-pretendard-medium text-center",
|
|
26
|
+
spacings: "px-3 py-2 mt-30 xxxs:mt-16",
|
|
27
|
+
hoveractions: "hover:bg-green-dark hover:text-white",
|
|
28
|
+
animations: "duration-300",
|
|
29
|
+
};
|
|
30
|
+
return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: "flex flex-col w-full justify-start max-w-6xl", children: [_jsxs("div", { className: cn(explainer), children: ["\uD559\uC0DD\uC774\uB77C\uBA74, ", _jsx("br", {}), "\uC804\uAD6D \uC5B4\uB514\uC5D0\uC11C\uB098 \uCC38\uC5EC \uAC00\uB2A5\uD55C"] }), _jsx("div", { className: cn(brandTextCore), children: "VOCA" }), _jsx("div", { className: cn(brandTextSub), children: "\uC62C\uB9BC\uD53C\uC544\uB4DC" }), _jsx("a", { href: "https://olympiad.tosel.co.kr/", className: cn(AdvertButton), children: "\uC9C0\uAE08 \uC811\uC218\uD558\uAE30" })] }) }));
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function Features(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../util";
|
|
3
|
+
export default function Features() {
|
|
4
|
+
const container = {
|
|
5
|
+
sizes: "w-full h-fit p-5",
|
|
6
|
+
backgroudns: "bg-green-light",
|
|
7
|
+
};
|
|
8
|
+
const boxWrapper = {
|
|
9
|
+
sizes: "w-full h-fit",
|
|
10
|
+
displays: "flex flex-col gap-4",
|
|
11
|
+
};
|
|
12
|
+
// styling of feature box components
|
|
13
|
+
const featureBox = {
|
|
14
|
+
sizes: "w-full h-80 rounded-lg",
|
|
15
|
+
backgrunds: "bg-green-dark",
|
|
16
|
+
};
|
|
17
|
+
const boxTitle = {};
|
|
18
|
+
return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(boxWrapper), children: [_jsx("div", { className: cn(featureBox) }), _jsx("div", { className: cn(featureBox) }), _jsx("div", { className: cn(featureBox) })] }) }));
|
|
19
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from "react";
|
|
2
|
+
import { useEffect, useState, useRef, useCallback } from "react"; // React 추가
|
|
3
|
+
import { useSpring, animated, easings } from "@react-spring/web";
|
|
3
4
|
import { cn } from "../../../../util";
|
|
4
5
|
import { useEase } from "../../../../hook";
|
|
5
6
|
import { LineBreaks } from "../../../../text";
|
|
@@ -9,18 +10,57 @@ import useResponsive from "../../../../hook/useMobile";
|
|
|
9
10
|
export default function Carousel({ contents, }) {
|
|
10
11
|
const [index, setIndex] = useState(0);
|
|
11
12
|
const [flag, inTime] = useEase(10000, 1000);
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
// }, [flag]);
|
|
13
|
+
const [loaded, setLoaded] = useState(false);
|
|
14
|
+
const isMD = useResponsive("md");
|
|
15
|
+
const isXL = useResponsive("xl");
|
|
16
|
+
const intervalRef = useRef(null);
|
|
17
17
|
const { tag, titles, image, option } = contents[index];
|
|
18
18
|
const { text, background } = option ?? {};
|
|
19
|
+
// Transition animation using react-spring
|
|
20
|
+
const transitionStyles = useSpring({
|
|
21
|
+
opacity: loaded ? 1 : 0,
|
|
22
|
+
transform: loaded ? "translateX(0px)" : "translateX(400px)",
|
|
23
|
+
config: {
|
|
24
|
+
duration: 500,
|
|
25
|
+
easing: easings.easeOutQuad,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const resetTimer = useCallback(() => {
|
|
29
|
+
// resetting the timer
|
|
30
|
+
if (intervalRef.current) {
|
|
31
|
+
clearInterval(intervalRef.current);
|
|
32
|
+
}
|
|
33
|
+
intervalRef.current = setInterval(() => {
|
|
34
|
+
setIndex((prevIndex) => (prevIndex + 1) % contents.length);
|
|
35
|
+
setLoaded(false); // trigger animation
|
|
36
|
+
}, 3000);
|
|
37
|
+
}, [contents.length]);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
resetTimer(); // timerstarts after mounting component
|
|
40
|
+
return () => {
|
|
41
|
+
// clear timer after unmounting component
|
|
42
|
+
if (intervalRef.current) {
|
|
43
|
+
clearInterval(intervalRef.current);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}, [resetTimer]);
|
|
47
|
+
const handleNext = () => {
|
|
48
|
+
setLoaded(false); // trigger animation
|
|
49
|
+
setIndex((prevIndex) => (prevIndex + 1) % contents.length);
|
|
50
|
+
resetTimer(); // reset timer after clicking button
|
|
51
|
+
};
|
|
52
|
+
const handlePrev = () => {
|
|
53
|
+
setLoaded(false);
|
|
54
|
+
setIndex((prevIndex) => (prevIndex - 1 + contents.length) % contents.length);
|
|
55
|
+
resetTimer();
|
|
56
|
+
};
|
|
57
|
+
// Styles definition
|
|
19
58
|
const container = {
|
|
20
59
|
displays: "relative flex justify-center items-center",
|
|
21
60
|
sizes: "w-full h-fit md:h-80 ml:h-100",
|
|
22
61
|
textstyle: "break-keep",
|
|
23
62
|
background,
|
|
63
|
+
animations: "duration-300",
|
|
24
64
|
};
|
|
25
65
|
const titleSet = {
|
|
26
66
|
displays: "flex items-center lex gap-4 flex-row xxs:gap-4 xxs:items-start xxs:flex-col md:gap-2",
|
|
@@ -30,6 +70,7 @@ export default function Carousel({ contents, }) {
|
|
|
30
70
|
displays: "flex flex-none flex-col items-center justify-center md:flex-row",
|
|
31
71
|
sizes: "w-full max-w-256 h-full",
|
|
32
72
|
text: text ?? "text-gray-dark",
|
|
73
|
+
animations: "duration-500",
|
|
33
74
|
};
|
|
34
75
|
const tagBox = {
|
|
35
76
|
displays: "flex justify-center items-center",
|
|
@@ -38,13 +79,6 @@ export default function Carousel({ contents, }) {
|
|
|
38
79
|
fonts: "text-white font-pretendard-medium text-sm md:text-base leading-none",
|
|
39
80
|
styles: "rounded-md",
|
|
40
81
|
};
|
|
41
|
-
const isMD = useResponsive("md");
|
|
42
|
-
const isXL = useResponsive("xl");
|
|
43
|
-
const test = {
|
|
44
|
-
postions: "absolute left-0 top-0 border-2 border-red-500",
|
|
45
|
-
sizes: "w-full",
|
|
46
|
-
displays: "flex justify-center",
|
|
47
|
-
};
|
|
48
82
|
const buttonBox = {
|
|
49
83
|
positions: !isMD && "absolute bottom-5 left-5 sm:bottom-10 sm:left-10",
|
|
50
84
|
animations: "duration-500",
|
|
@@ -52,5 +86,5 @@ export default function Carousel({ contents, }) {
|
|
|
52
86
|
sizes: "w-23.25 h-6.25 bg-gray-dark rounded-full",
|
|
53
87
|
paddings: "px-1.5 mt-12",
|
|
54
88
|
};
|
|
55
|
-
return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), children: [_jsxs("div", { className: "w-fit h-fit flex flex-col mt-4 xxs:mt-8 xxs:flex-row xxs:gap-8 md:flex-col md:flex-none md:w-72 md:pl-7.5 md:gap-6 md:mt-0", children: [_jsxs("div", { className: cn(titleSet), children: [_jsx("div", { className: cn(tagBox), children: tagString[tag.type] }), _jsx("div", { className: "font-pretendard-bold text-xl md:text-2xl", children: titles.title })] }), _jsx(LineBreaks, { className: "w-fit flex flex-col justify-center text-sm my-2 xxs:mt-0 md:text-base", texts: titles.subtitle }), _jsxs("div", { className: cn(buttonBox), children: [_jsx("button", { onClick:
|
|
89
|
+
return (_jsx("div", { className: cn(container), children: _jsxs("div", { className: cn(body), children: [_jsxs("div", { className: "duration-500 w-fit h-fit flex flex-col mt-4 xxs:mt-8 xxs:flex-row xxs:gap-8 md:flex-col md:flex-none md:w-72 md:pl-7.5 md:gap-6 md:mt-0", children: [_jsxs("div", { className: cn(titleSet), children: [_jsx("div", { className: cn(tagBox), children: tagString[tag.type] }), _jsx("div", { className: "font-pretendard-bold text-xl md:text-2xl", children: titles.title })] }), _jsx(LineBreaks, { className: "w-fit flex flex-col justify-center text-sm my-2 xxs:mt-0 md:text-base", texts: titles.subtitle }), _jsxs("div", { className: cn(buttonBox), children: [_jsx("button", { onClick: handlePrev, className: "w-5 h-5 flex justify-center items-center", children: _jsx(SVG.Symbol.LessThan, {}) }), _jsxs("div", { className: "flex flex-row gap-2 justify-center items-center", children: [_jsx("div", { className: "text-white w-2 text-sm", children: index + 1 }), _jsx("div", { className: "w-0.5 h-3 bg-gray-medium" }), _jsx("div", { className: "text-white w-2 text-sm", children: contents.length })] }), _jsx("button", { onClick: handleNext, className: "w-5 h-5 flex justify-center items-center", children: _jsx(SVG.Symbol.GreaterThan, {}) })] })] }), _jsx("div", { className: "h-full overflow-hidden w-fit", children: image && (_jsx(animated.img, { src: image, alt: "carousel-image", onLoad: () => setLoaded(true), className: "object-cover h-full", style: transitionStyles })) })] }) }));
|
|
56
90
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ConfirmModalProps } from "../../../interface/Modal";
|
|
2
|
-
import { State } from "../../../interface";
|
|
2
|
+
import { FileRead, State } from "../../../interface";
|
|
3
3
|
interface ReimageProps extends Omit<ConfirmModalProps, "children"> {
|
|
4
4
|
data: {
|
|
5
|
-
image: State<
|
|
5
|
+
image: State<FileRead>;
|
|
6
6
|
nowImage: string;
|
|
7
7
|
};
|
|
8
8
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edu-tosel/design",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.119",
|
|
4
4
|
"description": "UI components for International TOSEL Committee",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"jsx",
|
|
@@ -14,9 +14,11 @@
|
|
|
14
14
|
"type": "module",
|
|
15
15
|
"scripts": {},
|
|
16
16
|
"dependencies": {
|
|
17
|
+
"@gsap/react": "^2.1.1",
|
|
17
18
|
"date-fns": "^2.30.0",
|
|
18
19
|
"date-fns-tz": "^2.0.1",
|
|
19
20
|
"dayjs": "^1.11.12",
|
|
21
|
+
"gsap": "^3.12.5",
|
|
20
22
|
"react": "^18.2.0",
|
|
21
23
|
"react-beautiful-dnd": "^13.1.1",
|
|
22
24
|
"react-datepicker": "^6.4.0",
|
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.119
|