Created
May 17, 2016 12:54
-
-
Save outoftime/f9ebca662ecfdd44008b1e5cb236d4c3 to your computer and use it in GitHub Desktop.
Exported from Popcode. Click to import: https://popcode.org/?gist=f9ebca662ecfdd44008b1e5cb236d4c3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>GWHS Cafe</title> | |
</head> | |
<body> | |
<div id="menu"> | |
<h1> George Westinghouse Cafe</h1> | |
</div> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function addFood(object) { | |
var $container = $('<div class="food"></div>'); | |
// ADD FOOD IMAGE | |
$('<img>').attr('src', object.image).appendTo($container); | |
var $textContainer = $('<div class="food-text"></div>').appendTo($container); | |
// ADD FOOD NAME | |
$('<div class="name"></div>').text(object.name).appendTo($textContainer); | |
if (object.ingredients) { | |
// PRINT INGREDIENTS | |
$('<span class="ingredient"></span>').text(object.ingredients[0]+" ").appendTo($textContainer); | |
} | |
$('#menu').append($container); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.food { | |
max-width: 80%; | |
margin: 0 1em; | |
padding: 1em; | |
clear: both; | |
} | |
.food img { | |
width: 30%; | |
float: left; | |
} | |
.food-text { | |
width: 60%; | |
float: right; | |
padding: 20px; | |
} | |
.name { | |
font-size: 2em; | |
text-align: left; | |
} | |
body { | |
font-family: Helvetica; | |
background: #3CCFB9 | |
} | |
h1 { | |
background: #F8FD86; | |
border-radius: 10px; | |
padding: 10px; | |
text-align: center; | |
} | |
#menu{ | |
background: #FFFFFF; | |
margin: 50px; | |
padding: 20px; | |
border-radius: 10px; | |
clear:both; | |
} | |
#menu::after { | |
content: ""; | |
display: table; | |
clear: both; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment