Toggle navigation
Toggle navigation
This project
Loading...
Sign in
조수연
/
Find_your_own_personal_color
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-05 02:36:26 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
91493845db89473e0b1652d9e391d53eb33e1358
91493845
1 parent
a2d16282
사계절 결과 도출
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
43 additions
and
9 deletions
front/.eslintcache
front/src/summer.js
front/src/test2.js
front/src/test3.js
front/src/winter.js
front/.eslintcache
View file @
9149384
This diff is collapsed. Click to expand it.
front/src/summer.js
View file @
9149384
import
React
from
'react'
;
import
'./spring.css?ver=1.4'
;
import
summer
from
'./season/summer.jpg'
;
const
Summer
=
(
{
history
}
)
=>
{
return
(
<
div
className
=
'summer_class'
>
<
img
src
=
{
summer
}
width
=
'1300'
height
=
'600'
alt
=
"summer"
/>
<
div
id
=
"btn_back"
>
<
button
id
=
"back_btn"
onClick
=
{
()
=>
{
history
.
push
(
"/"
)}}
>
back
<
/button
>
<
/div
>
<
/div
>
);
}
export
default
Summer
;
\ No newline at end of file
...
...
front/src/test2.js
View file @
9149384
...
...
@@ -42,7 +42,7 @@ const Test2 = ( { history } ) =>
const
[
score
,
setPersonal
]
=
useState
(
""
);
//퍼스널컬러 결과
const
handleAnswerOptionClick
=
(
isCorrect
)
=>
{
const
handleAnswerOptionClick
=
(
isCorrect
)
=>
{
//함수3_여쿨, 겨쿨 점수 +1
if
(
isCorrect
)
{
setScore_cool_summer
(
score_c_s
+
1
);
}
...
...
@@ -60,7 +60,7 @@ const Test2 = ( { history } ) =>
};
//함수1 끝.
const
handlePersonalScore_cool
=
(
score_c_s
,
score_c_w
)
=>
{
//함수
3
_여쿨, 겨쿨 점수로 결과 구하기
const
handlePersonalScore_cool
=
(
score_c_s
,
score_c_w
)
=>
{
//함수
2
_여쿨, 겨쿨 점수로 결과 구하기
if
(
score_c_s
>
score_c_w
){
setPersonal
(
'summer cool'
);
}
...
...
@@ -70,7 +70,7 @@ const handlePersonalScore_cool = (score_c_s,score_c_w) =>{ //함수3_여쿨, 겨
else
{
setPersonal
(
'restart'
);
}
};
//함수
3
끝.
};
//함수
2
끝.
return
(
<
div
className
=
'app'
>
...
...
@@ -78,8 +78,8 @@ const handlePersonalScore_cool = (score_c_s,score_c_w) =>{ //함수3_여쿨, 겨
<
span
className
=
'score-section'
>
You
scored
{
score
}
out
of
{
questions_cool
.
length
}
<
button
onClick
=
{()
=>
handlePersonalScore_cool
(
score_c_s
,
score_c_w
)}
>
result
<
/button
>
{
score
===
"
cool"
?
<
button
onClick
=
{
()
=>
{
history
.
push
(
"/test2
"
)}}
>
next
<
/button
>
:
<
button
onClick
=
{
()
=>
{
history
.
push
(
"/
test3
"
)}}
>
next
<
/button>
}
{
score
===
"
summer cool"
?
<
button
onClick
=
{
()
=>
{
history
.
push
(
"/summer
"
)}}
>
next
<
/button
>
:
<
button
onClick
=
{
()
=>
{
history
.
push
(
"/
winter
"
)}}
>
next
<
/button>
}
<
/span
>
)
:
(
<>
...
...
front/src/test3.js
View file @
9149384
...
...
@@ -43,13 +43,13 @@ const Test3 = ( { history } ) =>
const
[
score
,
setPersonal
]
=
useState
(
""
);
//퍼스널컬러 결과
const
handleAnswerOptionClick
=
(
isCorrect
)
=>
{
//main 함수 1_
웜쿨
검사
const
handleAnswerOptionClick
=
(
isCorrect
)
=>
{
//main 함수 1_
봄, 가을
검사
if
(
isCorrect
)
{
setScore_warm_spring
(
score_w_s
+
1
);
}
else
{
setScore_warm_autumn
(
score_w_a
+
1
);
}
///
웜,쿨
if문으로 점수 올리기
}
///
봄, 가을
if문으로 점수 올리기
const
nextQuestion
=
currentQuestion_w
+
1
;
if
(
nextQuestion
<
questions_warm
.
length
)
{
...
...
@@ -61,7 +61,7 @@ const Test3 = ( { history } ) =>
};
//함수1 끝.
const
handlePersonalScore_warm
=
(
score_w_s
,
score_w_a
)
=>
{
//함수
3_여쿨, 겨쿨
점수로 결과 구하기
const
handlePersonalScore_warm
=
(
score_w_s
,
score_w_a
)
=>
{
//함수
2_봄, 가을
점수로 결과 구하기
if
(
score_w_s
>
score_w_a
){
setPersonal
(
'spring warm'
);
}
...
...
@@ -71,7 +71,7 @@ const handlePersonalScore_warm = (score_w_s,score_w_a) =>{ //함수3_여쿨, 겨
else
{
setPersonal
(
'restart'
);
}
};
//함수
3
끝.
};
//함수
2
끝.
return
(
<
div
className
=
'app'
>
...
...
front/src/winter.js
View file @
9149384
import
React
from
'react'
;
import
'./spring.css?ver=1.4'
;
import
winter
from
'./season/winter.png'
;
const
Winter
=
(
{
history
}
)
=>
{
return
(
<
div
className
=
'winter_class'
>
<
img
src
=
{
winter
}
width
=
'1300'
height
=
'600'
alt
=
"winter"
/>
<
div
id
=
"btn_back"
>
<
button
id
=
"back_btn"
onClick
=
{
()
=>
{
history
.
push
(
"/"
)}}
>
back
<
/button
>
<
/div
>
<
/div
>
);
}
export
default
Winter
;
\ No newline at end of file
...
...
Please
register
or
login
to post a comment