001 Sketch

In this example below you will see how to do a 001 Sketch with some HTML / CSS and Javascript

Sign in card build using react.

Thumbnail
This awesome code was written by jmanhart, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright jmanhart ©

Technologies

  • HTML
  • CSS
  • JavaScript
<!DOCTYPE html>
<html lang="en" >

<head>
  <meta charset="UTF-8">
  <title>001 Sketch</title>
  
  
  <link rel='stylesheet prefetch' href='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.6.3/css/font-awesome.min.css'>

      <link rel="stylesheet" href="css/style.css">

  
</head>

<body>

  <div id="reactCard" />
  <script src='http://cdnjs.cloudflare.com/ajax/libs/react/0.14.3/react.min.js'></script>

  

    <script  src="js/index.js"></script>




</body>

</html>

/*Downloaded from https://www.codeseek.co/jmanhart/001-sketch-eMzemr */
@import url("https://fonts.googleapis.com/css?family=Lato|Raleway");
html, body {
  height: 100%;
}

body {
  background: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: Helvetica Neue;
}

.wrapper {
  background-color: rgba(0, 0, 255, 0);
  width: 40em;
  overflow: scroll;
  margin-top: 20em;
  display: flex;
  align-items: center;
  flex-direction: column;
}

.card {
  background-color: white;
  border-radius: 4px;
  height: 8em;
  width: 30em;
  margin-bottom: 1em;
  display: flex;
  justify-content: flex-start;
  align-items: center;
}

.cardImage {
  display: flex;
  flex: 2;
  align-self: stretch;
  justify-content: center;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.2);
}
.cardImage .cardLogo {
  width: 4em;
  height: 4em;
  border-radius: 0.25em;
  background-color: rgba(0, 0, 0, 0.25);
}

.cardCopy {
  display: flex;
  flex: 5;
  flex-direction: column;
  background-color: rgba(0, 0, 0, 0.15);
}
.cardCopy .cardTitle {
  font-size: 1.50rem;
  font-weight: bold;
  font-family: 'Raleway', sans-serif;
  padding: 0.25em 0em;
}
.cardCopy .cardSubTitle {
  font-size: 1rem;
  font-family: 'Lato', sans-serif;
  padding: 0.5em 0em;
}

.cardCheck {
  display: flex;
  flex: 1;
  height: 2em;
  width: 2em;
  flex-direction: column;
  background-color: rgba(0, 0, 0, 0.15);
}
.cardCheck .cardDot {
  height: 2em;
  width: 2em;
  border-radius: 2em;
  background-color: rgba(0, 0, 0, 0.15);
}


/*Downloaded from https://www.codeseek.co/jmanhart/001-sketch-eMzemr */
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

var data = [{
	cardTitle: "Card Title Yo!",
	cardSubTitle: "This is a subtitle and awesome yay!"
}, {
	cardTitle: "Card Title Yo!",
	cardSubTitle: "This is a subtitle and awesome yay!"
}, {
	cardTitle: "Card Title Yo!",
	cardSubTitle: "This is a subtitle and awesome yay!"
}, {
	cardTitle: "Card Title Yo!",
	cardSubTitle: "This is a subtitle and awesome yay!"
}];

var ReactCard = function (_React$Component) {
	_inherits(ReactCard, _React$Component);

	function ReactCard(props) {
		_classCallCheck(this, ReactCard);

		var _this = _possibleConstructorReturn(this, (ReactCard.__proto__ || Object.getPrototypeOf(ReactCard)).call(this, props));

		_this.state = {
			isToggledOn: true
		};

		_this.handleClick = _this.handleClick.bind(_this);
		return _this;
	}

	_createClass(ReactCard, [{
		key: "handleClick",
		value: function handleClick() {
			return console.log("dude");
		}
	}, {
		key: "render",
		value: function render() {
			var _this2 = this;

			return React.createElement(
				"div",
				{ className: "wrapper" },
				data.map(function (item) {
					return React.createElement(
						"div",
						{ className: "card" },
						React.createElement(
							"div",
							{ className: "cardImage" },
							React.createElement("div", { className: "cardLogo" })
						),
						React.createElement(
							"div",
							{ className: "cardCopy" },
							React.createElement(
								"span",
								{ className: "cardTitle" },
								item.cardTitle
							),
							React.createElement(
								"span",
								{ className: "cardSubTitle" },
								item.cardSubTitle
							)
						),
						React.createElement(
							"div",
							{ className: "cardCheck", onClick: _this2.handleClick },
							React.createElement("div", { className: "cardDot" })
						)
					);
				})
			);
		}
	}]);

	return ReactCard;
}(React.Component);

React.render(React.createElement(ReactCard, null), document.getElementById('reactCard'));

Comments