Minifying
This commit is contained in:
parent
19203148e5
commit
9c4115b9ed
14 changed files with 347 additions and 29 deletions
21
js/init.js
21
js/init.js
|
@ -1,6 +1,7 @@
|
|||
function init() {
|
||||
initStars()
|
||||
computeAge()
|
||||
insertSystemInfo()
|
||||
}
|
||||
|
||||
function initStars() {
|
||||
|
@ -13,10 +14,10 @@ function initStars() {
|
|||
]
|
||||
const len = colors.length
|
||||
|
||||
const canvas = document.querySelector('canvas#stars')
|
||||
const canvas = document.getElementById('stars')
|
||||
const css = getComputedStyle(canvas)
|
||||
|
||||
const w = canvas.width = styleValue(css.getPropertyValue('width' ))
|
||||
const w = canvas.width = styleValue(css.getPropertyValue('width'))
|
||||
const h = canvas.height = styleValue(css.getPropertyValue('height'))
|
||||
|
||||
// if CSS hasn't been loaded yet
|
||||
|
@ -67,3 +68,19 @@ function computeAge() {
|
|||
|
||||
document.getElementById('age-js').textContent = Math.floor(age)
|
||||
}
|
||||
|
||||
function insertSystemInfo() {
|
||||
|
||||
const inxi = document.getElementById('inxi')
|
||||
|
||||
let xhr = new XMLHttpRequest()
|
||||
xhr.open('GET', '/inxi.txt')
|
||||
|
||||
xhr.onreadystatechange = () => {
|
||||
if (xhr.readyState != xhr.DONE) return
|
||||
if (xhr.status != 200) return
|
||||
inxi.textContent = xhr.response
|
||||
}
|
||||
|
||||
xhr.send()
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue