0x18b75119…b783sent to0x381233d5…7acd·#19,667,703·view on Etherscan
[1 ,()=>{console.log("Artist 16. Juan Rodríguez García -- platform 1 ");(()=>{"use strict";function e(e,t){return e+(t-e)*(n^=n<<13,n^=n>>20,n^=n<<5,(0>n?1+~n:n)%1e3/1e3)}function t(t){return t[a(e(0,.99*t.length))]}var a=Math.floor;let o="undefined"==typeof tokenData?(()=>{let e="0123456789abcdef",t="0x";for(let o=64;0<o;--o)t+=e[a(Math.random()*e.length)];return t})():"string"==typeof tokenData?tokenData:tokenData.hash,n=parseInt(o.slice(0,16),16);console.log(o);let r=(e=>{let t=[];for(let e=0;32>e;e++)t.push(o.slice(2+2*e,4+2*e));return t.map((e=>parseInt(e,16)))})(),i=window;var d;d=window.innerWidth<window.innerHeight?window.innerWidth:.5625*window.innerHeight;var f=["#00c7fd","#f34235","#011f4b","#f25f5c","#ffe066","#70a288","#3e4f56","#f4e04d","#fe8a71","#69a197","#021c1e","#cad7b2","#e84646","#e0c879","#4f6d7a","#d5d5d5","#edb83d","#223843","#d57a66","#b0d7ff","#ffef96","#6e9075","#0e4b5a","#f7f7f7","#1b262c","#d4a5a5","#84a98c","#f5cc00","#f19066"];let s=!0,h=Math.min(d,d);var l,c,u,p,g,b,w,k,M,m,v,D=Math.round(1.777*h),L=[],y=[],E=0,W=!1,C=0;i.setup=()=>{createCanvas(h,D,WEBGL),background("#fff9ea"),(M=createGraphics(width,height)).background("#fff9ea"),console.log("Después de todo"),g=h/200,M.noiseSeed(r[0]),M.randomSeed(r[1]),t(f),m=0,v=0,iniciar()},i.draw=()=>{dibujo(),push(),translate(-width/2,-height/2,-width/20),image(M,0,0),strokeWeight(width/8),stroke("#fff9ea"),noFill(),rectMode(CENTER),rect(width/2,height/2,1.09*width,1.07*height),pop()},i.dibujo=()=>{if(!W){0==E%90&&(k=e(0,1),b=t(f),w=e(h/1e3,h/200)),.5>=k?M.blendMode(MULTIPLY):M.blendMode(BLEND),m=abs(noise(frameCount/u)*h*2.24),v=abs(noise((frameCount+p)/u)*D*2.24),l=m%width,c=v%height,M.push(),M.translate(-h/1.8,-D/2),arrastre(0,m,v);for(var a=0;a<L.length-1;a++)arrastre(a+1,L[a],y[a]);M.pop(),3e3<=E&&(E=0,C++,console.log("pieza: "+C),10<=C&&noLoop(),W=!0,setTimeout((()=>{W=!1,iniciar(!1)}),1e4)),E+=1}},i.keyPressed=()=>{" "===key&&(s?(noLoop(),s=!1,console.log("pause")):(loop(),s=!0,console.log("play")))},i.arrastre=(e,t,a)=>{var o=t-L[e],n=a-y[e],r=atan2(n,o);L[e]=t-cos(r)*g,y[e]=a-sin(r)*g,M.push(),M.translate(L[e],y[e]),M.rotate(r),M.strokeWeight(w),M.stroke(red(b),green(b),blue(b),100),M.line(0,0,g,0),M.pop()},i.iniciar=e=>{M.blendMode(BLEND),0==e&&M.background("#fff9ea"),u=100,p=800,l=0,c=0;for(var t=0;500>t;t++)L[t]=l,y[t]=c}})();
}],[1 ,()=>{console.log("Artist 13. Ivona Tau -- platform 1 ");let neuralNetworkWeights, neuralNetworkBiases;
let targetImageData;
let noiseGraphics;
let iterations; //
let iteration = 0;
let learningRate = 0.00006; //
let canvasWidth, canvasHeight;
let vertexMultiplier;
let fixedImageWidth = 850;
let shapeNb;
setup = function(){
console.log('AILOVEAI by Ivona Tau');
console.log('Fully on chain denoising neural network.');
canvasHeight = windowHeight; // Use the full height of the window
canvasWidth = canvasHeight * (9 / 16);
if (canvasWidth < fixedImageWidth){
fixedImageWidth = canvasWidth;
}
createCanvas(canvasWidth, canvasHeight);
let colors = [
color(128, 0, 128),
color(238, 130, 238),
color(255, 105, 180), // pink
color(204, 119, 34), // yellow
color(0, 0, 139), // dark blue
color(255, 0, 0),
color(60,100,64),
color(37,110,91),
color(60,126,115),
color(153,40,0),
color(211,74,36),
color(253,174,0),
color(66,122,167),
color(0,67,120),
color(210,167,63),
color(208,158,45),
color(208,109,31),
color(146,57,20)
];
let vA = [65, 60, 72, 62, 61, 73, 76, 77, 72, 60, 65];
vertexMultiplier = R.random_choice(vA);
shapeNb = R.random_num(4,8);
iterations = R.random_num(100,200);
noiseGraphics = createGraphics(fixedImageWidth, fixedImageWidth*(16/9));
targetGraphics = createGraphics(fixedImageWidth, fixedImageWidth*(16/9));
let bgColor = R.random_choice(colors);
targetGraphics.background(bgColor);
targetGraphics.fill(220); // White text on the off-screen buffer
targetGraphics.textAlign(CENTER, CENTER);
drawPentagon();
targetGraphics.loadPixels();
targetImageData = targetGraphics.pixels;
initializeNetwork();
generateNoiseImage();
}
function initializeNetwork() {
neuralNetworkWeights = new Float32Array(targetImageData.length);
neuralNetworkBiases = new Float32Array(targetImageData.length);
for (let i = 0; i < targetImageData.length; i++) {
neuralNetworkWeights[i] = R.random_dec(-1, 1); // Initialize weights with random values between -1 and 1
neuralNetworkBiases[i] = R.random_dec(-1, 1); // Initialize biases with random values between -1 and 1
}
}
function activation(x) {
return constrain(x, 0, 255);
}
function generateNoiseImage() {
noiseGraphics.loadPixels();
for (let i = 0; i < noiseGraphics.pixels.length; i += 4) {
noiseGraphics.pixels[i] = R.random_num(0,255); // Red
noiseGraphics.pixels[i + 1] = R.random_num(0,255); // Green
noiseGraphics.pixels[i + 2] = R.random_num(0,255); // Blue
noiseGraphics.pixels[i + 3] = 255; // Alpha (fully opaque)
}
noiseGraphics.updatePixels();
}
function sigmoid(x) {
return 1 / (1 + exp(-x));
}
function forwardPropagation() {
noiseGraphics.loadPixels();
// Normalize inputs
for (let i = 0; i < noiseGraphics.pixels.length; i += 4) {
let inputRed = noiseGraphics.pixels[i] / 255.0;
let inputGreen = noiseGraphics.pixels[i + 1] / 255.0;
let inputBlue = noiseGraphics.pixels[i + 2] / 255.0;
// Apply weights and biases, then the activation function
let outputRed = sigmoid(inputRed * neuralNetworkWeights[i] + neuralNetworkBiases[i]);
let outputGreen = sigmoid(inputGreen * neuralNetworkWeights[i + 1] + neuralNetworkBiases[i + 1]);
let outputBlue = sigmoid(inputBlue * neuralNetworkWeights[i + 2] + neuralNetworkBiases[i + 2]);
noiseGraphics.pixels[i] = outputRed * 255; // Red
noiseGraphics.pixels[i + 1] = outputGreen * 255; // Green
noiseGraphics.pixels[i + 2] = outputBlue * 255; // Blue
}
noiseGraphics.updatePixels();
}
function calculateLoss() {
let loss = 0;
const length = targetImageData.length;
for (let i = 0; i < length; i++) {
let error = targetImageData[i] - noiseGraphics.pixels[i];
loss += error * error;
}
return loss / length; // Divide once after the loop completes
}
function adjustWeightsAndBiases() {
noiseGraphics.loadPixels();
for (let i = 0; i < neuralNetworkWeights.length; i++) {
let direction = targetImageData[i] - noiseGraphics.pixels[i];
neuralNetworkWeights[i] += direction * learningRate;
neuralNetworkBiases[i] += direction * learningRate;
}
noiseGraphics.updatePixels();
}
function drawSinglePentagon(radius, angleOffset) {
targetGraphics.push();
targetGraphics.rotate(angleOffset);
targetGraphics.beginShape();
for (let i = 0; i < shapeNb; i++) {
let vertexAngle = vertexMultiplier * i;
let x = cos(vertexAngle) * radius;
let y = sin(vertexAngle) * radius;
targetGraphics.vertex(x, y);
}
targetGraphics.endShape(CLOSE);
targetGraphics.pop();
}
function drawPentagon(){
targetGraphics.angleMode(DEGREES);
targetGraphics.stroke(255);
targetGraphics.noFill();
targetGraphics.translate(fixedImageWidth / 2, fixedImageWidth*(16/9) / 2);
const numShapes = R.random_num(20,50);
console.log(numShapes);
const maxRadius = (1.4*fixedImageWidth) / 2;
const angleInc = 360 / R.random_num(4,15);
for (let i = 0; i < numShapes; i++) {
const radius = map(i, 0, numShapes, 50, maxRadius);
const angle = i * (angleInc / numShapes);
drawSinglePentagon(radius, angle);
}
}
function placeText(){
noiseGraphics.fill(220);
noiseGraphics.textFont('Times New Roman');
let textSizeRelative = noiseGraphics.height * 0.08;
noiseGraphics.textSize(textSizeRelative);
noiseGraphics.text("LOVE", R.random_num(0,noiseGraphics.width - 222), noiseGraphics.height / 5);
noiseGraphics.text("AI", R.random_num(0,noiseGraphics.width - 111), R.random_num(0,noiseGraphics.height));
let currentLoss = calculateLoss();
noiseGraphics.textSize(textSizeRelative*0.25);
noiseGraphics.text(`Iteration ${iteration}, Loss: ${currentLoss}`, noiseGraphics.width * 0.1, noiseGraphics.height * 0.9);
}
draw = function(){
if (iteration < iterations) {
image(noiseGraphics, 0, 0, canvasWidth, canvasHeight);
forwardPropagation();
placeText();
adjustWeightsAndBiases();
iteration++;
}
}
}],[1 ,()=>{console.log("Artist 46. Linda Dounia -- platform 1 ");const COLORS = [
'#E9724C', '#C5283D', '#255F85', '#2A9D8F', '#F4A261','#E9C46A', '#264653', '#8A817C', '#F2CC8F', '#E76F51', '#3D405B', '#81B29A', '#F2D7EE', '#F2E9E4', '#3D5A80', '#98C1D9', '#E0FBFC', '#EE6C4D', '#293241', '#E07A5F', '#F4F1DE', '#E4D6A7', '#E9B44C', '#9B2915', '#50A2A7', '#E87461', '#BAC1B8', '#58A4B0', '#C4A77D', '#495867', '#577399',
];
let squares = [];
const scaleFactor = 1080 / 1920;
setup=() => {
const scaledWidth = windowHeight * scaleFactor;
const scaledHeight = windowWidth / scaleFactor;
if (window.innerHeight > window.innerWidth) {
mainCanvas = createCanvas(window.innerWidth, scaledHeight);
} else {
mainCanvas = createCanvas(scaledWidth, window.innerHeight);
}
noLoop();
generateSquares();
drawGrid();
drawSecondGrid();
drawSquares();
generateTaperedStaircase();
drawFrame();
}
function calculateCanvasSize() {
let aspectRatio = 9 / 16;
let canvasWidth = windowWidth;
let canvasHeight = windowWidth / aspectRatio;
if (canvasHeight > windowHeight) {
canvasHeight = windowHeight;
canvasWidth = windowHeight * aspectRatio;
}
return { width: canvasWidth, height: canvasHeight };
}
function drawGrid() {
let cols = R.random_num(1, 3);
let rows = R.random_num(2, 5);
let cellWidth = width / cols;
let cellHeight = height / rows;
for (let i = 0; i < cols; i++) {
for (let j = 0; j < rows; j++) {
let x = i * cellWidth;
let y = j * cellHeight;
let color1 = color(R.random_choice(COLORS));
let color2 = color(R.random_choice(COLORS));
setGradient(x, y, cellWidth, cellHeight, color1, color2, Y_AXIS);
}
}
}
function drawSecondGrid() {
stroke(R.random_choice(COLORS));
noFill();
let cols = R.random_num(50, 100);
let cellWidth = width / cols;
let cellHeight = height;
for (let i = 1; i < cols; i++) {
let x = i * cellWidth;
line(x, 0, x, cellHeight);
}
}
function setGradient(x, y, w, h, color1, color2, axis) {
noFill();
if (axis === Y_AXIS) {
for (let i = y; i <= y + h; i++) {
let inter = map(i, y, y + h, 0, 1);
let c = lerpColor(color1, color2, inter);
stroke(c);
line(x, i, x + w, i);
}
} else if (axis === X_AXIS) {
for (let i = x; i <= x + w; i++) {
let inter = map(i, x, x + w, 0, 1);
let c = lerpColor(color1, color2, inter);
stroke(c);
line(i, y, i, y + h);
}
}
}
const Y_AXIS = 1;
const X_AXIS = 2;
function generateSquares() {
squares = [];
let numOfSquares = R.random_num(4, 20);
let margin = width * 0.01;
let baseSquareSize = Math.min(width, height) / 20;
let placedSquares = 0;
let currentX = margin;
let currentY = margin;
while (placedSquares < numOfSquares) {
let squareScaleFactor = R.random_num(1, 3);
let squareSize = baseSquareSize * squareScaleFactor;
if (currentX + squareSize + margin > width) {
currentX = margin;
currentY += squareSize + margin;
}
if (currentY + squareSize + margin > height) break;
squares.push({ x: currentX, y: currentY, size: squareSize });
placedSquares++;
currentX += squareSize + margin;
}
}
function drawSquares() {
squares.forEach(sq => {
let color1 = color(R.random_choice(COLORS));
let color2 = color(R.random_choice(COLORS));
setGradient(sq.x, sq.y, sq.size, sq.size, color1, color2, Y_AXIS);
});
}
function generateTaperedStaircase() {
push();
blendMode(EXCLUSION);
noStroke();
let numSteps = R.random_num(1, 100);
let spacing = R.random_num(height / numSteps * 2, height / numSteps / 2);
for (let i = 0; i < numSteps; i++) {
let drawDirection = R.random_dec() > 0.5 ? 'right' : 'left';
fill(255, 204, 229);
let y = i * spacing * 2;
let x = drawDirection === 'right' ? 0 : width;
let currentY = y;
let startX = x;
let startY = y;
while (true) {
let stepWidth = R.random_num(width / 100, width / 5);
let stepHeight = R.random_num(spacing / 2, spacing * 2);
if ((drawDirection === 'right' && startX + stepWidth > width) || (drawDirection === 'left' && startX - stepWidth < 0)) {
break;
}
startX += drawDirection === 'right' ? stepWidth : -stepWidth;
startY += stepHeight;
rect(drawDirection === 'right' ? startX - stepWidth : startX, currentY, stepWidth, stepHeight);
currentY += stepHeight;
if (currentY > height) {
break;
}
}
}
pop();
}
function drawFrame() {
let frameStrokeWeight = width * 0.04;
noFill();
stroke(R.random_choice(COLORS));
strokeWeight(frameStrokeWeight);
rect(frameStrokeWeight / 2, frameStrokeWeight / 2, width - frameStrokeWeight, height - frameStrokeWeight);
}
function doubleClicked() {
let fs = fullscreen();
fullscreen(!fs);
}
}],