Utilisateur:Marc Vanlindt/FractalesCSS

De Movilab
Aller à :navigation, rechercher


-let a = 15 -let b = 8

style.

 body {
   --areas: #{a};
   --max-lvl: #{b - 1};
 }

mixin branch(m)

 if m-- > 1
   b(style="--lvl: " + (b - 1 - m) + ";")
     +branch(m)
     +branch(m)

mixin nest(n)

 -let x = Math.min(Math.max(0.000001, (a * a - n) % a / (a - 1)), 0.999999)
 -let y = Math.min(Math.max(0.000001, Math.floor((n - 1) / a) / (a - 1)), 0.999999)
 div(style="--x: " + x + "; --y: " + y + "; --sl: " + (x / y < 1 ? 1 : 0) + "; --sr: " + ((1 - x) / y < 1 ? 1 : 0) + ";")
   if n-- > 1
     +nest(n)
   else
     p
       +branch(b)
       +branch(b)

+nest(a * a)

Soutenir Movilab

Vous pensez que nous allons dans le bon sens ? Si vous en avez l'envie nous vous invitons à nous rejoindre ou à faire un don.