Skip to content

Instantly share code, notes, and snippets.

@kasperaamodt
Created November 8, 2021 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kasperaamodt/9fdd979848e4a573ad0c8d4d7fae58b4 to your computer and use it in GitHub Desktop.
Save kasperaamodt/9fdd979848e4a573ad0c8d4d7fae58b4 to your computer and use it in GitHub Desktop.
import React from "react";
import { connect, styled } from "frontity";
import Link from "@frontity/components/link";
const Hero = () => {
return (
<>
<HeroContainer>
<video playsInline autoPlay muted loop>
<source src="https://backend.arctic-bioscience.com/wp-content/uploads/2021/04/hero.mp4" type="video/mp4" />
</video>
<VideoOverlay>
<div className="hero-inner">
<div>
<h1>Arctic Bioscience - Norwegian herring caviar extracts</h1>
<div className="buttons">
<Link link="/news/">
<button className="wp-block-button__link">Media</button>
</Link>
<Link link="/investors/home/">
<button className="wp-block-button__link">Investors</button>
</Link>
</div>
</div>
</div>
</VideoOverlay>
</HeroContainer>
</>
);
};
export default connect(Hero);
const HeroContainer = styled.div`
height: calc(100vh - 95px);
margin: 0 auto;
video {
height: 100%;
width: 100%;
object-fit: cover;
@media (max-width: 600px) {
min-height: 600px;
}
}
@media (max-width: 600px) {
height: auto;
min-height: 600px;
}
`;
const VideoOverlay = styled.div`
background-color: rgba(0,0,0,0.5);
position: absolute;
top: 0;
left: 0;
display: flex;
height: calc(100vh - 95px);
min-height: calc(100vh - 95px);
align-items: center;
justify-content: center;
width: 100%;
max-width: 100vw;
.hero-inner {
display: flex;
align-items: flex-end;
width: 1200px;
height: 80%;
h1 {
margin-bottom: 1rem;
font-weight: 600;
width: 100%;
max-width: 620px;
color: #fff;
}
}
.buttons .wp-block-button__link {
margin-bottom: 1rem;
margin-right: 1rem;
}
@media (min-width: 1230px) {
justify-content: center;
}
@media (max-width: 1230px) {
padding-left: 15px;
padding-right: 15px;
width: auto;
}
@media (max-width: 600px) {
height: auto;
min-height: 600px;
}
`;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment