More info...
Adobe Illustrator will give you something like this, but you must add the width and height attributes based in the viewBox.
<?xml version="1.0" encoding="utf-8"?>
<svg id="svg" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 510 500" width="510" height="500" style="enable-background:new 0 0 510 500;" xml:space="preserve">
<style type="text/css">
.hidden { display: none; }
.pointer { cursor: pointer; }
@import url(https://fonts.googleapis.com/css?family=Rubik:300,400,500,700,900|Work+Sans:400,500,600,700);
.headers{ font-family:'Rubik'; font-weight: 600;}
</style>
Insert this line of SVG near the end of the svg file:
<script type="text/javascript" xlink:href="https://cdn.jsdelivr.net/npm/[email protected]/dist/svg.min.js"></script>
<script type="text/javascript">
<![CDATA[
]]>
</script>
If you put the javascript in the begining:
SVG.on(document, 'DOMContentLoaded', function() {
});
var redButton = SVG.select("#redbutton");
var allButtons = SVG.select("#button1, #button2, #button3");
redButton.parent().addClass("the_father");
Classes are very important to manage state and work with animations.
redButton.addClass("large");
redButton.removeClass("large");
redButton.toggleClass("hidden");
redButton.hasClass("hidden");
Add the event:
redButton.click(function(){
redWindow.toggleClass("hidden");
redButton.toggleClass("hidden");
});
Remove the event:
redButton.click(null);
redButton.on("click", function(){
this.toggleClass("hidden");
redButton.toggleClass("hidden");
});