A web component for
Visual Art & Creative Coding
Empowering CSS as an artistic language
A web component for
Visual Art & Creative Coding
Empowering CSS as an artistic language
A CSS-like language
<css-doodle>
@grid: 16x9 / 100% auto _1px;
transition: @r(1s) ease;
background:@p(
#ff8830, #d1b8a0, #aeced2, #cbdcdf
);
clip-path: polygon(@p(
'0 0, 100% 0, 100% 100%',
'0 0, 100% 0, 0 100%',
'0 0, 100% 100%, 0 100%',
'100% 0, 100% 100%, 0 100%'
));
</css-doodle> Nested, readable, no XML
<css-doodle>
@grid: 16x9 / 100% auto;
background: @svg(
viewBox: -3 -3 6 6;
fill: none;
stroke-width: .25;
stroke: #e91e63;
g {
transform: rotate($(90 * @p.m4.n));
circle*4 {
cx, cy: @pn.cycle(3 -3);
r: @pn(2, 4, 4, 2)
}
}
)
</css-doodle> No GLSL, runs on the GPU
<css-doodle>
@grid: 1 / 100% auto (16/9);
@content: @pattern(
grid: 48x27;
shape: circle;
size: sin(3*log(dr) - 2t - da);
fill: hsl(sin(dr/100 + 2t/100) .75 .65)
);
</css-doodle> clip-path: @shape()
<css-doodle>
@grid: 1 / 100% auto (16/9) ß1px ;
background: #07121f;
clip-path: @shape(
points: 2000;
scale: .061 .06;
-x: 1.81(11cos(.6t) + cos(55t) - 2.8);
-y: 2.5(11sin(9.03t) - sin(77t)) + 17;
);
</css-doodle> cssd render
# generate image from css-doodle code
$ cssd render code.css
# make image larger
$ cssd render code.css -x 10
# generate image from codepen
$ cssd render codepen.io/yuanchuan/pen/MQEeJo
# custom selectors
$ cssd render index.html -s '.container'