Recently, I came across an interesting YouTube video. Here is the link:
https://www.youtube.com/watch?v=2ak37WrbSDg
The video featured a captivating animation at the beginning, utilizing span text. Intrigued, I attempted to modify it by incorporating images instead. However, my efforts were unsuccessful when I tried to use images in place of text. Below is the HTML code snippet that I was working on:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="style.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300&display=swap" rel="stylesheet">
</head>
<body>
<div class="intro">
<div class="image-slider">
<div class="left leftright" >
<div class="leftmain" style="background-image: url(images/left.jpg);"></div>
</div>
<div class="right leftright">
<div class="main" style="background-image: url(images/right-bike.jpg);"></div>
</div>
</div>
</div>
<header>
<h4>hello world</h4>
</header>
<script src="script.js"></script>
</body>
</html>
This is the CSS code associated with the HTML structure outlined above:
*
{
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
header
{
position: relative;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
header h4
{
position: absolute;
left: 10%;
bottom: 1rem;
}
.intro
{
position: fixed;
z-index: 1;
left: 0;
right: 0;
width: 100%;
height: 100vh;
transition: 1s;
}
[right - sections for styling and animations omitted for brevity]
Furthermore, there is a JavaScript script included to handle interactions and animations within the webpage:
// JavaScript function to control animations on page load
let intro = document.querySelector('.intro');
let image = document.querySelectorAll('.leftright')
window.addEventListener('DOMContentLoaded', ()=>
{
[JavaScript functionality and timing functions continued...]
})
In conclusion, despite designing the webpage to have a dynamic introduction where split images slide in from both sides and rise together, the live server displays a blank screen. Seeking assistance to troubleshoot this issue. Any help would be greatly appreciated.