SlideShare a Scribd company logo
1 of 68
Download to read offline
以 Vue / GSAP / D3 為核⼼心的
網⾴頁視覺動態整合與架構設計
墨墨雨設計 吳哲宇

MOPCON @ 2017.10.29
http://monoame.com/
吳哲宇

動畫互動網⾴頁程式入⾨門講師

墨墨雨設計 Monoame Design 

設計/網⾴頁全端雙棲的⼯工程師

為了了有趣的想法赴湯蹈火
Outline
• Web development - Vue framework

• Animation basic & Math

• Vuex structure for controlling page motion

• Abstract concept - component for animation

• Lifecycle and framework
Web development -
Vue framework
Jquery Style
DOM
$(“label”).text(“new Text”)
@click
@click
Vue Style
DOM
vm.labelText = “newText”
@click
@click
labelText = “new Text”
Data
Why additional Layer?
Manage Complex
Will increase after each layer
Data Layer
Map Layer
View Layer
Functional
Programming
Data Layer : Static
Map Layer : Transform
View Layer : Only Show
Animation basic & Math
Where animation begin
T=0
Where animation begin
T=1
Where animation begin
T=2
Where animation begin
T=2T=1T=0
Continuous Change
T=2
PosX = 80
T=1
PosX = 40
T=0
PosX = 0
T=5
PosX = 200
T=4
PosX = 160
T=3
PosX = 120
How does
this look like?
Linear
y= 4x
ㄧ樣從起點到終點
有不同的走法
y=240-(60-x)^2 / 15
y= (x)^2 / 15
y= 4x
EaseIn
y=240-(60-x)^2 / 15
EaseOut
y= (x)^2 / 15
EaseIn
y=240-(60-x)^2 / 15
EaseOut
y= (x)^2 / 15
Concept:
Map Time into Function
Concept:
Map Time into Function
Ease
Function
Time (T=0,1,2,…) Pos=20,40,60….
Concept:
Map Time into Function
Time (T=0,1,2,…)
Pos=20,40,60….
Time
y= sin(x) y= exp(x) y= mod(x,10)
Many kinds of shape functions
Example: Sin
y= sin(x)
Scroll Pos
TranslateX
Example: mod+ceil -> stair
y=
mod(ceil(x/3),3))
Scroll Pos
TranslateX
https://goo.gl/PrgdME
Sin
+ Stair
http://easings.net/zh-tw Easing 函數速查表
Circle
R=1
https://goo.gl/rbh5vG
Vuex structure for
controlling page motion
Traditional Scroll Effect
Scroll
Event
DOM
translateX( scrollTop*50 px) scrollTop
Too Messy to update together
Traditional Scroll Effect
Scroll
EventDOM
A
B
C
Vue Style Scroll Effect
Scroll
EventDOM
A
B
C
Data:
scrollTop
=50…
Map
Map
Map
Traditional Scroll Effect
Scroll
Event
DOM
translateX( scrollTop*50 px)
Data:
scrollTop
Vue Watch Data
:style Math
Map
Scroll
EventDOM
A
B
C
Data:
scrollTop
=50…
Map
Map
Map
Trigger By Data change
instead of Event
Abstract concept -
component for animation
Problem
too much state / behavior
Example:
Slide In on Scroll
Slot for inner Element
Central
State
Input
Component
Component
Component
Update element Top
Use Slot to insert inner Element
Use CSS Class to Control
Animation Graph
http://2017.n3xtcon.com/
Lifecycle and
framework
Vue -> Auto Generate
DOM Object
http://saving.energypark.org.tw/家庭電器⽤用電家計簿
http://saving.energypark.org.tw/家庭電器⽤用電家計簿
http://saving.energypark.org.tw/家庭電器⽤用電家計簿
Lifecycle- mount Object
D3 / GSAP
Bind Object
On mount
Svg as root (this.$el)
D3 select initialize
Svg
Bubble
Component
Prop Data Change
Watch
D3 Update
Graph
http://saving.energypark.org.tw/家庭電器⽤用電家計簿
Summary
• Data to Change State

