mirror of
https://github.com/UofCBaja/BajaUofCWebsite.git
synced 2025-06-16 05:44:17 -06:00
feat(homePage): used new header to create the banner
This commit is contained in:
parent
81bc19b4bd
commit
1464667142
@ -1,6 +1,6 @@
|
|||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import "./Home.css";
|
import "./Home.css";
|
||||||
import { useEffect } from "react";
|
import UpdateBanner from "../Header/UpdateBanner";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {null} nothing - This takes in nothing
|
* @param {null} nothing - This takes in nothing
|
||||||
@ -9,42 +9,14 @@ import { useEffect } from "react";
|
|||||||
* @author Brock <darkicewolf50@gmail.com>
|
* @author Brock <darkicewolf50@gmail.com>
|
||||||
*/
|
*/
|
||||||
export default function Home() {
|
export default function Home() {
|
||||||
useEffect(() => {
|
|
||||||
HeaderBannerHeight();
|
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {null} nothing - This takes in nothing
|
|
||||||
* @returns {null} nothing - This returns nothing
|
|
||||||
* @description This makes it so that the banner will always be 100% of the page at the top
|
|
||||||
* @author Brock <darkicewolf50@gmail.com>
|
|
||||||
*/
|
|
||||||
const HeaderBannerHeight = () => {
|
|
||||||
const headerTop = document.getElementsByTagName("header")[0];
|
|
||||||
const headerTopStyle = getComputedStyle(headerTop);
|
|
||||||
const headerTopInnerHeight = headerTop.offsetHeight;
|
|
||||||
// const headerTopMarginTop = parseFloat(headerTop.marginTop);
|
|
||||||
const headerTopMarginHeight = parseFloat(headerTopStyle.marginBottom);
|
|
||||||
|
|
||||||
const headerTopTotalHeight = headerTopInnerHeight + headerTopMarginHeight;
|
|
||||||
|
|
||||||
const HomeBannerTop = document.getElementById("HomeBannerTop");
|
|
||||||
|
|
||||||
HomeBannerTop.style.height = `calc(100svh - ${headerTopTotalHeight}px)`;
|
|
||||||
};
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div id="HomeTop">
|
<UpdateBanner
|
||||||
<img
|
updatedTitleText="UCalgary Baja"
|
||||||
id="HomeBannerTop"
|
updatedSubtitleText="Catchphase goes here"
|
||||||
src="https://picsum.photos/200"
|
updatedImgUrl="https://picsum.photos/200"
|
||||||
alt="cool shot of driver in car, replace later"
|
updatetdImgAlt="cool shot of driver in car, replace later"
|
||||||
/>
|
/>
|
||||||
<div>
|
|
||||||
<h1>UCalgary Baja</h1>
|
|
||||||
<h2>Catchphase goes here</h2>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div className="HomePageLayout">
|
<div className="HomePageLayout">
|
||||||
<div>
|
<div>
|
||||||
<img
|
<img
|
||||||
|
Loading…
x
Reference in New Issue
Block a user