File tree Expand file tree Collapse file tree 8 files changed +31
-63
lines changed Expand file tree Collapse file tree 8 files changed +31
-63
lines changed Original file line number Diff line number Diff line change 3
3
width : 100vw ;
4
4
}
5
5
6
- /* #sidebar * {
7
- margin-bottom: 6px;
8
- } */
9
-
10
- /* #sidebar h1 {
11
- margin-top: '20px';
12
- background: #7F7FD5;
13
- background: -webkit-linear-gradient(to right, #91EAE4, #86A8E7, #7F7FD5);
14
- background: linear-gradient(to right, #91EAE4, #86A8E7, #7F7FD5);
15
- background-clip: text;
16
- -webkit-background-clip: text;
17
- -webkit-text-fill-color: transparent;
18
- } */
19
-
20
- # linewidth {
21
- margin-top : 10px !important ;
22
- }
23
-
24
6
# container {
25
7
height : 100% ;
26
8
display : flex;
27
9
width : 100% ;
28
10
}
29
11
30
- /* #sidebar{
31
- display: flex;
32
- flex-direction: column;
33
- padding: 5px;
34
- width: 250px;
35
- background-color: #202020;
36
- padding-left: 15px;
37
- } */
38
- .input-container {
39
- display : block;
40
- margin-top : 40px ;
41
- }
42
-
43
- .input-container label {
44
- display : block;
45
- color : white;
46
- }
47
-
48
- .input-container input {
49
- display : block;
50
- width : 60% ;
51
- }
52
-
53
- # clear {
54
- display : block;
55
- width : 60% ;
56
- margin-top : 20px ;
57
- }
58
-
59
12
60
13
61
14
Original file line number Diff line number Diff line change 1
- import { useEffect , useRef } from "react" ;
1
+ import { useEffect , useRef , useState } from "react" ;
2
2
import "./App.css" ;
3
3
import { io } from "socket.io-client" ;
4
4
5
5
const socket = io ( "http://localhost:8000" ) ;
6
6
7
- import Header from "./components/Header" ;
8
- import Toolbar from "./components/Toolbar" ;
9
- import Socials from "./components/Socials" ;
10
- import LoginAndLogout from "./components/LoginAndLogout" ;
11
7
import Sidebar from "./components/Sidebar" ;
12
8
import Canvas from "./components/Canvas" ;
9
+ import Menu from "./components/Menu" ;
13
10
14
11
function App ( ) {
12
+
13
+ const [ showMenu , setShowMenu ] = useState ( false ) ;
14
+
15
+ function toggleMenu ( ) {
16
+ setShowMenu ( ! showMenu ) ;
17
+ }
18
+
15
19
const canvasRef = useRef ( null ) ;
16
20
const sidebarRef = useRef ( null ) ;
17
21
let color = '#000000'
@@ -124,8 +128,10 @@ function App() {
124
128
clearOnClick = { clearOnClick }
125
129
ref = { sidebarRef }
126
130
id = "clear"
131
+ toggleMenu = { toggleMenu }
127
132
> </ Sidebar >
128
133
< Canvas canvasRef = { canvasRef } > </ Canvas >
134
+ { showMenu && < Menu > </ Menu > }
129
135
</ div >
130
136
) ;
131
137
}
Original file line number Diff line number Diff line change 1
1
/* eslint-disable react/prop-types */
2
+ import Menu from "./Menu" ;
3
+
2
4
function Canvas ( props ) {
3
5
return (
4
6
< div className = "flex justify-center items-center h-full w-80vw overflow-hidden" >
5
7
< canvas
6
8
className = "h-full w-86vw bg-yellow-600"
7
9
ref = { props . canvasRef }
8
10
> </ canvas >
11
+ { props . showMenu && < Menu > </ Menu > }
9
12
</ div >
10
13
) ;
11
14
}
Original file line number Diff line number Diff line change
1
+ /* eslint-disable react/prop-types */
1
2
import { FaBars } from "react-icons/fa" ;
2
3
3
- function Header ( ) {
4
+ function Header ( props ) {
4
5
return (
5
6
< div className = "flex py-5 justify-around bg-gradient-to-r from-indigo-500 from-10% via-sky-500 via-30% to-emerald-500 to-90% w-full items-center" >
6
7
< h1 className = "font-sans text-2xl antialiased font-extrabold text-white" >
7
8
drawRTC
8
9
</ h1 >
9
10
< div className = "" id = "options" >
10
- < FaBars size = { 25 } />
11
+ < FaBars size = { 25 } onClick = { props . toggleMenu } />
11
12
</ div >
12
13
</ div >
13
14
) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import Socials from "./Socials";
3
3
4
4
function Menu ( ) {
5
5
return (
6
- < div className = "w-20 h-auto bg-white z-100 " >
6
+ < div className = "w-52 h-56 rounded-xl bg-gradient-to-r from-slate-900 to-slate-700 absolute left-52 top-8 rounded-lg shadow-xl " >
7
7
< MenuItem feat = "Start Collaboration" > </ MenuItem >
8
8
< MenuItem feat = "Start Chat" > </ MenuItem >
9
9
< MenuItem feat = "Save as pdf" > </ MenuItem >
Original file line number Diff line number Diff line change 1
1
/* eslint-disable react/prop-types */
2
2
function MenuItem ( props ) {
3
- return (
4
- < div >
5
- < h1 > { props . feat } </ h1 >
6
- </ div >
7
- )
3
+ return (
4
+ < div className = "h-11 w-15 border-b border-dotted cursor-pointer content-center" >
5
+ < h1 className = "font-sans text-white justify-center flex" >
6
+ { props . feat }
7
+ </ h1 >
8
+ </ div >
9
+ ) ;
8
10
}
9
11
10
12
export default MenuItem ;
Original file line number Diff line number Diff line change @@ -5,8 +5,11 @@ import LoginAndLogout from "./LoginAndLogout";
5
5
6
6
function Sidebar ( props ) {
7
7
return (
8
- < div className = "flex flex-col w-64 bg-zinc-800 relative" ref = { props . ref } >
9
- < Header > </ Header >
8
+ < div
9
+ className = "flex flex-col w-64 bg-gradient-to-r from-slate-900 to-slate-700 relative"
10
+ ref = { props . ref }
11
+ >
12
+ < Header toggleMenu = { props . toggleMenu } > </ Header >
10
13
< Toolbar clearOnClick = { props . clearOnClick } id = { props . id } > </ Toolbar >
11
14
< LoginAndLogout > </ LoginAndLogout >
12
15
</ div >
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ function Socials(){
15
15
</ h1 >
16
16
< img
17
17
src = { Xlogo }
18
- className = "h-6 w-6 rounded cursor-pointer"
18
+ className = "h-5 w-5 rounded cursor-pointer"
19
19
onClick = { clickHandler }
20
20
> </ img >
21
21
</ div >
You can’t perform that action at this time.
0 commit comments