채지성

writing-complete

......@@ -63,7 +63,7 @@ const scrollChat = () => {
sideChat.style.top = scrollY + "px";
const reposition = () => { // 화면 크기 바뀔때도 이래야함--> 추후수정
sideChat.style.transition = '800ms';
sideChat.style.transition = '500ms';
scrollY = window.scrollY + document.body.scrollHeight / 5 - 50;
sideChat.style.top = scrollY + "px";
}
......
......@@ -72,4 +72,10 @@
.mainpage :nth-child(1) :nth-child(2),
.mainpage :nth-child(2) :nth-child(1){
background-color: #FFE4b1;
}
.mainpage :nth-child(2) :nth-child(2) {
display:flex;
flex-direction: column;
background-color: #FDF5E6;
}
\ No newline at end of file
......
......@@ -3,15 +3,23 @@ import axios from "axios";
import { useEffect, useState } from 'react';
import './MainPage.css'
function InnerContent(props){
return (
<div>
<div style={{fontSize:'15px', height: '10px', width:'100%', backgroundColor:'#FDF5E6'}}>{props.title} {props.content}</div>
</div>
);
}
function MainPage() {
const [list, setList] = useState([]);
const [list, setList] = useState([{title: '하이', content: '바보'},{title: '하이2', content: '바보2'},{title: '하이3', content: '바보3'}]);
let currentYear = new Date().getFullYear();
let currentMonth = new Date().getMonth();
let currentDate = new Date().getDate();
let today = currentYear+'/'+currentMonth+'/'+currentDate;
const todayMealTable = async()=>{
axios.get("/api/todayMenu").then(
(res) => {
......@@ -46,8 +54,16 @@ function MainPage() {
)
};
const todayInnerContent = async()=>{ // 게시글 목록 가져오기
axios.get('/api/get').then((res) => {
console.log(res.data);
}
);
}
useEffect(()=>{
todayMealTable();
todayInnerContent();
}, []);
return (
......@@ -68,6 +84,11 @@ function MainPage() {
<div className='mainpageUnder'>
<div>메뉴에 대한 이야기</div>
<div>
{list.map((item,index)=>{
return(
<InnerContent key={index} title={item.title} content={item.content}/>
)
})}
</div>
</div>
</div>
......
......@@ -15,9 +15,9 @@ code {
*{
margin:0px;
padding:0px;
/*
border-style: solid;
border-color: black;
border-width: 5px;
*/
}
......