mirror of
https://github.com/mathew-kurian/Scribe.js
synced 2025-04-25 06:45:10 +00:00
Add flat colors
This commit is contained in:
parent
d25a1e94be
commit
82b494a7b2
2 changed files with 29 additions and 2 deletions
|
@ -9,6 +9,17 @@
|
|||
* to display folder name, dates and file name
|
||||
*/
|
||||
|
||||
var colors = [
|
||||
"#16a085",
|
||||
"#27ae60",
|
||||
"#2980b9",
|
||||
"#8e44ad",
|
||||
"#f39c12",
|
||||
"#d35400",
|
||||
"#c0392b",
|
||||
"#7f8c8d"
|
||||
];
|
||||
|
||||
window.app.directive('block', [function () {
|
||||
|
||||
return {
|
||||
|
@ -58,7 +69,19 @@
|
|||
},
|
||||
restrict : "E",
|
||||
templateUrl : 'partials/elements/blocks.html',
|
||||
replace : true
|
||||
replace : true,
|
||||
|
||||
controller : ['$scope', function ($scope) {
|
||||
|
||||
/**
|
||||
* $scope.color
|
||||
*
|
||||
* @return {String} A radom haxa color from `colors`
|
||||
*/
|
||||
$scope.color = function () {
|
||||
return colors[Math.floor(Math.random() * colors.length)]
|
||||
};
|
||||
}]
|
||||
};
|
||||
|
||||
}]);
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
<div class="block" ng-class="{'block--date' : type == 'date', 'block--file': forceFile}">
|
||||
<div
|
||||
class="block"
|
||||
ng-class="{'block--date' : type == 'date', 'block--file': forceFile}"
|
||||
style="background: {{ color() }}"
|
||||
>
|
||||
<p class="block__message block__message--top" ng-if="messageTop">{{messageTop}}</p>
|
||||
<p class="block__message block__message--middle" ng-if="message">{{message}}</p>
|
||||
<p class="block__message block__message--bottom" ng-if="messageBottom">{{messageBottom}}</p>
|
||||
|
|
Loading…
Add table
Reference in a new issue