This project helps to control time was spent on sites. It requires special extension for Chrome browser.
Install extension for Chrome browser Custom JavaScript for websites.
Open configuration of cjs browser extension on the site you want to controll. Click on the link "your own external scripts", add path [https://varg123.github.io/34_timemachine/index.js]. Don`t forget to press "enable cjs for this host" to enable custom JS.
On the page in the upper left corner a timer will appear. The timer counts up to 3 minutes. After work timer will appear motivating "alert". After you disable an alert, it starts a timer for 30 seconds. After 30 seconds you will see motivating "alert". So it will be again to exit from the page.
For faster development you can use JS code hosted on localhost. Simple web server can be used for that, run:
python3 -m http.server
Add path http://localhost:8000/index.js
to cjs browser extension. Done.
The code is written for educational purposes. Training course for web-developers - DEVMAN.org