diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..f59ec20 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/.github/workflows/pr-branch-check.yml b/.github/workflows/pr-branch-check.yml new file mode 100644 index 0000000..475b39a --- /dev/null +++ b/.github/workflows/pr-branch-check.yml @@ -0,0 +1,18 @@ +name: Enforce allowed branches for PRs to main + +on: + pull_request: + branches: + - main + +jobs: + check-branch: + runs-on: ubuntu-latest + steps: + - name: Check PR source branch + run: | + echo "Source branch: ${{ github.head_ref }}" + if [[ "${{ github.head_ref }}" != "documentation" && "${{ github.head_ref }}" != "code" ]]; then + echo "Error: PRs to main must come from 'documentation' or 'code' branches only." + exit 1 + fi diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..f59ec20 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +* \ No newline at end of file diff --git a/src/Template.js b/src/Template.js index d51a9a6..0832c1b 100644 --- a/src/Template.js +++ b/src/Template.js @@ -129,18 +129,23 @@ export default class Template { for (let y = 0; y < canvasHeight; y++) { for (let x = 0; x < canvasWidth; x++) { // For every pixel... - - // ... Make it transparent unless it is the "center" - if (x % shreadSize !== 1 || y % shreadSize !== 1) { - const pixelIndex = (y * canvasWidth + x) * 4; // Find the pixel index in an array where every 4 indexes are 1 pixel + const pixelIndex = (y * canvasWidth + x) * 4; // Find the pixel index in an array where every 4 indexes are 1 pixel + // If the pixel is the color #deface, draw a translucent gray checkerboard pattern + if ( + imageData.data[pixelIndex] === 222 && + imageData.data[pixelIndex + 1] === 250 && + imageData.data[pixelIndex + 2] === 206 + ) { + if ((x + y) % 2 === 0) { // Formula for checkerboard pattern + imageData.data[pixelIndex] = 0; + imageData.data[pixelIndex + 1] = 0; + imageData.data[pixelIndex + 2] = 0; + imageData.data[pixelIndex + 3] = 32; // Translucent black + } else { // Transparent negative space + imageData.data[pixelIndex + 3] = 0; + } + } else if (x % shreadSize !== 1 || y % shreadSize !== 1) { // Otherwise only draw the middle pixel imageData.data[pixelIndex + 3] = 0; // Make the pixel transparent on the alpha channel - - // if (!!imageData.data[pixelIndex + 3]) { - // imageData.data[pixelIndex + 3] = 50; // Alpha - // imageData.data[pixelIndex] = 30; // Red - // imageData.data[pixelIndex + 1] = 30; // Green - // imageData.data[pixelIndex + 2] = 30; // Blue - // } } } } diff --git a/src/overlay.css b/src/overlay.css index 7a0a12e..1bc9429 100644 --- a/src/overlay.css +++ b/src/overlay.css @@ -8,7 +8,7 @@ padding: 10px; border-radius: 8px; z-index: 9000; - transition: all 0.3s ease; + transition: all 0.3s ease, transform 0s; max-width: 300px; width: auto; /* Performance optimizations for smooth dragging */