Last active
August 29, 2015 14:12
-
-
Save arm5077/8606e161b929e818ea07 to your computer and use it in GitHub Desktop.
National Journal swatch tool
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> | |
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script> | |
<script src="swatches.json"></script> | |
<script type="text/javascript"> | |
angular.module("swatchApp", []) | |
.controller('swatchController', ['$scope', function($scope){ | |
$scope.colors = swatches; | |
$scope.height = window.innerHeight / swatches.length; | |
}]); | |
</script> | |
<style type="text/css"> | |
body { | |
padding:0; | |
margin:0; | |
} | |
li { | |
width:100%; | |
height:15px; | |
list-style-type:none; | |
padding:0; | |
margin:0; | |
left:0; | |
text-align:center; | |
font-size:10px; | |
font-color:rgba(0,0,0,.3); | |
} | |
ul { | |
padding:0; | |
margin:0; | |
} | |
</style> | |
</head> | |
<body ng-app = "swatchApp"> | |
<ul ng-controller = "swatchController"> | |
<li ng-repeat="color in colors" ng-attr-id = "{{ 'swatch' + ($index + 1) }}" style = "background-color:{{color.color}}; height: {{height}}px; line-height: {{height}}px"" data-clipboard-text = "yoyoyoyoyo"> | |
{{color.color}} | |
</li> | |
</ul> | |
</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
swatches=[ | |
{ | |
"color": "#00473B" | |
}, | |
{ | |
"color": "#2C7064" | |
}, | |
{ | |
"color": "#63998F" | |
}, | |
{ | |
"color": "#9EBEB8" | |
}, | |
{ | |
"color": "#002740" | |
}, | |
{ | |
"color": "#165987" | |
}, | |
{ | |
"color": "#287EC1" | |
}, | |
{ | |
"color": "#77B5E3" | |
}, | |
{ | |
"color": "#C7DCE9" | |
}, | |
{ | |
"color": "#421314" | |
}, | |
{ | |
"color": "#952326" | |
}, | |
{ | |
"color": "#EA463D" | |
}, | |
{ | |
"color": "#E87E83" | |
}, | |
{ | |
"color": "#DCC7C7" | |
}, | |
{ | |
"color": "#988976" | |
}, | |
{ | |
"color": "#B5A99C" | |
}, | |
{ | |
"color": "#D6CFC7" | |
}, | |
{ | |
"color": "#E6E1DD" | |
}, | |
{ | |
"color": "#D5B329" | |
}, | |
{ | |
"color": "#FBD204" | |
}, | |
{ | |
"color": "#FCE888" | |
}, | |
{ | |
"color": "#FCF0B8" | |
}, | |
{ | |
"color": "#704D1E" | |
}, | |
{ | |
"color": "#C07C2A" | |
}, | |
{ | |
"color": "#F8A61C" | |
}, | |
{ | |
"color": "#FDC26D" | |
}, | |
{ | |
"color": "#FFDFB4" | |
}, | |
{ | |
"color": "#332B42" | |
}, | |
{ | |
"color": "#6B5B8C" | |
}, | |
{ | |
"color": "#9F8EC3" | |
} | |
]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment