From 73513fe40a9371ec3f1aab022ebbaecbea012b2d Mon Sep 17 00:00:00 2001 From: Jayd-Rubies <155784127+Jayd-Rubies@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:06:01 -0400 Subject: [PATCH 1/4] UwU^3 --- UwUify.js | 83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 UwUify.js diff --git a/UwUify.js b/UwUify.js new file mode 100644 index 00000000..5f64ca53 --- /dev/null +++ b/UwUify.js @@ -0,0 +1,83 @@ +document.body.style.backgroundImage = 'url("https://jayd-rubies.github.io/uwuify.png")'; +document.body.style.backgroundSize = 'cover'; +gameDiv.style.border = "1px solid #ffffff00"; +window.addEventListener("load",function(){ + document.querySelectorAll(".categoryButton").forEach(e => { + e.style.backgroundColor = "#ffc0cb40"; + }) +}); +function drawCursor() { + canvas.style.backgroundColor = "transparent"; + var layerCtx = canvasLayers.gui.getContext('2d'); + var mouseOffset = Math.trunc(mouseSize/2); + var topLeft = [mousePos.x-mouseOffset,mousePos.y-mouseOffset]; + var bottomRight = [mousePos.x+mouseOffset,mousePos.y+mouseOffset]; + // Draw a square around the mouse + layerCtx.strokeStyle = "#ffc0cb"; + layerCtx.fillStyle = "#ffc0cb40"; + layerCtx.strokeRect(topLeft[0]*pixelSize,topLeft[1]*pixelSize,(bottomRight[0]-topLeft[0]+1)*pixelSize,(bottomRight[1]-topLeft[1]+1)*pixelSize); + layerCtx.beginPath(); + layerCtx.lineWidth = 3; + layerCtx.stroke(); + layerCtx.fillRect(topLeft[0]*pixelSize,topLeft[1]*pixelSize,(bottomRight[0]-topLeft[0]+1)*pixelSize,(bottomRight[1]-topLeft[1]+1)*pixelSize); + layerCtx.fill(); + // draw one transparent pixel in the center + if (settings.precision) { + layerCtx.fillStyle = "#ffc0cb80"; + layerCtx.fillRect(mousePos.x*pixelSize,mousePos.y*pixelSize,pixelSize,pixelSize); + } + if (shaping) { + if (shaping === 1) { // Draw a white line from shapeStart.x to shapeStart.y + layerCtx.beginPath(); + layerCtx.strokeStyle = "#ffc0cb"; + layerCtx.lineWidth = 3; + layerCtx.moveTo(shapeStart.x*pixelSize+pixelSizeHalf, shapeStart.y*pixelSize+pixelSizeHalf); + layerCtx.lineTo(mousePos.x*pixelSize+pixelSizeHalf, mousePos.y*pixelSize+pixelSizeHalf); + layerCtx.stroke() + } + } +} +function pixelColorPick(pixel,customColor=null) { + var element = pixel.element; + var elementInfo = elements[element]; + //if (elementInfo.behavior instanceof Array) { + + if (pixel.charge && elementInfo.colorOn) { + customColor = elementInfo.colorOn; + } + if (customColor != null) { + if (Array.isArray(customColor)) { + customColor = customColor[Math.floor(Math.random() * customColor.length)]; + } + if (customColor.startsWith("#")) { + customColor = hexToRGB(customColor); + } + var rgb = customColor; + } + else { + var rgb = elements[element].colorObject; // {r, g, b} + // If rgb is an array, choose a random item + if (Array.isArray(rgb)) { + rgb = rgb[Math.floor(Math.random() * rgb.length)]; + } + } + // Randomly darken or lighten the RGB color + var coloroffset = Math.floor(Math.random() * (Math.random() > 0.5 ? -1 : 1) * Math.random() * 1); + var r = rgb.r + coloroffset; + var g = rgb.g + coloroffset; + var b = rgb.b + coloroffset; + // Make sure the color is within the RGB range + r = Math.max(0, Math.min(255, r)); + g = Math.max(0, Math.min(255, g)); + b = Math.max(0, Math.min(255, b)); + var color = "rgb("+r+","+g+","+b+")"; + + /*} + else { + var color = elementInfo.color; + if (Array.isArray(color)) { + color = color[Math.floor(Math.random() * color.length)]; + } + }*/ + return color; +} \ No newline at end of file From 42e0b3908729d0f73a6f2ce9108f70e978b83b99 Mon Sep 17 00:00:00 2001 From: Jayd-Rubies <155784127+Jayd-Rubies@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:07:14 -0400 Subject: [PATCH 2/4] Delete UwUify.js --- UwUify.js | 83 ------------------------------------------------------- 1 file changed, 83 deletions(-) delete mode 100644 UwUify.js diff --git a/UwUify.js b/UwUify.js deleted file mode 100644 index 5f64ca53..00000000 --- a/UwUify.js +++ /dev/null @@ -1,83 +0,0 @@ -document.body.style.backgroundImage = 'url("https://jayd-rubies.github.io/uwuify.png")'; -document.body.style.backgroundSize = 'cover'; -gameDiv.style.border = "1px solid #ffffff00"; -window.addEventListener("load",function(){ - document.querySelectorAll(".categoryButton").forEach(e => { - e.style.backgroundColor = "#ffc0cb40"; - }) -}); -function drawCursor() { - canvas.style.backgroundColor = "transparent"; - var layerCtx = canvasLayers.gui.getContext('2d'); - var mouseOffset = Math.trunc(mouseSize/2); - var topLeft = [mousePos.x-mouseOffset,mousePos.y-mouseOffset]; - var bottomRight = [mousePos.x+mouseOffset,mousePos.y+mouseOffset]; - // Draw a square around the mouse - layerCtx.strokeStyle = "#ffc0cb"; - layerCtx.fillStyle = "#ffc0cb40"; - layerCtx.strokeRect(topLeft[0]*pixelSize,topLeft[1]*pixelSize,(bottomRight[0]-topLeft[0]+1)*pixelSize,(bottomRight[1]-topLeft[1]+1)*pixelSize); - layerCtx.beginPath(); - layerCtx.lineWidth = 3; - layerCtx.stroke(); - layerCtx.fillRect(topLeft[0]*pixelSize,topLeft[1]*pixelSize,(bottomRight[0]-topLeft[0]+1)*pixelSize,(bottomRight[1]-topLeft[1]+1)*pixelSize); - layerCtx.fill(); - // draw one transparent pixel in the center - if (settings.precision) { - layerCtx.fillStyle = "#ffc0cb80"; - layerCtx.fillRect(mousePos.x*pixelSize,mousePos.y*pixelSize,pixelSize,pixelSize); - } - if (shaping) { - if (shaping === 1) { // Draw a white line from shapeStart.x to shapeStart.y - layerCtx.beginPath(); - layerCtx.strokeStyle = "#ffc0cb"; - layerCtx.lineWidth = 3; - layerCtx.moveTo(shapeStart.x*pixelSize+pixelSizeHalf, shapeStart.y*pixelSize+pixelSizeHalf); - layerCtx.lineTo(mousePos.x*pixelSize+pixelSizeHalf, mousePos.y*pixelSize+pixelSizeHalf); - layerCtx.stroke() - } - } -} -function pixelColorPick(pixel,customColor=null) { - var element = pixel.element; - var elementInfo = elements[element]; - //if (elementInfo.behavior instanceof Array) { - - if (pixel.charge && elementInfo.colorOn) { - customColor = elementInfo.colorOn; - } - if (customColor != null) { - if (Array.isArray(customColor)) { - customColor = customColor[Math.floor(Math.random() * customColor.length)]; - } - if (customColor.startsWith("#")) { - customColor = hexToRGB(customColor); - } - var rgb = customColor; - } - else { - var rgb = elements[element].colorObject; // {r, g, b} - // If rgb is an array, choose a random item - if (Array.isArray(rgb)) { - rgb = rgb[Math.floor(Math.random() * rgb.length)]; - } - } - // Randomly darken or lighten the RGB color - var coloroffset = Math.floor(Math.random() * (Math.random() > 0.5 ? -1 : 1) * Math.random() * 1); - var r = rgb.r + coloroffset; - var g = rgb.g + coloroffset; - var b = rgb.b + coloroffset; - // Make sure the color is within the RGB range - r = Math.max(0, Math.min(255, r)); - g = Math.max(0, Math.min(255, g)); - b = Math.max(0, Math.min(255, b)); - var color = "rgb("+r+","+g+","+b+")"; - - /*} - else { - var color = elementInfo.color; - if (Array.isArray(color)) { - color = color[Math.floor(Math.random() * color.length)]; - } - }*/ - return color; -} \ No newline at end of file From 6cc97248f78e0f03d8c0b6f055692bc88499fd5f Mon Sep 17 00:00:00 2001 From: Jayd-Rubies <155784127+Jayd-Rubies@users.noreply.github.com> Date: Mon, 30 Sep 2024 20:07:33 -0400 Subject: [PATCH 3/4] UwU^4 --- mods/UwUify.js | 117 ++++++++++++++++++++++++++++++++++--------------- 1 file changed, 82 insertions(+), 35 deletions(-) diff --git a/mods/UwUify.js b/mods/UwUify.js index 5d83e2b0..5f64ca53 100644 --- a/mods/UwUify.js +++ b/mods/UwUify.js @@ -1,36 +1,83 @@ -document.body.style.backgroundImage = 'url("https://jayd-rubies.github.io/uwuify.png")'; -gameDiv.style.border = "1px solid #ffffff00"; -window.addEventListener("load",function(){ - document.querySelectorAll(".categoryButton").forEach(e => { - e.style.backgroundColor = "ffc0cb40"; - }) -}); -function drawCursor() { - canvas.style.backgroundColor = "transparent"; - var layerCtx = canvasLayers.gui.getContext('2d'); - var mouseOffset = Math.trunc(mouseSize/2); - var topLeft = [mousePos.x-mouseOffset,mousePos.y-mouseOffset]; - var bottomRight = [mousePos.x+mouseOffset,mousePos.y+mouseOffset]; - // Draw a square around the mouse - layerCtx.strokeStyle = "#ffc0cb"; - layerCtx.fillStyle = "#ffc0cb40"; - layerCtx.strokeRect(topLeft[0]*pixelSize,topLeft[1]*pixelSize,(bottomRight[0]-topLeft[0]+1)*pixelSize,(bottomRight[1]-topLeft[1]+1)*pixelSize); - layerCtx.beginPath(); - layerCtx.lineWidth = 3; - layerCtx.stroke(); - layerCtx.fill(); - // draw one transparent pixel in the center - if (settings.precision) { - layerCtx.fillStyle = "#ffc0c80"; - layerCtx.fillRect(mousePos.x*pixelSize,mousePos.y*pixelSize,pixelSize,pixelSize); - } - if (shaping) { - if (shaping === 1) { // Draw a white line from shapeStart.x to shapeStart.y - layerCtx.beginPath(); - layerCtx.strokeStyle = "#ffc0c80"; - layerCtx.lineWidth = 1; - layerCtx.moveTo(shapeStart.x*pixelSize+pixelSizeHalf, shapeStart.y*pixelSize+pixelSizeHalf); - layerCtx.lineTo(mousePos.x*pixelSize+pixelSizeHalf, mousePos.y*pixelSize+pixelSizeHalf); - } - } +document.body.style.backgroundImage = 'url("https://jayd-rubies.github.io/uwuify.png")'; +document.body.style.backgroundSize = 'cover'; +gameDiv.style.border = "1px solid #ffffff00"; +window.addEventListener("load",function(){ + document.querySelectorAll(".categoryButton").forEach(e => { + e.style.backgroundColor = "#ffc0cb40"; + }) +}); +function drawCursor() { + canvas.style.backgroundColor = "transparent"; + var layerCtx = canvasLayers.gui.getContext('2d'); + var mouseOffset = Math.trunc(mouseSize/2); + var topLeft = [mousePos.x-mouseOffset,mousePos.y-mouseOffset]; + var bottomRight = [mousePos.x+mouseOffset,mousePos.y+mouseOffset]; + // Draw a square around the mouse + layerCtx.strokeStyle = "#ffc0cb"; + layerCtx.fillStyle = "#ffc0cb40"; + layerCtx.strokeRect(topLeft[0]*pixelSize,topLeft[1]*pixelSize,(bottomRight[0]-topLeft[0]+1)*pixelSize,(bottomRight[1]-topLeft[1]+1)*pixelSize); + layerCtx.beginPath(); + layerCtx.lineWidth = 3; + layerCtx.stroke(); + layerCtx.fillRect(topLeft[0]*pixelSize,topLeft[1]*pixelSize,(bottomRight[0]-topLeft[0]+1)*pixelSize,(bottomRight[1]-topLeft[1]+1)*pixelSize); + layerCtx.fill(); + // draw one transparent pixel in the center + if (settings.precision) { + layerCtx.fillStyle = "#ffc0cb80"; + layerCtx.fillRect(mousePos.x*pixelSize,mousePos.y*pixelSize,pixelSize,pixelSize); + } + if (shaping) { + if (shaping === 1) { // Draw a white line from shapeStart.x to shapeStart.y + layerCtx.beginPath(); + layerCtx.strokeStyle = "#ffc0cb"; + layerCtx.lineWidth = 3; + layerCtx.moveTo(shapeStart.x*pixelSize+pixelSizeHalf, shapeStart.y*pixelSize+pixelSizeHalf); + layerCtx.lineTo(mousePos.x*pixelSize+pixelSizeHalf, mousePos.y*pixelSize+pixelSizeHalf); + layerCtx.stroke() + } + } +} +function pixelColorPick(pixel,customColor=null) { + var element = pixel.element; + var elementInfo = elements[element]; + //if (elementInfo.behavior instanceof Array) { + + if (pixel.charge && elementInfo.colorOn) { + customColor = elementInfo.colorOn; + } + if (customColor != null) { + if (Array.isArray(customColor)) { + customColor = customColor[Math.floor(Math.random() * customColor.length)]; + } + if (customColor.startsWith("#")) { + customColor = hexToRGB(customColor); + } + var rgb = customColor; + } + else { + var rgb = elements[element].colorObject; // {r, g, b} + // If rgb is an array, choose a random item + if (Array.isArray(rgb)) { + rgb = rgb[Math.floor(Math.random() * rgb.length)]; + } + } + // Randomly darken or lighten the RGB color + var coloroffset = Math.floor(Math.random() * (Math.random() > 0.5 ? -1 : 1) * Math.random() * 1); + var r = rgb.r + coloroffset; + var g = rgb.g + coloroffset; + var b = rgb.b + coloroffset; + // Make sure the color is within the RGB range + r = Math.max(0, Math.min(255, r)); + g = Math.max(0, Math.min(255, g)); + b = Math.max(0, Math.min(255, b)); + var color = "rgb("+r+","+g+","+b+")"; + + /*} + else { + var color = elementInfo.color; + if (Array.isArray(color)) { + color = color[Math.floor(Math.random() * color.length)]; + } + }*/ + return color; } \ No newline at end of file From 9c3a0ea72ca34d2e6c7858868061fe2eea9f84dd Mon Sep 17 00:00:00 2001 From: Jayd-Rubies <155784127+Jayd-Rubies@users.noreply.github.com> Date: Wed, 2 Oct 2024 21:30:45 -0400 Subject: [PATCH 4/4] Add files via upload --- mods/customBackground.js | 45 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 mods/customBackground.js diff --git a/mods/customBackground.js b/mods/customBackground.js new file mode 100644 index 00000000..75027d84 --- /dev/null +++ b/mods/customBackground.js @@ -0,0 +1,45 @@ +var imgVar = "https://i.ytimg.com/vi/fx2Z5ZD_Rbo/hqdefault.jpg?sqp=-oaymwEmCOADEOgC8quKqQMa8AEB-AH-BIAC6AKKAgwIABABGGUgZShlMA8=&rs=AOn4CLD7X0AtWZAmVxLAt0LRvN8nrco_8Q"; +gameDiv.style.border = "1px solid #ffffff00"; +document.body.style.backgroundSize = 'cover'; +window.addEventListener("load",function(){ + document.querySelectorAll(".categoryButton").forEach(e => { + e.style.backgroundColor = "transparent"; + }) +}); +function drawCursor() { + document.body.style.backgroundImage = 'url('+ imgVar +')'; + canvas.style.backgroundColor = "transparent"; + var layerCtx = canvasLayers.gui.getContext('2d'); + var mouseOffset = Math.trunc(mouseSize/2); + var topLeft = [mousePos.x-mouseOffset,mousePos.y-mouseOffset]; + var bottomRight = [mousePos.x+mouseOffset,mousePos.y+mouseOffset]; + // Draw a square around the mouse + layerCtx.strokeStyle = "#808080"; + layerCtx.strokeRect(topLeft[0]*pixelSize,topLeft[1]*pixelSize,(bottomRight[0]-topLeft[0]+1)*pixelSize,(bottomRight[1]-topLeft[1]+1)*pixelSize); + layerCtx.beginPath(); + layerCtx.lineWidth = 1; + layerCtx.stroke(); + // draw one transparent pixel in the center + if (settings.precision) { + layerCtx.fillStyle = "#80808080"; + layerCtx.fillRect(mousePos.x*pixelSize,mousePos.y*pixelSize,pixelSize,pixelSize); + } + if (shaping) { + if (shaping === 1) { // Draw a white line from shapeStart.x to shapeStart.y + layerCtx.beginPath(); + layerCtx.strokeStyle = "#808080"; + layerCtx.lineWidth = 1; + layerCtx.moveTo(shapeStart.x*pixelSize+pixelSizeHalf, shapeStart.y*pixelSize+pixelSizeHalf); + layerCtx.lineTo(mousePos.x*pixelSize+pixelSizeHalf, mousePos.y*pixelSize+pixelSizeHalf); + layerCtx.stroke() + } + } +} +elements.change_background = { + color:"#ffffff", + category: "customBackground", + tool: function(pixel) {}, + onSelect: function() { + imgVar = prompt("Please input an image link to set as background."); + } +} \ No newline at end of file