added warning for unsupported browsers
This commit is contained in:
+27
-6
@@ -41,9 +41,9 @@ function randomBool(probability) {
|
|||||||
|
|
||||||
|
|
||||||
function clampNearest(n, mul) {
|
function clampNearest(n, mul) {
|
||||||
if(n > 0)
|
if (n > 0)
|
||||||
return Math.ceil(n / mul) * mul
|
return Math.ceil(n / mul) * mul
|
||||||
else if( n < 0)
|
else if (n < 0)
|
||||||
return Math.floor(n / mul) * mul
|
return Math.floor(n / mul) * mul
|
||||||
else
|
else
|
||||||
return 0
|
return 0
|
||||||
@@ -58,12 +58,12 @@ function lerp(x, y, t) {
|
|||||||
function debugPrint(title, value) {
|
function debugPrint(title, value) {
|
||||||
if (!title) {
|
if (!title) {
|
||||||
console.error(
|
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
|
--> unknown:0:0
|
||||||
|
|
|
|
||||||
0 | debugPrint()
|
0 | debugPrint()
|
||||||
| ^^^^^^^^^^-- argument #1 of type \`Any\` is missing`
|
| ^^^^^^^^^^-- argument #1 of type \`Any\` is missing`
|
||||||
)
|
)
|
||||||
return
|
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()
|
setVh()
|
||||||
debugPrint("currentPage", `${CURRENT_PAGE} ${Object.keys(PAGES)[CURRENT_PAGE + 1]}`)
|
debugPrint("currentPage", `${CURRENT_PAGE} ${Object.keys(PAGES)[CURRENT_PAGE + 1]}`)
|
||||||
|
|
||||||
startLoadingScreen()
|
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...")
|
setLoadingProgress("Fetching tips...")
|
||||||
|
|
||||||
await loadTips()
|
await loadTips()
|
||||||
@@ -203,7 +224,7 @@ document.addEventListener("DOMContentLoaded", async function() {
|
|||||||
}, false)
|
}, false)
|
||||||
|
|
||||||
|
|
||||||
window.addEventListener("resize", function() {
|
window.addEventListener("resize", function () {
|
||||||
setVh()
|
setVh()
|
||||||
calcPixelDensity()
|
calcPixelDensity()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user