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
SVG 動畫二三事
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Patrick Wang
January 09, 2015
Programming
440
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SVG 動畫二三事
Patrick Wang
January 09, 2015
More Decks by Patrick Wang
See All by Patrick Wang
使用 Jest 進行 Front-End Unit Test(線上 React 讀書會版)
patw0929
2
680
淺談使用 Appium 進行 React Native 雙平台(iOS & Android)App 的 E2E 自動化測試
patw0929
0
450
使用 Jest 進行 Front-End Unit Test
patw0929
9
2.5k
使用 Sketch 改善程式與設計的合作及標註方式
patw0929
6
2.1k
webpack 簡介
patw0929
2
530
Implement Social Login with Flask & authomatic
patw0929
1
230
淺談 RWD 與實做(用 Susy 1.0.9)
patw0929
2
630
Other Decks in Programming
See All in Programming
iOSDC2026登壇資料.pdf
riofujimon
0
200
Apple Intelligence を用いた個人情報誤送信防止、及びユーザーリクエスト体験の改善について
yukiny
0
270
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
1k
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
210
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
250
AI が書く Go コードの品質を劇的に向上させる Linter: “declscope”
mpyw
0
460
更なる可用性を求めて、5年間運用したKotlinのアプリケーションをGoでリプレイスする話
ken_tunc
0
420
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
390
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
460
カツオ、ご期待ください
suneo3476
0
130
GitHubハンズオン講座 — 実務レベルのチーム開発のフローを身につけよう
junhat6
0
110
TiDB Cloudのカスタムコントローラーによるオートスケール対応
takaidohigasi
0
140
Featured
See All Featured
Visualization
eitanlees
153
17k
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
270
Writing Fast Ruby
sferik
630
63k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
960
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
Mobile First: as difficult as doing things right
swwweet
225
10k
For a Future-Friendly Web
brad_frost
183
10k
Documentation Writing (for coders)
carmenintech
77
5.6k
Marketing to machines
jonoalderson
1
5.8k
Building Applications with DynamoDB
mza
96
7.2k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.6k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
232
55k
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/