Mikhail Davydov
Writing, 3200 BCE
Woodblock printing, 200 AE
Printing press, 1440
Typewriter, 1860
Terminal, 70-80th
==== o o~~ /~\ _\- /_ ( oo| ___ / \ / \ _\=/_ / ()\ //| | |\\ / _ \ _|_____|_ // | | |// =================== | | === | | // | | // | | |_| O |_|(' |===(| |_________________| || O || | || | | | ||__*__|| (_)(_) | | |~ \___/ ~| |_||_| | | /=\ /=\ /=\ |_||_| _|_________________|_______[_]_[_]_[_]____/__][__\__
Text UI of Dired, 1974
Graphic UI, 1985
Window Art
> wget -qO- file | bsdtar -xvf-
DSV – Domain Specific Vocabulary
Blessed.js Demo
var box = blessed.box({
style: {
fg: 'white',
bg: 'magenta'
},
border: {type: 'line'},
tags: true
});
inquirer.prompt([{
type: 'rawlist',
name: 'tui',
message: 'Are TUIs cool?',
choices: ['Yup', 'Why do you ask?']
}], (answers) => {
});
Inquirer.js Demo
<div className="mc">
<ul className="menu">
<li className="menu__item"><span className="menu__item-shortcut">L</span>eft</li>
<li className="menu__item"><span className="menu__item-shortcut">F</span>ile</li>
<li className="menu__item"><span className="menu__item-shortcut">C</span>ommand</li>
<li className="menu__item"><span className="menu__item-shortcut">O</span>ptions</li>
<li className="menu__item"><span className="menu__item-shortcut">R</span>ight</li>
</ul>
<div className="content">
{this.props.leftPanel ? this._renderPanel(this.props.leftPanel.toJS()) : null}
{this.props.rightPanel ? this._renderPanel(this.props.rightPanel.toJS()) : null}
</div>
<div className="console">
<input className="console__input" type="text" defaultValue="~/Documents/html-cli$ node index.js" autofocus />
</div>
<ul className="controls">
<li className="control">
<div className="control__number">1</div>
<div className="control__name">Help</div>
</li>
<li className="control">
<div className="control__number">2</div>
<div className="control__name">Menu</div>
</li>
<li className="control">
<div className="control__number">3</div>
<div className="control__name">View</div>
</li>
<li className="control">
<div className="control__number">4</div>
<div className="control__name">Edit</div>
</li>
React Midnight Commander
elem.getClientRects()
— Layout MathgetComputedStyle(elem)
— Styleslet styles = window.getComputedStyle(div);
let rect = div.getClientRects();
let box = renderBox(rect, styles);
let styles = window.getComputedStyle(div);
let text = div.firstChild;
let range = document.createRange();
range.selectNodeContents(text);
let rect = range.getClientRects();
let textBox = renderText(rect, styles);
STDIN
DOM
GOTO 1
addEventListener('MozAfterPaint')
requestAnimationFrame()
new MutationObserver()
componentDidUpdate
// A queue for collecting `componentDidMount` and
// `componentDidUpdate` callbacks during transaction
var ON_DOM_READY_QUEUEING = {
close: function() {
this.reactMountReady.notifyAll();
} // ...
};
class MyCQ extends CallbackQueue {
notifyAll() {
super.notifyAll();
console.log('update');
}
}
PooledClass.addPoolingTo(MyCQ);
class MyRRT extends ReactReconcileTransaction {
constructor() {
super();
this.reactMountReady = MyCQ.getPooled(null);
}
}
PooledClass.addPoolingTo(MyRRT);
ReactUpdates.injection
.injectReconcileTransaction(MyRRT);
onWheel
event hackDOM
& generate Text UISTDOUT
STDIN
EventsDOM
GOTO 1
HTML
+CSS
+JS
=TUI
Fork me on Github