MrMirror21

deploy 1.0.0

This diff is collapsed. Click to expand it.
...@@ -24,9 +24,7 @@ ...@@ -24,9 +24,7 @@
24 "web-vitals": "^0.2.4" 24 "web-vitals": "^0.2.4"
25 }, 25 },
26 "scripts": { 26 "scripts": {
27 - "start": "npm-run-all --parallel start:**", 27 + "start": "react-scripts start",
28 - "start:client": "react-scripts start",
29 - "start:server": "node ./server/app.js",
30 "build": "react-scripts build", 28 "build": "react-scripts build",
31 "test": "react-scripts test", 29 "test": "react-scripts test",
32 "eject": "react-scripts eject" 30 "eject": "react-scripts eject"
......
1 -const express = require('express');
2 -const bodyParser = require('body-parser')
3 -const app = express();
4 -const api = require('./routes/index');
5 -
6 -app.use(bodyParser.json());
7 -app.use('/api', api);
8 -
9 -const port = 3001;
10 -app.listen(port, () => console.log(`Listening on port ${port}`));
...\ No newline at end of file ...\ No newline at end of file
1 -const express = require('express');
2 -const router = express.Router();
3 -
4 -router.get('/', (req, res) => res.json({data:'this is index.'}));
5 -
6 -module.exports = router
...\ No newline at end of file ...\ No newline at end of file
...@@ -52,13 +52,13 @@ const checkStraight = (resData, position) => { //resData: API로 받은 JSON 객 ...@@ -52,13 +52,13 @@ const checkStraight = (resData, position) => { //resData: API로 받은 JSON 객
52 var d_right = distance(x_position[ear + 1], y_position[ear + 1], x_position[shoulder + 1], y_position[shoulder + 1]); 52 var d_right = distance(x_position[ear + 1], y_position[ear + 1], x_position[shoulder + 1], y_position[shoulder + 1]);
53 var gap = difference(d_left, d_right); 53 var gap = difference(d_left, d_right);
54 54
55 - if (gap >= 20) { //기운 각도가 20도를 넘을 경우 55 + if (gap >= 15) { //기운 각도가 15도를 넘을 경우
56 if (d_left > d_right) { //오른쪽으로 기울인 경우 56 if (d_left > d_right) { //오른쪽으로 기울인 경우
57 return 'leaning right by ' + gap + 'percent.'; 57 return 'leaning right by ' + gap + 'percent.';
58 } else if (d_left < d_right) { //왼쪽으로 기울인 경우 58 } else if (d_left < d_right) { //왼쪽으로 기울인 경우
59 return 'leaning left by ' + gap + 'percent.'; 59 return 'leaning left by ' + gap + 'percent.';
60 } 60 }
61 - } else { //기운 각도가 20도 미만인 경우 61 + } else { //기운 각도가 15도 미만인 경우
62 return 'okay'; 62 return 'okay';
63 } 63 }
64 64
......
1 -.App {
2 - text-align: center;
3 -}
4 -
5 -.App-logo {
6 - height: 40vmin;
7 - pointer-events: none;
8 -}
9 -
10 -@media (prefers-reduced-motion: no-preference) {
11 - .App-logo {
12 - animation: App-logo-spin infinite 20s linear;
13 - }
14 -}
15 -
16 -.App-header {
17 - background-color: #282c34;
18 - min-height: 100vh;
19 - display: flex;
20 - flex-direction: column;
21 - align-items: center;
22 - justify-content: center;
23 - font-size: calc(10px + 2vmin);
24 - color: white;
25 -}
26 -
27 -.App-link {
28 - color: #61dafb;
29 -}
30 -
31 -@keyframes App-logo-spin {
32 - from {
33 - transform: rotate(0deg);
34 - }
35 - to {
36 - transform: rotate(360deg);
37 - }
38 -}
1 import React from 'react' 1 import React from 'react'
2 import './style/Landing.css'; 2 import './style/Landing.css';
3 -import { Link } from 'react-router-dom'; // for test
4 import Button from './components/Button'; 3 import Button from './components/Button';
5 import Header from './components/Header'; 4 import Header from './components/Header';
6 export default function Landing() { 5 export default function Landing() {
...@@ -9,15 +8,13 @@ export default function Landing() { ...@@ -9,15 +8,13 @@ export default function Landing() {
9 <div className="Landingbg"> 8 <div className="Landingbg">
10 <Header /> 9 <Header />
11 <div className="mainTextContainer"> 10 <div className="mainTextContainer">
12 -
13 <h1 className="mainText">Welcome to Straight Up</h1> 11 <h1 className="mainText">Welcome to Straight Up</h1>
14 <span className="mainText">We support posture correction for you.</span> 12 <span className="mainText">We support posture correction for you.</span>
15 - <Button btnText="Get Started!"/> 13 + <Button btnText="Get Started!" />
16 - {/* for test */}
17 <div className="mainBtnContainer"> 14 <div className="mainBtnContainer">
18 - <Link to="/result"> 15 + <a target="blank" href="http://khuhub.khu.ac.kr/2019102240/Straight-Up">
19 - <button className="startBtn">To Result</button> 16 + <button className="startBtn">Contact Us</button>
20 - </Link> 17 + </a>
21 </div> 18 </div>
22 </div> 19 </div>
23 </div> 20 </div>
......
...@@ -9,8 +9,8 @@ import './style/Main.css'; ...@@ -9,8 +9,8 @@ import './style/Main.css';
9 require('dotenv').config(); 9 require('dotenv').config();
10 10
11 const axios = require('axios'); 11 const axios = require('axios');
12 -const API_KEY = "1f14e860f7f53f39a4dfe0a2a919a8c7"; 12 +const API_KEY = process.env.REACT_APP_APIKEY;
13 -//process.env.api_key; 13 +console.log(API_KEY);
14 let imageFormData = new FormData(); 14 let imageFormData = new FormData();
15 15
16 export default function Main() { 16 export default function Main() {
...@@ -86,10 +86,16 @@ export default function Main() { ...@@ -86,10 +86,16 @@ export default function Main() {
86 <h3>측면 사진 - 오른쪽</h3> 86 <h3>측면 사진 - 오른쪽</h3>
87 <Checkbox checked={selectedPosition === "right"} onChange={(isChecked) => { isChecked ? setPosition('right') : setPosition(undefined) }} /> 87 <Checkbox checked={selectedPosition === "right"} onChange={(isChecked) => { isChecked ? setPosition('right') : setPosition(undefined) }} />
88 </div> 88 </div>
89 + <div className="Caution">
90 + <p>-- 이미지 업로드 유의사항 --</p>
91 + <p>1. 업로드 되는 이미지는 JPEG, PNG 포맷만 지원합니다.</p>
92 + <p>2. 업로드할 있는 이미지의 최대 용량은 2MB입니다.</p>
93 + <p>3. 이미지의 권장 비율은 가로:세로 기준 16:9 ~ 9:16 입니다.</p>
94 + <p>4. 이미지의 가로와 세로 길이는 320px~2048px 범위 내여야 합니다.</p>
95 + </div>
89 <Link to="/result"> 96 <Link to="/result">
90 <button className="startBtn" type="button" onClick={analysisImage}>Submit</button> 97 <button className="startBtn" type="button" onClick={analysisImage}>Submit</button>
91 </Link> 98 </Link>
92 -
93 </div> 99 </div>
94 </div> 100 </div>
95 ) 101 )
......
...@@ -23,15 +23,12 @@ const ResultContent = (props) => { ...@@ -23,15 +23,12 @@ const ResultContent = (props) => {
23 } 23 }
24 else if (headLetters === "leani") { 24 else if (headLetters === "leani") {
25 return <ResultForLn direction={direction} /> 25 return <ResultForLn direction={direction} />
26 -
27 } 26 }
28 else if (resultStr === "bent-neck") { 27 else if (resultStr === "bent-neck") {
29 return <ResultForBn />; 28 return <ResultForBn />;
30 -
31 } 29 }
32 else if (resultStr === "bent-back") { 30 else if (resultStr === "bent-back") {
33 return <ResultForBb />; 31 return <ResultForBb />;
34 -
35 } 32 }
36 else { 33 else {
37 return <ResultForErr />; 34 return <ResultForErr />;
......
...@@ -13,7 +13,6 @@ const ResultForErr = () => { ...@@ -13,7 +13,6 @@ const ResultForErr = () => {
13 <p>다시 시도해주시기 바랍니다.</p> 13 <p>다시 시도해주시기 바랍니다.</p>
14 <RetryBtn btnText="Try Again" /> 14 <RetryBtn btnText="Try Again" />
15 </div> 15 </div>
16 -
17 </div> 16 </div>
18 ) 17 )
19 } 18 }
......
...@@ -13,7 +13,6 @@ const ResultForErr = () => { ...@@ -13,7 +13,6 @@ const ResultForErr = () => {
13 <p>주의사항에 맞게 사진을 업로드했는지 확인해주세요.</p> 13 <p>주의사항에 맞게 사진을 업로드했는지 확인해주세요.</p>
14 <RetryBtn btnText="Try Again" /> 14 <RetryBtn btnText="Try Again" />
15 </div> 15 </div>
16 -
17 </div> 16 </div>
18 ) 17 )
19 } 18 }
......
...@@ -14,7 +14,7 @@ const RetryBtn = (props) => { ...@@ -14,7 +14,7 @@ const RetryBtn = (props) => {
14 return ( 14 return (
15 <div className="mainBtnContainer"> 15 <div className="mainBtnContainer">
16 <Link to="/main"> 16 <Link to="/main">
17 - <button className="startBtn" onClick={reset}>{props.btnText}</button> 17 + <button className="startBtn" onClick={reset}>{props.btnText}</button>
18 </Link> 18 </Link>
19 </div> 19 </div>
20 ) 20 )
......
1 -const proxy = require('http-proxy-middleware');
2 -
3 -module.exports = function (app) {
4 - app.use(
5 - proxy('/api', {
6 - target: 'http://localhost:3001/'
7 - })
8 - );
9 -};
...\ No newline at end of file ...\ No newline at end of file
...@@ -28,16 +28,16 @@ body { ...@@ -28,16 +28,16 @@ body {
28 } 28 }
29 29
30 .ImagePreview{ 30 .ImagePreview{
31 - width: 400px; 31 + width: 300px;
32 height: 400px; 32 height: 400px;
33 background-color: #efefef; 33 background-color: #efefef;
34 + border-radius: 15px;
34 } 35 }
35 36
36 .PositionSelector { 37 .PositionSelector {
37 display: flex; 38 display: flex;
38 justify-content: center; 39 justify-content: center;
39 align-items: center; 40 align-items: center;
40 - padding: 1rem;
41 } 41 }
42 42
43 .Checkbox { 43 .Checkbox {
...@@ -47,4 +47,8 @@ body { ...@@ -47,4 +47,8 @@ body {
47 h3{ 47 h3{
48 color: white; 48 color: white;
49 padding: 1rem; 49 padding: 1rem;
50 -}
...\ No newline at end of file ...\ No newline at end of file
50 +}
51 +
52 +.Caution{
53 + color: pink;
54 +}
......