Skip to content

Instantly share code, notes, and snippets.

@HSchmale16
Created November 12, 2015 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HSchmale16/98e217d2a1c2a8cdc478 to your computer and use it in GitHub Desktop.
Save HSchmale16/98e217d2a1c2a8cdc478 to your computer and use it in GitHub Desktop.
<html>
<head>
<meta charset=utf-8>
<title>Some Thing</title>
<style>
body {
width: 400px;
}
.menuButton {
width: 45%;
height: 30%;
margin: 2.5%;
background-color: #EEE;
color: #107;
float: left;
font-size: 20pt;
position: relative;
}
.menuButton p{
margin: 0;
position: absolute;
top: 50%;
left: 50%;
margin-right: -50%;
transform: translate(-50%, -50%);
}
</style>
<script>
var t = {
home: [
{text: 'Hi'},
{text: 'Hello'},
{text: 'Life'},
{text: 'Hallo'},
{text: 'Something'},
{text: 'LaLa'},
{text: 'Yadda Yadda'}
]
};
window.onload = function(){
function layout(ele, idx, arr){
var elem = document.createElement('div');
elem.innerHTML = '<p>' + ele.text + '</p>';
elem.className = 'menuButton';
document.body.appendChild(elem);
}
t.home.forEach(layout);
}
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment