Skip to content

Commit

Permalink
Merge pull request #12 from 9JIIIIIN9/main
Browse files Browse the repository at this point in the history
로고 변경 및 버튼 수정
  • Loading branch information
hyunjin1109 authored Jun 10, 2024
2 parents 06df4ed + 4ad1850 commit 51232bf
Show file tree
Hide file tree
Showing 13 changed files with 316 additions and 44 deletions.
4 changes: 3 additions & 1 deletion spirograph/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import LastPage from "./pages/spiro/LastPage.jsx";
import SaleListPage from "./pages/SaleList/index";
import BrandingPage from "./pages/brandingPage/index";
import BusinessPage from "./pages/businessPage/index";
import ContactPage from "./pages/contactPage/index.jsx";

function App() {
return (
Expand All @@ -19,11 +20,12 @@ function App() {
<Route path="/salelist" element={<SaleListPage />} />
<Route path="/branding" element={<BrandingPage />} />
<Route path="/business" element={<BusinessPage />} />
<Route path="/contact" element={<ContactPage />} />

<Route path="/" element={<Main />} />
<Route path="/sketch" element={<SketchPage />} />
<Route path="/aiCorrection" element={<AICorrection />} />
<Route path="/LastPage" element={<LastPage />} />

</Routes>
</Router>
</div>
Expand Down
74 changes: 74 additions & 0 deletions spirograph/src/assets/newSymbol.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 6 additions & 4 deletions spirograph/src/components/Header/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,21 @@ export const Header = () => {
<div className="flex flex-col px-5 w-full max-w-full">
<div className="flex gap-5 items-start text-sm font-bold text-white flex-wrap">
<div className="flex flex-col">
<div className="img-container">
<div className="img-container hover-effect">
<img
loading="lazy"
src="https://cdn.builder.io/api/v1/image/assets/TEMP/e273b21e7a814573f6043f3bb8a5765e678dbd03a7dcdd8675469b73c1b547a1?"
className="self-center border border-solid border-stone-500 stroke-[1px] stroke-stone-500 w-[218px]"
style={{ height: "0px" }}
style={{ height: "0px", textAlign: "center" }}
hoverColor="#5339FD"
/>
<div
<button
hoverColor="#5339FD"
className="mt-1 text-custom text-left"
onClick={() => navigate("./LogicPage")}
>
Symbol Logic
</div>
</button>
</div>
</div>
<div className="flex flex-col whitespace-nowrap">
Expand Down
45 changes: 38 additions & 7 deletions spirograph/src/components/NavBar/Navbar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import * as S from "./styles";
import styled from "styled-components";
import { useNavigate } from "react-router-dom";
import Horizon from "../../components/NavBar/horizon";
import Logo from "../../assets/brandingImg/Logoo.svg";
const ImageWrapper = styled.div`
import Logo from "../../assets/newSymbol.svg";
const ImageWrapper = styled.button`
display: flex;
width: 100%;
//원래 1.69
Expand Down Expand Up @@ -66,23 +66,54 @@ const Navbar = () => {
return (
<S.NavBar style={{ top: `${topOffset}px`, transition: "top 0.3s" }}>
<ImageWrapper>
<Image src={Logo} alt="logo" />
<Image
src={Logo}
alt="logo"
onClick={() => {
navigate("/");
}}
/>
</ImageWrapper>
<Group>
<Horizon />
<S.NavMenu onClick={handleClick}>Symbol Logic</S.NavMenu>

<S.NavMenu
onClick={() => {
navigate("/branding");
}}
>
Symbol Logic
</S.NavMenu>
</Group>
<Group>
<Horizon />
<S.NavMenu onClick={handleClick}>About</S.NavMenu>
<S.NavMenu
onClick={() => {
navigate("/branding");
}}
>
About
</S.NavMenu>
</Group>
<Group>
<Horizon />
<S.NavMenu onClick={handleClick}>Business Model</S.NavMenu>
<S.NavMenu
onClick={() => {
navigate("/business");
}}
>
Business Model
</S.NavMenu>
</Group>
<Group>
<Horizon />
<S.NavMenu onClick={handleClick}>Contact</S.NavMenu>
<S.NavMenu
onClick={() => {
navigate("/contact");
}}
>
Contact
</S.NavMenu>
</Group>
<Group>
<Horizon />
Expand Down
1 change: 0 additions & 1 deletion spirograph/src/components/NavBar/styles.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ export const NavBar = styled.nav`
flex-direction: row;
/* margin-top: 2rem; */
height: 5vh;
position: fixed;
top: 0;
width: 100%;
transition: top 0.3s;
Expand Down
136 changes: 136 additions & 0 deletions spirograph/src/components/NavbarMain.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
import React, { useState, useEffect } from "react";

import * as S from "./NavBar/styles";
import styled from "styled-components";
import { useNavigate } from "react-router-dom";
import Horizon from "../../components/NavBar/horizon";
import Logo from "../../assets/newSymbol.svg";
const ImageWrapper = styled.button`
display: flex;
width: 100%;
//원래 1.69
margin-right: 2rem;
//원래 2.77rem
margin-left: 2.5rem;
height: 100%;
`;
const Image = styled.img`
display: block;
width: auto;
`;
const Group = styled.div`
display: flex;
flex-direction: column;
width: 100%;
margin-right: 1.25rem;
margin-bottom: 7.94rem;
text-align: start;
&:hover {
background-color: #fff;
transition: background-color 0.8s;
}
`;
const NavbarMain = () => {
const navigate = useNavigate();
const [topOffset, setTopOffset] = useState(0);
const [lastScrollY, setLastScrollY] = useState(0);

function handleClick() {
console.log("NavMenu가 클릭!");
navigate("/about");
}

//NavBar 효과
useEffect(() => {
const handleScroll = () => {
const currentScrollY = window.scrollY;
if (currentScrollY === 0) {
// 스크롤 위치가 0이면 고정
setTopOffset(20);
} else if (currentScrollY > lastScrollY) {
// 스크롤 다운
setTopOffset(-60); // navBar를 40px 위로 이동
} else {
// 스크롤 업
setTopOffset(0); // navBar를 맨 위에 붙이기
}
setLastScrollY(currentScrollY);
};

window.addEventListener("scroll", handleScroll);

return () => {
window.removeEventListener("scroll", handleScroll);
};
}, [lastScrollY]);
return (
<S.NavBar style={{ top: `${topOffset}px`, transition: "top 0.3s" }}>
<ImageWrapper>
<Image
src={Logo}
alt="logo"
onClick={() => {
navigate("/");
}}
/>
</ImageWrapper>
<Group>
<Horizon />

<S.NavMenu
onClick={() => {
navigate("/branding");
}}
>
Symbol Logic
</S.NavMenu>
</Group>
<Group>
<Horizon />
<S.NavMenu
onClick={() => {
navigate("/branding");
}}
>
About
</S.NavMenu>
</Group>
<Group>
<Horizon />
<S.NavMenu
onClick={() => {
navigate("/business");
}}
>
Business Model
</S.NavMenu>
</Group>
<Group>
<Horizon />
<S.NavMenu
onClick={() => {
navigate("/contact");
}}
>
Contact
</S.NavMenu>
</Group>
<Group>
<Horizon />
<S.NavMenu onClick={handleClick}>Shop</S.NavMenu>
</Group>
<Group>
<Horizon />
<S.NavMenu
onClick={handleClick}
style={{ fontSize: "1.12rem" }}
hoverColor="#5339FD"
>
Model Graphic {">"}{" "}
</S.NavMenu>
</Group>
</S.NavBar>
);
};

export default NavbarMain;
41 changes: 23 additions & 18 deletions spirograph/src/components/Sketch/Sketch.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,24 +311,29 @@ const Sketch = ({
<div ref={sketchRef}></div>
<div className="nft">
{isEnd && (
<div className="buttons">
<button className="button2" onClick={handlePrint}>
<span className="button-text">출력하기</span>
<div className="tooltip">
AI를 활용하여 자신의 취향을 담아 <br /> 더 멋진 심볼을 만들어
보아요!
</div>
</button>
<button
className="button3"
onClick={() => navigate("/aiCorrection", { state: { url } })}
>
<span className="button-text">AI 수정하기</span>
<div className="tooltip">
AI를 활용하여 자신의 취향을 담아 <br /> 더 멋진 심볼을 만들어
보아요!
</div>
</button>
<div className="flex h-32 justify-center items-center min-h-screen">
<div className="flex flex-row gap-4">
{/* <div className="button2 flex flex-col" onClick={handlePrint}>
<span className="button-text">홈으로 가기</span>
<div className="tooltip ">
AI를 활용하여 자신의 취향을 담아 <br /> 더 멋진 심볼을 만들어
보아요!
</div>
</div> */}
<button
className="button3 flex flex-col"
onClick={() => {
navigate("/");
}}
// onClick={() => navigate("/aiCorrection", { state: { url } })}
>
<span className="button-text">홈으로 가기</span>
{/* <div className="tooltip">
AI를 활용하여 자신의 취향을 담아 <br /> 더 멋진 심볼을 만들어
보아요!
</div> */}
</button>
</div>
</div>
)}
</div>
Expand Down
Loading

0 comments on commit 51232bf

Please sign in to comment.