@edu-tosel/design 1.0.171 → 1.0.173

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/layout/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export { default as Action } from "./template/Action";
2
2
  export { default as About } from "./template/About";
3
3
  export { default as Announcement } from "./template/Announcement";
4
4
  export { default as Archive } from "./template/Archive";
5
+ export { default as Books } from "./template/Books";
5
6
  export { default as Home } from "./template/home";
6
7
  export * from "./template/dashboard";
7
8
  export { default as Event } from "./template/Event";
@@ -18,6 +19,7 @@ export { default as TextBox } from "./template/TextBox";
18
19
  export { default as OlympiadLayout } from "./template/Olympiad/Olympiad.layout";
19
20
  export { default as Gomito } from "./template/Gomito";
20
21
  export { default as RegexamLayout } from "./template/Regexam/Regexam.layout";
22
+ export { default as BooksLayout } from "./template/Books/Books.layout";
21
23
  export { default as LegacyLayout } from "./template/Legacy/Legacy.layout";
22
24
  export { default as MonthlyProgressReport } from "./template/MonthlyProgressReport";
23
25
  export { default as Ticket } from "./template/Ticket";
package/layout/index.js CHANGED
@@ -2,6 +2,7 @@ export { default as Action } from "./template/Action";
2
2
  export { default as About } from "./template/About";
3
3
  export { default as Announcement } from "./template/Announcement";
4
4
  export { default as Archive } from "./template/Archive";
5
+ export { default as Books } from "./template/Books";
5
6
  export { default as Home } from "./template/home";
6
7
  export * from "./template/dashboard";
7
8
  export { default as Event } from "./template/Event";
@@ -18,6 +19,7 @@ export { default as TextBox } from "./template/TextBox";
18
19
  export { default as OlympiadLayout } from "./template/Olympiad/Olympiad.layout";
19
20
  export { default as Gomito } from "./template/Gomito";
20
21
  export { default as RegexamLayout } from "./template/Regexam/Regexam.layout";
22
+ export { default as BooksLayout } from "./template/Books/Books.layout";
21
23
  export { default as LegacyLayout } from "./template/Legacy/Legacy.layout";
22
24
  export { default as MonthlyProgressReport } from "./template/MonthlyProgressReport";
23
25
  export { default as Ticket } from "./template/Ticket";
