조수연

Merge branch 'test1' into 'master'

spring 결과 나타내기



See merge request !5
1 -[{"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\App.js":"1","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\Home.js":"2","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test.js":"3","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\index.js":"4","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test2.js":"5","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test3.js":"6"},{"size":625,"mtime":1606850624017,"results":"7","hashOfConfig":"8"},{"size":493,"mtime":1606850624022,"results":"9","hashOfConfig":"8"},{"size":3347,"mtime":1606849098689,"results":"10","hashOfConfig":"8"},{"size":238,"mtime":1606589880919,"results":"11","hashOfConfig":"8"},{"size":3249,"mtime":1606848650428,"results":"12","hashOfConfig":"8"},{"size":3313,"mtime":1606851847769,"results":"13","hashOfConfig":"8"},{"filePath":"14","messages":"15","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"pqxpq",{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"18","messages":"19","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"22","messages":"23","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"24","messages":"25","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"26"},"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\App.js",[],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\Home.js",[],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test.js",["27"],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\index.js",[],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test2.js",["28"],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test3.js",["29","30"],"import React, { useState } from 'react'; //리액트 불러오기\r\nimport console from 'react-console'; //리액트 콘솔_크롬으로 실행\r\nimport './test.css';//test.css 불러오기\r\n\r\nconst Test3 = ( { history } ) =>\r\n {\r\n\tconst questions_warm = [\r\n\t\t{\r\n\t\t\tquestionText: '머리카락 색이 검정에 가깝다',\r\n\t\t\tanswerOptions: [\r\n\t\t\t\t{ answerText: '예', isCorrect: true },\r\n\t\t\t\t{ answerText: '아니오', isCorrect: false }\r\n\t\t\t],\r\n\t\t},\r\n\t\t{\r\n\t\t\tquestionText: '피부에 붉은 기가 많다',\r\n\t\t\tanswerOptions: [\r\n\t\t\t\t{ answerText: '예', isCorrect: true },\r\n\t\t\t\t{ answerText: '아니오', isCorrect: false }\r\n\t\t\t],\r\n\t\t},\r\n\t\t{\r\n\t\t\tquestionText: '손목 혈관 색이 초록색이다',\r\n\t\t\tanswerOptions: [\r\n\t\t\t\t{ answerText: '예', isCorrect: false },\r\n\t\t\t\t{ answerText: '아니오', isCorrect: true }\r\n\t\t\t],\r\n\t\t},\r\n\t\t{\r\n\t\t\tquestionText: '햇볕에 장시간 있으면 피부가 붉어진다',\r\n\t\t\tanswerOptions: [\r\n\t\t\t\t{ answerText: '예', isCorrect: true },\r\n\t\t\t\t{ answerText: '아니오', isCorrect: false }\r\n\t\t\t],\r\n\t\t},\r\n\t]; //봄웜톤, 가을웜톤 파악\r\n\r\n\r\n\tconst [currentQuestion_w, setCurrentQuestion] = useState(0); //현재 문제 번호 [변수, 함수]\r\n\tconst [showScore_w, setShowScore] = useState(false); //결과 보여줄까?\r\n\tconst [score_w_s, setScore_warm_spring] = useState(0);\r\n\tconst [score_w_a, setScore_warm_autumn] = useState(0);\r\n\tconst [score, setPersonal] = useState(\"\"); //퍼스널컬러 결과\r\n\t\r\n\r\n\tconst handleAnswerOptionClick = (isCorrect) => { //main 함수 1_웜쿨 검사\r\n\t\tif (isCorrect) {\r\n\t\t\tsetScore_warm_spring(score_w_s+1);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsetScore_warm_autumn(score_w_a+1);\r\n\t\t} ///웜,쿨 if문으로 점수 올리기\r\n\r\n\t\tconst nextQuestion = currentQuestion_w + 1;\r\n\t\tif (nextQuestion < questions_warm.length) {\r\n\t\t\tsetCurrentQuestion(nextQuestion);\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsetShowScore(true); //questions 끝나면 점수 보여줄까? true -> className='score-section'\r\n\t\t}\r\n \r\n }; //함수1 끝.\r\n\r\nconst handlePersonalScore_warm = (score_w_s,score_w_a) =>{ //함수3_여쿨, 겨쿨 점수로 결과 구하기\r\n\tif(score_w_s>score_w_a){\r\n\t\tsetPersonal('spring warm');\r\n\t}\r\n\telse if(score_w_s<score_w_a){\r\n\t\tsetPersonal('autumn warm');\r\n\t}\r\n\telse{\r\n\t\tsetPersonal('restart');\r\n\t}\r\n}; //함수3 끝.\r\n\r\n\treturn (\r\n\t\t<div className='app'>\r\n\t\t\t{showScore_w ? ( \r\n\t\t\t\t<span className='score-section'>\r\n\t\t\t\t\tYou scored {score} out of {questions_warm.length}\r\n\t\t\t\t\t<button onClick={() => handlePersonalScore_warm(score_w_s,score_w_a)}>result</button>\r\n\t\t\t\t\t{score === \"spring warm\" ? <img id = \"season\" src={require(\"./season/spring.jpg\")}/>\r\n\t\t\t\t\t: <button onClick={ () => {history.push(\"/test3\")}}>next</button>}\r\n\t\t\t\t</span>\r\n\t\t\t) : (\r\n\t\t\t\t<>\r\n\t\t\t\t\t<div className='question-section'>\r\n\t\t\t\t\t\t<div className='question-count'>\r\n\t\t\t\t\t\t\t<span>Question {currentQuestion_w + 1}</span>/{questions_warm.length}\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t\t<div className='question-text'>{questions_warm[currentQuestion_w].questionText}</div>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<div className='answer-section'>\r\n\t\t\t\t\t\t{questions_warm[currentQuestion_w].answerOptions.map((answerOption) => (\r\n\t\t\t\t\t\t\t<button onClick={() => handleAnswerOptionClick(answerOption.isCorrect)}>{answerOption.answerText}</button>\r\n\t\t\t\t\t\t))}\r\n\t\t\t\t\t</div>\r\n\t\t\t\t</>\r\n\t\t\t)}\r\n\t\t</div>\r\n\t);\r\n}\r\n\r\n\r\nexport default Test3;",{"ruleId":"31","severity":1,"message":"32","line":1,"column":17,"nodeType":"33","messageId":"34","endLine":1,"endColumn":26},{"ruleId":"31","severity":1,"message":"35","line":2,"column":8,"nodeType":"33","messageId":"34","endLine":2,"endColumn":15},{"ruleId":"31","severity":1,"message":"35","line":2,"column":8,"nodeType":"33","messageId":"34","endLine":2,"endColumn":15},{"ruleId":"36","severity":1,"message":"37","line":82,"column":33,"nodeType":"38","endLine":82,"endColumn":90},"no-unused-vars","'useEffect' is defined but never used.","Identifier","unusedVar","'console' is defined but never used.","jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","JSXOpeningElement"]
...\ No newline at end of file ...\ No newline at end of file
1 +[{"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\App.js":"1","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\Home.js":"2","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test.js":"3","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\index.js":"4","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test2.js":"5","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test3.js":"6","C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\spring.js":"7"},{"size":1032,"mtime":1607016219720,"results":"8","hashOfConfig":"9"},{"size":493,"mtime":1607016099321,"results":"10","hashOfConfig":"9"},{"size":3347,"mtime":1607016031275,"results":"11","hashOfConfig":"9"},{"size":238,"mtime":1606589880919,"results":"12","hashOfConfig":"9"},{"size":3249,"mtime":1606848650428,"results":"13","hashOfConfig":"9"},{"size":3338,"mtime":1607016209869,"results":"14","hashOfConfig":"9"},{"size":293,"mtime":1607016257573,"results":"15","hashOfConfig":"9"},{"filePath":"16","messages":"17","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"pqxpq",{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"20","messages":"21","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"24","messages":"25","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"26","messages":"27","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\App.js",[],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\Home.js",[],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test.js",["30"],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\index.js",[],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test2.js",["31"],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\test3.js",["32"],"C:\\Users\\subin\\Desktop\\khuhub_color\\Find_your_own_personal_color\\front\\src\\spring.js",[],{"ruleId":"33","severity":1,"message":"34","line":1,"column":17,"nodeType":"35","messageId":"36","endLine":1,"endColumn":26},{"ruleId":"33","severity":1,"message":"37","line":2,"column":8,"nodeType":"35","messageId":"36","endLine":2,"endColumn":15},{"ruleId":"33","severity":1,"message":"37","line":2,"column":8,"nodeType":"35","messageId":"36","endLine":2,"endColumn":15},"no-unused-vars","'useEffect' is defined but never used.","Identifier","unusedVar","'console' is defined but never used."]
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -4,6 +4,10 @@ import Home from './Home'; ...@@ -4,6 +4,10 @@ import Home from './Home';
4 import Test from './test'; 4 import Test from './test';
5 import Test2 from './test2'; 5 import Test2 from './test2';
6 import Test3 from './test3'; 6 import Test3 from './test3';
7 +import Spring from './spring';
8 +import Summer from './summer';
9 +import Autumn from './autumn';
10 +import Winter from './winter';
7 11
8 12
9 class App extends Component { 13 class App extends Component {
...@@ -15,6 +19,10 @@ class App extends Component { ...@@ -15,6 +19,10 @@ class App extends Component {
15 <Route path="/test" exact component={Test} /> 19 <Route path="/test" exact component={Test} />
16 <Route path="/test2" exact component={Test2} /> 20 <Route path="/test2" exact component={Test2} />
17 <Route path="/test3" exact component={Test3} /> 21 <Route path="/test3" exact component={Test3} />
22 + <Route path="/spring?ver=<%=version%>" exact component={Spring} />
23 + <Route path="/summer?ver=0" exact component={Summer} />
24 + <Route path="/autumn?ver=0" exact component={Autumn} />
25 + <Route path="/winter?ver=0" exact component={Winter} />
18 </BrowserRouter> 26 </BrowserRouter>
19 </div> 27 </div>
20 ) 28 )
......
1 body 1 body
2 { 2 {
3 - background-image : url('main.png'); 3 + background-image : url('./main.png');
4 background-repeat : no-repeat; 4 background-repeat : no-repeat;
5 background-size : cover; 5 background-size : cover;
6 6
......
File mode changed
1 +body
2 + {
3 + background-image : url('./season/spring.jpg');
4 + background-repeat : no-repeat;
5 + background-size : cover;
6 +
7 + }
8 + @font-face
9 + {
10 + font-family: "title";
11 + src: url("Christmas Time Personal Use.ttf");
12 + }
13 + @font-face
14 + {
15 + font-family: "button";
16 + src: url("Monday Monkey.ttf");
17 + }
18 + #back_btn
19 + {
20 + border-top-left-radius: 5px;
21 + border-bottom-left-radius: 5px;
22 + border-top-right-radius: 5px;
23 + border-bottom-right-radius: 5px;
24 + font-family: "button";
25 + position: relative;
26 + top: -50px;
27 + left: 550px;
28 + }
29 + #btn_back
30 + {
31 + border: 1px;
32 + color:rgb(255, 255, 255);
33 + padding: 30px;
34 + align-items: center;
35 + text-align: center;
36 + font-size: 40px;
37 + background-color: rgba(255,255,255,0.5);
38 +
39 + }
40 + #btn_back:hover
41 + {
42 + background-color: rgb(167, 255, 246);
43 + }
...\ No newline at end of file ...\ No newline at end of file
1 +import React from 'react';
2 +import './spring.css?ver=1.3';
3 +
4 +const Spring = ( { history } ) =>
5 +{
6 + return (
7 + <div id="btn_back">
8 + <button id="back_btn" onClick={ () => {history.push("/")}}>back</button>
9 + </div>
10 + );
11 +}
12 +
13 +export default Spring;
...\ No newline at end of file ...\ No newline at end of file
File mode changed
...@@ -79,9 +79,8 @@ const handlePersonalScore_warm = (score_w_s,score_w_a) =>{ //함수3_여쿨, 겨 ...@@ -79,9 +79,8 @@ const handlePersonalScore_warm = (score_w_s,score_w_a) =>{ //함수3_여쿨, 겨
79 <span className='score-section'> 79 <span className='score-section'>
80 You scored {score} out of {questions_warm.length} 80 You scored {score} out of {questions_warm.length}
81 <button onClick={() => handlePersonalScore_warm(score_w_s,score_w_a)}>result</button> 81 <button onClick={() => handlePersonalScore_warm(score_w_s,score_w_a)}>result</button>
82 - {score === "spring warm" ? <ImageBackground source={require("./season/spring.jpg")} style={{width:"100%",height:"100%"}}> 82 + {score === "spring warm" ? <button onClick={ () => {history.push("/spring?ver=<%=version%>")}}>next</button>
83 - </ImageBackground> 83 + : <button onClick={ () => {history.push("/autumn")}}>next</button>}
84 - : <button onClick={ () => {history.push("/test3")}}>next</button>}
85 </span> 84 </span>
86 ) : ( 85 ) : (
87 <> 86 <>
......
File mode changed