• Math to Transform (MAP) / Easing

• Centralize UI Inputs (scrollTop…)

• Combine Frameworks
Q & A

More Related Content

Similar to 以 Vue / GSAP / D3 為核心的網頁視覺動態整合與架構設計 - 吳哲宇

SnapyX
SnapyXSnapyX
SnapyX
ekino
 
Silverlight overview
Silverlight overviewSilverlight overview
Silverlight overview
Taras Romanyk
 

Similar to 以 Vue / GSAP / D3 為核心的網頁視覺動態整合與架構設計 - 吳哲宇 (20)

VizEx View HTML5 Workshop
VizEx View HTML5 WorkshopVizEx View HTML5 Workshop
VizEx View HTML5 Workshop
 
SnapyX
SnapyXSnapyX
SnapyX
 
SnapyX - ParisJS
SnapyX - ParisJSSnapyX - ParisJS
SnapyX - ParisJS
 
[D2 campus seminar]웹브라우저 엔진
[D2 campus seminar]웹브라우저 엔진[D2 campus seminar]웹브라우저 엔진
[D2 campus seminar]웹브라우저 엔진
 
Station Four: Web Redesign Presentation
Station Four: Web Redesign PresentationStation Four: Web Redesign Presentation
Station Four: Web Redesign Presentation
 
Word camp nextweb
Word camp nextwebWord camp nextweb
Word camp nextweb
 
Word camp nextweb
Word camp nextwebWord camp nextweb
Word camp nextweb
 
Asp.net mvc - Better User Experience with Kendo UI
Asp.net mvc - Better User Experience with Kendo UIAsp.net mvc - Better User Experience with Kendo UI
Asp.net mvc - Better User Experience with Kendo UI
 
Silverlight overview
Silverlight overviewSilverlight overview
Silverlight overview
 
Node js
Node jsNode js
Node js
 
MVP Mix 2015 Leveraging MVVM on all Platforms
MVP Mix 2015  Leveraging MVVM on all PlatformsMVP Mix 2015  Leveraging MVVM on all Platforms
MVP Mix 2015 Leveraging MVVM on all Platforms
 
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
Familiar HTML5 - 事例とサンプルコードから学ぶ 身近で普通に使わているHTML5
 
Vue 2.0 + Vuex Router & Vuex at Vue.js
Vue 2.0 + Vuex Router & Vuex at Vue.jsVue 2.0 + Vuex Router & Vuex at Vue.js
Vue 2.0 + Vuex Router & Vuex at Vue.js
 
Html5 on Mobile(For Developer)
Html5 on Mobile(For Developer)Html5 on Mobile(For Developer)
Html5 on Mobile(For Developer)
 
Advanced Web Graphics with Canvas
Advanced Web Graphics with CanvasAdvanced Web Graphics with Canvas
Advanced Web Graphics with Canvas
 
Fundaments of Knockout js
Fundaments of Knockout jsFundaments of Knockout js
Fundaments of Knockout js
 
HTML5 Intoduction for Web Developers
HTML5 Intoduction for Web DevelopersHTML5 Intoduction for Web Developers
HTML5 Intoduction for Web Developers
 
Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5Moving to the Client - JavaFX and HTML5
Moving to the Client - JavaFX and HTML5
 
Single Page Applications – Know The Ecosystem system
Single Page Applications – Know The Ecosystem systemSingle Page Applications – Know The Ecosystem system
Single Page Applications – Know The Ecosystem system
 
Vue micro frontend implementation patterns
Vue micro frontend implementation patternsVue micro frontend implementation patterns
Vue micro frontend implementation patterns
 

Recently uploaded

UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
rknatarajan
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Christo Ananth
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
Tonystark477637
 

Recently uploaded (20)

UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service NashikCall Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
Call Girls Service Nashik Vaishnavi 7001305949 Independent Escort Service Nashik
 
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTINGMANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
MANUFACTURING PROCESS-II UNIT-1 THEORY OF METAL CUTTING
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 

以 Vue / GSAP / D3 為核心的網頁視覺動態整合與架構設計 - 吳哲宇