frontend-dorset/exercises/assets/css/hero-text.css

132 lines
3.5 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: beige;
}
.hero-block {
min-height: 500px;
display: flex;
flex-direction: column;
justify-content: center;
background-color: gray;
background-image: linear-gradient(90deg,#ff0000,#6b0000);
}
@media (min-width: 768px) {
.hero-block { height: 80vh }
}
.hero-text-container { padding: 0 12% 4% 12% }
.hero-block h1, .hero-block h2 {
line-height: 1.2;
color:#000;
text-shadow: 2px 2px #434343;
}
.hero-block h1 {
font-size: calc(64px + (112 - 64) * ((100vw - 320px) / (1600 - 320)));
margin-bottom: 24px;
}
.hero-block h2 {
font-weight: normal;
font-size: calc(30px + (64 - 30) * ((100vw - 320px) / (1600 - 320)));
text-transform: uppercase;
}
.slide-in-top {
-webkit-animation: slide-in-top 1s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
animation: slide-in-top 1s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}
.slide-in-left {
-webkit-animation: slide-in-left 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
animation: slide-in-left 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
}
/**
* ----------------------------------------
* animation slide-in-top
* ----------------------------------------
*/
@-webkit-keyframes slide-in-top {
0% {
-webkit-transform: translateY(-1000px);
transform: translateY(-1000px);
opacity: 0;
}
100% {
-webkit-transform: translateY(0);
transform: translateY(0);
opacity: 1;
}
}
@keyframes slide-in-top {
0% {
-webkit-transform: translateY(-1000px);
transform: translateY(-1000px);
opacity: 0;
}
100% {
-webkit-transform: translateY(0);
transform: translateY(0);
opacity: 1;
}
}
/**
* ----------------------------------------
* animation slide-in-left
* ----------------------------------------
*/
@-webkit-keyframes slide-in-left {
0% {
-webkit-transform: translateX(-1000px);
transform: translateX(-1000px);
opacity: 0;
}
100% {
-webkit-transform: translateX(0);
transform: translateX(0);
opacity: 1;
}
}
@keyframes slide-in-left {
0% {
-webkit-transform: translateX(-1000px);
transform: translateX(-1000px);
opacity: 0;
}
100% {
-webkit-transform: translateX(0);
transform: translateX(0);
opacity: 1;
}
}
/* ================ UTILITY CLASSES ============= */
.text-center { text-align: center }