Using GreenSock with GWD

677 views
Skip to first unread message

Chris Fortier

unread,
Dec 9, 2016, 6:05:57 PM12/9/16
to Google Web Designer beta
Not sure how you're supposed to use the GreenSock library and/or plugins. Are there any GWD examples or snippets that a designer like me could paste in and try?

Svein-Tore Narvestad

unread,
Dec 10, 2016, 9:39:13 AM12/10/16
to Google Web Designer beta
Hi!

In GWD, go to file, select Include JS library/Greensock/Tweenmax. Yes there are many others to select, but I recommend this one.

This will add the following in your head section:

<script type="text/javascript" id="TweenMax" src="https://s0.2mdn.net/ads/studio/cached_libs/tweenmax_1.18.5_23b0de6da0ee295131e32a500470610c_min.js"></script>

Which will include the tweenMax. Add three divs in your project, in colur red, blue and green, and name them (give them the id) box_red, box_blue and box_green.

Then, in the body, add the following script:

<body class="htmlNoPages">
<div class="gwd-div-kgpp" id="box_green"></div> //These are the divs you have created
<div class="gwd-div-1roc" id="box_red"></div>
<div class="gwd-div-1bhe" id="box_blue"></div>
<script>
var tl = new TimelineLite();
tl.to("#box_blue", 2, {
opacity: 0
})
tl.to("#box_blue", 0.5, {
opacity: 1,
rotation: 990,
left: 400,
top: 400
})
tl.to("#box_green", 2, {
left: 100,
top: 300
}, '-=2')
tl.to("#box_green", 2, {
left: 300,
top: 500,
rotation: 90
})
tl.to("#box_red", 2, {
left: 100
}, '-=4');
</script>
</body>

Hope this will help. Of course, If I have had your email I could have sent you the file (don't know how to upload here.....)

Svein-Tore
Svein-Tore

Chris Fortier

unread,
Dec 11, 2016, 8:06:20 PM12/11/16
to Google Web Designer beta
Thanks for your email! Appreciate it and I think I will sign up for some of your courses. Unfortunately I wasnt able to make your code work in GWD but I think I might have a conflict with the code GWD adds by default.

Jenny Graves

unread,
Dec 20, 2016, 3:05:38 PM12/20/16
to Google Web Designer beta
That choice is grayed out for me in GWD, any clue why?

Svein-Tore Narvestad

unread,
Dec 20, 2016, 4:45:47 PM12/20/16
to Google Web Designer beta
Hi Jenny!
To get this work you must be in code view:)

thekod...@gmail.com

unread,
Feb 10, 2017, 11:01:30 AM2/10/17
to Google Web Designer beta
You need to be in coding view to import js libraries... I had the same issue

fun...@gmail.com

unread,
Jun 1, 2017, 3:53:43 AM6/1/17
to Google Web Designer beta
Can you please email a sample GWD working file?
Reply all
Reply to author
Forward
0 new messages