Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SVG 動畫二三事
Search
Patrick Wang
January 09, 2015
Programming
0
360
SVG 動畫二三事
Patrick Wang
January 09, 2015
Tweet
Share
More Decks by Patrick Wang
See All by Patrick Wang
使用 Jest 進行 Front-End Unit Test(線上 React 讀書會版)
patw0929
2
600
淺談使用 Appium 進行 React Native 雙平台(iOS & Android)App 的 E2E 自動化測試
patw0929
0
380
使用 Jest 進行 Front-End Unit Test
patw0929
9
2.4k
使用 Sketch 改善程式與設計的合作及標註方式
patw0929
6
2k
webpack 簡介
patw0929
2
480
Implement Social Login with Flask & authomatic
patw0929
1
180
淺談 RWD 與實做(用 Susy 1.0.9)
patw0929
2
580
Other Decks in Programming
See All in Programming
TestingOsaka6_Ozono
o3
0
180
AIコーディングエージェント(NotebookLM)
kondai24
0
230
Patterns of Patterns
denyspoltorak
0
350
AIエージェントの設計で注意するべきポイント6選
har1101
5
2.4k
Flutter On-device AI로 완성하는 오프라인 앱, 박제창 @DevFest INCHEON 2025
itsmedreamwalker
1
150
新卒エンジニアのプルリクエスト with AI駆動
fukunaga2025
0
230
これならできる!個人開発のすゝめ
tinykitten
PRO
0
130
tsgolintはいかにしてtypescript-goの非公開APIを呼び出しているのか
syumai
7
2.4k
生成AIを利用するだけでなく、投資できる組織へ
pospome
2
410
ゲームの物理 剛体編
fadis
0
370
フルサイクルエンジニアリングをAI Agentで全自動化したい 〜構想と現在地〜
kamina_zzz
0
300
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
130
Featured
See All Featured
So, you think you're a good person
axbom
PRO
0
1.8k
Testing 201, or: Great Expectations
jmmastey
46
7.8k
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
74
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
330
Automating Front-end Workflow
addyosmani
1371
200k
Designing Experiences People Love
moore
143
24k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
58
Building an army of robots
kneath
306
46k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.3k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
94
Building a Scalable Design System with Sketch
lauravandoore
463
34k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.7k
Transcript
SVG 動畫⼆二三事 patw / Front-End Engineer Gogolook Developers meet up
╳
SVG • Scalable Vector Graphics • Proposed by W3C in
1999. In 2001 the SVG gained its first official release. • XML • Vector vs Bitmap
SVG • Scalable • Smaller sizes (can be gzipped) •
Interactive & Styleable (CSS & JavaScript)
None
None
TOOLS • Inkscape (http://inkscape.org/) • SVG-edit (http://svg-edit.googlecode.com/svn/ branches/stable/editor/svg-editor.html) • Adobe
Illustrator • Sketch
SVG ANIMATIONS
ANIMATED SVG VS. GIFS “By using animated SVGs instead of
GIFs we were able to reduce our page size from 1.6 mb to 389 kb, and reduce our page load time from 8.75 s to 412 ms. That’s a huge difference.” http://oak.is/thinking/animated-svgs/
SVG ANIMATIONS • 更多變化:⽐比起 CSS 3 transition,除了位移、 顏⾊色變化之外,還⽀支援路徑描繪、導引線、形 狀漸變等動畫... •
互動效果:點擊後播放、等待 A 結束若干秒後 播放,或是針對單⼀一元件互動...
SVG ANIMATIONS • 三種實現⽅方法 • CSS • SMIL(Synchronized Multimedia Integration
Language) • JavaScript http://css-tricks.com/video-screencasts/135-three-ways-animate-svg/
SVG ANIMATIONS • CSS 使⽤用時機 • 只要實現簡單的動畫效果 • 只需 CSS
動畫可⽀支援的屬性就可完成的情況 • 了解 CSS 動畫怎麼做
SVG ANIMATIONS • SMIL 使⽤用時機 • 那些 CSS 辦不到的動畫屬性(例如形變) •
要⽤用上 SMIL 的特殊效果,例如在 A 動畫結束 後播放(不需像 CSS 動畫要⾃自⾏行調整延遲時 間),或是點擊後播放之類的
SMIL ANIMATIONS • 不⽤用 CSS、JavaScript 就可實現動畫效果! • 瀏覽器⽀支援度 (http://caniuse.com/#feat=svg- smil)
SMIL ANIMATIONS • <set> • <animate> • <animateColor> • <animateTransform>
• <animateMotion> http://tutorials.jenkov.com/svg/svg-animation.html
SVG ANIMATIONS • JavaScript 使⽤用時機 • 就是要⽤用 JavaScript 的情況,像是動畫可能是 依據接收到的
JSON 來動作的 • 或是需要⼀一些數學邏輯時 • 解決跨瀏覽器的問題 • 需要實現龐⼤大且複雜的動畫 • 太複雜也許就⽤用 Canvas 了
SVG ANIMATIONS • JavaScript Solutions • Snap.svg (http://snapsvg.io/) • GreenSock
(http://codepen.io/GreenSock/pen/ gpDrC) • Velocity.js (http://julian.com/research/velocity/) • SVG Morpheus (http://alexk111.github.io/ SVG-Morpheus/)
DEMO
REFERENCES • http://slides.com/sarasoueidan/animating-svg-with-css- and-smil-full-version • http://css-tricks.com/video-screencasts/135-three- ways-animate-svg/ • http://www.oxxostudio.tw/articles/201409/svg-21-smil- animation.html
• http://tech.mozilla.com.tw/posts/5660/ • http://www.zhangxinxu.com/wordpress/2014/08/so- powerful-svg-smil-animation/