FCC Pomodoro
How do I make an fcc pomodoro?
What is a fcc pomodoro? How do you make a fcc pomodoro? This script and codes were developed by Victoria on 02 December 2022, Friday.
FCC Pomodoro - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>FCC Pomodoro</title> <link rel='stylesheet prefetch' href='https://netdna.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div id="pomodoro"></div> <script src='http://cdnjs.cloudflare.com/ajax/libs/react/0.14.7/react.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
FCC Pomodoro - Script Codes CSS Codes
body { font-size: 20px; background-color: limegreen; font-family: 'Lobster', cursive;
}
.title { font-size: 50px;
}
.pomodoro { margin: auto; text-align: center
}
.timer { font-size: 36px; width: 150px; height: 150px; margin: auto; display: inline-flex; justify-content: center; align-items: center; border: 5px solid darkred; border-radius: 100%; background-color: red; cursor: pointer;
}
.change { cursor: pointer;
}
FCC Pomodoro - Script Codes JS Codes
'use strict';
var Pomodoro = React.createClass({ displayName: 'Pomodoro', getInitialState: function getInitialState() { return { session: 1, break: 1, isSession: true, switchedOn: false, timer: 0 }; }, handleSwitcherClick: function handleSwitcherClick() { var _this = this; if (this._handler) clearInterval(this._handler); this.setState({ switchedOn: !this.state.switchedOn, isSession: true }, function () { if (_this.state.switchedOn) { (function () { var SECOND = 1000; var tick = function tick() { _this.setState({ timer: _this.state.isSession ? _this.state.session * 60 : _this.state.break * 60 }); _this._handler = setInterval(function () { _this.setState({ timer: _this.state.timer - 1 }, function () { if (_this.state.timer === 0) { clearInterval(_this._handler); _this.setState({ isSession: !_this.state.isSession }); tick(); } }); }, SECOND); }; tick(); })(); } }); }, colonTimer: function colonTimer(sec) { var pad = function pad(num, size) { var s = "0" + num; return s.substr(s.length - size); }; var minutes = Math.floor(sec / 60); var seconds = sec % 60; return pad(minutes, 2) + ':' + pad(seconds, 2); }, handleChange: function handleChange(isSession, isPlus) { var _this2 = this; return function () { var _this2$setState; var status = isSession ? 'session' : 'break'; var value = _this2.state[status]; if (!isPlus && value === 1) return; _this2.setState((_this2$setState = {}, _this2$setState[status] = value + (isPlus ? 1 : -1), _this2$setState)); }; }, render: function render() { return React.createElement( 'div', { className: 'pomodoro' }, React.createElement( 'div', { className: 'title' }, 'Pomodoro Clock' ), React.createElement( 'div', { className: 'session' }, 'Session: ', React.createElement('i', { className: 'change fa fa-minus-circle', 'aria-hidden': 'true', onClick: this.handleChange(true, false) }), ' ', this.state.session, ' minutes ', React.createElement('i', { className: 'change fa fa-plus-circle', 'aria-hidden': 'true', onClick: this.handleChange(true, true) }) ), React.createElement( 'div', { classname: 'break' }, 'Break: ', React.createElement('i', { className: 'change fa fa-minus-circle', 'aria-hidden': 'true', onClick: this.handleChange(false, false) }), ' ', this.state.break, ' minutes ', React.createElement('i', { className: 'change fa fa-plus-circle', 'aria-hidden': 'true', onClick: this.handleChange(false, true) }) ), React.createElement( 'div', { className: 'timer', onClick: this.handleSwitcherClick }, this.state.switchedOn ? this.state.isSession ? 'Session ' + this.colonTimer(this.state.timer) : 'Break ' + this.colonTimer(this.state.timer) : 'Go!' ) ); }
});
React.render(React.createElement(Pomodoro, null), document.getElementById('pomodoro'));
Developer | Victoria |
Username | Enieste |
Uploaded | December 02, 2022 |
Rating | 3 |
Size | 3,618 Kb |
Views | 8,096 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
FCC Tribute page | 3,327 Kb |
FCC Random quote machine | 2,085 Kb |
React TODO | 3,320 Kb |
A Pen by Victoria | 2,090 Kb |
FCC Leaderboard | 3,665 Kb |
FCC Tic Tac Toe | 5,602 Kb |
Profile | 3,970 Kb |
FCC Wiki viewer | 2,309 Kb |
Cube calc | 3,851 Kb |
FCC Recipe Box | 7,585 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
CSS3 keyframe onload animation. | Samueljseay | 1,706 Kb |
FreeCodeCamp - Simon Game | Ivhed | 8,481 Kb |
Infractions - Attitude | Kylie_Joseph | 7,672 Kb |
Jstam.com Home Page | Jstam | 10,558 Kb |
Animated SVG stroke-dasharray | Netsi1964 | 3,179 Kb |
Cloud upload | Jaflo | 2,774 Kb |
Menu | Vivi_Lai | 1,210 Kb |
Highbrow Basic HTML Lesson 7 | Kimlarocca | 1,662 Kb |
Base64 SVG Me | MrBambule | 44,786 Kb |
Glitchy Text Effect | Kescoe | 2,208 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!