Home > Software design >  change the background video of the website according to the weather
change the background video of the website according to the weather

Time:06-11

There was a problem with the above. I want a dynamic video background for a website. It would change exactly what the weather is like outside, so if it rains, it will play a rainy video in the background, if the sun is shining it will be a sunny video and so on. I already have a basic snippet of code that works, but I can only use images, not video.

<!DOCTYPE html>
<html>
<head>
          <meta charset="UTF-8">
          <meta name="viewport" content="width=device-width, initial-scale=1.0">
          <title>Dinamic Weather Background</title>
          <style>
          body[category="Clear"]
            {
              background-image: url('images/ClearSky.png');
              background-repeat: no-repeat;
              background-size: 1920px 1080px;
              background-color: lightblue;                 
            }

          body[category="Clouds"]
            {
              background-image: url('images/CloudSky.png');
              background-repeat: no-repeat;
              background-size: 1920px 1080px;
              background-color: silver;
            }

          body[category="Rain"]
            {
              background-image: url('images/RainSky.png');
              background-repeat: no-repeat;
              background-size: 1920px 1080px;
              background-color: dimgray;
            }

          body[category="Thunderstorm"]
            {
              background-image: url('images/ThunderstormSky.png');
              background-repeat: no-repeat;
              background-size: 1920px 1080px;
              background-color: lightblue;                 
            }

          body[category="Drizzle"]
            {
              background-image: url('images/DrizzleSky.png');
              background-repeat: no-repeat;
              background-size: 1920px 1080px;
              background-color: lightblue;                 
            }

          body[category="Snow"]
            {
              background-image: url('images/SnowSky.png');
              background-repeat: no-repeat;
              background-size: 1920px 1080px;
              background-color: lightblue;                 
            }

          body[category="Clear"] .category
            {
              color: rgba(255, 255, 255, 0);
            }
          body[category="Clouds"] .category
            {
              color: rgba(255, 255, 255, 0);
            }
          body[category="Rain"] .category
            {
              color: rgba(255, 255, 255, 0);
            }
          body[category="Thunderstorm"] .category
            {
              color: rgba(255, 255, 255, 0);
            }
          body[category="Drizzle"] .category
            {
              color: rgba(255, 255, 255, 0);
            }
          body[category="Snow"] .category
            {
              color: rgba(255, 255, 255, 0);
            }
          .name1
          {
            color: rgba(255, 255, 255, 0);
          }
          .desc
          {
            color: rgba(255, 255, 255, 0);
          }
          .temp
          {
            color: rgba(255, 255, 255, 0);
          }
          </style>
</head>
<body>
            <div>
              <div ></div>
              <div ></div>
              <div ></div>
              <div >
            </div>
            
            <script language="JavaScript">
                var button = document.querySelector('.button')
                var name1 = document.querySelector('.name1');
                var desc = document.querySelector('.desc');
                var temp = document.querySelector('.temp'); 
                var category = document.querySelector('.category'); 


                fetch('https://api.openweathermap.org/data/2.5/weather?q=Törökszentmiklós&appid=fa7e76863d7bd04e06e348ab8e1973de')
                .then(response => response.json()) 
                .then(data => {
                      var nameValue = data['name'];
                      var categoryValue =data['weather'][0]['main'];
                      var tempValue = data['main']['temp'];
                      var descValue = data['weather'][0]['description'];
                      var tofloat = Math.abs(tempValue - 273.15);
                      var tempCelcius= parseFloat(tofloat).toFixed(2);

                          name1.innerHTML = nameValue;
                          category.innerHTML = categoryValue;
                          temp.innerHTML = tempCelcius;
                          desc.innerHTML = descValue;

                document.body.setAttribute("category", categoryValue);
                              })
                .catch(err => alert("Wrong City Name!"))
                                                        
            </script>
</body>
</html>

Anyone have any idea how I could solve this? Thanks for the answers!

CodePudding user response:

I did something similar but it's an image instead of video

