Start modal

This commit is contained in:
Jordan Eldredge 2018-11-25 14:26:45 -08:00
parent 96d1537b80
commit 662efba1cc
2 changed files with 40 additions and 7 deletions

View file

@ -21,3 +21,30 @@
position: absolute;
background: white;
}
.overlay {
/* recommendation:
don't focus on the number "1000" here, but rather,
you should have a documented system for z-index and
follow that system. This number should be pretty
high on the scale in that system.
*/
z-index: 1000;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.9);
}
.modal {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background-color: red;
width: 600px;
max-width: 100%;
}

View file

@ -2,6 +2,7 @@ import React from "react";
import skins from "./skins.json";
import "./App.css";
import LoadQueue from "./LoadQueue";
import { Overlay } from "./Overlay";
const hashes = Object.keys(skins);
@ -213,13 +214,18 @@ class App extends React.Component {
);
}
return (
<div
style={{
height: Math.ceil(hashes.length / columnCount) * SKIN_HEIGHT,
position: "relative"
}}
>
{skinElements}
<div>
<div
style={{
height: Math.ceil(hashes.length / columnCount) * SKIN_HEIGHT,
position: "relative"
}}
>
{skinElements}
</div>
<Overlay>
<h1>Hello</h1>
</Overlay>
</div>
);
}