-
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 'develop' into feat-personalGoal
- Loading branch information
Showing
18 changed files
with
422 additions
and
99 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,36 @@ | ||
@use '../../lib/styles/palette' as *; | ||
|
||
.top_bar { | ||
display: flex; | ||
width: 334px; | ||
height: 31px; | ||
justify-content: space-between; | ||
align-items: center; | ||
flex-shrink: 0; | ||
|
||
color: $black-color; | ||
font-family: Inter; | ||
font-size: 20px; | ||
font-style: normal; | ||
font-weight: 600; | ||
line-height: normal; | ||
|
||
.pay { | ||
display: flex; | ||
align-items: center; | ||
gap: 4px; | ||
} | ||
|
||
.setting { | ||
display: flex; | ||
align-items: center; | ||
gap: 8px; | ||
} | ||
} | ||
.info { | ||
color: $dark-gray-color; | ||
font-size: 13px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: normal; | ||
} |
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,9 +1,30 @@ | ||
import { useState } from 'react'; | ||
import styles from './header.module.scss' | ||
|
||
export default function Header() { | ||
return ( | ||
<div> | ||
|
||
|
||
export default function Header({pageName, info}: {pageName: string, info: string}) { | ||
|
||
return ( | ||
<div> | ||
<div className={styles.top_bar}> | ||
<div className={styles.pay}> | ||
<span>{pageName}</span> | ||
</div> | ||
<div className={styles.setting}> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="27" height="27" viewBox="0 0 27 27" fill="none"> | ||
<path d="M7.25382 8.9656C7.60746 5.78286 10.2977 3.375 13.5 3.375V3.375C16.7023 3.375 19.3925 5.78286 19.7462 8.9656L20.0295 11.5151C20.0331 11.5476 20.0349 11.5638 20.0367 11.5799C20.1818 12.8441 20.5933 14.0631 21.244 15.1566C21.2523 15.1705 21.2607 15.1845 21.2775 15.2125L21.9278 16.2963C22.5179 17.2799 22.813 17.7716 22.7493 18.1753C22.7069 18.444 22.5687 18.6881 22.3601 18.8627C22.0467 19.125 21.4732 19.125 20.3262 19.125H6.67376C5.52677 19.125 4.95327 19.125 4.63988 18.8627C4.43135 18.6881 4.2931 18.444 4.25071 18.1753C4.18702 17.7716 4.48208 17.2799 5.0722 16.2963L5.72249 15.2125C5.73931 15.1845 5.74772 15.1705 5.756 15.1566C6.40674 14.0631 6.81822 12.8441 6.96328 11.5799C6.96513 11.5638 6.96693 11.5476 6.97055 11.5151L7.25382 8.9656Z" stroke="#535353" stroke-width="2.25"/> | ||
<path d="M9 19.125C9 19.7159 9.1164 20.3011 9.34254 20.8471C9.56869 21.393 9.90016 21.8891 10.318 22.307C10.7359 22.7248 11.232 23.0563 11.7779 23.2825C12.3239 23.5086 12.9091 23.625 13.5 23.625C14.0909 23.625 14.6761 23.5086 15.2221 23.2825C15.768 23.0563 16.2641 22.7248 16.682 22.307C17.0998 21.8891 17.4313 21.393 17.6575 20.8471C17.8836 20.3011 18 19.7159 18 19.125" stroke="#535353" stroke-width="2.25" stroke-linecap="round"/> | ||
</svg> | ||
<svg xmlns="http://www.w3.org/2000/svg" width="27" height="27" viewBox="0 0 27 27" fill="none"> | ||
<path d="M3.4669 15.6876C2.8721 14.6183 2.5747 14.0837 2.5747 13.5C2.5747 12.9163 2.8721 12.3817 3.4669 11.3124L4.9848 8.58375L6.58896 5.90486C7.21755 4.85513 7.53185 4.33026 8.03735 4.03841C8.54284 3.74656 9.15454 3.73681 10.3779 3.71729L13.5 3.6675L16.6221 3.71729C17.8455 3.73681 18.4572 3.74656 18.9626 4.03841C19.4681 4.33026 19.7824 4.85513 20.411 5.90486L22.0152 8.58375L23.5331 11.3124C24.1279 12.3817 24.4253 12.9163 24.4253 13.5C24.4253 14.0837 24.1279 14.6183 23.5331 15.6876L22.0152 18.4162L20.411 21.0951C19.7824 22.1449 19.4681 22.6697 18.9627 22.9616C18.4572 23.2534 17.8455 23.2632 16.6221 23.2827L13.5 23.3325L10.3779 23.2827C9.15454 23.2632 8.54285 23.2534 8.03735 22.9616C7.53185 22.6697 7.21756 22.1449 6.58896 21.0951L4.9848 18.4163L3.4669 15.6876Z" stroke="#535353" stroke-width="2.25"/> | ||
<circle cx="13.5" cy="13.5" r="3.375" stroke="#535353" stroke-width="2.25"/> | ||
</svg> | ||
</div> | ||
); | ||
} | ||
|
||
</div> | ||
<span className={styles.info}>{info}</span> | ||
</div> | ||
|
||
); | ||
} | ||
|
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,7 +1,6 @@ | ||
@use '../../lib/styles/palette' as *; | ||
|
||
.fakeEl{ | ||
height: 62px; | ||
} | ||
.navbar { | ||
display: flex; | ||
|
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,49 @@ | ||
import { NextResponse } from 'next/server'; | ||
import axios from 'axios'; | ||
|
||
export async function POST(request) { | ||
const { goal, status } = await request.json(); | ||
|
||
try { | ||
const response = await axios.post( | ||
'https://api.openai.com/v1/chat/completions', | ||
{ | ||
model: 'gpt-4o-mini', | ||
messages: [ | ||
{ | ||
role: 'system', | ||
content: '너는 운동, 식단, 잠관리를 해주는 앱의 어시스턴트야.' | ||
}, | ||
{ | ||
role: 'user', | ||
content: ` | ||
goal: ${JSON.stringify(goal)} | ||
status: ${JSON.stringify(status)} | ||
위의 goal과 status를 0부터 100까지의 점수로 변환해줘. | ||
goal은 사용자가 지정한 목표를 나타내고, status는 사용자의 현재 상태를 나타내. | ||
0은 아무것도 하지 않았거나 아무것도 달성하지 못했을 때, 100은 목표를 완벽하게 달성했을 때를 의미해. | ||
칼로리가 너무 적거나 너무 커도, 자는 시간이 너무 적거나 너무 많아도 안돼. | ||
운동은 얼마나 하든 괜찮아 | ||
프로그램에서 사용되는거니까 다른말은 하지말고 0부터 100까지의 정수로만 변환해줘. | ||
` | ||
} | ||
], | ||
max_tokens: 256, | ||
temperature: 0.7, | ||
}, | ||
{ | ||
headers: { | ||
'Authorization': `Bearer ${process.env.OPENAI_API_KEY}`, | ||
'Content-Type': 'application/json', | ||
}, | ||
} | ||
); | ||
|
||
const score = response.data.choices[0].message.content.trim(); | ||
return NextResponse.json({ score }); | ||
} catch (error) { | ||
console.error(error); | ||
return NextResponse.json({ error: 'Error generating score' }, { status: 500 }); | ||
} | ||
} |
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
Oops, something went wrong.