Initial commit
This commit is contained in:
commit
494429a6be
6 files changed
+156
No files matched your search
@@ -0,0 +1,25 @@
|
||||
.parent {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
font-size: 80;
|
||||
/* font-family: 'Comic Neue', cursive; */
|
||||
font-family: "Comic Sans MS", "Comic Sans", cursive;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
@media screen and (max-width: 800px) {
|
||||
.parent {
|
||||
font-size: 60;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@media screen and (min-width: 1000px) {
|
||||
.parent {
|
||||
font-size: 80;
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
function loadContent() {
|
||||
let domain = "http://localhost/percent"
|
||||
let xhttp = new XMLHttpRequest();
|
||||
let ele = document.getElementById('number')
|
||||
let temp = document.getElementById('temp')
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
let obj = JSON.parse(this.responseText)
|
||||
ele.innerHTML = obj.percent
|
||||
temp.innerHTML = obj.temp[0] + "°C / " + obj.temp[1] + "°C"
|
||||
}
|
||||
};
|
||||
xhttp.open("GET", domain, true);
|
||||
xhttp.send();
|
||||
}
|
||||
|
||||
setInterval(loadContent, 4000)
|
||||
loadContent()
|
||||
Reference in new issue
Block a user