html,
body {
height: 100%;
margin: 0;
padding: 0;
}
body {
font-family: "Abhaya Libre";
text-align: center;
color: #f5f5f5;
}
.hero {
background: url("https://fwca.ch/wp-content/uploads/2024/07/close-up-businessman-with-digital-tablet-scaled.jpg")
no-repeat center;
background-size: cover;
background-color: rgba(0, 0, 0, 0.75);
background-blend-mode: multiply;
height: 100vh;
width: 100%;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
padding: 0 15px; /* Add some padding for smaller screens */
}
.inner-text {
font-size: 40px; /* Initial font size */
text-align: center;
padding: 0 15px; /* Ensure padding is added for all screens */
@media only screen and (min-width: 680px) {
font-size: 50px;
}
@media only screen and (min-width: 950px) {
font-size: 75px;
}
}
.p1 {
display: inline-block;
font-size: 1.9em;
font-weight: 900;
margin: 0;
line-height: 1;
@media only screen and (max-width: 465px) {
display: block;
position: relative;
top: 0; /* Adjusted position */
left: 0; /* Adjusted position */
transform: none; /* Removed transformation */
margin-top: 20px; /* Add some margin for better spacing */
}
}
.p2 {
display: inline-block;
font-size: 1.2em;
font-weight: 100;
margin: 0;
line-height: 1;
color: #87975e;
@media only screen and (max-width: 465px) {
position: relative;
top: 0.6em;
display: block; /* Ensure it displays as a block for better spacing */
}
}
.subtitle {
font-size: 0.7em; /* Smaller font size */
font-weight: 300;
margin: 1.5em;
line-height: 2;
color: #f5f5f5;
}
.hero-down {
position: absolute;
bottom: 0;
font-size: 2em;
width: 2em;
height: 2em;
color: #f5f5f5;
border-radius: 100%;
&:hover,
&:focus {
color: #ccc;
}
&:active {
color: #f5f5f5;
}
.btn-react {
background-color: #f5f5f5;
height: 100%;
width: 100%;
border-radius: 100%;
opacity: 0;
position: absolute;
}
i {
vertical-align: bottom;
position: relative;
top: 0.1em;
}
}
View Compiled
$(function () {
$(".p2").typed({
strings: ["Fiduciaire", "Business Advisory", "Assurances"],
typeSpeed: 50,
backSpeed: 10,
backDelay: 2000,
showCursor: false,
loop: true
});
});
$(".hero-down").mousedown(function () {
TweenMax.fromTo(
".btn-react",
0.25,
{
opacity: 0,
scale: 0
},
{
opacity: 0.25,
scale: 1,
onComplete: function () {
TweenMax.to(".btn-react", 0.25, {
opacity: 0,
scale: 0
});
}
}
);
});
// smooth scroll to div
$("a[href*=#]:not([href=#])").click(function () {
if (
location.pathname.replace(/^\//, "") == this.pathname.replace(/^\//, "") &&
location.hostname == this.hostname
) {
var target = $(this.hash);
target = target.length ? target : $("[name=" + this.hash.slice(1) + "]");
if (target.length) {
$("html,body").animate(
{
scrollTop: target.offset().top
},
1000
);
return false;
}
}
});