JSFiddle - React, Tailwind, and code Playground
by Cupidvogel
HTML
<div class = 'enquireMainlineAnswer'>
<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 weatherForecastSubUnitValue'>
<span>15° / 16°</span>
</div>
</div>
<div class = 'weatherForecastUnit'>
<div class = 'weatherForecastSubUnit weatherForecastSubUnitIcon'>
<i class="fas fa-cloud-sun-rain"></i>
</div>
<div class = 'weatherForecastSubUnit weatherForecastSubUnitDay'>
<span>Fri</span>
</div>
<div class = 'weatherForecastSubUnit weatherForecastSubUnitValue'>
<span>18° / 17°</span>
</div>
</div>
<div class = 'weatherForecastUnit'>
<div class = 'weatherForecastSubUnit weatherForecastSubUnitIcon'>
<i class="fas fa-cloud-rain"></i>
</div>
<div class = 'weatherForecastSubUnit weatherForecastSubUnitDay'>
<span>Sat</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: 410px;
background-image: url("https://upload.wikimedia.org/wikipedia/commons/thumb/0/08/EmpireStateNewYokCity.jpg/1200px-EmpireStateNewYokCity.jpg");
background-size: cover;
}
.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: 6px;
}
.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: -10px;
}
#currentWeatherSlider span:focus, #currentWeatherSlider span:active, #currentWeatherSlider span:hover {
border: 0 !important;
outline: 0 !important;
}
.currentWeatherRangeElements {
position: absolute;
top: 10px;
width: 100%;
height:...
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);
});
});