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
React と 画像
Search
ymrl
March 11, 2016
Programming
1.5k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
React と 画像
途中で出てくるデモはこちらです
http://ymrl.github.io/lgtm-editor/
ymrl
March 11, 2016
More Decks by ymrl
See All by ymrl
freeeらしさをAIとともに作る / Creating the freee Experience with AI
ymrl
0
250
たのしいtable / Fun table
ymrl
0
42
freeeのアクセシビリティの現在地 / freee's Current Position on Accessibility
ymrl
4
1.6k
全社でアクセシビリティに取り組む / Company-wide Accessibility Initiatives
ymrl
1
1k
デザイナーがTSKaigiでWAI-ARIAの話をしてみて / Speaking as a Designer: WAI-ARIA at TSKaigi
ymrl
0
740
TypeScriptとReactで、WAI-ARIAの属性を正しく利用する / Fixing WAI-ARIA Typing in React with TypeScript
ymrl
1
1k
がんばらないアクセシビリティ / Accessibility Without the Struggle
ymrl
0
1.1k
Webサイトのアクセシビリティにどう向き合う? / How Should We Approach Web Accessibility?
ymrl
0
200
いま求められるソフトウェアのアクセシビリティ / Essential Accessibility in Software Today
ymrl
1
1.7k
Other Decks in Programming
See All in Programming
パズルゲームの作り方 / how to make puzzle games
kaityo256
PRO
2
290
SalesForceを内製化!? ~ HR事業を支える顧客管理基盤のインフラを大公開 ~
oku053
0
180
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
2
600
Domain-Driven Transformation
hschwentner
2
2.3k
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
310
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
28
32k
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
230
dotNET_vulnclicker_intro.pdf
deka_morita
0
140
The Rails Doctrine Decade
koic
2
590
外から家のPCの電源入れたい!をPHPで解決する
kawashimo0
1
130
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
1k
Jetpack Compose Mechanisms
skydoves
3
820
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
710
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
430
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Google's AI Overviews - The New Search
badams
0
1.6k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.9k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
550
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
300
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Un-Boring Meetings
codingconduct
0
460
Transcript
Reactͱը૾ Gotanda.js #3 @ymrl
ςΩετ ࣗݾհ ▸ @ymrl (Twitter, GitHub, etc…) ▸ freeeͱ͍͏ձࣾͰڅ༩ܭࢉαʔϏεΛ࡞͍ͬͯ·͢
ςΩετ LGTMize ▸ 1΄Ͳલʹࡶʹ࡞ͬͨChrome֦ு ▸ ը૾ϏσΦΛӈΫϦοΫͯ͠LGTMͬͯจࣈΛࡌͤͯอଘ ▸ ࣾͷԁͳίϛϡχέʔγϣϯʹʢݸਓతʹʣศར
http://bylines.news.yahoo.co.jp/kohyoungki/20151012-00050386/
ςΩετ Canvasཁૉ ▸ ͍ΘΏΔHTML5ͷՖܗͬΆ͍ͭ ▸ 2࣍ݩϏοτϚοϓը૾͕ѻ͑Δ ▸ ศརͳΑ͏Ͱ͚ͬ͜͏໘͍͘͞ ▸ ྑ͘ѱ͘ϏοτϚοϓ
react-canvas
ςΩετ react-canvas ▸ ReactͰը૾͕࡞ΕΔͧʂʂʂ ▸ Textͱ͔Imageͱ͔Layerͱ͔ͬͯը૾࡞ΕΔ ▸ CSSͬΆ͍ObjectΛͯ͠ελΠϧΛௐ ▸ ຊདྷߴͳಈ࡞ͷUIΛ࡞ΔͨΊʹ࡞ΒΕͨͬΆ͍งғؾ
▸ mouse/touchܥΠϕϯτ͍͔࣮ͭ͘͞ΕͯΔ
None
None
DEMO
إೝࣝ
إʹจࣈ͕͔͔ Δͷආ͚͍ͨ
ςΩετ ccv ▸ CݴޠͷϥΠϒϥϦ͚ͩͲJSʹҠ২͞ΕͯΔ ▸ إೝࣝͰ͖Δ ▸ Web Worker͑Δʢͬͯͳ͍ʣ ▸
npmͱ͔ීٴͯ͠ͳ͍ࠒͷϒπͳͷͰదʹམͱ͖ͯͨ͠ ϑΝΠϧΛஔͯ͠͏
http://www.asahi.com/articles/ASHB75GGFHB7UTFK00G.html
http://www.asahi.com/articles/ASHB75GGFHB7UTFK00G.html
None
None
ςΩετ إΛආ͚Δ ▸ ݩͷը૾͔ΒإͷҐஔͰۣܗΛ͍ͬͯͬͨΓͷ͏ͪ Ұ൪͍ॴʹஔ ▸ ReactCanvasͷϊʔυΛ͢ͱനࠇԽ͞Εͯ͠·ͬͨΓ͢Δ ▸ ͍ͬͯ͏͔͜Ε͋Μ·ΓReactؔͳ͍ ▸
ؾܰʹCanvasΛॻ͖ͤΔͷྑ͍
GIF
animated GIF
ςΩετ gif ▸ Canvasཁૉʹॻ͖ग़͢ͱ1ίϚ ▸ toDataURL() Ͱ͖ͳ͍ ▸ ʢαϒϚϦϯಛڐͬͯͲ͏ͳͬͨΜͰ͚ͨͬ͠ʣ
ςΩετ readwrite-gif ▸ EncoderͱDecoder͕ೖͬͯΔ ▸ 1ίϚͣͭImageDataͰಡΈग़ͤͨΓ͢Δ ▸ Encoder gif.jsify ͷ΄͏͕ଟػೳ͔……
▸ ίϚ͝ͱʹ͞Λม͑ͨΓͰ͖ͦ͏
GIF ΛಡΉ
None
None
࠶ੜ
None
શϑϨʔϜඳը ͠ͳ͖Όμϝ
None
ग़ྗ
ςΩετ શϑϨʔϜͷը૾σʔλ͕΄͍͠ ▸ setState()ͰϑϨʔϜΛ1ͭͣͭඳը͍ͯ͘͠ͷ͍͠ ▸ ࠶ඳըͷλΠϛϯά͕Α͘Θ͔Βͳ͍ ▸ ࠶ੜ͠ͳ͕Βඳը݁ՌΛอଘ͚ͯ͠Α͍ͷͰʁ ▸ componentDidUpdate
ͰదʹಥͬࠐΜͰ͍͘
None
None
ͳΜͱ͔ग़ͤΔΑ ͏ʹͳͬͨͧ
ςΩετ ·ͱΊ ▸ animated GIFͷ૬खΛ͢ΔͷͭΒ͍
͝ਗ਼ௌ͋Γ͕ͱ ͏͍͟͝·ͨ͠