Skip to content

Commit

Permalink
minor
Browse files Browse the repository at this point in the history
  • Loading branch information
progapandist committed Jun 11, 2024
1 parent c3db5f6 commit a472124
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/javascript/controllers/hints_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default class extends Controller {

this.hint = document.createElement("div");

this.hint.innerText = "click to go =>, click left edge to go <=";
this.hint.innerText = "click to 👉, click left edge to 👈";

this.hint.innerText += isMobile
? " | flip phone to resize"
Expand Down
16 changes: 2 additions & 14 deletions app/javascript/controllers/random_image_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,14 @@ export default class extends Controller {
static outlets = ["sessions"];

connect() {
console.log(this.sessionsOutlet.sessionIdValue);

console.log(
"Hello from RandomImageController, imgproxyUrl:",
this.imgproxyUrlValue
);

this.imageDisplayTarget.src = this.imgproxyUrlValue;

const urlParams = new URLSearchParams(window.location.search);
if (!urlParams.has("page")) {
urlParams.set("page", 1);
}
// Add event listener to intercept clicks on the viewport
document.addEventListener("click", this.handleClick.bind(this));
}

handleClick(event) {
// Calculate the width of the left 50% of the screen
const leftBoundary = window.innerWidth * 0.5;
// Calculate the width of the left 20% of the screen
const leftBoundary = window.innerWidth * 0.2;

// Check if the click target is the draggable box or its children
if (!event.target.closest("[data-controller='draggable']")) {
Expand Down

0 comments on commit a472124

Please sign in to comment.