Skip to content
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

[수정] fixed 제거 #71 #72

Merged
merged 4 commits into from
Sep 24, 2022
Merged
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/css/LoginPage.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ html,
body {
width: 100vw;
height: 100vh;
overflow: hidden;
height: calc(var(--vh) * 100);
}

#root {
width: 100vw;
height: 100vh;
height: calc(var(--vh) * 100);
align-items: center;
}

Expand Down
5 changes: 0 additions & 5 deletions src/css/MainPage.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#mainPage {
margin-top: 75px;
}

#timer {
position: sticky;
top: 20px;
Expand All @@ -11,7 +7,6 @@
width: 100%;
display: flex;
flex-direction: column;
/* justify-content: space-between; */
position: sticky;
bottom: 50px;
}
Expand Down
2 changes: 1 addition & 1 deletion src/css/Navigation.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
.navigation__wrapper {
width: 100%;
height: 75px;
position: fixed;
display: flex;
align-items: center;
z-index: 1;
Expand Down Expand Up @@ -51,6 +50,7 @@
left: 0;
top: 75px;
background-color: #50b4d2;
z-index: 1;
box-shadow: 2px 0px 1px rgba(44, 44, 44, 0.137);
}

Expand Down
22 changes: 22 additions & 0 deletions src/tsx/LoginPage.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,32 @@
import React from "react";
import Button from "react-bootstrap/Button";
import Form from "react-bootstrap/Form";
import { FaUser, FaLock } from "react-icons/fa";
import { Link } from "react-router-dom";
import "../css/LoginPage.css";

const LoginPage = () => {
let windowInnerHeight = 0;
let vh = 0;

const handleResize = () => {
const currentInnerHeight = window.innerHeight;
console.log(`${currentInnerHeight}/${windowInnerHeight}`);
if (currentInnerHeight !== windowInnerHeight) {
windowInnerHeight = currentInnerHeight;
vh = window.innerHeight * 0.01;
document.documentElement.style.setProperty("--vh", `${vh}px`);
}
};

handleResize();

React.useEffect(() => {
window.addEventListener("resize", handleResize);
return () => {
window.removeEventListener("resize", handleResize);
};
});
return (
<Form>
<div id="loginPage">
Expand Down