Meta Description" name="description" />
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Container Into Master Home</title>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
height: 100vh;
overflow: hidden;
font-family: Arial, sans-serif;
background: #000;
color: white;
}
.container {
position: relative;
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.container img {
width: 100%;
height: 100%;
object-fit: cover;
filter: brightness(55%);
}
.overlay {
position: absolute;
inset: 0;
background: linear-gradient(
to top,
rgba(0,0,0,0.9),
transparent
);
}
.content {
position: absolute;
text-align: center;
width: 90%;
top: 50%;
transform: translateY(-50%);
}
#mainText {
font-size: clamp(35px, 7vw, 90px);
font-weight: 900;
text-transform: uppercase;
text-shadow: 0 5px 25px black;
opacity: 0;
transform: scale(0.7);
transition:
opacity 0.7s ease,
transform 0.7s ease;
}
#subText {
font-size: clamp(16px, 3vw, 28px);
margin-top: 15px;
opacity: 0;
transition: opacity 0.7s ease;
}
.show {
opacity: 1 !important;
transform: scale(1) !important;
}
.progress {
position: absolute;
bottom: 30px;
left: 5%;
width: 90%;
height: 5px;
background: rgba(255,255,255,0.3);
}
#progressBar {
width: 0%;
height: 100%;
background: white;
transition: width 0.3s linear;
}
button {
position: absolute;
bottom: 55px;
padding: 13px 25px;
border: none;
border-radius: 30px;
background: white;
color: black;
font-size: 16px;
font-weight: bold;
cursor: pointer;
}
#startBtn {
left: 50%;
transform: translateX(-50%);
}
#soundBtn {
right: 20px;
}
</style>
</head>
<body>
<div class="container">
<!-- اپنی تصویر کا نام یہاں دیں -->
<img
src="a_photorealistic_collage_timeline_image_showing_th.png"
alt="Container Into Master Home"
>
<div class="overlay"></div>
<div class="content">
<div id="mainText">
OLD CONTAINER
</div>
<div id="subText">
Wait for the transformation...
</div>
</div>
<button id="startBtn">
▶ START TRANSFORMATION
</button>
<button id="soundBtn">
🔇 SOUND OFF
</button>
<div class="progress">
<div id="progressBar"></div>
</div>
</div>
<script>
const scenes = [
{
title: "OLD CONTAINER",
subtitle: "Just wait for the transformation..."
},
{
title: "THE WORK BEGINS",
subtitle: "Cutting • Cleaning • Preparing"
},
{
title: "BUILDING THE DREAM",
subtitle: "Windows • Doors • Insulation"
},
{
title: "LUXURY INTERIOR",
subtitle: "Modern design meets smart living"
},
{
title: "FINAL TOUCH",
subtitle: "Every detail matters"
},
{
title: "MASTER HOME",
subtitle: "From a simple container to a dream home 🏡"
},
{
title: "WATCH TILL THE END",
subtitle: "You won't believe the transformation!"
}
];
let currentScene = 0;
let timer;
let soundOn = false;
const mainText =
document.getElementById("mainText");
const subText =
document.getElementById("subText");
const progressBar =
document.getElementById("progressBar");
const startBtn =
document.getElementById("startBtn");
const soundBtn =
document.getElementById("soundBtn");
/* Text Animation */
function showScene(index) {
mainText.classList.remove("show");
subText.classList.remove("show");
setTimeout(() => {
mainText.innerText =
scenes[index].title;
subText.innerText =
scenes[index].subtitle;
mainText.classList.add("show");
subText.classList.add("show");
}, 300);
const progress =
(index / (scenes.length - 1)) * 100;
progressBar.style.width =
progress + "%";
playSound();
}
/* Start Transformation */
function startTransformation() {
clearInterval(timer);
currentScene = 0;
showScene(currentScene);
startBtn.style.display = "none";
timer = setInterval(() => {
currentScene++;
if (
currentScene >= scenes.length
) {
clearInterval(timer);
startBtn.innerText =
"🔄 PLAY AGAIN";
startBtn.style.display =
"block";
return;
}
showScene(currentScene);
}, 3000);
}
/* Sound */
let audioContext;
function playSound() {
if (!soundOn) return;
audioContext =
audioContext ||
new (
window.AudioContext ||
window.webkitAudioContext
)();
const oscillator =
audioContext.createOscillator();
const gain =
audioContext.createGain();
oscillator.type = "sine";
oscillator.frequency.value =
500;
gain.gain.setValueAtTime(
0.15,
audioContext.currentTime
);
gain.gain.exponentialRampToValueAtTime(
0.001,
audioContext.currentTime + 0.5
);
oscillator.connect(gain);
gain.connect(
audioContext.destination
);
oscillator.start();
oscillator.stop(
audioContext.currentTime + 0.5
);
}
/* Sound Button */
soundBtn.addEventListener(
"click",
() => {
soundOn = !soundOn;
soundBtn.innerText =
soundOn
? "🔊 SOUND ON"
: "🔇 SOUND OFF";
}
);
/* Start Button */
startBtn.addEventListener(
"click",
startTransformation
);
</script>
</body>
</html>2
1
6KB
6KB
59.0ms
220.0ms
127.0ms