Skip to content

Commit

Permalink
different hints for mobil
Browse files Browse the repository at this point in the history
  • Loading branch information
progapandist committed Jun 9, 2024
1 parent 704aff0 commit 06b1462
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/javascript/controllers/hints_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 06b1462

Please sign in to comment.