Skip to content

Commit

Permalink
feat : 24/04/23작업 추가
Browse files Browse the repository at this point in the history
1. typed.js 추가 및 타이핑 효과 적용
2. 메인 배너 디자인 변경
3. 회사다닌경험 experience칸 섹션 추가
4. project들 ref추가 및 경험탭에서 프로젝트클릭시 이동기능 추가
  • Loading branch information
goodchuck committed Apr 23, 2024
1 parent b57bdb4 commit abcf1bb
Show file tree
Hide file tree
Showing 8 changed files with 5,931 additions and 5,700 deletions.
11,328 changes: 5,667 additions & 5,661 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
"next": "14.2.1",
"react": "^18",
"react-dom": "^18",
"styled-components": "^6.1.8"
"styled-components": "^6.1.8",
"typed.js": "^2.1.0"
},
"devDependencies": {
"@types/node": "^20",
Expand Down
3 changes: 3 additions & 0 deletions src/app/_component/StyledHeader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@ import styled from "styled-components";
export const StyledHeader = styled.header`
height: 72px;
width: 100%;
position: fixed;
top: 0;
display: flex;
justify-content: center;
background-color: white;
z-index: 1000;
& .main-container {
/* padding: 0 40px 0 40px; */
width: 70%;
Expand Down
81 changes: 66 additions & 15 deletions src/app/_component/Styledmain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const StyledMain = styled.main`
flex-direction: column;
justify-content: center;
align-items: center;
font-family: Black Han Sans, sans-serif;
font-family: "Archivo Black", sans-serif;
color: #212529;
@font-face {
font-family: "GOR";
Expand All @@ -27,6 +27,13 @@ export const StyledMain = styled.main`
font-style: normal;
}
@font-face {
font-family: "Archivo Black", sans-serif;
src: url("./fonts/ArchivoBlack-Regular.ttf") format("truetype");
font-weight: 400;
font-style: normal;
}
& > .main-container {
width: 100%;
height: 500px;
Expand All @@ -37,7 +44,7 @@ export const StyledMain = styled.main`
rgba(112, 93, 80, 0.8) 0,
rgba(112, 93, 80, 0.8) 90%
),
url("./assets/image.png") 50% no-repeat;
url("./assets/frame.jpg") 50% no-repeat;
/* opacity: 0.7; */
color: #fff;
& .title-box {
Expand All @@ -51,20 +58,40 @@ export const StyledMain = styled.main`
}
}
& .typer-box {
margin-top: 72px;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
background-color: black;
/* background-image: url("./assets/background1.jpg"); */
/* background-attachment: fixed; */
/* background-repeat: no-repeat; */
/* background-size: cover; */
color: white;
width: 100%;
& > p {
font-size: 5rem;
}
}
& .container {
padding-top: 20px;
padding-bottom: 20px;
width: 100%;
/* background-color: aqua; */
& > .header {
/* font-weight: 400; */
font-weight: 700;
font-size: 3rem;
border-bottom-width: 1px;
border-bottom-style: solid;
}
}
& .aboutme {
/* height: 100vh; */
.icon {
font-size: 48px;
}
Expand All @@ -75,6 +102,42 @@ export const StyledMain = styled.main`
.bottom {
font-size: 1rem;
}
& .innerContainer {
display: flex;
flex-direction: column;
font-size: 1.25rem;
}
}
& .archive {
& .card {
width: 350px;
background-color: white;
border-radius: 0.5rem;
padding: 20px;
& a {
color: blue;
}
}
}
& .experience {
& .inner-container {
width: 70%;
& .left {
width: 30%;
display: flex;
flex-direction: column;
}
& .right {
width: 70%;
& .contribute-container {
padding-left: 20px;
}
}
}
}
& .skills {
Expand All @@ -92,16 +155,4 @@ export const StyledMain = styled.main`
padding: 20px;
}
}
& .archive {
& .card {
width: 350px;
background-color: white;
border-radius: 0.5rem;
padding: 20px;
& a {
color: blue;
}
}
}
`;
45 changes: 45 additions & 0 deletions src/app/_component/TypingContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
"use client"

import { useEffect, useState } from "react";

type Props = {
inputText: string;
speed?: number;
}
export const TypingContainer = ({ inputText, speed = 100 }: Props) => {
const [textLines, setTextLines] = useState<string[]>([]);
const [typingIndex, setTypingIndex] = useState<number>(0);
// const speed: number = 100; // 타이핑 속도 (milliseconds);

useEffect(() => {
const originalText: string = inputText;

// 입력된 텍스트를 줄바꿈 문자(\n)을 기준으로 나누어 배열로 변환
const lines: string[] = originalText.split('\n');

const typingInterval: NodeJS.Timeout = setInterval(() => {
if (typingIndex < lines.length) {
// 한 줄씩 타이핑 효과 적용
setTextLines((prevLines: string[]) => {
const newLines = [...prevLines];
newLines[typingIndex] += lines[typingIndex][newLines[typingIndex].length];
return newLines;
});
setTypingIndex((prevIndex: number) => prevIndex + 1);
} else {
clearInterval(typingInterval);
}
}, speed);


return () => clearInterval(typingInterval);
}, [typingIndex])
return (
<>
{textLines.map((line, index) => (
<p key={index}>{line}</p>
))}
</>

)
}
34 changes: 34 additions & 0 deletions src/app/_component/TypingEffect.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"use client"
import React, { useEffect, useRef } from 'react';
import Typed from 'typed.js';

type Props = {
strings: string[];
size?: string;
}
export const TypingEffect = ({ strings, size = '1rem' }: Props) => {
const el = useRef<HTMLSpanElement>(null);
const typed = useRef<Typed | null>(null);

useEffect(() => {
const options = {
strings,
typeSpeed: 50,
backSpeed: 25,
loop: false,
showCursor: false,
};

if (el.current) {
typed.current = new Typed(el.current, options);
}

return () => {
if (typed.current) {
typed.current.destroy();
}
};
}, []);

return <span ref={el} style={{ whiteSpace: 'pre', fontSize: size }} />;
}
13 changes: 8 additions & 5 deletions src/app/_component/project/ProjectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// import Image from "next/image"
import { Flex, Carousel, Divider, Button, Image } from "antd"
import { StyledProjectCard } from "./StyledProjectCard";
import { forwardRef } from "react";

const ImageProps = { width: 650, height: 400 }
const contentStyle: React.CSSProperties = {
Expand All @@ -13,6 +14,7 @@ const contentStyle: React.CSSProperties = {
};

export type Project = {
projectId?: string;
isPort?: boolean;
title: string,
description: string,
Expand All @@ -30,17 +32,18 @@ export type Project = {

}

export const ProjectCard = ({
isPort = true, title, description, outline, link, images,

export const ProjectCard = forwardRef<HTMLDivElement, Project>(({
projectId, isPort = true, title, description, outline, link, images,
main, git, url, notion, Frontend, Backend, Database, Deployment
}: Project) => {
}, ref) => {

const handleClickEvent = () => {
alert(`click ${link}`)
}

return (
<StyledProjectCard>
<StyledProjectCard id={projectId ? projectId : undefined} ref={ref}>
<div className="title">{title}</div>
<div className="description">{description} / {isPort ? '포트폴리오' : '회사프로젝트'}</div>
<Flex style={{ width: '100%' }} gap={"middle"}>
Expand Down Expand Up @@ -170,4 +173,4 @@ export const ProjectCard = ({
</Flex>
</StyledProjectCard>
)
}
})
Loading

0 comments on commit abcf1bb

Please sign in to comment.