From f374a38412b8e4dfb598465307c771aa3f2a9e51 Mon Sep 17 00:00:00 2001 From: Tina Tsai <144840829+pawsnana@users.noreply.github.com> Date: Sat, 9 Dec 2023 14:22:24 -0500 Subject: [PATCH] let the selection function disable! --- projects/project-03/script.js | 14 ++++++++++---- projects/project-03/style.css | 17 ++++++++++++----- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/projects/project-03/script.js b/projects/project-03/script.js index 894a816..380a940 100644 --- a/projects/project-03/script.js +++ b/projects/project-03/script.js @@ -9,6 +9,7 @@ document.addEventListener("DOMContentLoaded", function() { let clientY = e.clientY || e.touches[0].clientY; offsetX = clientX - background.offsetLeft; offsetY = clientY - background.offsetTop; + background.style.cursor = 'grab'; } function doDragBackground(e) { @@ -26,11 +27,14 @@ document.addEventListener("DOMContentLoaded", function() { // to make the icons looks like floating trial 1 updateIconPositions(newX, newY); + + background.style.cursor = 'grabbing'; } } function endDragBackground() { isDraggingBackground = false; + background.style.cursor = 'default'; } // this function is to update icon position when i move the background @@ -114,11 +118,10 @@ document.addEventListener("DOMContentLoaded", function() { let iconsInDivision = division.querySelectorAll('.icon'); let divisionId = division.id; let correctIconsForDivisions = { - 'div1_TD': ['icon_akali', 'icon_ekko', 'icon_senna'], + 'TD_pickdroplot': ['icon_akali', 'icon_ekko', 'icon_senna'], 'div2_K': ['icon_akali', 'icon_ahri', 'icon_kaisa'], - }; - + let correctIcons = correctIconsForDivisions[divisionId] || []; let correctCount = 0; iconsInDivision.forEach(icon => { @@ -126,9 +129,12 @@ document.addEventListener("DOMContentLoaded", function() { correctCount++; } }); - + + console.log(`Division: ${divisionId}, Correct Count: ${correctCount}`); + if (correctCount >= 3) { division.style.backgroundImage = 'url(backgrounds/TD_1.png)'; + console.log(`Background image set for division: ${divisionId}`); } } }); diff --git a/projects/project-03/style.css b/projects/project-03/style.css index 23d0a40..62be4f4 100644 --- a/projects/project-03/style.css +++ b/projects/project-03/style.css @@ -10,6 +10,12 @@ body, html { height: 100%; margin: 0; overflow: hidden; /* won't scroll i think */ + + user-select: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + } /* for making view port default at 489 and 479 */ @@ -86,11 +92,11 @@ body, html { } -.container { +/* .container { position: relative; width: 2638px; height: 2075px; - } + } */ .division { position: absolute; @@ -110,9 +116,9 @@ body, html { } -.pick_drop_lot { +#TD_pickdroplot { height: 500px; - width: 750px;; + width: 750px; z-index: 1; position: absolute; top: 400px; @@ -124,7 +130,7 @@ body, html { } -#TD_pickdroplot_1, #TD_pickdroplot_2 #TD_pickdroplot_3 { +#TD_pickdroplot_1 { width: 65px; height: 65px; border-radius: 50%; @@ -132,6 +138,7 @@ body, html { z-index: 1; display: inline-block; + }