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
そのデザイントークン、Flutterでも同じ見た目になりますか?
nakamizu
0
370
Distance field of Julia set
kinakomoti321
0
330
あなたはMCPの機能を、まだ知らない。
4geru
1
360
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
140
あなたの await、OS まで届いてる? strace で覗く JavaScript の非同期
hasutosasaki
1
2.4k
ローカルLLMの基本と近況 2611 / Local LLM basics and recent situation 2611
kishida
2
490
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
170
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
210
AI-Powered Domain-Driven Design
ziobrando
0
460
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
270
AI時代のシニアエンジニアとは
yosuke_furukawa
PRO
15
12k
自宅サーバはどこまで再現できるのか - Proxmox VE上のVM環境をIaCとバックアップで戻してみた
youto
0
310
Featured
See All Featured
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
540
Building Adaptive Systems
keathley
44
3.3k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
Amusing Abliteration
ianozsvald
1
390
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
2
530
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
680
30 Presentation Tips
portentint
PRO
1
470
Darren the Foodie - Storyboard
khoart
PRO
5
4.1k
Paper Plane (Part 1)
katiecoart
PRO
3
12k
Principles of Awesome APIs and How to Build Them.
keavy
128
18k
Into the Great Unknown - MozCon
thekraken
41
2.8k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
3.1k