Toggle navigation
Toggle navigation
This project
Loading...
Sign in
khusat
/
khusat-front
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이준호
2020-12-10 00:29:07 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
60aa6407d3de8af241ca206d28a87f080c558761
60aa6407
1 parent
fa14c1f6
[UPDATE] Card 컴포넌트 모바일 적용
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
2 deletions
src/components/card/Card.js
src/components/card/Card.js
View file @
60aa640
import
React
from
"react"
;
import
styled
,
{
css
}
from
"styled-components"
;
import
{
lighten
,
darken
}
from
"polished"
;
const
sizes
=
{
desktop
:
102.4
,
tablet
:
76.8
,
phone
:
36
,
};
const
media
=
Object
.
keys
(
sizes
).
reduce
((
acc
,
label
)
=>
{
acc
[
label
]
=
(...
args
)
=>
css
`
@media (max-width:
${
sizes
[
label
]}
rem) {
${
css
(...
args
)}
}
`
;
return
acc
;
},
{});
function
Card
({
question
,
answer
,
setAnswer
,
curIdx
,
setCurIdx
})
{
const
CardWrap
=
styled
.
div
`
...
...
@@ -11,6 +25,9 @@ function Card({ question, answer, setAnswer, curIdx, setCurIdx }) {
height: 100%;
font-size: 20px;
font-weight: bold;
${
media
.
phone
`
min-width: 360px;
`
}
`
;
const
CardQuest
=
styled
.
div
`
...
...
@@ -32,7 +49,7 @@ function Card({ question, answer, setAnswer, curIdx, setCurIdx }) {
justify-content: center;
align-items: center;
&:hover {
background:
${
lighten
(
0.1
,
"#536349"
)}
;
// color of card -> theme화 하기
background:
${
lighten
(
0.1
,
"#536349"
)}
;
}
&:active {
background:
${
darken
(
0.1
,
"#536349"
)}
;
...
...
@@ -72,6 +89,5 @@ function Card({ question, answer, setAnswer, curIdx, setCurIdx }) {
<
/
>
);
}
// 나중에 데이터 넘어오면 넘어온 데이터로 카드 업데이트
export
default
Card
;
...
...
Please
register
or
login
to post a comment