diff --git a/src/components/HouseCard.js b/src/components/HouseCard.js new file mode 100644 index 0000000..3832db3 --- /dev/null +++ b/src/components/HouseCard.js @@ -0,0 +1,120 @@ +import React from 'react'; +import styled from 'styled-components'; +import { find } from 'styled-components/test-utils' + +const Image = styled.img` + display:block; +`; +const Tick = styled.input.attrs(props => ({ + type: "radio", + name: "radiobtn" + +}))` + +`; +const Overlay = styled.div` + + position: block; + bottom: 0; + background: rgb(0, 0, 0); + background: rgba(0, 0, 0, 0.5); + color: #f1f1f1; + width: 100%; + transition: .5s ease; + opacity:0; + color: white; + font-size: 20px; + padding: 20px; + text-align: center; + margin-top: -90px; +`; + + +const Card = styled.div` + width: 300px; + height: 300px; + border-radius: 40px; +box-shadow: 4px 4px 5px 5px rgba(0,0,0,0.01), -2px -2px 5px 5px rgba(0,0,0,0.22); + cursor: pointer; + transition: 0.4s; + + + & .card_image { + width: inherit; + height:inherit; + + } + + & .card_image ${Image} { + width: inherit; + height:inherit; + border-radius: 40px; + object-fit:cover; + } + + & .card_title { + text-align: center; + border-radius: 0px 0px 40px 40px; + font-family: sans-serif; + font-weight: bold; + font-size: 30px; + margin-top: -80px; + height: 40px; +} + + +& .card_title { + text-align: center; + border-radius: 0px 0px 40px 40px; + font-family: sans-serif; + font-weight: bold; + font-size: 30px; + margin-top: -80px; + height: 40px; + color: white !important; +} +& .card_tick { + content:'asdf'; + border-radius: 0px 0px 40px 40px; + margin-top: -90px; + height: 40px; + color: white; +} + +&:hover { + +box-shadow: 2px 2px 5px 9px rgba(0,0,0,0.22), -2px -2px 5px 5px rgba(0,0,0,0.11); +; + +} +&:hover ${Overlay}{ + opacity: 1; + +} +`; + + + +const HouseCard = (props) => { + + + + + return ( + + + + asdf + +

Card Title

+
+
+ + + ); + + + +} + +export default HouseCard; \ No newline at end of file diff --git a/src/components/NavBar.js b/src/components/NavBar.js index 6c55b8d..2aa22d7 100644 --- a/src/components/NavBar.js +++ b/src/components/NavBar.js @@ -5,9 +5,6 @@ import UserContext from "../context/UserContext"; export default function NavBar() { const { userData, setUserData } = useContext(UserContext); - - - const logout = () => { setUserData({ token: undefined, @@ -15,21 +12,19 @@ export default function NavBar() { }); localStorage.setItem("auth-token", ""); }; - window.addEventListener("scroll", () => { - var header = document.querySelector("header"); - header.classList.toggle("sticky", window.scrollY > 0); - - }) - console.log(userData); + document.addEventListener('DOMContentLoaded', () => { + window.addEventListener("scroll", () => { + var header = document.getElementById("navheader"); + header.classList.toggle("sticky", window.scrollY > 0); + }); + }); return (
-
+