Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Working with Women's Coding Collective to learn a few things about JavaScript.
<link rel="stylesheet" href="css/main.css" type="text/css">
<link rel="stylesheet" href="css/features.css" type="text/css">
<script src=""></script>
<div id='wrapper'>
<h1>Erin's Card-o-Matic</h1>
<!-- Left side with all the controls -->
<div id='controls'>
<!-- Color picker -->
<h2>Pick a color</h2>
<div id="red" class="color"></div>
<div id="orange" class="color"></div>
<div id="gold" class="color"></div>
<div id="green" class="color"></div>
<div id="blue" class="color"></div>
<div id="purple" class="color"></div>
<div id="gray" class="color"></div>
<div class="clearfix"></div>
<div id='results'></div>
<!-- Texture picture -->
<h2>Pick a texture</h2>
<div id="circles" class="texture"></div>
<div id="cloth" class="texture"></div>
<div id="paper" class="texture"></div>
<div id="swirls" class="texture"></div>
<div id="none" class="texture">None</div>
<div class="clearfix"></div>
<!-- Message -->
<h2>Pick a message</h2>
<!-- Recipient -->
<!-- Sticker picker -->
<h2>Click a sticker to add</h2>
<!-- Right side with the live preview -->
<div id='preview'>
<div id='card-background'>
<div id='canvas'>
<div id='message-output'></div>
<div id='recipient-output'></div>
<!-- Buttons -->
<input type='button' id='refresh-btn' value='Start over'>
<input type='button' id='print-btn' value='Print'>
<script src="js/card-o-matic.js"></script>
var chosen_color = $(this).css('background-color')
$('#canvas').css('background-color', chosen_color)
var chosen_color = $(this).css('background-image')
$('#canvas').css('background-image', chosen_color)
.color {
border: 1px solid #474747;
margin-left: 10px;
cursor: pointer;
#red { background-color: #990000;}
#orange { background-color: #FF6600}
#gold { background-color: #FFCC00}
#green { background-color: #009999}
#blue { background-color: #336699}
#purple { background-color: #993399}
#gray { background-color: #474747}
.texture {
width: 60px;
height: 30px;
border: 1px solid #666666;
margin-left: 10px;
cursor: pointer;
#circles {
background-image: url('../images/texture-circles.png');}
#cloth {
background-image: url('../images/texture-cloth.png');}
#paper {
background-image: url('../images/texture-paper.png');}
#swirls {
background-image: url('../images/texture-swirls.png');}
#none {
font-size: 1.5em;
text-align: center;
vertical-align: middle;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment