LOADING...

Preview

Pen ID
Unlock Campus Themeforest adv

 

Code
(Click on the capital letter to change color)
CSS
html,
body {
  margin: 0;
  height: 100%;
}
body,
button,
input,
textarea {
  font-family: 'Open Sans', sans;
}
.main {
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.icon {
  background: #ff6347;
  width: 150px;
  height: 150px;
  cursor: pointer;
  border-radius: 5px;
  margin-bottom: 25px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  font-size: 100px;
  transition: 0.2s;
}
.icon.disabled {
  background: rgba(0,0,0,0.5);
}
.icon.icon-dark {
  color: rgba(0,0,0,0.5);
}
.name-input {
  border: none;
  border-bottom: 1px solid rgba(0,0,0,0.2);
  font-size: 18px;
  padding: 5px 10px;
}
.name-input:focus {
  outline: none;
}
.btn-continue {
  border: none;
  color: #fff;
  background: rgba(0,0,0,0.5);
  margin-top: 15px;
  font-size: 1.3em;
  padding: 5px 15px;
  border-radius: 3px;
  transition: 0.2s;
  cursor: pointer;
}
.btn-continue:hover {
  background: rgba(0,0,0,0.7);
}
.btn-continue:active {
  background: rgba(0,0,0,0.8);
}
.btn-continue:focus {
  outline: none;
}
.btn-continue.disabled {
  background: #f5f5f5;
  color: rgba(0,0,0,0.2);
}
.hint {
  font-size: 0.7em;
  margin-top: 15px;
  color: rgba(0,0,0,0.4);
}
JS
var app = angular.module('app', []);
app.controller('MainController', function($scope) {
  $scope.name = '';
  $scope.$watch('name', function() {
    $scope.icon = angular.uppercase($scope.name[0]);
  });
});
app.directive('colorPicker', function($window) {
  var scale = function(r, d) {
    return function(value) {
      return (d[1] - d[0]) * (value - r[0])/(r[1] - r[0]) + d[0]
    }
  }
  var color = '';
  var active = false;
  var cp = angular.element('
'); cp.css({ position: 'absolute', background: 'tomato', width: '100%', height: '100%', top: '-100%', left: '0', opacity: '0', transition: '.2s', cursor: 'pointer' }); angular.element(document.body).append(cp); return { restrict: 'EAC', link: function(scope, element, attrs) { cp.on('click', function() { cp.css({ opacity: '0', top: '-100%' }); active = false; element.css({ background: color }); }); cp.on('mousemove', function(event) { if(active) { var scaleL = scale([0, cp.prop('offsetHeight')], [100, 0]); var scaleH = scale([0, cp.prop('offsetWidth')], [0, 360]); var hue = Math.floor(scaleH(event.clientX)); var light = Math.floor(scaleL(event.clientY)); if (light > 65) { element[0].classList.add('icon-dark'); } else { element[0].classList.remove('icon-dark'); } color = 'hsl(' + hue + ', 65%, ' + light + '%)'; cp.css({ background: color }); element.css({ background: color }); } }); element.on('click', function(event) { if(element.hasClass('disabled')) { event.preventDefault(); } else { active = true; cp.css({ opacity: '1', top: '0' }); } }) } } })

Description

Testing new type of create project form.
Wed, 12/27/2017 - 07:01

Related Codes

Pen ID
Pen ID
Pen ID
Square Adv