JSFiddle - React, Tailwind, and code Playground

by ZhenLiu

HTML

<div id="drawing"></div>

JavaScript

// Draw the Canvas with the width of 600 and height 400
var draw = SVG("SimpleHouse").size(600,400);
/* This function draw the base(top and bottom base)
It has 3 parameters
1) basex = x position of the base
2) basey = y position of the base
3) c = the color of the base
*/
	function makeBaseD3(basex,basey,c1,c2) {
var TopBase = draw.rect(275,150).fill(c1).stroke({width:3});
TopBase.x(basex); TopBase.y(basey)
var BottomBase = draw.rect(320,35).fill(c2).stroke({width:3});
BottomBase.x(basex-45); BottomBase.y(basey+150)
}
makeBaseD3(70,100,'#98754d','#c39765')