@@ -0,0 +1 @@
1
+ export default function BooksLayout(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useRef } from "react";
3
+ import { cn } from "../../../util";
4
+ import { Books } from "../../../layout";
5
+ export default function BooksLayout() {
6
+ const ref = useRef(null);
7
+ const container = {
8
+ sizes: "min-h-screen w-full",
9
+ textoptions: "break-keep antialiased",
10
+ cursor: "cursor-default",
11
+ };
12
+ return (_jsx("div", { className: cn(container), children: _jsx(Books.SectionA, {}) }));
13
+ }
@@ -0,0 +1 @@
1
+ export default function SectionA(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,102 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from "react";
3
+ import gsap from "gsap";
4
+ import ScrollTrigger from "gsap/ScrollTrigger";
5
+ import { cn } from "../../../util";
6
+ gsap.registerPlugin(ScrollTrigger);
7
+ export default function SectionA() {
8
+ const stickyRef = useRef(null);
9
+ const bookRef = useRef(null); // bookWrapper를 위한 ref 추가
10
+ const mainTitleRef = useRef(null); // mainTitle을 위한 ref 추가
11
+ const subTitleRef = useRef(null);
12
+ useEffect(() => {
13
+ const ctx = gsap.context(() => {
14
+ const vh = window.innerHeight * 0.01;
15
+ const scrollWrapper = stickyRef.current;
16
+ const bookWrapper = bookRef.current; // bookWrapper 참조
17
+ const endpoint = `${50 * vh}px`;
18
+ if (scrollWrapper && bookWrapper) {
19
+ // 첫 번째 ScrollTrigger: stickyRef를 고정하고 mainTitle의 투명도를 조정 및 크기 조절
20
+ const scrollTrigger = ScrollTrigger.create({
21
+ trigger: scrollWrapper,
22
+ start: "top top",
23
+ end: `bottom ${endpoint}`,
24
+ pin: true,
25
+ markers: false,
26
+ onLeave: () => {
27
+ console.log("Scroll completed, navigate to the next component");
28
+ },
29
+ scrub: true, // 스크롤에 따라 애니메이션 동기화
30
+ });
31
+ // mainTitle의 투명도와 크기를 스크롤 위치에 따라 조절하는 애니메이션 추가
32
+ if (mainTitleRef.current) {
33
+ gsap.to(mainTitleRef.current, {
34
+ opacity: 0,
35
+ scale: 0.7, // 크기를 70%로 줄임
36
+ scrollTrigger: {
37
+ trigger: scrollWrapper,
38
+ start: `top-=10 top`,
39
+ end: `bottom ${endpoint}`,
40
+ markers: true,
41
+ scrub: true, // 스크롤에 따라 애니메이션 동기화
42
+ },
43
+ });
44
+ }
45
+ if (subTitleRef.current) {
46
+ gsap.to(subTitleRef.current, {
47
+ opacity: 0,
48
+ scrollTrigger: {
49
+ trigger: scrollWrapper,
50
+ start: `top top`,
51
+ end: `bottom ${endpoint}`,
52
+ markers: true,
53
+ scrub: true, // 스크롤에 따라 애니메이션 동기화
54
+ },
55
+ });
56
+ }
57
+ // 두 번째 ScrollTrigger: bookWrapper가 뷰포트 상단에 도달하면 sticky하게 붙기
58
+ const bookTrigger = ScrollTrigger.create({
59
+ trigger: bookWrapper,
60
+ start: "top top", // bookWrapper의 top이 뷰포트의 top에 도달했을 때
61
+ pin: true,
62
+ pinSpacing: false, // 추가된 pinSpacing을 false로 설정하여 고정된 상태에서 공간을 차지하지 않음
63
+ markers: false,
64
+ onEnter: () => {
65
+ console.log("bookWrapper is pinned!");
66
+ },
67
+ onLeaveBack: () => {
68
+ console.log("bookWrapper is unpinned!");
69
+ },
70
+ });
71
+ return () => {
72
+ scrollTrigger.kill();
73
+ bookTrigger.kill();
74
+ };
75
+ }
76
+ });
77
+ return () => ctx.revert();
78
+ }, []); // 빈 배열로 dependency 설정
79
+ const container = {
80
+ sizes: "w-full h-fit",
81
+ displays: "flex flex-col justify-start items-center",
82
+ textstyles: "antialiased",
83
+ backgrounds: "bg-white bg-cover bg-center",
84
+ };
85
+ const TitleWrapper = {
86
+ spacings: "pt-[30vh] z-0",
87
+ sizes: "w-full h-[100vh]",
88
+ display: "flex flex-col justify-start items-center",
89
+ test: "border-2 border-red-500",
90
+ };
91
+ const miniTitle = {
92
+ textstyles: "text-center font-medium text-lg text-green-dark",
93
+ };
94
+ const mainTitle = {
95
+ textstyles: "text-center font-bold text-9xl text-black",
96
+ };
97
+ const bookWrapper = {
98
+ displays: "flex flex-col justify-center items-center -translate-y-[40vh]",
99
+ sizes: "p-10 w-full h-screen",
100
+ };
101
+ return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: cn(TitleWrapper), ref: stickyRef, children: [_jsx("div", { className: cn(miniTitle), ref: subTitleRef, children: "\uBBFF\uC744 \uC218 \uC788\uB294 \uC601\uC5B4\uAD50\uC7AC" }), _jsx("div", { className: cn(mainTitle), ref: mainTitleRef, children: "TOSEL Books" }), " "] }), _jsx("div", { className: cn(bookWrapper), ref: bookRef, children: _jsx("div", { className: "w-100 h-140 bg-red-500 mt-[calc(10vh)] z-10 rounded-2xl shadow-main " }) })] }));
102
+ }
@@ -0,0 +1,5 @@
1
+ import SectionA from "./SectionA";
2
+ declare const Books: {
3
+ SectionA: typeof SectionA;
4
+ };
5
+ export default Books;
@@ -0,0 +1,5 @@
1
+ import SectionA from "./SectionA";
2
+ const Books = {
3
+ SectionA,
4
+ };
5
+ export default Books;
@@ -84,7 +84,7 @@ export default function Banner() {
84
84
  backgrounds: "bg-white group hover:bg-green-dark",
85
85
  other: "animate-bounce bg-white p-1 w-10 h-10 ring-1 ring-slate-900/5 shadow-lg rounded-full flex items-center justify-center",
86
86
  };
