Global Composite Operation Test

Developer
Size
1,992 Kb
Views
10,120

How do I make an global composite operation test?

Testing another effect.. What is a global composite operation test? How do you make a global composite operation test? This script and codes were developed by Dave DeHaan on 04 January 2023, Wednesday.

Global Composite Operation Test Previews

Global Composite Operation Test - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Global Composite Operation Test</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <center> <canvas id="canvas" height="300" width="600"></canvas>
</center> <script src="js/index.js"></script>
</body>
</html>

Global Composite Operation Test - Script Codes CSS Codes

body { margin: 0px; background: #333;
}
#canvas { background: #000;
}

Global Composite Operation Test - Script Codes JS Codes

var canvas = document.getElementById('canvas');
var context = canvas.getContext('2d');
var position = canvas.width;
var fillColor = '#333';
var canvasColor = '#FFF';
var pad = '#000000';
var fontColor;
var animInterval = setInterval(function() { if (position >= canvas.width) { fontColor = canvasColor; position = 0; canvasColor = fillColor; canvas.setAttribute ('style', 'background: '+fillColor); fillColor = Math.floor(Math.random()*16777215).toString(16); // This is to fix an issue caused by hex numbers that start with 0s fillColor = pad.substring(0, pad.length - fillColor.length) + fillColor; } canvas.width = 500; context.fillStyle = fontColor; context.font = '85px Arial'; context.fillText('Testing',25,180); context.globalCompositeOperation = 'xor'; context.fillStyle = fillColor; context.fillRect(0,0,position,canvas.height); position++;
}, 1000/60);
Global Composite Operation Test - Script Codes
Global Composite Operation Test - Script Codes
Home Page Home
Developer Dave DeHaan
Username davedehaan
Uploaded January 04, 2023
Rating 4
Size 1,992 Kb
Views 10,120
Do you need developer help for Global Composite Operation Test?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Dave DeHaan (davedehaan) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!