<snapdata remixID="14434976"><project name="line more detailed" app="Snap! 10.7.2, https://snap.berkeley.edu" version="2"><notes>THIS WILL LAG A LOT!!!</notes><thumbnail>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKAAAAB4CAYAAAB1ovlvAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAoKADAAQAAAABAAAAeAAAAAAeaS0RAAADJ0lEQVR4Ae3XQS6kARSF0V+njW3BbmzBwEAklmE7dmIzpgbMNGYGOrnJ7VzSp2bKy3vl+ELVyevb4/AgMBL4NbrrLIEPAQEKYSogwCm/4wLUwFRAgFN+xwWogamAAKf8jgtQA1MBAU75HRegBqYCApzyOy5ADUwFBDjld1yAGpgKCHDK77gANTAVEOCU33EBamAqIMApv+MC1MBUQIBTfscFqIGpgACn/I4LUANTAQFO+R0XoAamAgKc8jsuQA1MBQQ45XdcgBqYCghwyu+4ADUwFRDglN9xAWpgKiDAKb/jAtTAVECAU37HBaiBqYAAp/yOC1ADUwEBTvkdF6AGpgICnPI7LkANTAUEOOV3XIAamAoIcMrvuAA1MBUQ4JTfcQFqYCogwCm/4wLUwFRAgFN+xwWogamAAKf8jgtQA1OB39Pr3/j4/f398fT0dFxcXBzn5+ff+JX+7Jd28vr2+Nk/wr959c/Pz8fNzc3x8vJyPD4+HldXV8c71e3t7XF6evpvjv6HWwX4l1/6w8PDcXd3d5ydnX2aeo/z+vr647nLy8tP3/NFJuA9YOZluizgL+AXoP4FfwFTflqAX4D6EPIFTPlpAZZBrcsEvAfMvEyXBQRYBrUuExBg5mW6LCDAMqh1mYAAMy/TZQEBlkGtywQEmHmZLgsIsAxqXSYgwMzLdFlAgGVQ6zIBAWZepssCAiyDWpcJCDDzMl0WEGAZ1LpMQICZl+mygADLoNZlAgLMvEyXBQRYBrUuExBg5mW6LCDAMqh1mYAAMy/TZQEBlkGtywQEmHmZLgsIsAxqXSYgwMzLdFlAgGVQ6zIBAWZepssCAiyDWpcJCDDzMl0WEGAZ1LpMQICZl+mygADLoNZlAgLMvEyXBQRYBrUuExBg5mW6LCDAMqh1mYAAMy/TZQEBlkGtywQEmHmZLgsIsAxqXSYgwMzLdFlAgGVQ6zIBAWZepssCAiyDWpcJCDDzMl0WEGAZ1LpMQICZl+mygADLoNZlAgLMvEyXBQRYBrUuExBg5mW6LCDAMqh1mYAAMy/TZQEBlkGtywQEmHmZLgsIsAxqXSbwB8A0S9W6mh84AAAAAElFTkSuQmCC</thumbnail><scenes select="1"><scene name="line more detailed"><notes>THIS WILL LAG A LOT!!!</notes><hidden></hidden><headers></headers><code></code><blocks></blocks><primitives></primitives><stage name="Stage" width="480" height="360" costume="0" color="255,255,255,1" tempo="60" threadsafe="false" penlog="false" volume="100" pan="0" lines="round" ternary="false" hyperops="true" codify="false" inheritance="true" sublistIDs="false" id="6"><pentrails>data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAeAAAAFoCAYAAACPNyggAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAB4KADAAQAAAABAAABaAAAAAAHwbojAAAL30lEQVR4Ae3QMQEAAADCoPVPbQwfiEBhwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAw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DBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGDBgwIABAwYMGPgMDI3+AAEeFvcCAAAAAElFTkSuQmCC</pentrails><costumes><list struct="atomic" id="7"></list></costumes><sounds><list struct="atomic" id="8"></list></sounds><variables></variables><blocks></blocks><scripts></scripts><sprites select="1"><sprite name="Sprite" idx="1" x="0" y="0" heading="90" scale="1" volume="100" pan="0" rotation="1" draggable="true" costume="0" color="80,80,80,1" pen="tip" id="13"><costumes><list struct="atomic" id="14"></list></costumes><sounds><list struct="atomic" id="15"></list></sounds><blocks></blocks><variables></variables><scripts><script x="20" y="20"><block s="receiveGo"></block><block s="doRun"><block s="reportJSFunction"><list></list><l>// This code goes INSIDE the `run JavaScript function ( ) { [ ] }` block.&#xD;// It creates a RED VERTICAL line composed of multiple segments.&#xD;// The line animates to move horizontally towards the right.&#xD;// The glitch effect has been REMOVED.&#xD;// The background *after* the line passes will reveal a pixelated version of your provided image.&#xD;// When the spacebar is pressed, ALL elements and the background will be cleared.&#xD;&#xD;(function() {&#xD;    // --- PART 0: Setup Hidden Canvas for Image Data &amp; Background Pixel Grid ---&#xD;&#xD;    // !!! IMPORTANT: REPLACE THIS WITH THE ACTUAL URL TO YOUR NEW IMAGE FILE !!!&#xD;    // If you&apos;re using the image you sent, make sure it&apos;s hosted publicly.&#xD;    // Example: &apos;https://gemini.google.com/temp/Gemini_Generated_Image_yqyrmmyqyrmmyqyr.jpg-0613dd86-8c0a-45d0-baec-9677c6e2f732&apos;;&#xD;    // For demonstration, I&apos;ll put a placeholder.&#xD;    const backgroundImageURL = &apos;https://picsum.photos/1000/600&apos;; // Placeholder - CHANGE THIS!&#xD;&#xD;    // !!! KEY CHANGE FOR PERFORMANCE: DECREASED PIXEL SIZE EVEN FURTHER !!!&#xD;    const pixelSize = 5; // &lt;--- Made pixels much smaller (e.g., 5px).&#xD;                                 //      Smaller = more pixels, potentially slower but finer detail.&#xD;&#xD;    let backgroundPixels = []; // Array to hold all the background pixel divs&#xD;    let imageData = null;      // Will store the pixel data (RGBA values) from the loaded image&#xD;    let imageLoaded = false;   // Flag to indicate if the image is successfully loaded&#xD;&#xD;    // Create a hidden canvas element or get an existing one&#xD;    let hiddenCanvas = document.getElementById(&apos;my-hidden-canvas&apos;);&#xD;    if (!hiddenCanvas) {&#xD;        hiddenCanvas = document.createElement(&apos;canvas&apos;);&#xD;        hiddenCanvas.id = &apos;my-hidden-canvas&apos;;&#xD;        hiddenCanvas.style.display = &apos;none&apos;; // Keep it hidden from view&#xD;        document.body.appendChild(hiddenCanvas);&#xD;    }&#xD;    const ctx = hiddenCanvas.getContext(&apos;2d&apos;);&#xD;&#xD;    // Create an Image object and start loading the user&apos;s image&#xD;    const img = new Image();&#xD;    img.crossOrigin = "Anonymous"; // Essential for loading images from different origins due to CORS policy&#xD;    img.src = backgroundImageURL;&#xD;&#xD;    img.onload = () =&gt; {&#xD;        // Set canvas dimensions to match the image&#xD;        hiddenCanvas.width = img.width;&#xD;        hiddenCanvas.height = img.height;&#xD;        ctx.drawImage(img, 0, 0); // Draw the entire image onto the canvas&#xD;&#xD;        // Get the raw pixel data (RGBA values) from the canvas&#xD;        imageData = ctx.getImageData(0, 0, img.width, img.height);&#xD;        imageLoaded = true;&#xD;        console.log("Background image loaded and pixel data retrieved!");&#xD;&#xD;        // Initialize the visible pixel grid ONLY AFTER the image is loaded and its dimensions are known&#xD;        initializeBackgroundPixelGrid();&#xD;        // --- START THE ANIMATION HERE, AFTER IMAGE IS LOADED ---&#xD;        currentAnimationFrameId = requestAnimationFrame(animateLine);&#xD;    };&#xD;&#xD;    img.onerror = () =&gt; {&#xD;        console.error("Failed to load background image:", backgroundImageURL);&#xD;        // Fallback: If image fails to load, create a simple blue pixelated background&#xD;        imageLoaded = false; // Ensure flag is false so fallback path is taken&#xD;        initializeBackgroundPixelGrid(true); // Pass true to use fallback solid blue colors&#xD;        // --- START THE ANIMATION HERE, EVEN IF IMAGE FAILED (using fallback) ---&#xD;        currentAnimationFrameId = requestAnimationFrame(animateLine);&#xD;    };&#xD;&#xD;    // This function initializes the grid of background &apos;pixel&apos; divs&#xD;    function initializeBackgroundPixelGrid(useFallback = false) {&#xD;        // Clear any existing pixels from previous runs to prevent duplicates&#xD;        document.querySelectorAll(&apos;.my-dynamic-background-pixel&apos;).forEach(el =&gt; el.remove());&#xD;        backgroundPixels = []; // Reset the array of pixel divs&#xD;&#xD;        // Calculate how many columns and rows of &apos;pixel&apos; divs are needed to cover the screen&#xD;        const numCols = Math.ceil(window.innerWidth / pixelSize);&#xD;        const numRows = Math.ceil(window.innerHeight / pixelSize);&#xD;&#xD;        for (let r = 0; r &lt; numRows; r++) {&#xD;            for (let c = 0; c &lt; numCols; c++) {&#xD;                const pixelDiv = document.createElement(&apos;div&apos;);&#xD;                pixelDiv.classList.add(&apos;my-dynamic-background-pixel&apos;); // Assign a class for easy selection&#xD;&#xD;                Object.assign(pixelDiv.style, {&#xD;                    position: &apos;fixed&apos;,&#xD;                    backgroundColor: &apos;transparent&apos;, // Initially transparent&#xD;                    width: pixelSize + &apos;px&apos;,&#xD;                    height: pixelSize + &apos;px&apos;,&#xD;                    top: (r * pixelSize) + &apos;px&apos;,&#xD;                    left: (c * pixelSize) + &apos;px&apos;,&#xD;                    zIndex: &apos;997&apos;, // Ensures these pixels are behind the red line (999)&#xD;                });&#xD;                document.body.appendChild(pixelDiv);&#xD;                backgroundPixels.push(pixelDiv);&#xD;            }&#xD;        }&#xD;        console.log(`Initialized ${backgroundPixels.length} background pixel divs.`);&#xD;    }&#xD;&#xD;&#xD;    // --- PART 1: Line Creation (Multiple Segments) ---&#xD;&#xD;    const viewportWidth = window.innerWidth || document.documentElement.clientWidth;&#xD;    const viewportHeight = window.innerHeight || document.documentElement.clientHeight;&#xD;&#xD;    const lineWidth = pixelSize; // &lt;--- RED LINE WIDTH IS NOW EQUAL TO PIXEL SIZE&#xD;    const segmentHeight = 8; // Height of each small segment. Adjust for more/fewer segments.&#xD;    const lineColor = &apos;red&apos;;&#xD;    &#xD;    const initialLineXPos = 0; // Starting X position of the red line&#xD;    const initialLineYPos = 0; // Starting Y position (top of the screen)&#xD;&#xD;    let lineSegments = []; // Array to hold all the div segments that make up the red line&#xD;&#xD;    // Loop to create individual segments and stack them vertically to form the red line&#xD;    for (let i = 0; i * segmentHeight &lt; viewportHeight; i++) {&#xD;        const segmentDiv = document.createElement(&apos;div&apos;);&#xD;        segmentDiv.classList.add(&apos;my-dynamic-red-line-segment&apos;); // Unique class for easy clearing&#xD;&#xD;        Object.assign(segmentDiv.style, {&#xD;            position: &apos;fixed&apos;,&#xD;            backgroundColor: lineColor,&#xD;            width: lineWidth + &apos;px&apos;, // Use the new pixelSize-based width&#xD;            height: segmentHeight + &apos;px&apos;,&#xD;            top: (initialLineYPos + i * segmentHeight) + &apos;px&apos;, // Position each segment vertically&#xD;            left: initialLineXPos + &apos;px&apos;, // Initial horizontal position&#xD;            zIndex: &apos;999&apos;, // Ensures the red line is on top of the background pixels&#xD;        });&#xD;        document.body.appendChild(segmentDiv);&#xD;        lineSegments.push(segmentDiv);&#xD;    }&#xD;&#xD;&#xD;    // --- PART 2: Animation Logic without Glitch Effect ---&#xD;    let currentAnimationFrameId; // Holds the ID for the requestAnimationFrame loop&#xD;    const animationSpeed = 2; // Pixels the entire line moves per frame (adjust for speed)&#xD;&#xD;    // Glitch parameters (disabled):&#xD;    // Set probability to 0 to disable glitches&#xD;    const glitchProbability = 0; // &lt;--- Set to 0 to completely disable glitching.&#xD;    const maxOverallGlitchWidthOffset = 0; // These will effectively be 0 now.&#xD;    const maxOverallGlitchYOffset = 0;&#xD;    const maxJaggedBendOffset = 0;&#xD;    const glitchDurationFrames = 0;&#xD;    let glitchFrameCounter = 0;&#xD;&#xD;    let currentOverallGlitchWidthOffset = 0;&#xD;    let currentOverallGlitchYOffset = 0;&#xD;    let currentOverallGlitchXOffset = 0;&#xD;    let perSegmentJaggedOffsets = new Array(lineSegments.length).fill(0);&#xD;&#xD;&#xD;    function animateLine() {&#xD;        // If the red line segments are gone (e.g., cleared by spacebar or off-screen), stop animating&#xD;        if (lineSegments.length === 0 || !lineSegments[0].parentNode) {&#xD;            cancelAnimationFrame(currentAnimationFrameId);&#xD;            return;&#xD;        }&#xD;&#xD;        // Calculate the base horizontal position of the red line (smooth movement)&#xD;        let baseLineX = parseFloat(lineSegments[0].style.left); // Removed glitch offsets&#xD;        baseLineX += animationSpeed;&#xD;&#xD;        // Since glitching is disabled (glitchProbability = 0), this block will effectively do nothing&#xD;        // or always reset offsets to zero, ensuring no glitch visual.&#xD;        if (glitchFrameCounter &gt; 0) {&#xD;            glitchFrameCounter--;&#xD;        } else {&#xD;            // This logic will still run, but since glitchProbability is 0,&#xD;            // it will always enter the &apos;else&apos; block and keep offsets at 0.&#xD;            if (Math.random() &lt; glitchProbability) {&#xD;                glitchFrameCounter = glitchDurationFrames;&#xD;                currentOverallGlitchWidthOffset = (Math.random() * 2 - 1) * maxOverallGlitchWidthOffset;&#xD;                currentOverallGlitchYOffset = (Math.random() * 2 - 1) * maxOverallGlitchYOffset;&#xD;                currentOverallGlitchXOffset = (Math.random() * 2 - 1) * maxJaggedBendOffset;&#xD;                for (let i = 0; i &lt; lineSegments.length; i++) {&#xD;                    perSegmentJaggedOffsets[i] = (Math.random() * 2 - 1) * maxJaggedBendOffset;&#xD;                }&#xD;            } else {&#xD;                currentOverallGlitchWidthOffset = 0;&#xD;                currentOverallGlitchYOffset = 0;&#xD;                currentOverallGlitchXOffset = 0;&#xD;                for (let i = 0; i &lt; lineSegments.length; i++) {&#xD;                    perSegmentJaggedOffsets[i] = 0;&#xD;                }&#xD;            }&#xD;        }&#xD;        // --- End Glitch Effect Logic ---&#xD;&#xD;        // --- Apply All Calculated Styles to EACH Red Line Segment (now without glitch offsets) ---&#xD;        for (let i = 0; i &lt; lineSegments.length; i++) {&#xD;            const segment = lineSegments[i];&#xD;            &#xD;            // These values are now effectively 0 due to glitchProbability = 0&#xD;            segment.style.width = (lineWidth + currentOverallGlitchWidthOffset) + &apos;px&apos;;&#xD;            segment.style.top = (initialLineYPos + i * segmentHeight + currentOverallGlitchYOffset) + &apos;px&apos;;&#xD;            segment.style.left = (baseLineX + currentOverallGlitchXOffset + perSegmentJaggedOffsets[i]) + &apos;px&apos;;&#xD;            segment.style.transform = &apos;none&apos;;&#xD;        }&#xD;&#xD;        // --- Update the pixelated background fill based on image data ---&#xD;        if (imageLoaded &amp;&amp; imageData) {&#xD;            const numColsScreen = Math.ceil(window.innerWidth / pixelSize);&#xD;            const numRowsScreen = Math.ceil(window.innerHeight / pixelSize);&#xD;&#xD;            for (let i = 0; i &lt; backgroundPixels.length; i++) {&#xD;                const pixel = backgroundPixels[i];&#xD;                const pixelLeft = parseFloat(pixel.style.left);&#xD;                const pixelTop = parseFloat(pixel.style.top);&#xD;                &#xD;                if (pixelLeft &lt; baseLineX) {&#xD;                    if (pixel.dataset.colored !== &apos;true&apos;) {&#xD;                        const imgX = Math.floor((pixelLeft / (numColsScreen * pixelSize)) * imageData.width);&#xD;                        const imgY = Math.floor((pixelTop / (numRowsScreen * pixelSize)) * imageData.height);&#xD;&#xD;                        const clampedImgX = Math.min(Math.max(0, imgX), imageData.width - 1);&#xD;                        const clampedImgY = Math.min(Math.max(0, imgY), imageData.height - 1);&#xD;&#xD;                        const dataIndex = (clampedImgY * imageData.width + clampedImgX) * 4;&#xD;&#xD;                        const r = imageData.data[dataIndex];&#xD;                        const g = imageData.data[dataIndex + 1];&#xD;                        const b = imageData.data[dataIndex + 2];&#xD;                        const a = imageData.data[dataIndex + 3];&#xD;&#xD;                        pixel.style.backgroundColor = `rgba(${r}, ${g}, ${b}, ${a / 255})`;&#xD;                        pixel.dataset.colored = &apos;true&apos;;&#xD;                    }&#xD;                }&#xD;            }&#xD;        } else if (!imageLoaded &amp;&amp; backgroundPixels.length &gt; 0) {&#xD;            for (let i = 0; i &lt; backgroundPixels.length; i++) {&#xD;                const pixel = backgroundPixels[i];&#xD;                const pixelLeft = parseFloat(pixel.style.left);&#xD;                if (pixelLeft &lt; baseLineX) {&#xD;                    if (pixel.style.backgroundColor === &apos;transparent&apos; || pixel.dataset.colored !== &apos;true&apos;) {&#xD;                        pixel.style.backgroundColor = &apos;rgb(0, 0, 150)&apos;; // A default blue fallback&#xD;                        pixel.dataset.colored = &apos;true&apos;;&#xD;                    }&#xD;                }&#xD;            }&#xD;        }&#xD;&#xD;        if (baseLineX &lt; viewportWidth) {&#xD;            currentAnimationFrameId = requestAnimationFrame(animateLine);&#xD;        } else {&#xD;            cancelAnimationFrame(currentAnimationFrameId);&#xD;            lineSegments.forEach(segment =&gt; {&#xD;                if (segment.parentNode) {&#xD;                    segment.parentNode.removeChild(segment);&#xD;                }&#xD;            });&#xD;            lineSegments = [];&#xD;        }&#xD;    }&#xD;&#xD;    initializeBackgroundPixelGrid(); &#xD;&#xD;&#xD;    // --- PART 3: Spacebar Event Listener for Clearing ALL Elements ---&#xD;    function clearAllMyRedLines() {&#xD;        const segmentsToClear = document.querySelectorAll(&apos;.my-dynamic-red-line-segment&apos;);&#xD;        segmentsToClear.forEach(segment =&gt; {&#xD;            if (segment.parentNode) {&#xD;                segment.parentNode.removeChild(segment);&#xD;            }&#xD;        });&#xD;        console.log("All red line segments cleared by spacebar!");&#xD;        &#xD;        const pixelsToClear = document.querySelectorAll(&apos;.my-dynamic-background-pixel&apos;);&#xD;        pixelsToClear.forEach(pixel =&gt; {&#xD;            if (pixel.parentNode) {&#xD;                pixel.parentNode.removeChild(pixel);&#xD;            }&#xD;        });&#xD;        backgroundPixels = [];&#xD;        console.log("Pixelated background cleared by spacebar!");&#xD;&#xD;        const existingCanvas = document.getElementById(&apos;my-hidden-canvas&apos;);&#xD;        if (existingCanvas &amp;&amp; existingCanvas.parentNode) {&#xD;            existingCanvas.parentNode.removeChild(existingCanvas);&#xD;            console.log("Hidden canvas cleared by spacebar!");&#xD;        }&#xD;&#xD;        imageLoaded = false; &#xD;        imageData = null;&#xD;    }&#xD;&#xD;    if (!document.body.__spaceKeyListenerAttached) { &#xD;        document.addEventListener(&apos;keydown&apos;, (event) =&gt; {&#xD;            if (event.key === &apos; &apos;) {&#xD;                clearAllMyRedLines();&#xD;            }&#xD;        });&#xD;        document.body.__spaceKeyListenerAttached = true;&#xD;    }&#xD;&#xD;})();</l></block><list></list></block></script></scripts></sprite></sprites></stage><variables></variables></scene></scenes></project><media name="line more detailed" app="Snap! 10.7.2, https://snap.berkeley.edu" version="2"></media></snapdata>