Add Dev judgment

This commit is contained in:
ElapsingDreams 2024-08-08 16:40:34 +08:00 committed by GitHub
parent c29a3fd6d4
commit 25f7540f86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,7 +34,13 @@ if ("aqi" in aqi) {
if (item["defaultLocalAqi"]) {
document.getElementById("aqi-data").innerText = "AQI " + item["valueDisplay"] + " " + item["category"]
// 将(255,255,255)这种格式的颜色设置给css
document.getElementById("aqi-dot").style.backgroundColor = "rgb(" + item["color"] + ")"
if(is_dev == 1){
//开发版
document.getElementById("aqi-dot").style.backgroundColor = "rgb(" + item["color"]['red'] + "," + item["color"]['green'] + "," + item["color"]['blue'] + "," + item["color"]['alpha'] + ")"
}else{
//正式版
document.getElementById("aqi-dot").style.backgroundColor = "rgb(" + item["color"] + ")"
}
}
}
)