File tree 4 files changed +33
-3
lines changed
4 files changed +33
-3
lines changed Original file line number Diff line number Diff line change @@ -9,14 +9,13 @@ import DisplayList from "./components/Hooks/useCallback/DisplayList";
9
9
// TRY IT YOURSELF COMPONENTS
10
10
import FormDetails from "./tryityourself/Akash/FormDetails" ;
11
11
import RandomBackground from "./tryityourself/Akash/RandomBackground" ;
12
+ import WindowTape from "./tryityourself/Akash/WindowTape" ;
12
13
13
14
// PROJECTS
14
15
import StopWatch from "./project/StopWatch/StopWatch" ;
15
16
16
17
const App = ( ) => {
17
-
18
- return < DisplayList /> ;
19
-
18
+ return < WindowTape /> ;
20
19
} ;
21
20
22
21
export default App ;
Original file line number Diff line number Diff line change 3
3
@import "./tryityourself/Akash/FormDetails.style.css" ;
4
4
@import "./tryityourself/Akash/RandomBackground.style.css" ;
5
5
@import "./project/StopWatch/StopWatch.style.css" ;
6
+ @import "./tryityourself/Akash/WindowTape.style.css" ;
Original file line number Diff line number Diff line change
1
+ import React , { useState , useEffect } from "react" ;
2
+
3
+ const WindowTape = ( ) => {
4
+ const [ height , setHeight ] = useState ( window . innerHeight ) ;
5
+ const [ width , setWidth ] = useState ( window . innerWidth ) ;
6
+
7
+ useEffect ( ( ) => {
8
+ const handleHeight = ( ) => setHeight ( window . innerHeight ) ;
9
+ window . addEventListener ( "resize" , handleHeight ) ;
10
+ const handleWidth = ( ) => setWidth ( window . innerWidth ) ;
11
+ window . addEventListener ( "resize" , handleWidth ) ;
12
+ } , [ ] ) ;
13
+
14
+ return (
15
+ < div className = "Background" >
16
+ < div className = "ScreenSize" >
17
+ { width } x { height }
18
+ </ div >
19
+ </ div >
20
+ ) ;
21
+ } ;
22
+
23
+ export default WindowTape ;
Original file line number Diff line number Diff line change
1
+ .ScreenSize {
2
+ @apply w-[500px ] h-[100px ] flex justify-center items-center p-2 text-3xl font-semibold text-white border-[2.5px ] border-white rounded-md bg-gray-950 shadow-xl shadow-black;
3
+ }
4
+
5
+ .Background {
6
+ @apply h-screen flex justify-center items-center bg-orange-700;
7
+ }
You can’t perform that action at this time.
0 commit comments