tomadoro/static/js/main.bca74514.chunk.js.map

1 line
21 KiB
Plaintext

{"version":3,"sources":["assets/sound.mp3","assets/logo.svg","containers/Notification.js","components/Headbar.js","utils.js","components/Timer.js","components/Logo.js","components/Box.js","components/Footer.js","containers/App.js","serviceWorker.js","index.js"],"names":["module","exports","Notification","props","state","ignore","title","handlePermissionGranted","bind","handlePermissionDenied","handleNotSupported","sendNotification","handleNotificationOnShow","playSound","this","send","handleNotification","setState","e","tag","console","log","options","Date","now","body","lang","sound","document","getElementById","play","onPermissionGranted","onPermissionDenied","notSupported","onError","timeout","onShow","id","preload","src","type","hidden","Component","headbar","style","display","minHeight","flexDirection","textAlign","alignItems","justifyContent","fontSize","color","textShadow","marginBottom","formatMinute","s","timer","fontWeight","seconds","logo","className","isStarted","logoSVG","alt","onClick","click","box","buttonStyle","height","borderRadius","width","margin","padding","backgroundColor","borderBottom","boxShadow","Row","Col","xs","Button","block","size","startButton","disabled","stopButton","resetButton","footer","fontFamily","marginTop","href","App","tick","APP_NAME","stopTimer","finishedTimer","startTimer","started","activePopupNotification","interval","setInterval","clearInterval","resetTimer","break","breakMode","pomodoroMode","sendNotificationFlag","changeMode","POMODORO_SECONDS","BREAK_SECONDS","flag","notification","Headbar","Container","Timer","sm","offset","md","lg","Box","Footer","Boolean","window","location","hostname","match","ReactDOM","render","navigator","serviceWorker","ready","then","registration","unregister"],"mappings":"wFAAAA,EAAOC,QAAU,IAA0B,mC,mBCA3CD,EAAOC,QAAU,IAA0B,kC,gQCyG5BC,E,kDApGb,WAAYC,GAAQ,IAAD,8BACjB,cAAMA,IAEDC,MAAQ,CACXC,QAAQ,EACRC,MAAO,IAGT,EAAKC,wBAA0B,EAAKA,wBAAwBC,KAA7B,gBAC/B,EAAKC,uBAAyB,EAAKA,uBAAuBD,KAA5B,gBAC9B,EAAKE,mBAAqB,EAAKA,mBAAmBF,KAAxB,gBAC1B,EAAKG,iBAAmB,EAAKA,iBAAiBH,KAAtB,gBACxB,EAAKI,yBAA2B,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BACjB1F,mBAAoBF,KAAKE,sBAK3B,6BACG+F,EACD,kBAACC,EAAD,MACA,kBAACC,EAAA,EAAD,KACE,kBAACpC,EAAA,EAAD,KACE,kBAACC,EAAA,EAAD,KACE,kBAAC,EAAD,CACEhB,UAAWhD,KAAKV,MAAM6F,QACtB/B,MAAOpD,KAAK6F,eAGlB,kBAAC9B,EAAA,EAAD,KACE,kBAACC,EAAA,EAAD,KACE,kBAACoC,EAAD,CAAOvD,QAAS7C,KAAKV,MAAMuD,YAG/B,kBAACkB,EAAA,EAAD,KACE,kBAACC,EAAA,EAAD,CACEqC,GAAI,CAAEjC,KAAM,GAAIkC,OAAQ,GACxBC,GAAI,CAAEnC,KAAM,EAAGkC,OAAQ,GACvBE,GAAI,CAAEpC,KAAM,EAAGkC,OAAQ,IACvB,kBAACG,EAAD,CACEpC,YAAarE,KAAKkF,WAClBX,WAAYvE,KAAKgF,UACjBR,YAAaxE,KAAKwF,WAClBxC,UAAWhD,KAAKV,MAAM6F,QACtBtC,QAAS7C,KAAKV,MAAMuD,YAG1B,kBAACkB,EAAA,EAAD,KACE,kBAACC,EAAA,EAAD,KACE,kBAAC0C,EAAD,c,GAjII9E,cCDE+E,QACW,cAA7BC,OAAOC,SAASC,UAEe,UAA7BF,OAAOC,SAASC,UAEhBF,OAAOC,SAASC,SAASC,MACvB,2DCZNC,IAASC,OAAO,kBAAC,EAAD,MAASnG,SAASC,eAAe,SD2H3C,kBAAmBmG,WACrBA,UAAUC,cAAcC,MAAMC,MAAK,SAAAC,GACjCA,EAAaC,kB","file":"static/js/main.bca74514.chunk.js","sourcesContent":["module.exports = __webpack_public_path__ + \"static/media/sound.ec792557.mp3\";","module.exports = __webpack_public_path__ + \"static/media/logo.08ea9508.svg\";","import React, { Component } from 'react';\nimport WebNotification from 'react-web-notification';\nimport sound from '../assets/sound.mp3';\n\nclass Notification extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n ignore: true,\n title: ''\n };\n\n this.handlePermissionGranted = this.handlePermissionGranted.bind(this);\n this.handlePermissionDenied = this.handlePermissionDenied.bind(this);\n this.handleNotSupported = this.handleNotSupported.bind(this);\n this.sendNotification = this.sendNotification.bind(this);\n this.handleNotificationOnShow = this.handleNotificationOnShow.bind(this);\n this.playSound = this.playSound.bind(this);\n }\n\n componentDidUpdate() {\n if(this.props.send) {\n this.sendNotification()\n this.props.handleNotification(false)\n };\n }\n\n handlePermissionGranted() {\n this.setState({\n ignore: false\n });\n }\n\n handlePermissionDenied() {\n this.setState({\n ignore: true\n });\n }\n\n handleNotSupported() {\n this.setState({\n ignore: true\n });\n }\n\n handleNotificationOnError(e, tag) {\n console.log(e, 'Notification error tag:' + tag);\n }\n\n handleNotificationOnShow() {\n this.playSound();\n }\n\n sendNotification() {\n if (this.state.ignore) {\n return;\n }\n\n const title = 'tomadoro';\n const body = 'Time is Up! 🍅';\n const tag = Date.now();\n\n const options = {\n tag: tag,\n body: body,\n lang: 'en',\n sound: { sound }\n };\n\n this.setState({\n title: title,\n options: options\n });\n }\n\n playSound() {\n document.getElementById('sound').play();\n }\n\n render() {\n return(\n <div>\n <WebNotification\n ignore={this.state.ignore}\n onPermissionGranted={this.handlePermissionGranted}\n onPermissionDenied={this.handlePermissionDenied}\n notSupported={this.handleNotSupported}\n onError={this.onError}\n timeout={5000}\n title={this.state.title}\n options={this.state.options}\n onShow={this.handleNotificationOnShow}\n >\n </WebNotification>\n\n <audio id='sound' preload='auto'>\n <source src={sound} type='audio/mpeg' />\n <embed hidden src={sound} />\n </audio>\n </div>\n );\n }\n}\n\nexport default Notification;","import React from 'react';\n\nconst headbar = () => {\n const style = {\n display: 'flex',\n minHeight: '5vh',\n flexDirection: 'column',\n textAlign: 'left',\n alignItems: 'center',\n justifyContent: 'center',\n fontSize: '44px',\n color: 'white', \n textShadow: '0 2px 4px #909090', \n marginBottom: '6px'\n };\n\n return (\n <div style={style}>\n tomadoro\n </div>\n );\n};\n\n\nexport default headbar;","export const formatMinute = s => {\n return (s - (s %= 60)) / 60 + (9 < s ? \":\" : \":0\") + s;\n};\n","import React from \"react\";\nimport PropTypes from 'prop-types';\n\nimport { formatMinute } from '../utils';\n\nconst timer = props => {\n const style = {\n fontSize: \"110px\",\n fontWeight: \"normal\",\n color: \"white\",\n textShadow: \"0 2px 3px #8a8888\"\n };\n\n return (\n <div style={style} >\n { formatMinute(props.seconds) }\n </div>\n )\n ;\n};\n\ntimer.propTypes = {\n seconds: PropTypes.number.isRequired\n};\n\n\nexport default timer;\n","import React from 'react';\nimport PropTypes from 'prop-types';\n\nimport logoSVG from '../assets/logo.svg';\nimport './Logo.css';\n\nconst logo = props => {\n const logoRotationClass = 'App-logo-rotation';\n\n return (\n <img \n className={`App-logo ${props.isStarted ? logoRotationClass: ''}`}\n src={logoSVG}\n alt=\"Tomato\"\n title=\"Click on the tomato to change modes\"\n onClick={props.click} \n ></img>\n )\n}\n\nlogo.propTypes = {\n isStarted: PropTypes.bool.isRequired,\n click: PropTypes.func.isRequired\n}; \n\nexport default logo;","import React from 'react';\nimport { Button, Row, Col } from 'reactstrap';\nimport PropTypes from 'prop-types';\n\n\nconst box = props => {\n const buttonStyle = {\n fontSize: '16px',\n fontWeight: 'lighter',\n height: '50px',\n borderRadius: '30px',\n width: '100%',\n margin: '4px 0px 4px 0px'\n };\n\n const boxStyle = {\n padding: '6px',\n backgroundColor: 'white',\n borderRadius: '6px',\n borderBottom: '16px solid #c84132',\n boxShadow: '0 2px 3px #8a8888'\n };\n\n return (\n <div style={boxStyle}>\n <Row>\n <Col xs=\"12\">\n <Button\n style={buttonStyle}\n block\n size=\"lg\"\n color=\"success\"\n onClick={props.startButton}\n disabled={props.isStarted || props.seconds===0}>\n START\n </Button>\n </Col>\n </Row>\n <Row>\n <Col xs=\"6\">\n <Button\n style={buttonStyle}\n color=\"danger\"\n size=\"lg\"\n onClick={props.stopButton}\n disabled={!props.isStarted}>\n STOP\n </Button>\n </Col>\n <Col xs=\"6\">\n <Button\n style={buttonStyle}\n color=\"secondary\"\n size=\"lg\"\n onClick={props.resetButton}\n disabled={props.isStarted}>\n RESET\n </Button>\n </Col>\n </Row>\n </div>\n );\n}\n\nbox.propTypes = {\n startButton: PropTypes.func.isRequired,\n stopButton: PropTypes.func.isRequired,\n resetButton: PropTypes.func.isRequired,\n isStarted: PropTypes.bool.isRequired,\n seconds: PropTypes.number.isRequired\n};\n\nexport default box;","import React from 'react';\n\nconst footer = () => {\n const style = {\n fontFamily: 'Arial, Helvetica, sans-serif',\n marginTop: '8px',\n color: '#ffffff',\n textShadow: '0 2px 3px #a3a3a3'\n };\n\n return (\n <div style={style}>\n <p>\n <a href=\"https://github.com/franjsco/tomadoro\">tomadoro</a>{` `}\n by <a href=\"https://github.com/franjsco\">Francesco Esposito</a>\n </p>\n </div>\n );\n \n};\n\nexport default footer;","import React, { Component } from 'react';\nimport { Container, Row, Col } from 'reactstrap';\n\nimport Notification from './Notification';\nimport Headbar from '../components/Headbar';\nimport Timer from '../components/Timer';\nimport Logo from '../components/Logo';\nimport Box from '../components/Box';\nimport Footer from '../components/Footer';\nimport { formatMinute } from '../utils';\n\nimport './App.css';\n \nclass App extends Component {\n constructor(props) {\n super(props);\n\n this.APP_NAME = 'tomadoro';\n this.POMODORO_SECONDS = 1500;\n this.BREAK_SECONDS = 300;\n\n this.state = {\n seconds: this.POMODORO_SECONDS,\n started: false,\n break: false,\n activePopupNotification: false, \n sendNotificationFlag: false\n };\n }\n \n tick = () => {\n this.setState(state => ({ seconds: state.seconds - 1}));\n\n document.title = `(${formatMinute(this.state.seconds)}) ${this.APP_NAME}`;\n\n if (this.state.seconds === 0) {\n this.stopTimer();\n this.finishedTimer();\n }\n };\n\n startTimer = () => {\n this.setState({ started: true, activePopupNotification: true });\n \n this.interval = setInterval(() => this.tick(), 1000);\n }\n\n stopTimer = () => {\n this.setState({ started: false});\n\n clearInterval(this.interval);\n }\n\n resetTimer = () => {\n if (this.state.break) {\n this.breakMode();\n } else {\n this.pomodoroMode();\n }\n\n document.title = this.APP_NAME;\n }\n\n finishedTimer = () => {\n this.setState({\n sendNotificationFlag: true\n });\n\n this.changeMode();\n }\n\n changeMode = () => {\n if (this.state.break && !this.state.started) {\n this.pomodoroMode();\n } else if (!this.state.break && !this.state.started) {\n this.breakMode();\n }\n }\n\n pomodoroMode = () => {\n this.setState({\n seconds: this.POMODORO_SECONDS,\n break: false\n });\n }\n\n breakMode = () => {\n this.setState({\n seconds: this.BREAK_SECONDS,\n break: true\n });\n }\n\n handleNotification = flag => {\n this.setState({\n sendNotificationFlag: flag\n });\n }\n\n render() {\n let notification = null;\n\n if (this.state.activePopupNotification) {\n notification = (\n <Notification\n send={this.state.sendNotificationFlag}\n handleNotification={this.handleNotification} />\n );\n }\n\n return (\n <div>\n {notification}\n <Headbar />\n <Container>\n <Row>\n <Col>\n <Logo\n isStarted={this.state.started}\n click={this.changeMode} />\n </Col>\n </Row>\n <Row>\n <Col>\n <Timer seconds={this.state.seconds} />\n </Col>\n </Row>\n <Row>\n <Col\n sm={{ size: 10, offset: 1 }}\n md={{ size: 8, offset: 2 }}\n lg={{ size: 6, offset: 3 }} >\n <Box\n startButton={this.startTimer}\n stopButton={this.stopTimer}\n resetButton={this.resetTimer}\n isStarted={this.state.started}\n seconds={this.state.seconds} />\n </Col>\n </Row>\n <Row>\n <Col>\n <Footer />\n </Col>\n </Row>\n </Container>\n </div>\n );\n }\n}\n\nexport default App;","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit https://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See https://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport 'bootstrap/dist/css/bootstrap.min.css';\nimport App from './containers/App';\nimport * as serviceWorker from './serviceWorker';\n\nReactDOM.render(<App />, document.getElementById('root'));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}