diff --git a/dist/index.html b/dist/index.html index 2ee33f4..555c15b 100644 --- a/dist/index.html +++ b/dist/index.html @@ -9,5 +9,5 @@
- + \ No newline at end of file diff --git a/dist/shell-game.bundle.js b/dist/shell-game.bundle.js index 893394b..a3f24fb 100644 --- a/dist/shell-game.bundle.js +++ b/dist/shell-game.bundle.js @@ -65,7 +65,7 @@ /******/ } /******/ /******/ var hotApplyOnUpdate = true; -/******/ var hotCurrentHash = "a26dd72e56c831d69926"; // eslint-disable-line no-unused-vars +/******/ var hotCurrentHash = "93767a037dffbbb40e2d"; // eslint-disable-line no-unused-vars /******/ var hotCurrentModuleData = {}; /******/ var hotCurrentParents = []; // eslint-disable-line no-unused-vars /******/ @@ -593,13 +593,11 @@ var _reactDom2 = _interopRequireDefault(_reactDom); + var _components = __webpack_require__(172); + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } - _reactDom2.default.render(_react2.default.createElement( - 'div', - null, - 'Hello world!' - ), document.getElementById('react-shell-game')); + _reactDom2.default.render(_react2.default.createElement(_components.ShellGameAppContainer, null), document.getElementById('react-shell-game')); /***/ }, /* 1 */ @@ -21967,6 +21965,19467 @@ module.exports = ReactDOMNullInputValuePropHook; /* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(3))) +/***/ }, +/* 172 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.Options = exports.Shell = exports.ShellGameAppContainer = exports.ShellGameApp = exports.GameContainer = exports.Game = undefined; + + var _Game = __webpack_require__(173); + + var _GameContainer = __webpack_require__(195); + + var _ShellGameApp = __webpack_require__(199); + + var _ShellGameAppContainer = __webpack_require__(205); + + var _Shell = __webpack_require__(174); + + var _Options = __webpack_require__(200); + + exports.Game = _Game.Game; + exports.GameContainer = _GameContainer.GameContainer; + exports.ShellGameApp = _ShellGameApp.ShellGameApp; + exports.ShellGameAppContainer = _ShellGameAppContainer.ShellGameAppContainer; + exports.Shell = _Shell.Shell; + exports.Options = _Options.Options; + +/***/ }, +/* 173 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.Game = undefined; + + var _react = __webpack_require__(1); + + var _react2 = _interopRequireDefault(_react); + + var _Shell = __webpack_require__(174); + + var _game = __webpack_require__(193); + + var _game2 = _interopRequireDefault(_game); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var Game = exports.Game = function Game(props) { + return _react2.default.createElement( + 'div', + null, + _react2.default.createElement( + 'div', + { className: _game2.default.board, style: { width: 10 + props.shells.length * 110 } }, + props.shells.map(function (shell, idx) { + return _react2.default.createElement(_Shell.Shell, { + key: shell.id, + onClick: function onClick() { + return props.shellClickHandler(shell.id); + }, + position: 10 + idx * 110, + containsBall: props.ballShellId === shell.id, + displayBall: !props.shuffling && !props.shuffled + }); + }) + ), + _react2.default.createElement( + 'button', + { + className: _game2.default.play, + onClick: props.startGameClickHandler, + disabled: props.inProgress + }, + 'Play!' + ), + _react2.default.createElement( + 'p', + { className: _game2.default.output }, + props.output + ) + ); + }; + +/***/ }, +/* 174 */ +/***/ function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.Shell = undefined; + + var _react = __webpack_require__(1); + + var _react2 = _interopRequireDefault(_react); + + var _shell = __webpack_require__(175); + + var _shell2 = _interopRequireDefault(_shell); + + var _reactMotion = __webpack_require__(179); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var Shell = exports.Shell = function Shell(props) { + return _react2.default.createElement( + _reactMotion.Motion, + { style: { x: (0, _reactMotion.spring)(props.position, { stiffness: 276, damping: 26 }) } }, + function (_ref) { + var x = _ref.x; + return _react2.default.createElement( + 'div', + null, + _react2.default.createElement( + 'div', + { + style: { + left: x + }, + className: _shell2.default.shell, + onClick: props.onClick + }, + props.containsBall && props.displayBall && _react2.default.createElement('div', { className: _shell2.default.ball }) + ) + ); + } + ); + }; + +/***/ }, +/* 175 */ +/***/ function(module, exports, __webpack_require__) { + + // style-loader: Adds some css to the DOM by adding a