UNPKG

tokyo-3

Version:

Worlds Best Pomodoro. 3rd Impact Imminent. Switching to Auxillary Power.

60 lines (59 loc) 2.71 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.unit03 = void 0; const colorette_1 = require("colorette"); const terminal_kit_1 = __importDefault(require("terminal-kit")); const node_notifier_1 = require("node-notifier"); const _1 = require("."); const path_1 = __importDefault(require("path")); const unit03 = () => { const { terminal } = terminal_kit_1.default; let swap = true; const sunset1 = () => __awaiter(void 0, void 0, void 0, function* () { return yield terminal.drawImage(path_1.default.join(__dirname, "../images/unit-3-walk/sunset-1.jpg"), { shrink: { width: 80, height: 60 }, }); }); const sunset2 = () => __awaiter(void 0, void 0, void 0, function* () { return yield terminal.drawImage(path_1.default.join(__dirname, "../images/unit-3-walk/sunset-2.jpg"), { shrink: { width: 80, height: 60 }, }); }); const walk = setInterval(() => __awaiter(void 0, void 0, void 0, function* () { terminal.clear(); if (swap) { yield sunset1(); console.log((0, colorette_1.bold)((0, colorette_1.red)("WARNING! 9th ANGEL! WARNING! 9th ANGEL! WARNING! 9th ANGEL! WARNING! 9th ANGEL"))); swap = !swap; } else { yield sunset2(); console.log((0, colorette_1.bold)((0, colorette_1.yellow)("9th ANGEL! WARNING! 9th ANGEL! WARNING! 9th ANGEL! WARNING! 9th ANGEL! WARNING"))); swap = !swap; } }), 900); const clearAll = setTimeout(() => { clearInterval(walk); clearTimeout(clearAll); _1.rl.write("\u001B[?25h"); terminal.clear(); console.log((0, colorette_1.yellow)(_1.example)); process.exit(); }, 10000); walk; (0, node_notifier_1.notify)("🚨TIME🚨"); clearAll; }; exports.unit03 = unit03;