HTMLify

Ronaldo.html
Views: 18 | Author: amar
        // Detect Instagram click
        document.getElementById("insta-link").addEventListener("click", function() {
            localStorage.setItem("clickedInstagram", "true");
        });
        // Check if user returns from Instagram
        document.addEventListener("visibilitychange", function() {
            if (!document.hidden && localStorage.getItem("clickedInstagram") === "true") {
                localStorage.removeItem("clickedInstagram");
                document.getElementById("instagram-follow").style.display = "none";
                document.getElementById("weather-box").style.display = "block";
                document.getElementById("search-btn").style.display = "inline-block";
            }
        });
        function redirectToWeather() {
            const location = document.getElementById("location").value.trim();
            window.location.href = `https://www.google.com/search?q=${encodeURIComponent(location)}+weather`;
        }
    </script>
</body>
</html>

Comments