xxxxxxxxxx
let weightSlider;
let slantSlider;
let casualSlider;
let variable;
let off= 0;
function preload() {
// both will do the same thing
// loadFont(
// "../src/BricolageGrotesque-VariableFont.ttf",
// (font) => {
// const axis = font.getVariations(true);
// const styles = font.getStyles(true);
// },
// () => {},
// "Bricolage Grotesque"
// );
loadGoogleFont("Nunito Sans", {
wght: [200, 1000],
wdth: [75, 125],
YTLC: [440, 540]
});
}
var rad = 20;
var num = 16;
var angle = 0;
var letter = ['code', ' drift']
var lIndex = 20;
function setup() {
createCanvas(windowWidth, windowHeight);
background(100);
angleMode(DEGREES);
//frameRate(1)
rectMode(CENTER)
}
function draw() {
background(235);
const n = 75 + (sin(frameCount * 2) * 0.5 + 0.5) * 50;
//console.log(n)
translate(width / 2, height / 2)
rotate(frameCount / 2)
textSize(20)
angle = 0;
//console.log("w: ");
for (var i = 0; i < num; i++) {
push()
translate(rad * sin(angle), rad * cos(angle))
rotate(90 - 360 / num * i)
const w = 200 + (cos(((360)/num) * i + (360/num)*frameCount/4 ) * 0.5 + 0.5) * 800;
//console.log(w);
textFont("Nunito Sans", 20, {
wdth: n,
YTLC: 440,
wght: w
});
text(letter[lIndex % 2], 0, 0);
angle = angle + 360 / num;
lIndex++;
pop()
}
}
// function draw() {
// background("blue");
// const n = 75 + (sin(frameCount * 0.05) * 0.5 + 0.5) * 50;
// push();
// fill("yellow")
// for(let i=0;i<=height;i+=height/8){
// const m = 440 + (cos(i+frameCount * 0.08) *0.5 + 0.5) * 100;
// const w = 200 + (cos(i+frameCount * 0.08) *0.5 + 0.5) * 800;
// textFont("Nunito Sans", 80, { wdth: n, YTLC: m, wght: w });
// text("Code Drift", width / 2, i);}
// pop();
// }