This is my first attempt at building a Gist that will become a Block.
I will likely replace this text with something more meaningful in the future.
height: 700 | |
scrolling: yes |
const totalSize = leftSize + rightSize + 1; // A comment
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1"> | |
<meta name="apple-mobile-web-app-capable" content="yes"> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black"> | |
<title>My First Smartdown Block</title> | |
<link rel=stylesheet href="https://smartdown.site/lib/fonts.css"> | |
<link rel=stylesheet href="https://smartdown.site/lib/smartdown.css"> | |
<script src="https://smartdown.site/lib/smartdown.js"></script> | |
<style> | |
body { | |
margin: 0; | |
} | |
</style> | |
</head> | |
<body> | |
<div | |
class="smartdown-container" | |
id="smartdown-output"> | |
</div> | |
<script | |
src="https://smartdown.site/lib/blocks_helper.js"> | |
</script> | |
<script> | |
console.log('using starter'); | |
window.smartdownStarter(); | |
</script> | |
</body> | |
</html> |
This card demonstrates the synergy between Smartdown cells and playables. In this case, we are using a P5JS playable to draw a sketch and react to changes in the Name
variable via the What is your name?
input field.
What is your name?
Click the triangular Play
button to play this Sketch, .
p5.setup = function () {
p5.resizeCanvas(p5.windowWidth / 2, 150);
};
p5.draw = function() {
p5.background('darkgray');
var name = env.Name || 'Someone';
p5.fill('lavender');
p5.ellipse(50, 70, 80, 120);
p5.textSize(32);
p5.fill('lightgreen');
p5.text(name, 100, 40);
p5.fill('lightblue');
p5.text(name, 100, 70);
p5.fill('pink');
p5.text(name, 100, 100);
};
Back to Home