Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
LINE Developer Meetup: Javascript All The Things
Search
Joel Billaud
July 20, 2016
Programming
730
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
LINE Developer Meetup: Javascript All The Things
Joel Billaud
July 20, 2016
Transcript
26 slides
Image copyright: Hyperbole and a Half LINE Fukuoka Joël Billaud
2016-07-20
2015 11 LINE Fukuoka Creators Market
JavaScript?
Perl JavaScript (ES6) bless +{ description => $description, methods =>
\@methods, }; bless +{ description => $description, methods => \@methods, }; { description, methods, };
Perl?
None
Green Red Pink
HTML CSS
HTML CSS JavaScript 40 PSDs 2 2 2
➜
PSD HTML Canvas
40 PSDs 2 5
⅓ ⅓ ➜
PSD
None
PSD DSL
PSD npm install psd # > const PSD = require('psd')
> const psd = PSD.fromFile(filepath) > const layer = psd.tree().children()[0] // PSD > layer.name // 'Friends @a.top.title' >[layer.width, layer.height] // [629, 1140] > layer.toPng() // Stream { ... }
"AndroidFriends": { "ja": { "width": 720, "height": 1232, "layers": [
{ "color": "a.friends.bg" "rect": { "left": 0, "top": 0, "width": 720, "height": 1232 } }, { "color": "a.top.button" "src": {
HTML Canvas
Reactive UI
Green Red Pink
function renderPreviewScreen(ctx, preview) { // Promise const renderers = preview.layers.map(layer
=> { if (layer.element) { return loadElementLayer(...); } else if (layer.rect) { return loadRectLayer(...); } else { return loadSpriteLayer(...); } }); // ... function loadSpriteLayer(layer, spriteUrl, colors) { return loadImage(spriteUrl).then(sprite => { return function render(ctx) { ctx.drawImage(sprite, src, dst); }; }); }
// Promise.all(renderers).then(...); // renderers.each(render => render.then(...)); // renderers[0].then(render => render(ctx))
.then(() => renderers[1]).then(render => render(ctx)) .then(() => renderers[2]).then(render => render(ctx)) ... .then(() => renderers[n]).then(render => render(ctx)) // reduce renderers.reduce((previous, current) => { return previous .then(() => current) .then(render => render(ctx)) });
function renderPreviewScreen(ctx, preview) { return preview.layers.map(layer => { if (layer.element)
{ return loadElementLayer(...); } else if (layer.rect) { return loadRectLayer(...); } else { return loadSpriteLayer(...); } }) .reduce((previous, current) => previous.then(() => current) .then(render => render(ctx)) ); }
npm Promise Node npm install beer vodka whiskey #
LINE
Other Decks in Programming
See All in Programming
Scalaの型でマルチテナントの認可を守る
nextbeatdev
0
180
正解の無い問題を 「できるだけ上手く」解く ヒューリスティックで感性を磨こう。〜現実課題をプログラミングで解きあうコミュニティについて〜
allegrogiken
0
120
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
160
Going Full Circle with Virtual Graphs and Relational Databases
michaelsimons
1
110
エージェントの管理もエージェントに – herdr-core と自作バックログで作る司令塔 –
nearme_tech
PRO
2
150
仕様駆動開発入門 (何を作るかを先に決めて渡す) | 目指せ Kiro マスター 05
inariku
PRO
3
230
作れるエンジニアから、価値を届けるエンジニアへ
ryunakayama
1
950
あなたはMCPの機能を、まだ知らない。
4geru
1
740
imagewebp()の向こう側: WebPはなぜ JPEG・PNGより軽いのか
yuzneri
0
150
AWS CDKを理解するために公式の定義を深掘って解説してみる / Understanding AWS CDK by Digging into Its Official Definition
akihisaikeda
3
340
Kotlin JVM用に作られたライブラリのKMPを前提とした再設計
jsoizo
0
240
[DroidKnights 2026] Workflow AX 적용기 — 자동 정책 정리부터 E2E까지
dayeon
0
120
Featured
See All Featured
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.7k
Designing for Performance
lara
612
70k
Skip the Path - Find Your Career Trail
mkilby
1
300
The Limits of Empathy - UXLibs8
cassininazir
2
800
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
890
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
540
How to train your dragon (web standard)
notwaldorf
96
6.9k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Building Flexible Design Systems
yeseniaperezcruz
330
41k
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
1.1k
Rebuilding a faster, lazier Slack
samanthasiow
85
9.8k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
3k