added warning for unsupported browsers
This commit is contained in:
+27
-6
@@ -41,9 +41,9 @@ function randomBool(probability) {
|
||||
|
||||
|
||||
function clampNearest(n, mul) {
|
||||
if(n > 0)
|
||||
if (n > 0)
|
||||
return Math.ceil(n / mul) * mul
|
||||
else if( n < 0)
|
||||
else if (n < 0)
|
||||
return Math.floor(n / mul) * mul
|
||||
else
|
||||
return 0
|
||||
@@ -58,12 +58,12 @@ function lerp(x, y, t) {
|
||||
function debugPrint(title, value) {
|
||||
if (!title) {
|
||||
console.error(
|
||||
`error[A0000]: this function takes 1 argument but 0 arguments were supplied
|
||||
`error[A0000]: this function takes 1 argument but 0 arguments were supplied
|
||||
--> unknown:0:0
|
||||
|
|
||||
0 | debugPrint()
|
||||
| ^^^^^^^^^^-- argument #1 of type \`Any\` is missing`
|
||||
)
|
||||
)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -147,12 +147,33 @@ function setVh() {
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener("DOMContentLoaded", async function() {
|
||||
function getEngine() {
|
||||
if ("MozAppearance" in document.documentElement.style)
|
||||
{ return "gecko" }
|
||||
|
||||
if (
|
||||
window.chrome &&
|
||||
CSS.supports("-webkit-appearance", "none") &&
|
||||
!CSS.supports("-apple-pay-button-style", "black")
|
||||
) { return "blink" }
|
||||
|
||||
if (CSS.supports("-apple-pay-button-style", "black"))
|
||||
{ return "webkit" }
|
||||
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
|
||||
document.addEventListener("DOMContentLoaded", async function () {
|
||||
setVh()
|
||||
debugPrint("currentPage", `${CURRENT_PAGE} ${Object.keys(PAGES)[CURRENT_PAGE + 1]}`)
|
||||
|
||||
startLoadingScreen()
|
||||
|
||||
let engine = getEngine()
|
||||
if (!["gecko", "blink"].includes(engine))
|
||||
{ alert("Your web browser is not supported, expect major issues.\nRendering engine:" + engine) }
|
||||
|
||||
setLoadingProgress("Fetching tips...")
|
||||
|
||||
await loadTips()
|
||||
@@ -203,7 +224,7 @@ document.addEventListener("DOMContentLoaded", async function() {
|
||||
}, false)
|
||||
|
||||
|
||||
window.addEventListener("resize", function() {
|
||||
window.addEventListener("resize", function () {
|
||||
setVh()
|
||||
calcPixelDensity()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user