xxxxxxxxxx
103
//reference for input: https://p5js.org/examples/dom-input-and-button.html
// reveals free vpn account for specific Zip codes (11101)
let graphikB, vpnArray, fontSize = 580,
fontSize2 = 240,
input;
let link;
function preload() {
graphikB = loadFont('GraphikXXXCond-Bold.otf');
}
function setup() {
// create canvas
createCanvas(600, 600);
background(255);
input = createInput();
input.position(20, 560);
fill(255);
//instruction above text box
instruction = createElement('h3', 'Type Something');
instruction.position(20, 510);
for (let x=0; x<50;x++){
for (let y=0; y<25; y++){
noStroke()
fill(0)
ellipse(random(width)*x, random(height), 30,30)
ellipse(random(width)*y, random(height), random(30,30))
}
}
}
function draw() {
background(255, 0, 0,1);
// shape function with the type
shapes()
}
function shapes(){
if (input.value() === '11101') {
if (input.value() === '11101') {
link = createA('https://nordaccount.com/login/identifier?challenge=c5a795065e29496aa452de03bc06c3a6', 'Click Here', '_blank')
link.position(155, 45);
}
vpnArray = graphikB.textToPoints("ID:FREEVPN", 15, 250, fontSize2, {
sampleFactor: 0.25
});
vpnArray2 = graphikB.textToPoints("PW:VPN130", 15, 480, fontSize2, {
sampleFactor: 0.25
});
// Array containing VPN ID & Password
for (let i = 0; i < vpnArray.length; i = i + 3) {
xWidth = mouseX;
yWidth = mouseY;
ellipse(vpnArray[i].x, vpnArray[i].y, xWidth - 170, yWidth - 70);
ellipse(vpnArray2[i].x, vpnArray2[i].y, xWidth - 170, yWidth - 70);
}
} else {
// taking input value in textbox for text to points
vpnArray = graphikB.textToPoints(input.value(), 5, 450, fontSize, {
sampleFactor: 0.25
});
// looping to draw shapes using array from text to point
for (let i = 0; i < vpnArray.length; i = i + 5) {
//regular color
if (i % 3 == 0) {
stroke(30, 20, 240);
strokeWeight(1.5)
xWidth = mouseX;
yWidth = mouseY;
push();
ellipse(vpnArray[i].x, vpnArray[i].y, xWidth - 170, yWidth - 70);
pop();
} else {
// color when zipcode is activated
stroke(30, 230, 240);
xWidth = mouseX;
yWidth = mouseY;
push();
ellipse(vpnArray[i].x, vpnArray[i].y, xWidth - 170, yWidth - 70);
}
}
}
}