Toggle navigation
Toggle navigation
This project
Loading...
Sign in
최은석
/
ossw-project
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
채지성
2022-06-04 17:20:02 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
2ac98b6c4e5cf1e7d53dfc8047484f6744d5358f
2ac98b6c
1 parent
88520052
writing-complete
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
4 deletions
client/src/Component/SideChat.js
client/src/Component/mainpage.css
client/src/Component/mainpage.js
client/src/index.css
client/src/Component/SideChat.js
View file @
2ac98b6
...
...
@@ -63,7 +63,7 @@ const scrollChat = () => {
sideChat
.
style
.
top
=
scrollY
+
"px"
;
const
reposition
=
()
=>
{
// 화면 크기 바뀔때도 이래야함--> 추후수정
sideChat
.
style
.
transition
=
'
8
00ms'
;
sideChat
.
style
.
transition
=
'
5
00ms'
;
scrollY
=
window
.
scrollY
+
document
.
body
.
scrollHeight
/
5
-
50
;
sideChat
.
style
.
top
=
scrollY
+
"px"
;
}
...
...
client/src/Component/mainpage.css
View file @
2ac98b6
...
...
@@ -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
...
...
client/src/Component/mainpage.js
View file @
2ac98b6
...
...
@@ -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
>
...
...
client/src/index.css
View file @
2ac98b6
...
...
@@ -15,9 +15,9 @@ code {
*
{
margin
:
0px
;
padding
:
0px
;
/*
border-style: solid;
border-color: black;
border-width: 5px;
*/
}
...
...
Please
register
or
login
to post a comment