87
- return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex flex-col md:flex-row w-full max-w-6xl justify-between items-center", children: [_jsxs("div", { className: "flex flex-col w-full md:w-fit h-full shrink-0 justify-start", children: [_jsx("div", { className: cn(brandTextSub), children: "about" }), _jsx("div", { className: cn(brandTextCore), children: _jsx("img", { src: "/images/logos/logo-tosel-main.svg", alt: "", className: "h-full" }) }), _jsxs("div", { className: cn(explainer), children: ["15,000\uC5EC\uAC1C\uC758 \uD559\uAD50\uC640 \uD559\uC6D0\uC774 \uC120\uD0DD\uD55C ", _jsx("br", {}), "\uB300\uD55C\uBBFC\uAD6D \uB300\uD45C \uC601\uC5B4 \uC778\uC99D\uC2DC\uD5D8"] }), _jsxs("div", { onClick: () => window.location.href = `https://olympiad.tosel.co.kr/dashboard`, className: cn(AdvertButton), children: [_jsx("div", { className: cn(buttonBackground1) }), _jsx("div", { className: cn(buttonBackground2) }), _jsx("div", { className: cn(buttonText), children: "\uC9C0\uAE08 \uC811\uC218\uD558\uAE30" })] })] }), _jsx("div", { className: cn(carouselWrapper), children: _jsx(InfiniteCarousel, {}) })] }), _jsxs("div", { className: cn(scrollGuideWrapper), children: [_jsx("div", { className: cn(scrollGuideText), children: "\uC790\uC138\uD55C \uB0B4\uC6A9\uC744 \uBCF4\uB824\uBA74 \uC544\uB798\uB85C \uC2A4\uD06C\uB864 \uD574\uBCF4\uC138\uC694" }), _jsx("div", { className: cn(scrollGuideButton), onClick: handleScroll, children: _jsx("svg", { className: "w-6 h-6 text-green-dark group-hover:text-white", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { d: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }) })] })] }));
87
+ return (_jsxs("div", { className: cn(container), children: [_jsxs("div", { className: "flex flex-col md:flex-row w-full max-w-6xl justify-between items-center", children: [_jsxs("div", { className: "flex flex-col w-full md:w-fit h-full shrink-0 justify-start", children: [_jsx("div", { className: cn(brandTextSub), children: "about" }), _jsx("div", { className: cn(brandTextCore), children: _jsx("img", { src: "/images/logos/logo-tosel-main.svg", alt: "", className: "h-full" }) }), _jsxs("div", { className: cn(explainer), children: ["15,000\uC5EC\uAC1C\uC758 \uD559\uAD50\uC640 \uD559\uC6D0\uC774 \uC120\uD0DD\uD55C ", _jsx("br", {}), "\uB300\uD55C\uBBFC\uAD6D \uB300\uD45C \uC601\uC5B4 \uC778\uC99D\uC2DC\uD5D8"] }), _jsxs("div", { onClick: () => (window.location.href = `https://new.tosel.org/dashboard`), className: cn(AdvertButton), children: [_jsx("div", { className: cn(buttonBackground1) }), _jsx("div", { className: cn(buttonBackground2) }), _jsx("div", { className: cn(buttonText), children: "\uC9C0\uAE08 \uC811\uC218\uD558\uAE30" })] })] }), _jsx("div", { className: cn(carouselWrapper), children: _jsx(InfiniteCarousel, {}) })] }), _jsxs("div", { className: cn(scrollGuideWrapper), children: [_jsx("div", { className: cn(scrollGuideText), children: "\uC790\uC138\uD55C \uB0B4\uC6A9\uC744 \uBCF4\uB824\uBA74 \uC544\uB798\uB85C \uC2A4\uD06C\uB864 \uD574\uBCF4\uC138\uC694" }), _jsx("div", { className: cn(scrollGuideButton), onClick: handleScroll, children: _jsx("svg", { className: "w-6 h-6 text-green-dark group-hover:text-white", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round", "stroke-width": "2", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { d: "M19 14l-7 7m0 0l-7-7m7 7V3" }) }) })] })] }));
88
88
  }
89
89
  const InfiniteCarousel = () => {
90
90
  const slides = [
@@ -35,7 +35,7 @@ export default function OfflineExam() {
35
35
  const container = {
36
36
  displays: "flex flex-col justify-center items-center",
37
37
  sizes: "w-full h-fit min-h-screen",
38
- spacings: "pt-20 md:px-10 px-5 pb-20",
38
+ spacings: "pt-44 md:px-10 px-5 pb-20",
39
39
  backgrounds: "bg-gray-light/50",
40
40
  };
41
41
  //controlls max-w
@@ -1,6 +1,6 @@
1
1
  import { Button, OnClick } from "../../../../interface";
2
2
  import { ReactNode } from "react";
3
- export default function Layout({ contents, children, logo, rightButton, }: {
3
+ export default function Layout({ contents, children, logo, rightButton, option, }: {
4
4
  contents: Button[];
5
5
  children: React.ReactNode;
6
6
  logo: {
@@ -8,4 +8,7 @@ export default function Layout({ contents, children, logo, rightButton, }: {
8
8
  onClick?: OnClick;
9
9
  };
10
10
  rightButton?: Button;
11
+ option?: {
12
+ isPulled?: boolean;
13
+ };
11
14
  }): import("react/jsx-runtime").JSX.Element;
@@ -3,12 +3,13 @@ import { cn } from "../../../../util";
3
3
  import Footer from "./Footer";
4
4
  import Header from "./Header";
5
5
  import { useActionStore } from "../../../../store";
6
- export default function Layout({ contents, children, logo, rightButton, }) {
6
+ export default function Layout({ contents, children, logo, rightButton, option, }) {
7
+ const { isPulled } = option ?? {};
7
8
  const container = {
8
9
  displays: "flex flex-col",
9
10
  sizes: "w-full min-h-screen",
10
11
  overflows: "overflow-x-hidden ",
11
12
  };
12
13
  const { setFlag } = useActionStore();
13
- return (_jsxs("div", { className: cn(container), onClick: setFlag, children: [_jsx(Header, { logo: logo, rightButton: rightButton, contents: contents }), _jsx("div", { className: "w-full max-w-[1200px] h-15" }), children, _jsx(Footer, {})] }));
14
+ return (_jsxs("div", { className: cn(container), onClick: setFlag, children: [_jsx(Header, { logo: logo, rightButton: rightButton, contents: contents }), isPulled && _jsx("div", { className: "w-full max-w-[1200px] h-15" }), children, _jsx(Footer, {})] }));
14
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edu-tosel/design",
3
- "version": "1.0.171",
3
+ "version": "1.0.173",
4
4
  "description": "UI components for International TOSEL Committee",
5
5
  "keywords": [
6
6
  "jsx",
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.171
1
+ 1.0.173