made with esnextbin
Created
August 10, 2016 09:04
-
-
Save voronianski/2abcda2f469def2275ae8a6b679894c8 to your computer and use it in GitHub Desktop.
esnextbin sketch
This file contains hidden or 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> | |
<meta charset="utf-8"> | |
<title>ESNext Bin Sketch</title> | |
<!-- put additional styles and scripts here --> | |
<link href="https://fonts.googleapis.com/css?family=Glass+Antiqua" rel="stylesheet" type="text/css"> | |
<!-- CSS Reset --> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.3/normalize.css"> | |
<!-- Milligram CSS minified --> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/milligram/1.1.0/milligram.min.css"> | |
<style> | |
body { | |
color: white; | |
background-color: #575A65; | |
font-family: 'Glass Antiqua', cursive; | |
} | |
#app { | |
padding: 20px; | |
text-align: center; | |
} | |
.name { | |
font-size: 1.7em; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="app"></div> | |
</body> | |
</html> |
This file contains hidden or 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
import {random} from 'lordofthering-names' | |
import React from 'react' | |
import ReactDOM from 'react-dom' | |
const App = React.createClass({ | |
getInitialState() { | |
return {name: '[Click the button]'} | |
}, | |
render() { | |
return ( | |
<div> | |
<h1>Random "Lord of the Ring" Names</h1> | |
<div className="name">{this.state.name}</div> | |
<hr /> | |
<button onClick={() => this.setState({name: random()})}> | |
New Random Name | |
</button> | |
</div> | |
) | |
} | |
}) | |
ReactDOM.render( | |
<App />, | |
document.getElementById('app'), | |
) |
This file contains hidden or 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
{ | |
"name": "esnextbin-sketch", | |
"version": "0.0.0", | |
"dependencies": { | |
"lordofthering-names": "0.0.0-semantically-released", | |
"react": "0.14.7", | |
"react-dom": "0.14.7" | |
} | |
} |
This file contains hidden or 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
'use strict'; | |
var _lordoftheringNames = require('lordofthering-names'); | |
var _react = require('react'); | |
var _react2 = _interopRequireDefault(_react); | |
var _reactDom = require('react-dom'); | |
var _reactDom2 = _interopRequireDefault(_reactDom); | |
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
var App = _react2.default.createClass({ | |
displayName: 'App', | |
getInitialState: function getInitialState() { | |
return { name: '[Click the button]' }; | |
}, | |
render: function render() { | |
var _this = this; | |
return _react2.default.createElement( | |
'div', | |
null, | |
_react2.default.createElement( | |
'h1', | |
null, | |
'Random "Lord of the Ring" Names' | |
), | |
_react2.default.createElement( | |
'div', | |
{ className: 'name' }, | |
this.state.name | |
), | |
_react2.default.createElement('hr', null), | |
_react2.default.createElement( | |
'button', | |
{ onClick: function onClick() { | |
return _this.setState({ name: (0, _lordoftheringNames.random)() }); | |
} }, | |
'New Random Name' | |
) | |
); | |
} | |
}); | |
_reactDom2.default.render(_react2.default.createElement(App, null), document.getElementById('app')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment