[ { "search": "try {\n // This will run when the DOM is ready.\n document.addEventListener(\"DOMContentLoaded\", function() {\n const canvas = document.getElementById('artCanvas');\n const ctx = canvas.getContext('2d');\n let degrees = 0;\n\n setInterval(function() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.save();\n ctx.translate(canvas.width / 2, canvas.height / 2);\n ctx.rotate(degrees * Math.PI / 180);\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.font = '100px Monoton';\n ctx.fillText('🐻', 0, 0);\n ctx.restore();\n degrees = (degrees + 1) % 360;\n }, 50);\n });\n\n } catch (error) {\n // This will throw the error to the parent window.\n throw error;\n }", "replace": "try {\n // This will run when the DOM is ready.\n document.addEventListener(\"DOMContentLoaded\", function() {\n const canvas = document.getElementById('artCanvas');\n const ctx = canvas.getContext('2d');\n let degrees = 0;\n\n canvas.addEventListener('mousemove', function(event) {\n degrees = event.clientX / window.innerWidth * 360;\n });\n\n setInterval(function() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.save();\n ctx.translate(canvas.width / 2, canvas.height / 2);\n ctx.rotate(degrees * Math.PI / 180);\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n ctx.font = '100px Monoton';\n ctx.fillText('🐻', 0, 0);\n ctx.restore();\n }, 50);\n });\n\n } catch (error) {\n // This will throw the error to the parent window.\n throw error;\n }" } ]