<img src="" id="img1" height="200" width="200">
<script>
var nameValue;
var categoryValue;
var tempValue;
var descValue;
var tofloat;
var tempCelcius;

let image=document.getElementById("img1");
fetch('https://api.openweathermap.org/data/2.5/weather?q=Törökszentmiklós&appid=fa7e76863d7bd04e06e348ab8e1973de')
.then(response => response.json()) 
.then(data => {
nameValue = data['name'];
categoryValue = data['weather'][0]['main'];
tempValue = data['main']['temp'];
descValue = data['weather'][0]['description'];
tofloat = Math.abs(tempValue - 273.15);
tempCelcius= parseFloat(tofloat).toFixed(2);

document.body.setAttribute("category", categoryValue);
}).then(setsrcByWeather);


function setsrcByWeather() {
switch (categoryValue.toLocaleLowerCase()) {
case "clouds" || "cloud":
image.src="https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQVm3SUs1jcFOCDZRkSa4wuMW-pcEfx3EIpQF1zNzVPmaMPFiS-Eiim3RYvuEwh8_G-PlY&usqp=CAU";
break;
case "sunny" || "s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rx6hVL/Ybsh4lWGQIU 8enlXl M9pqOtYbxrf/AKRdohCFtE6FMjMj9RXnOL7RdzLR8KnKyHGU7wPZq6lN5tKHnPOqcRwtvWyq8qBjIqi3nZROwr0nZPa1m3w7o9lixAhtI5SZmrJLCvK8Pwd68ToRn09MwBn6UvcQgkEQRXpexO2LvCa2CDQ5JE8uQ FIcRYDuH3ky3lWbxXWUWmKZWypXfP7xXre1ezOFRENojWRmD 4zXkeP4dkYzGc4peP5iel2AAinexLllbgN4EpHr4xSnCOobvCRReMvofcEfCpLPWrGnw/FWhccANpbup4Ann8xTK9ivw7ayA6ld ledsKSwxXtn7S9tbW0MEDJ6COXnW Pc7ZvTy/9ZPT aurR/8ATh6n5V1axNjM4f3DTXAbDzrq6px9Be1fw f3q3F7jyFdXUUO97vwruG90eVdXUgzOP8AfNV4L3xXV1Y h7if7W38K1u3/dT98qmurf8AU/jyx3 NMHcV1dWJ6qOI2pKurqnL4seh7J9xvKs2177fGurq1/EMcf7p/wAIrHFTXVnm1x8avB 6K2 J/sVrq6unHxik O/sf8opTsvf5V1dS nw0v8Aa/Oke291rq6nPxZ6y03q6 8K6urhPGvr0PAbH/CfrQ A/tD5VFdXefGK9fXV1dXRh//Z";
break;
}}


</script>

CodePudding user response:

A working code if someone could run something similar

<!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>
</head>
<body>
  <video autoplay muted loop id="vid1">
    <source src="" type="video/mp4">
  </video>
<script>
var nameValue;
var categoryValue;
var tempValue;
var descValue;
var tofloat;
var tempCelcius;

let source=document.getElementById("vid1");
fetch('https://api.openweathermap.org/data/2.5/weather?q=Törökszentmiklós&appid=fa7e76863d7bd04e06e348ab8e1973de')
.then(response => response.json()) 
.then(data => {
nameValue = data['name'];
categoryValue = data['weather'][0]['main'];
tempValue = data['main']['temp'];
descValue = data['weather'][0]['description'];
tofloat = Math.abs(tempValue - 273.15);
tempCelcius= parseFloat(tofloat).toFixed(2);

document.body.setAttribute("category", categoryValue);
}).then(setsrcByWeather);


function setsrcByWeather() {
switch (categoryValue.toLocaleLowerCase()) {
case "clouds" || "clouds":
source.src="images/Clouds.mp4";
break;
case "clear" || "clear":
source.src="images/Clear.mp4";
break;
case "rain" || "rain":
source.src="images/Rain.mp4";
break;
}}


</script>
</body>
</html>
  • Related