-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feat-53-gradient' of https://github.com/sprint6-part2/f…
…andom-k into feat-53-gradient
- Loading branch information
Showing
38 changed files
with
845 additions
and
74 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { baseAxios } from './api'; | ||
import { votesErrorMessage } from '@/constants/errorMessage'; | ||
|
||
export const postVotes = async (idolId) => { | ||
try { | ||
const response = await baseAxios.post('/votes', { | ||
idolId, | ||
}); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error(votesErrorMessage); | ||
} | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { baseAxios } from './api'; | ||
import { contributeErrorMessage } from '@/constants/errorMessage'; | ||
|
||
export const putContribute = async (id, amount) => { | ||
try { | ||
const response = await baseAxios.put(`/donations/${id}/contribute`, { | ||
amount, | ||
}); | ||
return response.data; | ||
} catch (error) { | ||
throw new Error(contributeErrorMessage); | ||
} | ||
}; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import React from 'react'; | ||
import GithubLogo from '@/assets/images/github.png'; | ||
import style from './styles.module.scss'; | ||
|
||
const Footer = () => { | ||
return ( | ||
<footer className={style.footer}> | ||
<span> | ||
@ Codeit <span>2024, Inc.</span> | ||
</span> | ||
<span> | ||
<span>6기 2조 </span>Fandom-K | ||
</span> | ||
<div> | ||
<img | ||
src={GithubLogo} | ||
width={20} | ||
onClick={() => | ||
window.open('https://github.com/sprint6-part2/fandom-k') | ||
} | ||
/> | ||
<span>GitHub</span> | ||
</div> | ||
</footer> | ||
); | ||
}; | ||
|
||
export default Footer; |
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
@import '../../styles/'; | ||
|
||
.footer { | ||
max-width: 1360px; | ||
margin: 0 auto; | ||
text-align: center; | ||
padding-block: 50px; | ||
|
||
display: flex; | ||
align-items: center; | ||
justify-content: space-around; | ||
|
||
@include font-base(white, 400, 15px, 26px); | ||
letter-spacing: 0.5px; | ||
opacity: 60%; | ||
|
||
> div { | ||
cursor: pointer; | ||
display: flex; | ||
align-items: center; | ||
gap: 6px; | ||
img { | ||
margin-bottom: 4px; | ||
} | ||
} | ||
|
||
@media (max-width: 500px) { | ||
font-size: 13px; | ||
|
||
> span { | ||
> span { | ||
display: none; | ||
} | ||
} | ||
|
||
> div { | ||
span { | ||
display: none; | ||
} | ||
} | ||
} | ||
} |
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 +1,3 @@ | ||
export const loadingErrorMessage = '로딩에 실패하였습니다 \n다시 시도해주세요'; | ||
export const contributeErrorMessage = '후원에 실패하였습니다'; | ||
export const votesErrorMessage = '투표에 실패하였습니다'; |
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { useEffect } from 'react'; | ||
|
||
const useScrollToTop = () => { | ||
useEffect(() => { | ||
document.getElementById('root').scrollTo(0, 0); | ||
}, []); | ||
|
||
return null; | ||
}; | ||
|
||
export default useScrollToTop; |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { useEffect, useState } from 'react'; | ||
|
||
export function useTitle(initialTitle) { | ||
const [title, setTitle] = useState(initialTitle); | ||
const updateTitle = () => { | ||
const htmlTitle = document.querySelector('title'); | ||
htmlTitle.innerText = title; | ||
}; | ||
|
||
useEffect(updateTitle, [title]); | ||
return setTitle; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import React from 'react'; | ||
import styles from './styles.module.scss'; | ||
import classNames from 'classnames'; | ||
import { motion } from 'framer-motion'; | ||
|
||
const Description = ({ backgroundImg, mainImg, title, mainText }) => { | ||
const text = classNames(styles.text, { | ||
[styles.end]: title === '이달의 아티스트', | ||
}); | ||
return ( | ||
<section className={styles.description_section}> | ||
<div className={styles.background_gradient} /> | ||
<img | ||
src={backgroundImg} | ||
alt="아이돌 사진" | ||
className={styles.background_image} | ||
/> | ||
<motion.div | ||
initial={{ opacity: 0, x: 50 }} | ||
whileInView={{ opacity: 1, x: 0 }} | ||
viewport={{ once: false }} | ||
transition={{ | ||
ease: 'easeInOut', | ||
duration: 2, | ||
x: { duration: 1 }, | ||
}} | ||
className={text} | ||
> | ||
<span className={styles.title}>{title}</span> | ||
<p className={styles.main_text}>{mainText}</p> | ||
</motion.div> | ||
<motion.img | ||
initial={{ opacity: 0, x: -50 }} | ||
whileInView={{ opacity: 1, x: 0 }} | ||
viewport={{ once: false }} | ||
transition={{ | ||
ease: 'easeInOut', | ||
duration: 2, | ||
x: { duration: 1 }, | ||
}} | ||
src={mainImg} | ||
alt="사이트 캡쳐" | ||
className={styles.main_image} | ||
/> | ||
</section> | ||
); | ||
}; | ||
|
||
export default Description; |
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 |
---|---|---|
@@ -0,0 +1,115 @@ | ||
@import '../../../styles/'; | ||
|
||
$color-yellow-title: #d2c030; | ||
|
||
.description_section { | ||
width: 100%; | ||
height: 1200px; | ||
position: relative; | ||
|
||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 60px; | ||
|
||
@media (max-width: $width-tablet) { | ||
height: 744px; | ||
gap: 47px; | ||
} | ||
@media (max-width: $width-mobile) { | ||
height: 812px; | ||
gap: 66px; | ||
} | ||
} | ||
|
||
.background_gradient { | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
z-index: 1; | ||
|
||
background: radial-gradient( | ||
50% 50% at 50% 50%, | ||
rgba(2, 0, 14, 0) 0%, | ||
rgba(2, 0, 14, 0.180099) 37.5%, | ||
rgba(2, 0, 14, 0.5) 79.5%, | ||
#02000e 100% | ||
); | ||
} | ||
.background_image { | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
z-index: 0; | ||
opacity: 20%; | ||
|
||
@media (max-width: $width-tablet) { | ||
width: 744px; | ||
} | ||
@media (max-width: $width-mobile) { | ||
width: 375px; | ||
} | ||
} | ||
|
||
.main_image { | ||
z-index: 3; | ||
width: 320px; | ||
height: 694px; | ||
|
||
@media (max-width: $width-tablet) { | ||
width: 200px; | ||
height: 434px; | ||
} | ||
@media (max-width: $width-mobile) { | ||
width: 240px; | ||
height: 520px; | ||
} | ||
} | ||
|
||
.text { | ||
z-index: 3; | ||
width: 100%; | ||
margin-top: 160px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 8px; | ||
|
||
@media (max-width: $width-tablet) { | ||
margin-top: 74px; | ||
} | ||
@media (max-width: $width-mobile) { | ||
align-items: flex-start; | ||
padding: 0 12px; | ||
|
||
&.end { | ||
align-items: flex-end; | ||
p { | ||
text-align: right; | ||
} | ||
} | ||
} | ||
|
||
span { | ||
@include font-base($color-yellow-title, 500, 16px, 19px); | ||
|
||
@media (max-width: $width-mobile) { | ||
@include font-base($color-yellow-title, 500, 14px, 17px); | ||
} | ||
} | ||
|
||
p { | ||
white-space: pre-wrap; | ||
@include font-base(white, 700, 24px, 29px); | ||
text-align: center; | ||
|
||
@media (max-width: $width-tablet) { | ||
@include font-base(white, 500, 16px, 24px); | ||
} | ||
|
||
@media (max-width: $width-mobile) { | ||
@include font-base(white, 500, 20px, 24px); | ||
text-align: start; | ||
} | ||
} | ||
} |
Oops, something went wrong.