Climate

by Cupidvogel

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.css">
<script src="https://kit.fontawesome.com/63eb67d0e7.js"></script>
<link rel="stylesheet" href="https://f001.backblazeb2.com/file/kaustavtemp/switchery.css">
<script src="https://f001.backblazeb2.com/file/kaustavtemp/switchery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.3.0/Chart.js"></script>
<div class = 'enquireMainlineAnswer'>
<img class = 'covePic' src = 'https://ak.picdn.net/shutterstock/videos/27185671/thumb/12.jpg' />
<div class = 'weatherRangeChart'>
<canvas id="chartJSContainer" width="600" height="120"></canvas>

</div>

<div class = 'weatherSnapshot'>
<div>Precipitation: 85%</div>
<div>Wind: 11 KMPH</div>
<div>Humidity: 69%</div>

</div>

<div class = 'temperatureUnitChanger'>
<span>Showing temperature in Celsius</span>
<input type="checkbox" class="js-switch temperatureUnit" checked />
</div>

<div class = 'weatherPlaceAndDate'>
  <div class = 'weatherPlace'>
  San Fransisco
  </div>
  <div class = 'weatherDate'>
  July 26, 2021
  </div>

</div>
<div class = 'curTemperature'>
-12°
</div>

<div class = 'curWeatherIconography'>
<i class="fas fa-cloud-rain"></i>
<div>Rainy</div>
</div>

<div class = 'curDayMaxAndMindTemp'>
<span>-12° / 21°</span>

</div>

<div class = 'currentWeatherRange'>
<div class = 'currentWeatherRangeElements'>
<span>12 AM</span><span>1 AM</span><span>2 AM</span><span>3 AM</span><span>4 AM</span><span>5 AM</span><span>6 AM</span><span>7 AM</span>

</div>
<div id="currentWeatherSlider"></div>
</div>

<div class = 'weatherForecast'>

<div class = 'weatherForecastUnit'>
  <div class = 'weatherForecastSubUnit weatherForecastSubUnitIcon'>
<i class="fas fa-cloud"></i>
  </div>
  <div class = 'weatherForecastSubUnit weatherForecastSubUnitDay'>
<span>Thu</span>
  </div>
  <div class = 'weatherForecastSubUnit...

CSS

.enquireMainlineAnswer {
  width: 650px;
  border-radius: 20px;
  border: 1px solid #ddd;
  position: relative;
  font-family: sans-serif;
  font-size: 13px;
  padding: 10px 0 0 0;
  height: 555px;
}

.covePic {
position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    border-radius: 20px 20px 0 0;
    display: block;
    width: 100%;
    height: 410px;
    /* filter: blur(3px); */
}

.weatherRangeChart {
  position: absolute;
  top: 410px;
  width: 100%;
  left: 0px;
  height: 130px;
}

canvas { background-color : #eee;
width:650px !important;
  height:120px !important;
  background: white
}

.weatherPlaceAndDate {
  position: absolute;
  width: 420px;
  color: white;
  height: 100px;
  left: 20px;
  padding: 10px;
}

.weatherPlace {
  font-size: 30px;
  font-weight: bold;
  color: white;
}

.weatherDate {
  font-size: 16px;
  margin-top: 1px;
}

.curTemperature, .curDayMaxAndMindTemp {
    position: absolute;
    top: 11px;
    right: 40px;
    width: 101px;
    height: 50px;
    font-size: 54px;
    color: white;
    font-weight: bold;
}

.curWeatherIconography {
  position: absolute;
  top: 95px;
  left: 30px;
  width: 347px;
  height: 50px;
}

.curWeatherIconography .fas {
    font-size: 42px;
    position: relative;
    margin-top: 13px;
    left: 0px;
    display: inline-block;
    color: white;
}

.curWeatherIconography div {
  color: white;
  font-size: 24px;
  position: relative;
  margin-top: 10px;
}

.curDayMaxAndMindTemp {
  top: 95px;
  width: 150px;
  text-align: right;
  font-size: 24px;
}

.curDayMaxAndMindTemp span {
  position: relative;
  top: 13px;
}

.currentWeatherRange {
  position: absolute;
    top: 210px;
    width: calc(100% - 20px);
    height: 46px;
    left: 10px;
}

#currentWeatherSlider {
  border: 1px solid white;
  height: 0;
  position: absolute;
  bottom: 0;
  width: 100%;
}

#currentWeatherSlider span {
  height: 20px;
  width: 20px;
  border-radius: 10px;
  background: white;
  border: 0;
  top:...

JavaScript

$( function() {
    $( "#currentWeatherSlider" ).slider({
    	value: 0,
    });
    
    var switchery = Array.prototype.slice.call(document.querySelectorAll('.js-switch'));
switchery.forEach(function(html) {
    switchery[html.getAttribute('id')] = new Switchery(html);
});

var options = {
  type: 'line',
  data: {
    labels: ["11 PM", "12 AM", "1 AM", "2 AM", "3 AM", "4 AM", "5 AM", "6 AM"],
    datasets: [
	    {
	      label: 'Temperature',
	      data: [12, 19, 18, 15, 12, 13, 21, 19],
      	borderWidth: 1
    	}
		]
  },
  options: {
  	scales: {
    	yAxes: [{
        ticks: {
					reverse: false
        },
        gridLines: {
                  display: false
               }
      }],
      xAxes: [{
        gridLines: {
                  display: false
               }
      }]
    }
  }
}

var ctx = document.getElementById('chartJSContainer').getContext('2d');
new Chart(ctx, options);

  });