Skip to content

Instantly share code, notes, and snippets.

@fulminator
Created November 18, 2012 18:57
Show Gist options
  • Save fulminator/4106842 to your computer and use it in GitHub Desktop.
Save fulminator/4106842 to your computer and use it in GitHub Desktop.
win8 look alike list
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Script List</title>
<link rel="stylesheet" href="style.css" />
<script src="javascript.js"></script>
</head>
<body>
<div id="wrapper">
</div>
</body>
</html>
window.onload = function () {
var colors = ["#A37575",
"#A38C75",
"#A3A375",
"#8CA375",
"#75A375",
"#75A38C",
"#75A3A3",
"#758CA3",
"#7575A3",
"#8C75A3",
"#A375A3",
"#A3758C",
"#BC9A9A",
"#D4BFBF",
"#9ABCBC",
"#BFD4D4"];
var titles = ["Alert and Prompt",
"Date and Time",
"Calendar",
"Calculator",
"Text Effects",
"Visual Scripts",
"Development",
"Form Scripts",
"Frame Scripts",
"Game Software",
"Graph and Chart",
"Image Effect",
"Navigation Scripts",
"Search Scripts",
"Security Scripts",
"Miscellaneous"];
var wrapper = document.getElementById('wrapper');
for (var i = 0; i < 16; i++) {
var newlink = document.createElement('a');
newlink.setAttribute('alt', titles[i] + 'scripts');
newlink.setAttribute('href', 'http://thejavascripthomework.blogspot.ro/');
newlink.setAttribute('target', '_blank');
newlink.className = "newlink";
newlink.innerHTML = titles[i];
var square = document.createElement("div");
square.className = "square";
square.appendChild(newlink);
square.style.backgroundColor = colors[i];
wrapper.appendChild(square);
}
}
.square {
width: 140px;
height: 80px;
float: left;
margin: 2px;
text-align: center;
line-height: 5em;
font-family: helvetica;
font-weight: bold;
color: #fff;
opacity: 0.85;
transition: opacity .25s ease-in-out;
-moz-transition: opacity .25s ease-in-out;
-webkit-transition: opacity .25s ease-in-out;
}
.square:hover {
cursor:pointer;
opacity: 1;
}
.newlink {
text-decoration: none;
color: #fff;
}
#wrapper {
background-color: #000;
border: 1px solid black;
width: 576px;
height: 336px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment