mirror of
https://github.com/konpa/devicon.git
synced 2025-08-16 03:24:13 +02:00
Add a color picker to enhance the devicon.dev ui (#704)
Co-authored-by: Clemens Bastian <8781699+amacado@users.noreply.github.com>
This commit is contained in:
@@ -409,3 +409,9 @@ header {
|
||||
.footer {
|
||||
margin-top: 6rem;
|
||||
text-align: center; }
|
||||
|
||||
input[type='color'] {
|
||||
width: 1.25em;
|
||||
height: 1.25em;
|
||||
margin-left: 0.5em;
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
var devicon = angular.module('devicon', ['ngSanitize', 'ngAnimate']);
|
||||
const DEFAULT_BACKGROUND = "#60be86";
|
||||
|
||||
/*
|
||||
||==============================================================
|
||||
@@ -34,9 +35,15 @@ devicon.controller('IconListCtrl', function($scope, $http, $compile) {
|
||||
|-----------------------------------------
|
||||
*/
|
||||
|
||||
// icons related stuff
|
||||
$scope.icons = [];
|
||||
$scope.selectedIcon = {};
|
||||
|
||||
// background color related stuff
|
||||
// default is the default site background color
|
||||
$scope.fontBackground = DEFAULT_BACKGROUND;
|
||||
$scope.svgBackground = DEFAULT_BACKGROUND;
|
||||
|
||||
// Loop through devicon.json
|
||||
angular.forEach(data, function(devicon, key) {
|
||||
|
||||
@@ -95,6 +102,9 @@ devicon.controller('IconListCtrl', function($scope, $http, $compile) {
|
||||
$scope.selectedFontIndex = 0;
|
||||
$scope.selectedSvgIcon = $scope.selectSvg(icon.svg[0], 0);
|
||||
|
||||
// reset color
|
||||
$scope.fontBackground = DEFAULT_BACKGROUND;
|
||||
$scope.svgBackground = DEFAULT_BACKGROUND;
|
||||
}
|
||||
/*---- End of "Change selected icon" ----*/
|
||||
|
||||
@@ -145,7 +155,6 @@ devicon.controller('IconListCtrl', function($scope, $http, $compile) {
|
||||
});
|
||||
}
|
||||
/*---- End of "Change selected svg icon" ----*/
|
||||
|
||||
});
|
||||
|
||||
/*================ End of "Devicons controller" ================*/
|
||||
|
Reference in New Issue
Block a user