<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Slider with Animation Using Bootstrap 5</title>
<!-- Bootstrap CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Font Awesome -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
</head>
<body>
<section class="section-banner d-none d-lg-block d-md-block">
<div id="carouselExampleControls" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner py-5">
<div class="carousel-item py-5 active">
<div id="WebGL-output">
</div>
<img class="planetImg" src="https://assets.codepen.io/1651485/planet.png">
<div class="container">
<div class="row py-5">
<div class="col-lg-12">
<div class="mainText">
<div class="mainTitle">
Empower Your Procurement Process with GeM Solutions.
</div>
<div class="subTitle">
<a class="text-white" title="The Bachelorette S21 Finale Spoilers" href="https://thethoughtoftheday.com/trending/the-bachelorette-s21-finale-spoilers-jenn-tran-shocking-ending">The Bachelorette S21 Finale Spoilers</a>
</div>
<div class="cursor" style="left: 820px; top: 590px;"></div>
</div>
</div>
</div>
</div>
</div>
<div class="carousel-item py-5">
<div id="WebGL-output">
</div>
<img class="planetImg" src="https://assets.codepen.io/1651485/planet.png">
<div class="container">
<div class="row py-5">
<div class="col-lg-12">
<div class="mainText">
<div class="mainTitle">
Innovative Mobile Solutions Our App Development Expertise.
</div>
<div class="subTitle">
<a class="text-white" title="The Bachelorette Finale Jenn Tran Choose Devin Strader or Marcus Shoberg" href="https://thethoughtoftheday.com/trending/the-bachelorette-finale-jenn-tran-choose-devin-strader-or-marcus-shoberg">The Bachelorette s21 Finale Updates</a>
</div>
<div class="cursor" style="left: 820px; top: 590px;"></div>
</div>
</div>
</div>
</div>
</div>
<div class="carousel-item py-5">
<div id="WebGL-output">
</div>
<img class="planetImg" src="https://assets.codepen.io/1651485/planet.png">
<div class="container">
<div class="row py-5">
<div class="col-lg-12">
<div class="mainText">
<div class="mainTitle">
Unlocking Online Potential Digital Marketing Services.
</div>
<div class="subTitle">
Let’s Talk Business
</div>
<div class="cursor" style="left: 820px; top: 590px;"></div>
</div>
</div>
</div>
</div>
</div>
</div>
<button class="carousel-control-prev" type="button" data-bs-target="#carouselExampleControls"
data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="visually-hidden">Previous</span>
</button>
<button class="carousel-control-next" type="button" data-bs-target="#carouselExampleControls"
data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="visually-hidden">Next</span>
</button>
</div>
<script>
let menuBtn = document.querySelector("#menuBtn");
let curs = document.querySelector(".cursor");
let menuItems = document.querySelectorAll(".menu-item");
let mainText = document.querySelector(".mainText");
document.addEventListener("mousemove", (e) => {
let x = e.pageX;
let y = e.pageY;
curs.style.left = x - 15 + "px";
curs.style.top = y - 15 + "px";
});
// show hide menu animation
let flag = true;
menuBtn.addEventListener("click", () => {
flag = !flag;
if (!flag) {
gsap.to(".straight-line", {
width: 700,
duration: 0.3
});
gsap.to(".menu", {
display: "block",
duration: 0.3
});
} else {
gsap.to(".straight-line", {
width: 0,
duration: 0.2
});
gsap.to(".menu", {
display: "none",
duration: 0.2
});
}
});
// menu item click animation and changing maim title
menuItems.forEach((item, index) => {
item.addEventListener("click", () => {
curs.classList.add("explosion");
setTimeout(function () {
curs.classList.remove("explosion");
}, 900);
});
});
// Taken from https://codepen.io/enesser/pen/jdenE
function main() {
let scene = new THREE.Scene();
let camera = new THREE.PerspectiveCamera(
45,
window.innerWidth / window.innerHeight,
0.1,
1000
);
let webGLRenderer = new THREE.WebGLRenderer();
webGLRenderer.setClearColor(new THREE.Color(0x000000, 1.0));
webGLRenderer.setSize(window.innerWidth, window.innerHeight);
webGLRenderer.shadowMapEnabled = true;
camera.position.x = -30;
camera.position.y = 40;
camera.position.z = 50;
camera.lookAt(new THREE.Vector3(10, 0, 0));
document.querySelector("#WebGL-output").append(webGLRenderer.domElement);
let step = 0;
let knot;
let controls = new (function () {
this.radius = 40;
this.tube = 17;
this.radialSegments = 186;
this.tubularSegments = 4;
this.p = 9;
this.q = 1;
this.heightScale = 4;
this.asParticles = true;
this.rotate = true;
this.redraw = function () {
if (knot) scene.remove(knot);
let geom = new THREE.TorusKnotGeometry(
controls.radius,
controls.tube,
Math.round(controls.radialSegments),
Math.round(controls.tubularSegments),
Math.round(controls.p),
Math.round(controls.q),
controls.heightScale
);
if (controls.asParticles) {
knot = createParticleSystem(geom);
} else {
knot = createMesh(geom);
}
scene.add(knot);
};
})();
let gui = new dat.GUI();
gui.add(controls, "radius", 0, 40).onChange(controls.redraw);
gui.add(controls, "tube", 0, 40).onChange(controls.redraw);
gui.add(controls, "radialSegments", 0, 400).step(1).onChange(controls.redraw);
gui.add(controls, "tubularSegments", 1, 20).step(1).onChange(controls.redraw);
gui.add(controls, "p", 1, 10).step(1).onChange(controls.redraw);
gui.add(controls, "q", 1, 15).step(1).onChange(controls.redraw);
gui.add(controls, "heightScale", 0, 5).onChange(controls.redraw);
gui.add(controls, "asParticles").onChange(controls.redraw);
gui.add(controls, "rotate").onChange(controls.redraw);
gui.close();
controls.redraw();
render();
function generateSprite() {
let canvas = document.createElement("canvas");
canvas.width = 16;
canvas.height = 16;
let context = canvas.getContext("2d");
let gradient = context.createRadialGradient(
canvas.width / 2,
canvas.height / 2,
0,
canvas.width / 2,
canvas.height / 2,
canvas.width / 2
);
gradient.addColorStop(0, "rgba(255,255,255,1)");
gradient.addColorStop(0.2, "rgba(0,255,255,1)");
gradient.addColorStop(0.4, "rgba(0,0,64,1)");
gradient.addColorStop(1, "rgba(0,0,0,1)");
context.fillStyle = gradient;
context.fillRect(0, 0, canvas.width, canvas.height);
let texture = new THREE.Texture(canvas);
texture.needsUpdate = true;
return texture;
}
function createParticleSystem(geom) {
let material = new THREE.ParticleBasicMaterial({
color: 0xffffff,
size: 2,
transparent: true,
blending: THREE.AdditiveBlending,
map: generateSprite()
});
let system = new THREE.ParticleSystem(geom, material);
system.sortParticles = true;
return system;
}
function createMesh(geom) {
let meshMaterial = new THREE.MeshNormalMaterial({});
meshMaterial.side = THREE.DoubleSide;
let mesh = THREE.SceneUtils.createMultiMaterialObject(geom, [meshMaterial]);
return mesh;
}
function render() {
if (controls.rotate) {
knot.rotation.y = step += 0.00058;
}
requestAnimationFrame(render);
webGLRenderer.render(scene, camera);
}
}
main();
</script>
</section>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js"
crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js"
crossorigin="anonymous"></script>
</body>
</html>
.section-banner {
background: radial-gradient(circle,
rgba(19, 17, 17, 1) 0%,
rgba(0, 0, 0, 1) 17%,
rgba(0, 0, 0, 1) 27%);
overflow: hidden;
}
.planetImg {
transform: scale(0.7) rotate(158deg);
position: absolute;
top: -42%;
right: 13%;
animation: float 12s ease-in-out infinite;
}
.mainTitle {
text-transform: uppercase;
color: #fff;
font-size: 60px;
position: relative;
letter-spacing: 10px;
position: relative;
display: block;
font-family: "Poppins", sans-serif;
text-transform: uppercase;
-webkit-text-stroke: 2px #ffffff;
text-stroke: 2px #ffffff;
-webkit-text-fill-color: transparent;
text-fill-color: transparent;
color: transparent;
transition: all 0.4s linear;
opacity: 0.5;
user-select: none;
}