Skip to content

Commit

Permalink
Merge branch 'dev' of https://github.com/boostcampwm-2024/web33-Nocta โ€ฆ
Browse files Browse the repository at this point in the history
โ€ฆinto Feature/#131_๋ธ”๋ก_๋“œ๋ž˜๊ทธ์•ค๋“œ๋ž_๊ตฌํ˜„
  • Loading branch information
pipisebastian committed Nov 18, 2024
2 parents 484140c + a3131b7 commit 4ec0edd
Show file tree
Hide file tree
Showing 47 changed files with 1,259 additions and 81 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
# Run Unit tests
- name: Run Unit Tests
run: pnpm test
env:
JWT_SECRET: ${{ secrets.JWT_SECRET }}

test_building_docker_image:
name: Test Building Docker Image
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/lint_and_unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,5 @@ jobs:
# Run Unit tests
- name: Run Unit Tests
run: pnpm test
env:
JWT_SECRET: ${{ secrets.JWT_SECRET }}
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
![Group 38 (1)](https://github.com/user-attachments/assets/a882c5c5-b205-43cc-9a16-2f5e87dbd6aa)


![image](https://github.com/user-attachments/assets/ce48d2e5-ca40-43e6-8d64-0f874312f065)


<div align="center">
<a href="http://223.130.159.220/">๋ฐฐํฌ์‚ฌ์ดํŠธ</a>
<br>
Expand All @@ -10,13 +11,20 @@

</div>

<p align="center">
<a href="http://223.130.159.220" title="๐ŸŒŒ ๋ฐคํ•˜๋Š˜์˜ ๋ณ„๋น›์ฒ˜๋Ÿผ, ์ž์œ ๋กœ์šด ์ธํ„ฐ๋ž™์…˜ ์‹ค์‹œ๊ฐ„ ์—๋””ํ„ฐ"><strong>๋ฐฐํฌ ์‚ฌ์ดํŠธ</strong></a>
</p>


## `Nocta`

> ๐ŸŒŒ ๋ฐคํ•˜๋Š˜์˜ ๋ณ„๋น›์ฒ˜๋Ÿผ, ์ž์œ ๋กœ์šด ์ธํ„ฐ๋ž™์…˜ ์‹ค์‹œ๊ฐ„ ์—๋””ํ„ฐ
- ์‹ค์‹œ๊ฐ„ ๊ธฐ๋ก ํ˜‘์—… ์†Œํ”„ํŠธ์›จ์–ด์ž…๋‹ˆ๋‹ค.

## `Team Glassmo`

## `Team Glassmo`


- ๊ธ€๋ž˜์Šค๋ชจํ”ผ์ฆ˜์˜ ์•ฝ์ž

Expand All @@ -34,6 +42,8 @@


## ํ”„๋กœ์ ํŠธ ๊ธฐ๋Šฅ ์†Œ๊ฐœ


### 1. ํŽ˜์ด์ง€ ์ƒ์„ฑ, ๋“œ๋ž˜๊ทธ ์•ค ๋“œ๋ž

์‚ฌ์ด๋“œ๋ฐ”์˜ ํŽ˜์ด์ง€ ์ถ”๊ฐ€ ๋ฒ„ํŠผ์„ ํ†ตํ•ด ํŽ˜์ด์ง€๋ฅผ ์ƒ์„ฑํ•˜๊ณ  ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
Expand Down
1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"react": "^18.3.1",
"react-dom": "^18.3.1",
"socket.io-client": "^4.8.1",
"vite-plugin-svgr": "^4.3.0",
"zustand": "^5.0.1"
},
"devDependencies": {
Expand Down
3 changes: 3 additions & 0 deletions client/src/assets/icons/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions client/src/assets/icons/expand.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions client/src/assets/icons/minus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified client/src/assets/images/background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 5 additions & 3 deletions client/src/components/bottomNavigator/BottomNavigator.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Page } from "@src/types/page";
import { motion } from "framer-motion";
import { IconButton } from "@components/button/IconButton";
import { Page } from "@src/types/page";
import { animation } from "./BottomNavigator.animation";
import { bottomNavigatorContainer } from "./BottomNavigator.style";

interface BottomNavigatorProps {
pages: Page[];
handlePageSelect: (pageId: number) => void;
handlePageSelect: ({ pageId, isSidebar }: { pageId: number; isSidebar?: boolean }) => void;
}

export const BottomNavigator = ({ pages, handlePageSelect }: BottomNavigatorProps) => {
Expand All @@ -25,7 +25,9 @@ export const BottomNavigator = ({ pages, handlePageSelect }: BottomNavigatorProp
icon={page.icon}
size="md"
onClick={() => {
handlePageSelect(page.id);
handlePageSelect({
pageId: page.id,
});
}}
/>
</motion.div>
Expand Down
18 changes: 3 additions & 15 deletions client/src/components/modal/modal.animation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,7 @@ export const overlayAnimation = {
};

export const modalContainerAnimation = {
initial: {
scale: 0.7,
opacity: 0,
top: "50%",
left: "50%",
transform: "translate(-50%, -50%)",
},
animate: {
scale: 1,
opacity: 1,
},
exit: {
scale: 0.7,
opacity: 0,
},
initial: { opacity: 0, y: 50, scale: 0.3 },
animate: { opacity: 1, y: 0, scale: 1 },
exit: { opacity: 0, scale: 0.5, transition: { duration: 0.2 } },
};
2 changes: 0 additions & 2 deletions client/src/components/modal/modal.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ export const modalContainer = cx(
display: "flex",
zIndex: 10001,
position: "absolute",
top: "50%",
left: "50%",
transform: "translate(-50%, -50%)",
flexDirection: "column",
width: "400px",
Expand Down
1 change: 1 addition & 0 deletions client/src/components/sidebar/MenuButton.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const imageBox = css({
borderRadius: "sm",
width: "50px",
height: "50px",
background: "white",
overflow: "hidden",
});

Expand Down
4 changes: 1 addition & 3 deletions client/src/components/sidebar/MenuButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { menuItemWrapper, imageBox, textBox } from "./MenuButton.style";
export const MenuButton = () => {
return (
<div className={menuItemWrapper}>
<div className={imageBox}>
<img src="https://via.placeholder.com/50" />
</div>
<div className={imageBox}></div>
<p className={textBox}>Noctturn</p>
</div>
);
Expand Down
5 changes: 5 additions & 0 deletions client/src/components/sidebar/PageItem.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const pageItemContainer = css({
gap: "sm",
alignItems: "center",
width: "100%",
height: "56px",
paddingInline: "md",
"&:hover": {
background: "white/50",
Expand All @@ -14,6 +15,7 @@ export const pageItemContainer = css({

export const iconBox = css({
display: "flex",
flexShrink: 0,
justifyContent: "center",
alignItems: "center",
borderRadius: "xs",
Expand All @@ -26,4 +28,7 @@ export const iconBox = css({
export const textBox = css({
textStyle: "display-medium20",
color: "gray.700",
textOverflow: "ellipsis",
overflow: "hidden",
whiteSpace: "nowrap",
});
3 changes: 3 additions & 0 deletions client/src/components/sidebar/Sidebar.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@ export const navWrapper = css({
gap: "md",
flexDirection: "column",
width: "100%",
overflowX: "hidden",
overflowY: "scroll",
});

export const plusIconBox = css({
display: "flex",
justifyContent: "start",
marginBlock: "10px",
paddingInline: "md",
});

Expand Down
49 changes: 40 additions & 9 deletions client/src/components/sidebar/Sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { useIsSidebarOpen, useSidebarActions } from "@src/stores/useSidebarStore";
import { Page } from "@src/types/page";
import { motion } from "framer-motion";
import { IconButton } from "@components/button/IconButton";
import { Modal } from "@components/modal/modal";
import { useModal } from "@components/modal/useModal";
import { MAX_VISIBLE_PAGE } from "@src/constants/page";
import { useIsSidebarOpen, useSidebarActions } from "@src/stores/useSidebarStore";
import { Page } from "@src/types/page";
import { MenuButton } from "./MenuButton";
import { PageItem } from "./PageItem";
import { animation, contentVariants, sidebarVariants } from "./Sidebar.animation";
Expand All @@ -14,10 +17,30 @@ export const Sidebar = ({
}: {
pages: Page[];
handlePageAdd: () => void;
handlePageSelect: (pageId: number, isSidebar: boolean) => void;
handlePageSelect: ({ pageId }: { pageId: number }) => void;
}) => {
const visiblePages = pages.filter((page) => page.isVisible);
const isMaxVisiblePage = visiblePages.length >= MAX_VISIBLE_PAGE;

const isSidebarOpen = useIsSidebarOpen();
const { toggleSidebar } = useSidebarActions();
const { isOpen, openModal, closeModal } = useModal();

const handlePageItemClick = (id: number) => {
if (isMaxVisiblePage) {
openModal();
return;
}
handlePageSelect({ pageId: id });
};

const handleAddPageButtonClick = () => {
if (isMaxVisiblePage) {
openModal();
return;
}
handlePageAdd();
};

return (
<motion.aside
Expand All @@ -29,23 +52,31 @@ export const Sidebar = ({
<div className={sidebarToggleButton} onClick={toggleSidebar}>
{isSidebarOpen ? "ยซ" : "ยป"}
</div>

<motion.nav className={navWrapper} variants={contentVariants}>
<motion.div variants={contentVariants}>
<MenuButton />
</motion.div>
<motion.nav className={navWrapper} variants={contentVariants}>
{pages?.map((item) => (
<motion.div
key={item.id}
initial={animation.initial}
animate={animation.animate}
transition={animation.transition}
>
<PageItem {...item} onClick={() => handlePageSelect(item.id, true)} />
<PageItem {...item} onClick={() => handlePageItemClick(item.id)} />
</motion.div>
))}
<div className={plusIconBox}>
<IconButton icon="โž•" size="sm" onClick={handlePageAdd} />
</div>
</motion.nav>
<motion.div className={plusIconBox} variants={contentVariants}>
<IconButton icon="โž•" onClick={handleAddPageButtonClick} size="sm" />
</motion.div>
<Modal isOpen={isOpen} primaryButtonLabel="ํ™•์ธ" primaryButtonOnClick={closeModal}>
<p>
์ตœ๋Œ€ {MAX_VISIBLE_PAGE}๊ฐœ์˜ ํŽ˜์ด์ง€๋งŒ ํ‘œ์‹œํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค
<br />
์‚ฌ์šฉํ•˜์ง€ ์•Š๋Š” ํŽ˜์ด์ง€๋Š” ๋‹ซ์•„์ฃผ์„ธ์š”.
</p>
</Modal>
</motion.aside>
);
};
1 change: 1 addition & 0 deletions client/src/constants/page.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const MAX_VISIBLE_PAGE = 10;
6 changes: 4 additions & 2 deletions client/src/features/page/Page.animation.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const pageAnimation = {
initial: {
x: -300,
x: 0,
y: 0,
opacity: 0,
scale: 0.8,
Expand All @@ -12,7 +12,9 @@ export const pageAnimation = {
scale: 1,
boxShadow: isActive ? "0 8px 30px rgba(0,0,0,0.15)" : "0 2px 10px rgba(0,0,0,0.1)",
transition: {
boxShadow: { duration: 0.2 },
x: { type: "tween", duration: 0.03, ease: "linear" },
y: { type: "tween", duration: 0.03, ease: "linear" },
scale: { type: "spring", stiffness: 300, damping: 15 },
},
}),
};
Expand Down
7 changes: 2 additions & 5 deletions client/src/features/page/Page.style.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { glassContainer } from "@styled-system/recipes";
export const pageContainer = cx(
glassContainer({ border: "lg" }),
css({
display: "flex",
position: "absolute",
flexDirection: "column",
width: "450px",
height: "400px",
}),
Expand All @@ -24,11 +26,6 @@ export const pageHeader = css({
},
});

export const pageTitle = css({
textStyle: "display-medium24",
color: "gray.500",
});

export const resizeHandle = css({
position: "absolute",
right: "-10px",
Expand Down
13 changes: 7 additions & 6 deletions client/src/features/page/Page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Page as PageType } from "@src/types/page";
import { motion, AnimatePresence } from "framer-motion";
import { useRef } from "react";
import { Editor } from "@features/editor/Editor";
import { Page as PageType } from "@src/types/page";
import { pageAnimation, resizeHandleAnimation } from "./Page.animation";
import { pageContainer, pageHeader, resizeHandle } from "./Page.style";

Expand All @@ -10,7 +9,7 @@ import { PageTitle } from "./components/PageTitle/PageTitle";
import { usePage } from "./hooks/usePage";

interface PageProps extends PageType {
handlePageSelect: (pageId: number) => void;
handlePageSelect: ({ pageId, isSidebar }: { pageId: number; isSidebar?: boolean }) => void;
handlePageClose: (pageId: number) => void;
handleTitleChange: (pageId: number, newTitle: string) => void;
}
Expand All @@ -26,7 +25,6 @@ export const Page = ({
handlePageClose,
handleTitleChange,
}: PageProps) => {
const pageRef = useRef<HTMLDivElement>(null);
const { position, size, pageDrag, pageResize, pageMinimize, pageMaximize } = usePage({ x, y });

const onTitleChange = (newTitle: string) => {
Expand All @@ -36,7 +34,6 @@ export const Page = ({
return (
<AnimatePresence>
<motion.div
ref={pageRef}
className={pageContainer}
initial={pageAnimation.initial}
animate={pageAnimation.animate({
Expand All @@ -49,7 +46,11 @@ export const Page = ({
height: `${size.height}px`,
zIndex,
}}
onPointerDown={() => handlePageSelect(id)}
onPointerDown={() =>
handlePageSelect({
pageId: id,
})
}
>
<div className={pageHeader} onPointerDown={pageDrag}>
<PageTitle title={title} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ import { css, cva } from "@styled-system/css";
export const pageControlContainer = css({
display: "flex",
gap: "sm",
_hover: {
"& svg": {
transform: "scale(1)", // ์ถ”๊ฐ€ ํšจ๊ณผ
opacity: 1,
},
},
});

export const pageControlButton = cva({
Expand All @@ -20,3 +26,11 @@ export const pageControlButton = cva({
},
},
});

export const iconBox = css({
transform: "scale(0.8)",
strokeWidth: "2.5px",
color: "white/90",
opacity: 0,
transition: "all 0.1s ease",
});
Loading

0 comments on commit 4ec0edd

Please sign in to comment.