Skip to content

tushit(tiy-window-tape): Completed WindowTape #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import DisplayList from "./components/Hooks/useCallback/DisplayList";
// TRY IT YOURSELF COMPONENTS
import FormDetails from "./tryityourself/Akash/FormDetails";
import RandomBackground from "./tryityourself/Akash/RandomBackground";
import WindowTape from "./tryityourself/Tushit/WindowTape";

// PROJECTS
import StopWatch from "./project/StopWatch/StopWatch";

const App = () => {

return <DisplayList />;
return <WindowTape/>;

};

Expand Down
1 change: 1 addition & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
@import "./tryityourself/Akash/FormDetails.style.css";
@import "./tryityourself/Akash/RandomBackground.style.css";
@import "./project/StopWatch/StopWatch.style.css";
@import "./tryityourself/Tushit/WindowTape.style.css";
23 changes: 23 additions & 0 deletions src/tryityourself/Tushit/WindowTape.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React,{useState,useEffect} from 'react'


const WindowTape = () => {

const [width, setWidth] = useState(window.innerWidth);
const [height, setHeight] = useState(window.innerHeight);
useEffect(() => {
const handleWidth = () => setWidth(window.innerWidth);
window.addEventListener('resize', handleWidth);
const handleHeight = () => setHeight(window.innerHeight);
window.addEventListener('resize', handleHeight);
}, []);
return (
<div className='bg'>
<div className='text'>
<p>{width} X {height}</p>
</div>
</div>
)
}

export default WindowTape;
6 changes: 6 additions & 0 deletions src/tryityourself/Tushit/WindowTape.style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.text {
@apply w-[500px] h-[100px] flex justify-center items-center p-2 text-3xl font-semibold text-white border-[2.5px] border-white rounded-full bg-gray-950 shadow-xl shadow-black;
}
.bg {
@apply h-screen flex justify-center items-center bg-slate-900;
}