From 06b1462ff9887f02b5b7b60041e59ceb9508f222 Mon Sep 17 00:00:00 2001 From: Andy Baranov Date: Sun, 9 Jun 2024 10:09:01 +0200 Subject: [PATCH] different hints for mobil --- app/javascript/controllers/hints_controller.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/javascript/controllers/hints_controller.js b/app/javascript/controllers/hints_controller.js index 52777b4..e6c8c02 100644 --- a/app/javascript/controllers/hints_controller.js +++ b/app/javascript/controllers/hints_controller.js @@ -10,8 +10,15 @@ export default class extends Controller { } addHintMessage() { + const isMobile = /Mobi|Android/i.test(navigator.userAgent); + console.log(isMobile); + this.hint = document.createElement("div"); - this.hint.innerText = "drag corner to resize ⇲"; + + this.hint.innerText = isMobile + ? "flip phone to resize" + : "drag corner to resize ⇲"; + this.hint.style.position = "fixed"; this.hint.style.bottom = "10px"; this.hint.style.right = "10px";