<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Weather Checker</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
background-color: #111;
color: white;
padding: 20px;
}
#city-input, #loading-screen, #final-loading-screen, #weather-box {
display: none;
margin-top: 30px;
}
#progress-container {
width: 80%;
max-width: 400px;
background: #333;
border-radius: 10px;
margin: 20px auto;
height: 20px;
overflow: hidden;
}
#progress-bar, #final-progress-bar {
width: 0%;
height: 100%;
background: limegreen;
border-radius: 10px;
transition: width 0.3s linear;
}
.btn {
padding: 12px 20px;
font-size: 16px;
border: none;
cursor: pointer;
border-radius: 8px;
font-weight: bold;
width: 85%;
max-width: 300px;
display: block;
margin: 15px auto;
transition: all 0.3s ease-in-out;
}
.btn-primary {
background: #007bff;
color: white;
box-shadow: 0px 4px 10px rgba(0, 123, 255, 0.4);
}
.btn-primary:hover {
background: #0056b3;
}
.btn-danger {
background: red;
color: white;
box-shadow: 0px 4px 10px rgba(255, 0, 0, 0.4);
}
.btn-danger:hover {
background: darkred;
}
.btn-follow {
background: #ff007f;
color: white;
box-shadow: 0px 4px 10px rgba(255, 0, 127, 0.4);
}
.btn-follow:hover {
background: #cc0066;
}
input {
padding: 12px;
font-size: 16px;
border-radius: 8px;
width: 85%;
max-width: 300px;
text-align: center;
border: 2px solid #007bff;
background: #222;
color: white;
}
.popup {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #222;
color: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 0px 15px rgba(255, 255, 255, 0.2);
text-align: center;
width: 320px;
}
</style>
</head>
<body>
<h1>Weather Checker</h1>
<div id="city-input">
<h2>Enter Your City</h2>
<input type="text" id="location" placeholder="Enter city...">
<button class="btn btn-primary" id="check-btn" onclick="startFakeLoading()">Check Weather</button>
</div>
<div id="loading-screen">
<h2>Checking weather data...</h2>
<div id="progress-container">
<div id="progress-bar"></div>
</div>
<p id="loading-text">Initializing...</p>
</div>
<div id="instagram-popup" class="popup">
<h2>One Last Step</h2>
<p>Follow me on Instagram to unlock the weather results!</p>
<button class="btn btn-follow" onclick="redirectToInstagram()">Follow on Instagram</button>
<button class="btn btn-danger" onclick="showBrokenPopup()">✖ Close</button>
</div>
<div id="broken-popup" class="popup">
<h2>Oops!</h2>
<p>This button is broken. Try again!</p>
<button class="btn btn-primary" onclick="closeBrokenPopup()">Okay</button>
</div>
<div id="final-loading-screen">
<h2>Finalizing Data...</h2>
<div id="progress-container">
<div id="final-progress-bar"></div>
</div>
<p id="final-loading-text">Processing data...</p>
<p><strong>Estimated Time: <span id="countdown-timer">5</span> seconds</strong></p>
</div>
<div id="weather-box">
<button class="btn btn-primary" id="search-btn" onclick="redirectToWeather()">Show Weather</button>
</div>
<script>
document.getElementById("city-input").style.display = "block";
function startFakeLoading() {
const location = document.getElementById("location").value.trim();
if (!location) {
alert("Please enter a city name.");
return;
}
document.getElementById("city-input").style.display = "none";
document.getElementById("loading-screen").style.display = "block";
let progress = 0;
const progressBar = document.getElementById("progress-bar");
const loadingText = document.getElementById("loading-text");
const messages = [
"Checking satellite data...",
"Analyzing global temperature...",
"Processing real-time conditions...",
"Finalizing weather model..."
];
function updateProgress() {
if (progress < 100) {
progress += Math.floor(Math.random() * 10) + 10;
if (progress > 100) progress = 100;
progressBar.style.width = progress + "%";
loadingText.innerText = messages[Math.floor(Math.random() * messages.length)];
setTimeout(updateProgress, 1000);
} else {
document.getElementById("loading-screen").style.display = "none";
document.getElementById("instagram-popup").style.display = "block";
}
}
updateProgress();
}
function redirectToInstagram() {
localStorage.setItem("followedOnInstagram", "true");
window.open("https://www.instagram.com/eternalamar", "_blank");
}
function showBrokenPopup() {
document.getElementById("instagram-popup").style.display = "none";
document.getElementById("broken-popup").style.display = "block";
}
function closeBrokenPopup() {
document.getElementById("broken-popup").style.display = "none";
document.getElementById("instagram-popup").style.display = "block";
}
document.addEventListener("visibilitychange", function() {
if (!document.hidden && localStorage.getItem("followedOnInstagram") === "true") {
localStorage.removeItem("followedOnInstagram");
document.getElementById("instagram-popup").style.display = "none";
document.getElementById("final-loading-screen").style.display = "block";
let countdown = 5;
function updateCountdown() {
document.getElementById("countdown-timer").innerText = countdown;
document.getElementById("final-progress-bar").style.width = (5 - countdown) * 20 + "%";
if (countdown === 0) {
document.getElementById("final-loading-screen").style.display = "none";
document.getElementById("weather-box").style.display = "block";
document.getElementById("search-btn").style.display = "inline-block";
} else {
countdown--;
setTimeout(updateCountdown, 1000);
}
}
updateCountdown();
}
});
function redirectToWeather() {
const location = document.getElementById("location").value.trim();
window.location.href = `https://www.google.com/search?q=${encodeURIComponent(location)}+weather`;
}
</script>
</body>
</html>