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-01 17:58:57 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7444a56cd2e4656ff9b8cf6513f9331767c2be1f
7444a56c
1 parent
293bfa33
sidechat-demo-positioning
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
4 deletions
client/src/Component/SideChat.css
client/src/Component/SideChat.js
client/src/Component/App.js → client/src/Component/TopBanner.js
client/src/index.js
client/src/Component/SideChat.css
0 → 100644
View file @
7444a56
.SideChat
{
color
:
yellow
;
background-color
:
gray
;
position
:
absolute
;
z-index
:
999
;
right
:
100px
;
top
:
0px
;
transition
:
0ms
;
}
.scrollmake
{
height
:
1200px
;
width
:
100px
;
background-color
:
red
;
}
\ No newline at end of file
client/src/Component/SideChat.js
0 → 100644
View file @
7444a56
import
'./App.css'
;
import
axios
from
"axios"
;
import
{
useEffect
}
from
'react'
;
import
'./SideChat.css'
const
scrollChat
=
()
=>
{
let
scrollY
;
const
sideChat
=
document
.
getElementsByClassName
(
'SideChat'
)[
0
];
scrollY
=
window
.
scrollY
+
window
.
outerHeight
/
2
;
sideChat
.
style
.
top
=
scrollY
+
"px"
;
document
.
addEventListener
(
'scroll'
,
()
=>
{
sideChat
.
style
.
transition
=
'800ms'
;
scrollY
=
window
.
scrollY
+
window
.
outerHeight
/
2
;
sideChat
.
style
.
top
=
scrollY
+
"px"
;
});
}
function
SideChat
()
{
const
callApi
=
async
()
=>
{
axios
.
get
(
"/api"
).
then
((
res
)
=>
{
console
.
log
(
res
.
data
.
test
)});
};
useEffect
(()
=>
{
callApi
();
scrollChat
();
},
[]);
return
(
<
div
>
<
div
className
=
'SideChat'
height
=
"100px"
width
=
"100px"
style
=
{{
background
:
"gray"
}}
>
하이
<
/div
>
<
div
className
=
'scrollmake'
>
바보
<
/div
>
<
/div
>
);
}
export
default
SideChat
;
\ No newline at end of file
client/src/Component/
App
.js
→
client/src/Component/
TopBanner
.js
View file @
7444a56
...
...
@@ -4,7 +4,7 @@ import { useEffect } from 'react';
import
{
Navbar
,
Container
,
NavDropdown
,
Nav
}
from
'react-bootstrap'
import
khuimg
from
'../img/khumeal.png'
function
App
()
{
function
TopBanner
()
{
const
callApi
=
async
()
=>
{
axios
.
get
(
"/api"
).
then
((
res
)
=>
{
console
.
log
(
res
.
data
.
test
)});
};
...
...
@@ -32,4 +32,4 @@ function App() {
);
}
export
default
App
;
\ No newline at end of file
export
default
TopBanner
;
\ No newline at end of file
...
...
client/src/index.js
View file @
7444a56
import
React
from
'react'
;
import
ReactDOM
from
'react-dom/client'
;
import
'./index.css'
;
import
App
from
'./Component/App'
;
import
TopBanner
from
'./Component/TopBanner'
;
import
SideChat
from
'./Component/SideChat'
;
import
reportWebVitals
from
'./reportWebVitals'
;
import
'bootstrap/dist/css/bootstrap.min.css'
;
const
root
=
ReactDOM
.
createRoot
(
document
.
getElementById
(
'root'
));
root
.
render
(
<
React
.
StrictMode
>
<
App
/>
<
div
className
=
'Screen'
style
=
{{
width
:
'100vw'
,
height
:
'100vh'
}}
>
<
TopBanner
/>
<
SideChat
/>
<
/div
>
<
/React.StrictMode
>
);
...
...
Please
register
or
login
to post a comment