diff --git a/2026/half_field-old.png b/2026/half_field-old.png new file mode 100644 index 000000000..513f78376 Binary files /dev/null and b/2026/half_field-old.png differ diff --git a/2026/half_field.png b/2026/half_field.png index 513f78376..4fae50949 100644 Binary files a/2026/half_field.png and b/2026/half_field.png differ diff --git a/2026/rebuilt_config.js b/2026/rebuilt_config.js index 0a6616aaa..11ab74890 100644 --- a/2026/rebuilt_config.js +++ b/2026/rebuilt_config.js @@ -59,8 +59,8 @@ var config_data = ` "type": "clickable_image", "filename": "2026/half_field.png", "clickRestriction": "one", - "dimensions": "7 10", - "allowableResponses": "4 11 18 25 32 39 46 53 60 67", + "dimensions": "1 5", + "allowableResponses": "1 2 3 4 5", "shape": "circle 5 black red true" } ], @@ -69,8 +69,8 @@ var config_data = ` "code": "asl", "type": "clickable_image", "filename": "2026/half_field.png", - "dimensions": "7 10", - "allowableResponses": "1 2 3 4 8 9 10 11 15 16 17 18 22 23 24 25 29 30 31 32 36 37 38 39 43 44 45 46 50 51 52 53 57 58 59 60 64 65 66 67", + "dimensions": "2 3", + "allowableResponses": "1 2 3 4 5 6", "expectedMax": 5, "shape": "circle 5 black red true" }, @@ -116,8 +116,8 @@ var config_data = ` "code": "tsl", "type": "clickable_image", "filename": "2026/half_field.png", - "dimensions": "7 10", - "allowableResponses": "1 2 3 4 8 9 10 11 15 16 17 18 22 23 24 25 29 30 31 32 36 37 38 39 43 44 45 46 50 51 52 53 57 58 59 60 64 65 66 67", + "dimensions": "2 3", + "allowableResponses": "1 2 3 4 5 6", "expectedMax": 25, "shape": "circle 5 black red true" }, @@ -182,7 +182,7 @@ var config_data = ` "10": "Level 1[break]", "20": "Level 2[break]", "30": "Level 3[break]", - "a": "Attempted[break]", + "f": "Failed[break]", "x": "Not Attempted" }, "defaultValue": "x" @@ -234,7 +234,8 @@ var config_data = ` "code": "co", "type": "text", "size": 15, - "maxSize": 55 + "maxSize": 200, + "rows": 5 } ] }`; diff --git a/resources/css/scoutingPASS.css b/resources/css/scoutingPASS.css index 6102167aa..a1cb449c0 100644 --- a/resources/css/scoutingPASS.css +++ b/resources/css/scoutingPASS.css @@ -41,6 +41,7 @@ html, body{ border-color: black; } + .button { font-family: Roboto; font-size: 16px; @@ -168,7 +169,10 @@ input[type="checkbox"] { margin: 2vw; } -.field-image-src{ +.field-image-src { + width: 225px; + max-width: 500px; + height: auto; background-position: center; border: 1px solid; } diff --git a/resources/js/scoutingPASS.js b/resources/js/scoutingPASS.js index fa91c3e68..9a364da4c 100644 --- a/resources/js/scoutingPASS.js +++ b/resources/js/scoutingPASS.js @@ -343,6 +343,8 @@ function addClickableImage(table, idx, name, data) { cell.setAttribute("colspan", 2); cell.setAttribute("style", "text-align: center;"); var canvas = document.createElement('canvas'); + canvas.width = 225; + canvas.height = 300; //canvas.onclick = onFieldClick; canvas.setAttribute("onclick", "onFieldClick(event)"); canvas.setAttribute("class", "field-image-src"); @@ -475,9 +477,21 @@ function addText(table, idx, name, data) { cell1.setAttribute("title", data.tooltip); } cell2.classList.add("field"); - var inp = document.createElement("input"); - inp.setAttribute("id", "input_" + data.code); - inp.setAttribute("type", "text"); + // var inp = document.createElement("input"); + // inp.setAttribute("id", "input_" + data.code); + // inp.setAttribute("type", "text"); + + if (data.hasOwnProperty('rows')) { + var inp = document.createElement("textarea"); + inp.setAttribute("id", "input_" + data.code); + inp.setAttribute("rows", data.rows); + inp.style.resize = "none"; + } else { + var inp = document.createElement("input"); + inp.setAttribute("id", "input_" + data.code); + inp.setAttribute("type", "text"); + } + if (enableGoogleSheets && data.hasOwnProperty('gsCol')) { inp.setAttribute("name", data.gsCol); } else { @@ -1083,7 +1097,7 @@ function clearForm() { } } } else { - if (e.type == "number" || e.type == "text" || e.type == "hidden") { + if (e.type == "number" || e.type == "text" || e.type == "hidden" || e.tagName == "TEXTAREA") { if ((e.classList.contains("counter")) || (e.classList.contains("timer")) || (e.classList.contains("cycle"))) { @@ -1227,8 +1241,15 @@ function onFieldClick(event) { } //Turns coordinates into a numeric box - let box = ((Math.ceil(event.offsetY / target.height * resY) - 1) * resX) + Math.ceil(event.offsetX / target.width * resX); - let coords = event.offsetX + "," + event.offsetY; + // let box = ((Math.ceil(event.offsetY / target.height * resY) - 1) * resX) + Math.ceil(event.offsetX / target.width * resX); + // let coords = event.offsetX + "," + event.offsetY; + + const scaleX = target.width / target.getBoundingClientRect().width; + const scaleY = target.height / target.getBoundingClientRect().height; + const adjustedX = event.offsetX * scaleX; + const adjustedY = event.offsetY * scaleY; + let box = ((Math.ceil(adjustedY / target.height * resY) - 1) * resX) + Math.ceil(adjustedX / target.width * resX); + let coords = adjustedX + "," + adjustedY; let allowableResponses = document.getElementById("allowableResponses" + base).value;