diff --git a/asset-manifest.json b/asset-manifest.json new file mode 100644 index 0000000..2b41e77 --- /dev/null +++ b/asset-manifest.json @@ -0,0 +1,10 @@ +{ + "files": { + "main.js": "/calc-react/static/js/main.b9a1eadf.js", + "index.html": "/calc-react/index.html", + "main.b9a1eadf.js.map": "/calc-react/static/js/main.b9a1eadf.js.map" + }, + "entrypoints": [ + "static/js/main.b9a1eadf.js" + ] +} \ No newline at end of file diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000..a11777c Binary files /dev/null and b/favicon.ico differ diff --git a/index.html b/index.html new file mode 100644 index 0000000..f50b907 --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +Calculator with React
\ No newline at end of file diff --git a/logo192.png b/logo192.png new file mode 100644 index 0000000..fc44b0a Binary files /dev/null and b/logo192.png differ diff --git a/logo512.png b/logo512.png new file mode 100644 index 0000000..a4e47a6 Binary files /dev/null and b/logo512.png differ diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..080d6c7 --- /dev/null +++ b/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/static/js/main.b9a1eadf.js b/static/js/main.b9a1eadf.js new file mode 100644 index 0000000..c16b0ae --- /dev/null +++ b/static/js/main.b9a1eadf.js @@ -0,0 +1,3 @@ +/*! For license information please see main.b9a1eadf.js.LICENSE.txt */ +(function(){var __webpack_modules__={555:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";var C_Users_USER_Desktop_calc_react_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(63),C_Users_USER_Desktop_calc_react_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(152),C_Users_USER_Desktop_calc_react_node_modules_babel_runtime_helpers_esm_taggedTemplateLiteral_js__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(168),styled_components__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(867),_components_Keypad__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(923),_components_CalcResult__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(911),styled_reset__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(356),react__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(791),react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(184),_templateObject,_templateObject2,_templateObject3,_templateObject4,GlobalStyle=(0,styled_components__WEBPACK_IMPORTED_MODULE_5__.vJ)(_templateObject||(_templateObject=(0,C_Users_USER_Desktop_calc_react_node_modules_babel_runtime_helpers_esm_taggedTemplateLiteral_js__WEBPACK_IMPORTED_MODULE_6__.Z)(["\n","\n\n* {\n box-sizing: border-box;\n}\n\nbody {\n width: 100%;\n height: 100vh;\n}\n"])),styled_reset__WEBPACK_IMPORTED_MODULE_2__.ZP);function App(){var _useState=(0,react__WEBPACK_IMPORTED_MODULE_3__.useState)({calcForm:"",calcResult:""}),_useState2=(0,C_Users_USER_Desktop_calc_react_node_modules_babel_runtime_helpers_esm_slicedToArray_js__WEBPACK_IMPORTED_MODULE_7__.Z)(_useState,2),calcState=_useState2[0],setCalcState=_useState2[1],isNumber=function(e){return/[0-9]+/.test(e)},allClear=function(){setCalcState({calcForm:"",calcResult:""})},Clear=function(){var e=calcState.calcForm.substring(0,calcState.calcForm.length-1);setCalcState({calcForm:e})},getResult=function getResult(){var updateResult=eval(calcState.calcForm.replaceAll("\xd7","*").replaceAll("%","*0.01"));Number.isInteger(updateResult)?setCalcState((0,C_Users_USER_Desktop_calc_react_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,C_Users_USER_Desktop_calc_react_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},calcState),{},{calcResult:updateResult})):setCalcState((0,C_Users_USER_Desktop_calc_react_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)((0,C_Users_USER_Desktop_calc_react_node_modules_babel_runtime_helpers_esm_objectSpread2_js__WEBPACK_IMPORTED_MODULE_8__.Z)({},calcState),{},{calcResult:updateResult.toFixed(12)}))},appendNum=function(e){if(!(calcState.calcForm.length>=20)&&!("0"===e&0===calcState.calcForm.length&calcState.calcForm.charAt(calcState.calcForm.length-1))){var t=calcState.calcForm+e;setCalcState({calcForm:t})}},appendOperator=function(e){if(!(calcState.calcForm.length>=20)&&!(""===calcState.calcForm|isNaN(calcState.calcForm.charAt(calcState.calcForm.length-1)))){var t=calcState.calcForm+e;setCalcState({calcForm:t})}},appendPoint=function(e){if(!(calcState.calcForm.length>=20)){var t=calcState.calcForm+e;setCalcState({calcForm:t})}},appendPercent=function(e){if(!(""===calcState.calcForm|isNaN(calcState.calcForm.charAt(calcState.calcForm.length-1)))){var t=calcState.calcForm+e;setCalcState({calcForm:t})}},onClick=function(e){"AC"===e?allClear(e):"C"===e?Clear():isNumber(e)?appendNum(e):"+"===e|"-"===e|"/"===e|"\xd7"===e?appendOperator(e):"."===e&!calcState.calcForm.includes(".")?appendPoint(e):"%"===e?appendPercent(e):"="===e&&isNumber(calcState.calcForm.charAt(calcState.calcForm.length-1))|"%"===calcState.calcForm.charAt(calcState.calcForm.length-1)&&getResult()};return(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(Container,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(GlobalStyle,{}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(CalcContainer,{children:[(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_components_CalcResult__WEBPACK_IMPORTED_MODULE_1__.Z,{form:calcState.calcForm,result:calcState.calcResult}),(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(KeypadContainer,{children:(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_components_Keypad__WEBPACK_IMPORTED_MODULE_0__.Z,{onClick:onClick})})]})]})}__webpack_exports__.Z=App;var Container=styled_components__WEBPACK_IMPORTED_MODULE_5__.zo.div(_templateObject2||(_templateObject2=(0,C_Users_USER_Desktop_calc_react_node_modules_babel_runtime_helpers_esm_taggedTemplateLiteral_js__WEBPACK_IMPORTED_MODULE_6__.Z)(["\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100vh;\n background-color: #ede4e0;\n"]))),CalcContainer=styled_components__WEBPACK_IMPORTED_MODULE_5__.zo.div(_templateObject3||(_templateObject3=(0,C_Users_USER_Desktop_calc_react_node_modules_babel_runtime_helpers_esm_taggedTemplateLiteral_js__WEBPACK_IMPORTED_MODULE_6__.Z)(["\n box-shadow: 0 14px 28px rgba(0, 0, 0, 0.15), 0 10px 10px rgba(0, 0, 0, 0.12);\n"]))),KeypadContainer=styled_components__WEBPACK_IMPORTED_MODULE_5__.zo.div(_templateObject4||(_templateObject4=(0,C_Users_USER_Desktop_calc_react_node_modules_babel_runtime_helpers_esm_taggedTemplateLiteral_js__WEBPACK_IMPORTED_MODULE_6__.Z)(["\n display: grid;\n grid-template-columns: repeat(4, 1fr);\n grid-template-rows: repeat(5, 1fr);\n width: 350px;\n height: 450px;\n"])))},911:function(e,t,n){"use strict";n.d(t,{Z:function(){return s}});var r,a,l,o=n(168),i=n(867),u=n(184);function s(e){return(0,u.jsxs)(c,{children:[(0,u.jsx)(f,{children:e.form}),(0,u.jsx)(d,{children:e.result})]})}var c=i.zo.div(r||(r=(0,o.Z)(["\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n align-items: flex-end;\n width: 350px;\n height: 100px;\n padding: 12px;\n background-color: #ecf2ff;\n"]))),f=i.zo.div(a||(a=(0,o.Z)(["\n font-size: 20px;\n"]))),d=i.zo.div(l||(l=(0,o.Z)(["\n font-size: 32px;\n font-weight: bold;\n color: #6527be;\n"])))},923:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r,a=n(168),l=n(867),o=n(184);function i(e){var t=e.onClick;return(0,o.jsx)(o.Fragment,{children:["C","AC","%","/","7","8","9","+","4","5","6","\xd7","1","2","3","-","0",".","="].map((function(e){return"0"===e?(0,o.jsx)(u,{value:e,style:{gridColumnStart:1,gridColumnEnd:3},onClick:function(){return t(e)},children:e},e):(0,o.jsx)(u,{value:e,onClick:function(){return t(e)},children:e},e)}))})}var u=l.zo.div(r||(r=(0,a.Z)(["\n display: flex;\n justify-content: center;\n align-items: center;\n width: 100%;\n height: 100%;\n background-color: #ecf2ff;\n cursor: pointer;\n user-select: none;\n\n &:hover {\n background-color: #e3dffd;\n }\n\n &:active {\n background-color: #e5d1fa;\n }\n"])))},463:function(e,t,n){"use strict";var r=n(791),a=n(296);function l(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n