frontend-dorset/assets/css/hero-img.css

265 lines
6.0 KiB
CSS

/* ============= WEB BROWSER RESETS ============ */
* { margin: 0; padding: 0; border: none }
*, *::before, *::after { box-sizing: border-box }
html { height: 100%; font-size: 100%; font: inherit; vertical-align: baseline;
scroll-behavior: smooth; scroll-padding-top: 20px }
body { max-width: 1920px; line-height: 1.5; margin-left: auto; margin-right: auto;
min-height: 100vh; text-rendering: optimizeSpeed }
img { width: 100%; height: auto; display: block }
input, button, textarea, select { font: inherit }
/* Help prevent overflow of long words/names/URLs */
h1, h2, h3, h4, p, li { word-break: break-word; hyphens: auto }
/* HTML5 container elements full viewport width */
header, section, footer { width: 100% }
/* Last element at bottom of header or section */
header *:last-child, section *:last-child, footer *:last-child { margin-bottom: 0 }
/* ================= ENDS ================ */
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
background-color: #edc3a5;
}
section {
text-align: center;
font-family: 'Fjalla One', sans-serif;
}
.hero-block {
position: relative;
height: 80vh;
min-height: 500px;
display: flex;
flex-direction: column;
/* Vertically center text */
justify-content: center;
overflow: hidden
}
.end-block {
position: relative;
height: 30vh;
min-height: 200px;
display: flex;
flex-direction: column;
/* Vertically center text */
justify-content: center;
overflow: hidden;
padding-bottom: 8%;
}
.cheer {
border-radius: 50%;
width : 20%;
margin-top:100px;
display: block;
margin-left: auto;
margin-right: auto;
box-shadow: 0px 0px 5px 3px rgba(0,0,0,0.75);
}
/* Horizontally center text, left to right */
.hero-block.text-center { align-items: center }
.hero-text-container { text-align: center }
/* Stack order */
.hero-block .hero-text-container { z-index: 3 }
.hero-block [class*="bg-overlay"] { z-index: 2 }
.hero-block h1, .hero-block h2 { z-index: 1 }
/* Desktops */
@media (min-width: 768px) { .hero-block { padding: 0 7% 3% 7% } }
/* Mobiles */
@media (max-width: 767px) { .hero-block { padding: 0 12% 5% 12% } }
.hero-block h1, .hero-block h2 {
line-height: 1.2;
color:#fff;
text-shadow: 2px 2px #222;
}
.hero-block h1 {
font-size: calc(48px + (120 - 48) * ((100vw - 320px) / (1600 - 320)));
margin-bottom: 24px;
}
.hero-block h2 {
font-weight: normal;
font-size: calc(20px + (48 - 20) * ((100vw - 320px) / (1600 - 320)));
}
.bg-text {
background-color: rgb(0,0,0); /* Fallback color */
background-color: rgba(0,0,0, 0.6); /* Black w/opacity/see-through */
color: white;
font-weight: bold;
border: 3px solid #f1f1f1;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
z-index: 2;
width: 80%;
padding: 20px;
text-align: center;
}
.animate-spawn{
animation:animateSpawn 3s;
} @keyframes animateSpawn{
0%{
opacity:0
}
100%{
opacity:1
}
}
.hero-img {
position: absolute;
top: 0; right: 0; bottom: 0; left: 0;
/* Always 3rd in stack. Behind 3 and behind 2. */
z-index: 0;
/* Add the blur effect */
filter: blur(3px);
-webkit-filter: blur(3px);
}
.hero-img img {
object-fit: cover; width: 100%; height: 100%;
}
/* Optional overlay */
[class*="bg-overlay"] {
position: absolute; top: 0; right: 0; bottom: 0; left: 0;
background-image: linear-gradient(rgba(0,0,0,0.3),rgba(0,0,0,0.3));
}
.bg-overlay-red {
background-image: linear-gradient(rgba(245,0,34,0.5),rgba(204,0,34,0.5));
}
.bg-overlay-green {
background-image: linear-gradient(rgba(0,102,0,0.5),rgba(0,102,0,0.5));
}
.bg-overlay-blue {
background-image: linear-gradient(rgba(0,0,179,0.5),rgba(0,0,179,0.5));
}
.bg-overlay-purple {
background-image: linear-gradient(rgba(179, 0, 134,0.5),rgba(179, 0, 134,0.5));
}
/* Regular and larger screens */
@media (min-width: 1200px) {
section {
margin-left: auto;
margin-right: auto;
padding: 3.5% 0 4% 0;
padding-left: calc( (100% - 1140px)/2 );
padding-right: calc( (100% - 1140px)/2 );
}
.section-narrow {
padding-left: calc( (100% - 920px)/2 );
padding-right: calc( (100% - 920px)/2 );
}
}
/* Tablets and smaller desktops */
@media (min-width: 1025px) and (max-width: 1199px ) {
section { padding: 3% 10% 4% 10% }
}
/* Tablets */
@media (min-width: 768px) and (max-width: 1024px) {
section { padding: 4% 5% 4% 5% }
}
/* Larger mobiles */
@media (min-width: 400px) and (max-width: 767px) {
section { padding: 7% 13% 8% 13% }
}
/* Smaller mobiles */
@media (max-width: 399px) {
section { padding: 7% 10% 8% 10% }
}
/* Coloured backgrounds */
.bg-header { background-color: #f5f9fb }
.bg-blue-light { background-color: #d8f0f5 }
.bg-blue-dark { background-color: #1435b3 }
/* Light blue section background: h1 headings and p text paragraphs */
.bg-blue-light h1 { color: #1435b3 }
.bg-blue-light p { color: #222 }
/* Dark blue section background: h1 headings and p text paragraphs */
.bg-blue-dark h1 { color: #fff }
.bg-blue-dark p { color: #fff }
/* =============== UTILTY CLASSES ============== */
.text-center { text-align: center !important }
p {
font-size: 20px;
margin-bottom: 16px;
text-decoration: none;
color : #3f1f09;
}
p.hover {
color : #2a1506;
font-weight : bold;
}
a {
text-decoration: none;
color : #3f1f09;
}
a:hover {
color : #2a1506;
font-weight : bold;
animation:textSpawn 1s;
} @keyframes textSpawn{
0%{
opacity:0.3
}
100%{
opacity:1
}
}
h3 {
font-size: 24px;
margin-top: 48px;
margin-bottom: 20px;
line-height: 1.2;
text-transform: uppercase;
}
section h3 {
margin-top: 0;
}
.dark-section {
background-color: #3B1E00;
color: #fdfff5;
}
.dark-section a {
color: #fdfff5dc;
}
.dark-section a:hover {
color: #fdfff59f;
}