-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
120 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 11 additions & 2 deletions
13
src/features/diary-list-item/diary-list-item-ui/image-box/ImageBox.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
import { Box } from './ImageBoxCss'; | ||
|
||
const ImageBox = () => { | ||
return <Box />; | ||
interface ImageBoxProps { | ||
imgUrl: string; | ||
musicName: string; | ||
} | ||
|
||
const ImageBox: React.FC<ImageBoxProps> = ({ imgUrl, musicName }) => { | ||
return ( | ||
<Box imgUrl={imgUrl}> | ||
<p>{musicName}</p> | ||
</Box> | ||
); | ||
}; | ||
|
||
export default ImageBox; |
51 changes: 50 additions & 1 deletion
51
src/features/diary-list-item/diary-list-item-ui/image-box/ImageBoxCss.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,57 @@ | ||
import styled from 'styled-components'; | ||
|
||
export const Box = styled.div` | ||
export const Box = styled.div<{ imgUrl: string }>` | ||
width: 135px; | ||
height: 115px; | ||
border: 1px solid black; | ||
border-radius: 15px; | ||
background-image: url(${(props) => props.imgUrl}); | ||
background-position: center; | ||
background-repeat: no-repeat; | ||
background-size: cover; | ||
position: relative; | ||
overflow: hidden; | ||
display: flex; | ||
justify-content: center; | ||
align-items: end; | ||
&::after { | ||
content: ''; | ||
display: block; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background: linear-gradient(0deg, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0)); | ||
transition: 0.2s; | ||
opacity: 0; | ||
} | ||
&:hover::after { | ||
content: ''; | ||
display: block; | ||
position: absolute; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background: linear-gradient(0deg, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0)); | ||
opacity: 1; | ||
} | ||
p { | ||
opacity: 0; | ||
z-index: 99; | ||
color: white; | ||
transition: 0.2s; | ||
font-size: 14px; | ||
padding-bottom: 8px; | ||
} | ||
&:hover > p { | ||
opacity: 1; | ||
z-index: 99; | ||
color: white; | ||
} | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,24 @@ | ||
import DiaryListItem from '@/features/diary-list-item'; | ||
|
||
const item = { | ||
id: 31, | ||
title: '오늘 나의 일기', | ||
id: 220, | ||
title: '개발일기2', | ||
content: | ||
'신나는 제주도 여행 1일차다. 정말 신난다. 신나는 제주도 여행 신나는 제주도 여행 1일차다. 정말 신난다. 신나는 제주도 여행 신나는 제주도 여행 1일차다. 정말 신난다. 신나는 제주도 여행 신나는 제주도 여행 1일차다. 정말 신난다. 신나는 제주도 여행 신나는 제주도 여행 1일차다. 정말 신난다. 신나는 제주도 여행 신나는 제주도 여행 1일차다. 정말 신난다. 신나는 제주도 여행', | ||
'개발일기의 내용2개발일기의 내용2개발일기의 내용2개발일기의 내용2개발일기의 내용2개발일기의 내용2개발일기의 내용2개발일기의 내용2개발일기의 내용2개발일기의 내용2', | ||
is_public: 1, | ||
music_url: 'http://example.com/music.mp3', | ||
mood: '매우 나쁨', | ||
emotion: '자신 있어요', | ||
sub_emotion: '{"sub_mood": "행복", "intensity": 8}', | ||
created_date: '2024-10-27T07:12:33.000Z', | ||
updated_date: '2024-10-28T03:39:36.000Z', | ||
author_email: '[email protected]', | ||
reactions: [ | ||
{ | ||
id: 34, | ||
type: '화나요', | ||
user_email: '[email protected]', | ||
created_at: '2024-10-24T03:58:35.000Z' | ||
} | ||
] | ||
music_url: 'https://example.com/music.mp3', | ||
mood: '좋음', | ||
emotion: '감사해요', | ||
sub_emotion: null, | ||
created_date: '2024-11-10T11:48:50.000Z', | ||
updated_date: '2024-10-30T07:51:23.000Z', | ||
author_email: '[email protected]', | ||
music_title: '노래제목', | ||
music_imgurl: 'https://avatars.githubusercontent.com/u/88082564?s=200&v=4', | ||
music_id: '노래아이디', | ||
artist: '가수', | ||
author_username: '김민준', | ||
reactions: [] | ||
}; | ||
|
||
const MainPage = () => { | ||
|