File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
1616 -->
1717 < link rel ="manifest " href ="%PUBLIC_URL%/manifest.json " />
18+ <!-- Compiled and minified CSS -->
19+ < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css ">
1820 <!--
1921 Notice the use of %PUBLIC_URL% in the tags above.
2022 It will be replaced with the URL of the `public` folder during the build.
Original file line number Diff line number Diff line change 1111 align-items: center;
1212 justify-content: center;
1313 font-size: calc(10px + 2vmin);
14- } */
14+ } */
15+
16+
17+
Original file line number Diff line number Diff line change @@ -20,3 +20,4 @@ function App()
2020}
2121
2222export default App ;
23+
Original file line number Diff line number Diff line change 1+ .Chat {
2+ background-color : lightcyan;
3+ color : black;
4+ padding : 40px ;
5+ text-align : center;
6+ border-style : solid;
7+ width : 500px ;
8+ height : 600px ;
9+ overflow-y : auto;
10+ margin : 50px ;
11+ top : -40px ;
12+ }
13+
14+ * : focus {
15+ outline : none;
16+ }
17+
18+ .Chat {
19+ border-width : 3px ;
20+ margin-top : 20px ;
21+ margin-bottom : 20px ;
22+ margin-left : 20px ;
23+ margin-right : 20px ;
24+ padding-top : 10px ;
25+ padding-bottom : 15px ;
26+ padding-right : 20px ;
27+ padding-left : 15px ;
28+ border-radius : 15px ;
29+ border : 1px solid lightgrey;
30+ }
31+
32+ /* total width */
33+ .Chat ::-webkit-scrollbar {
34+ width : 16px
35+ }
36+
37+
38+ /* scrollbar itself */
39+ .Chat ::-webkit-scrollbar-thumb {
40+ background-color : # babac0 ;
41+ border-radius : 16px ;
42+ border : 4px solid # babac0 ;
43+ }
44+
45+ /* set button(top and bottom of the scrollbar) */
46+ .Chat ::-webkit-scrollbar-button {display : none}
47+
48+ .username {
49+ color : # cc0066 ;
50+ text-transform : uppercase;
51+ font-weight : bold;
52+ }
53+
54+ .playername {
55+ color : # 0000cc ;
56+ text-transform : uppercase;
57+ font-weight : bold;
58+ }
59+
60+
61+
62+
Original file line number Diff line number Diff line change 11import React , { useEffect , useState } from "react" ;
2+ import './Chat.css' ;
23
34export default function Chat ( props )
45{
@@ -52,19 +53,19 @@ export default function Chat(props)
5253 } , [ ] ) ;
5354
5455 return (
55- < div >
56- Welcome, < strong > { props . userName } </ strong >
56+ < div className = "Chat" >
57+ < span className = "welcomemsg" > Welcome, < strong className = "username" > { props . userName } </ strong > </ span >
5758 < form onSubmit = { onSubmit } >
5859 < input type = "text" placeholder = "Chat Here" onChange = { onChange } />
5960 </ form >
6061 Messages:< br />
6162 { messages . map ( msg =>
62- < div >
63+ < div className = "otherUser" >
6364 { msg . player . name !== props . userName ?
64- < a href = { msg . player . name } onClick = { event => onClick ( event , msg . player ) } > < strong > { msg . player . name } </ strong > </ a > :
65- < strong > { msg . player . name } </ strong >
65+ < a href = { msg . player . name } onClick = { event => onClick ( event , msg . player ) } > < strong className = "playername" > { msg . player . name } </ strong > </ a > :
66+ < strong className = "username" > { msg . player . name } </ strong >
6667 }
67- < br />
68+ :
6869 { msg . chatMsg }
6970 </ div >
7071 ) }
Original file line number Diff line number Diff line change 1+ .login {
2+ min-height : 100vh ;
3+ display : flex;
4+ flex-direction : column;
5+ align-items : center;
6+ justify-content : center;
7+ text-align : center;
8+
9+ }
10+
11+ /*
12+ .logo {
13+ position: absolute;
14+ left: 50%;
15+ margin-left: -50px;
16+ top: 50%;
17+ margin-top: -50px;
18+ }
19+ */
20+
21+ /*
22+ .main{
23+ display: grid;
24+ grid-template-columns: repeat(3, 1fr);
25+ grid-gap: 10px;
26+ grid-auto-rows: minmax(100px, auto);
27+ }
28+
29+
30+ .two {
31+ grid-column: 1 / 3;
32+ grid-row: 1;
33+ }
34+
35+
36+ .three {
37+ grid-column: 2 / 4;
38+ grid-row: 1 / 3;
39+ }
40+
41+ */
42+
43+ .main {
44+ display : grid;
45+ grid-template-columns : repeat (3 , 1fr );
46+ grid-gap : 15px ;
47+ grid-auto-rows : minmax (100px , auto);
48+ margin : 2rem ;
49+ }
50+
51+ .one {
52+ grid-column : 2 ;
53+ grid-row : 1 ;
54+ justify-self : center;
55+ }
56+
57+ .two {
58+ grid-column : 2 ;
59+ grid-row : 2 / 5 ;
60+ position : relative;
61+ right : 240px ;
62+ resize : both;
63+
64+ }
65+
66+ .three {
67+ grid-column : 3 ;
68+ grid-row : 2 / 3 ;
69+ position : relative;
70+ right : 250px ;
71+ top : 24px ;
72+
73+ }
74+
75+ .four {
76+ grid-column : 1 ;
77+ grid-row : 3 ;
78+ position : adsolute;
79+ bottom : 0 ;
80+ left : 0 ;
81+ }
82+
83+
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ import socketIOClient from "socket.io-client";
33import Chat from "../Chat/Chat" ;
44import Notepad from "../Notepad/Notepad" ;
55import Music from "../Music/Music" ;
6+ import share_my_code from './share_my_code.png' ;
7+ import "./Client.css"
68
79let ENDPOINT ;
810
@@ -57,20 +59,23 @@ export default function Client()
5759 return (
5860 < div >
5961 { ! isLoggedIn ?
60- < div >
62+ < div className = "login" >
6163 < form onSubmit = { onSubmit } >
6264 Enter a Username:< br />
6365 < input type = "text" name = "input" placeholder = "Username" />
64- < button type = "submit" > Enter the Chat</ button >
66+ < button class = "btn waves-effect waves-light" type = "submit" name = "action" > Enter the Chat
67+ < i class = "material-icons right" > send</ i >
68+ </ button >
6569 </ form >
6670 < br />
6771 { errorMsg }
6872 </ div >
6973 :
70- < div >
71- < Notepad socket = { socket } />
72- < Chat socket = { socket } userName = { userName } />
73- < Music />
74+ < div className = "main" >
75+ < div className = "one" > < img className = "logo" src = { share_my_code } alt = "Logo" /> </ div >
76+ < div className = "two" > < Notepad socket = { socket } /> </ div >
77+ < div className = "three" > < Chat socket = { socket } userName = { userName } /> </ div >
78+ < div className = "four" > < Music /> </ div >
7479 </ div >
7580 }
7681 </ div >
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class Music extends Component {
3434 render ( ) {
3535 const imageName = this . getImageName ( ) ;
3636 return (
37- < div >
37+ < div className = "musicbox" >
3838 < form >
3939 < img src = { imageP [ imageName ] } onClick = { this . toggleBoth } alt = 'crappyjukebox' />
4040 </ form >
Original file line number Diff line number Diff line change 1+ label ,
2+ textarea {
3+ font-size : 1rem ;
4+ letter-spacing : 1px ;
5+ }
6+ textarea {
7+ padding : 10px ;
8+ line-height : 1.5 ;
9+ border-radius : 5px ;
10+ border : 1px solid # ccc ;
11+ box-shadow : 1px 1px 1px rgb (219 , 205 , 205 );
12+ width : 600px ;
13+ height : 600px ;
14+ }
15+
16+ label {
17+ display : block;
18+ margin-bottom : 0em ;
19+ }
You can’t perform that action at this time.
0 commit comments