Jump to content
Search Community

Search the Community

Showing results for tags 'svg'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • GreenSock Forums
    • GSAP
    • Banner Animation
    • Jobs & Freelance
  • Flash / ActionScript Archive
    • GSAP (Flash)
    • Loading (Flash)
    • TransformManager (Flash)

Product Groups

  • Club GreenSock
  • TransformManager
  • Supercharge

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

  1. JonasBad

    SVG position tweening performance

    Hello, I'm facing performance issues when tweening SVG <image> elements x and y position. I'm animating using the attr x and y value. The performance is great on IE,FF and Safari, but very bad on Chrome. Does anyone have a cross browser solution or an explanation why this happends? Thanks! Jonas
  2. Raynor

    MInor bugs with SVG

    Hi there guys! I am a newbie to GSAP - discovered it while searching for universal cross-browser tool to make efficient animations for the web-sites. In short, it's great) I'm planning to use svg a lot, so it's crucial for me how it is handled in GSAP. I delved deeper and did some experimentation, and as a result I came up with what seems to be a bug: - 3D transform (rotationY, for example) does not work in Firefox, though, in contrast to IE, it is supported in FF. It took some time until I figured out that with earlier versions of GSAP (back from 1.14.0) everything's working fine. No problems in Chrome as well. - The next thing that annoys me a little is the necessity to use {transform-origin: "50% 50%"} each time to make svg element rotate around its center; as opposed to what is written in "getting started" guide, it seems that this value is not default for svg elements: their transformation is done around left top corner if {transform-origin: "50% 50%"} is not defined explicitly. See both cases on Codepen here http://codepen.io/anon/pen/jEmNyw. Thanks!
  3. Check out the Codepen and you'll notice that you're able to drag the octopus to the left a bit before the bounds stop you from going further. You can't go to the right at all. After you let go, you'd expect to be able to drag it to the right (back to where it started), but it seems as though the bounds reset based on the image's relative position. When you drag it, you can't go to the right, but you can go further to the left than you originally could. Thanks for your help!
  4. TRIPLESENSE REPLY

    ScrambleTextPlugin Svg Text

    Hi to all, for a project we need to use the ScrambleTextPlugin with a svg text but it does not work with Internet Explorer. To get it work we changed innerHTML in TextContent, but I think you can get something better Thank for your support Jacopo
  5. Jean-Baptiste Janot

    Opacity and SVG

    Hi ! I have been working on a full SVG animation with TweenMax. It was a pleasure as everything works really really well with the great addition of cross browser transform origin. Thanks ! I just noted one thing that you might be able to adjust for future releases. At first, I was using opacity attribute to tween elements opacity. It worked with <g></g>, <path />, <rect />, quite everything. But not on ios... On ios, if you tween opacity and you move the element using x property, it creates a glitch. I couldn't find a way to make it behave correctly. I dig around a little, and the only way I could manage to use opacity for now has been by creating a tween using attr: {'fill-opacity': 0.5} or attr: {'stroke-opacity': 0.5}, and by being sure that the property was set before tweening it (using TweenMax.set did the trick). The big downside of that technique is that you can't tween group (<g></g>) opacity, and for tweening the global opacity of an object, you have to tween the stroke and the fill. The codepen attached shows three ways of tweening the opacity. Chrome handle the three ways perfectly, but ios and firefox not. Please have a look. I hope you'll have an idea of a better way to use this. Have a nice day !
  6. Hi, I've embedded my base64 encoded SVG into my CSS but the fill and stroke tweens seem to be ignored. See the Codepen example. What am I doing thats wrong? Here's the SVG <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 125.368 104.307"><path fill="#8F5E8D" d="M85.194 86.885v17.422l4.494-5.123c4.84 5.1 4.8 5.1 4.8 5.123V86.885c-1.302 1.04-2.898 1.38-4.52 1.38-1.555.035-3.168-.365-4.768-1.38zm4.813-15c-3.536 0-6.754 3.403-6.754 7.175 0 3.7 3.2 7.1 6.8 7.1s6.755-3.405 6.755-7.15C96.762 75.3 93.5 71.9 90 71.885zm27.657 12.635c.313 0 .95-.364.95-1.04s-.637-1.013-.95-1.013h-15.106c-.637 0-1.276.337-1.276 1.014 0 .7.6 1 1.3 1 15.082.02 15.118.02 15.118.04zm-15.106 5.8h15.1c.313 0 .95-.704.95-1.38 0-.338-.637-1.014-.95-1.014h-15.106c-.637 0-1.276.676-1.276 1 .005.674.624 1.374 1.324 1.393zm22.497-17.76C110.91 57.9 110.9 57.9 110.9 57.895c-.325-.34-.638-.677-.962-.677H94.835c-3.535 0-6.114 3.066-6.114 6.81v3.096c0 .7.6 1.4 1.3 1.4.67 0 1.31-.676 1.31-1.354v-3.095c0-2.026 1.596-3.744 3.536-3.744h13.5v8.53c0 3.7 2.6 6.8 6.1 6.818h8v22.2c0 2.055-1.275 3.405-3.19 3.405H102.55c-.638 0-1.277.703-1.277 1.717 0 .7.6 1.4 1.3 1.4h16.7c3.533 0 6.084-2.73 6.084-6.5V73.69c.014-.39.046-.79-.254-1.13zm-10.613 0c-1.912 0-3.532-1.69-3.532-3.743v-6.812c9.964 10.6 10 10.6 10 10.555h-6.468zM48.872.252C22.494 13.6 22.5 13.6 22.5 13.565h57.6L53.366.3C52.09-.084 50.146-.084 48.9.252zM22.176 104.307h57.9v-89.39H22.19v89.39zm40.523-81.2c3.53 0 6.4 3.1 6.4 6.812 0 3.43-2.878 6.5-6.41 6.5s-6.44-3.07-6.44-6.508c.01-3.718 2.944-6.818 6.444-6.81zm0 19.786c3.53 0 6.4 3.1 6.4 6.8 0 3.435-2.878 6.5-6.41 6.5s-6.44-3.065-6.44-6.5c.01-3.693 2.945-6.793 6.445-6.8zm0 19.807c3.53 0 6.4 3.1 6.4 6.476 0 3.77-2.878 6.838-6.41 6.838s-6.44-3.067-6.44-6.838c.012-3.476 2.95-6.476 6.45-6.496zm0 20.104c3.53 0 6.4 3.1 6.4 6.474 0 3.77-2.878 6.84-6.41 6.8s-6.44-3.067-6.44-6.84c.01-3.338 2.945-6.438 6.445-6.433zM39.54 23.107c3.534 0 6.4 3.1 6.4 6.8 0 3.434-2.9 6.5-6.436 6.5-3.22 0-6.116-3.066-6.116-6.5.035-3.707 2.912-6.807 6.112-6.8zm0 19.793c3.534 0 6.4 3.1 6.4 6.812 0 3.435-2.9 6.5-6.436 6.5-3.22 0-6.116-3.065-6.116-6.5C33.423 46 36.3 42.9 39.5 42.892zm0 19.78c3.534 0 6.4 3.1 6.4 6.475 0 3.77-2.9 6.838-6.436 6.8-3.22 0-6.116-3.067-6.116-6.838C33.423 65.7 36.3 62.7 39.5 62.68zm0 20.124c3.534 0 6.4 3.1 6.4 6.5 0 3.77-2.9 6.84-6.436 6.84-3.22 0-6.116-3.068-6.116-6.84.035-3.404 2.912-6.504 6.112-6.5zM0 104.307h18.6V35.04H0v69.267zm9.333-61.414c3.19 0 6.1 3.1 6.1 6.812 0 3.435-2.9 6.5-6.09 6.5-3.536 0-6.435-3.065-6.435-6.5C2.898 46 5.8 42.9 9.3 42.893zm0 19.786c3.19 0 6.1 2.7 6.1 6.47 0 3.403-2.9 6.473-6.09 6.5-3.536 0-6.435-3.07-6.435-6.475-.01-3.78 2.892-6.48 6.392-6.5zm0 20.12c3.19 0 6.1 3.1 6.1 6.8 0 3.432-2.9 6.5-6.09 6.5-3.536 0-6.435-3.068-6.435-6.5-.01-3.7 2.892-6.8 6.392-6.8z" /></svg>
  7. Hi all, I'm having this problem with SVG rotation. Basically it always reset its position once the animation is finished. Codepen: http://codepen.io/anon/pen/QwwEYX During testing, it works fine on Chrome, but not of Firefox and mobile Safari. I'm using Firefox 33.1.1. Anyone's having the same issue? Any pointer is greatly appreciated. Cheers! UPDATE: Apparently the problem is exclusive to FF for mac and Safari mac.
  8. So I'm doing some experimentation to see if I can find a use for SVG in my web game. I can tween SVG elements without a problem, but I cannot figure out how to remove them when I'm done. The typical this.target.parentNode.removeChild(this.target) isn't working for Raphael objects... so how do you do it?
  9. dxc

    SVG Scaling - Transform Origin

    I can't seem to figure out how I'd set the transform point so that I could have it scale from the right, bottom, etc. Thanks! - Lance
  10. raskolnikov

    SVG Path to Bezier tool

    Hey all! I've been doing a lot of animating along bezier curves and created a simple little helper tool/function that converts an SVG path into an array of cubic bezier points that can be plugged directly into GSAP Tweening functions. It's still missing a little functionality for quadratic and elliptical arc movements, but I haven't come across any issues with it yet converting SVGs saved out of Illustrator. Just thought I'd share in case anyone else finds it useful. http://github.com/mattanglin/svg-to-cubic-bezier I'll update to incorporate the other SVG movements (and cleanup the code. It's pretty quick and dirty at the moment...) as I have time. Any feedback welcomed. Thanks!
  11. gabrielstuff

    Performance with large SVG files

    Hi there, I'm playing with the TweenMax API and I encounter some difficulties. I aim to animate a full svg. I use a basic Tween for test puprose TweenMax.to($('#' + 'front_side_down'), 1, { opacity: 1, display: 'inline' }) When the SVG does not contain much nodes, it runs smoothly and nicely. But when I hit more than 1000 groups node of svg path the animation got choppy. I wonder why it influence anything, as in any case we only target one element... Any help would be much appreciate ! Thanks ! P.S : I'm talking about a 3.5mo SVG file
  12. I've noticed that GSAP applies transform properties to SVG elements via the inline style attribute instead of the native SVG transform attribute: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform. This tends to be a browser compatibility issue, especially with IE. I cross referenced Velocity JS, and it looks like there's some feature detection built in that deals with this issue. Am I missing something? Or does GSAP have a method of accomplishing this easily? I should note that I already have some functional code, but it's a lot more verbose than I'd like it to be; onUpdate functions running after every tween. To be sure I'm clear, I want: transform="translate(40, 60)" or transform="matrix(1,2,3,4,5,6)" instead of style="transform: matrix(1, 0, 0, 1, -45, 75)" (ignore number values) Thanks for the help
  13. dxc

    SVG Animations in IE

    Oh how I hate IE. I have this working in all browsers, including mobile iOS. The only place it doesn't work is in ie. Everything shows up as it should, but none of the movements happen. I'm not even sure where to start. Thanks for your help! Here's the non-codepen version if that helps: http://aprendagames.com/stock/error_pages_robot/headlessRobot/?errorcode=404
  14. I'm able to animate the entire SVG. I'm also able to call and modify an element within the SVG (rect02), but I can't seem to animate rect01. Help would be much appreciated!
  15. manchuwook

    Animate arc inside svg image

    Given an SVG image with two circles, #innerCircle and #outerCircle, and other elements I don't care as much about - I want to have an easy way to animate the arc of #outerCicle with maybe easein. Tried snap.svg but it doesn't animate well (which is a point of contention on SO), wanted to try Raphael but it doesn't handle existing SVGs, looked up svgjs but it is pending svg adoption in the RC milestones. (function () { var ocx = 0, ocy = 0, oca = 0; function describeArc(x, y, radius, startAngle, endAngle) { var start = polarToCartesian(x, y, radius, endAngle); var end = polarToCartesian(x, y, radius, startAngle); var arcSweep = endAngle - startAngle <= 180 ? "0" : "1"; var d = ["M", start.x, start.y, "A", radius, radius, 0, arcSweep, 0, end.x, end.y, "L", x, y, "Z"].join(" "); return d; } function polarToCartesian(centerX, centerY, radius, angleInDegrees) { var angleInRadians = (angleInDegrees - 90) * Math.PI / 180.0; return { x: centerX + (radius * Math.cos(angleInRadians)), y: centerY + (radius * Math.sin(angleInRadians)) }; } Polymer('character-hitpoints', { maxHealth: 0, maxHealthChanged: function () { // NotImplemented }, increment: function () { // NotImplemented }, ready: function () { var character = this.character; var h = this.$.hpRing; var t = {}; // load the svg fragment into the element Snap.load("hpcircle.svg", function (f) { var s = Snap(h); s.append(f); var n = s.select('#outerRing').node; var np = n.pathSegList[2]; var a = n.pathSegList[1]; ocx = np.x; ocy = np.y; oca = a.r1; t = s.select('#characterName'); t.node.textContent = character; t.node.x = ocx + 10; t.node.y = ocy; }) }, animRing: function (divRing) { var hpRing = Snap(divRing.toElement.shadowRoot.querySelector('#svg2')); var max = Math.floor(Math.random() * 359 + 1) Snap.animate(0, max, function (val) { hpRing.select('#outerRing').attr({ 'd': describeArc(ocx, ocy, oca, 0, max) }); }, 2000, mina.bounce, function (val) { console.log('Animate done'); }); } }); })(); The last bit, animRing, changes the arc, but doesn't actually animate with a bounce, it just flips to the new size. Any advice is welcome, I've got a dent where I've been banging my head against my desk.
  16. timherbert

    SVG Animation Troubles

    So I have this idea to do an landing animation for my new website with svg animation. Where I'll have multiple parallax cloud layers animating. However, I am having issues getting the idea to work in all browsers, and can't even get it to work at all in CodePen for some reason. There has to be an easier way to do this kind of animation. I'm just looking to get pointed in the right direction here as I am getting frustrated trying to get this to work. The animation works in Chrome, but Firefox reports the initial position of the clouds and never updates for some reason no matter what I've tried with jQuery anyways. http://timherbert.net/sandbox/ I also accidently linked the private codepen. Here is the public one: http://codepen.io/timherbert/pen/vzuDr/
  17. bigbeats01

    IE SVG transforms

    I know in IE, you cannot transform svg child elements normally with the style attribute so you need to fallback to updating the transform attribute on the element within the svg. TweenMax.to('#circle', 1, {scaleX : 1, onUpdate: scaleXie, onUpdateParams: ["{self}"]}); function scaleXie(t){ if(!Modernizr.smil){ //fallback for IE. $(t.target.selector).attr('transform', 'matrix(' + t.target[0]._gsTransform.scaleX + ', 0, 0, 1, 0,0)'); } } This works but is there a more elegant / global way to have TweenMax update the transform attribute on svg elements when the browser is IE ? I have many of these transform tweens and would like to know if there is a better way at polyfilling IE.
  18. I'm able to animate two SVGs, each with a class of 'widget', upon loading the page. But when I add event listeners for mouse events to animate them on rollover, nothing happens when I mouse over or out of the SVG objects. Do SVGs have to be treated differently than other images for the event listeners to work?
  19. ShinyRobot

    Firefox: Draggable + SVG

    Here's an odd one. Rotation for SVG elements doesn't seem to work in Firefox. Does anyone know if there's a workaround? http://codepen.io/Mode7James/pen/mjxtC
  20. SDP

    Draggable with SVG elements

    I am trying to use Draggable to rotate a <g> inside some inline SVG. <script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/1.11.6/TweenMax.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/1.11.6/plugins/CSSPlugin.min.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/gsap/1.11.6/utils/Draggable.min.js"></script> ... TweenLite.set(".group1", {transformOrigin:"50% 50%"}) Draggable.create(".group1", {type: "rotation", throwProps: true }); This will allow the element to be rotated by dragging, but none of the momentum works and the rotation is incorrect in that the movement shifts from clockwise to counter clockwise mid-drag.
  21. akbr

    General purpose SVG plug-in?

    First of all, I'm long time fan. Greensock is great! I've been using GSAP in one of my projects as a unified platform for animating both SVG and HTML. Up until recently, I'd been using Raphael as my SVG library. GSAP's RaphaelPlugin was a nice abstraction from the messy matrix math underlying transitions between transform states. I got spoiled using scaleX, scaleY, tx, ty, localPivot, etc. Recently, I switched fron Raphael to D3, both for the data-driven functionality but also for more direct access/control over my SVG elements. (D3 focuses on transformation of SVG, whereas Raphael introduces it's own, special representations.) The change has been refreshing, but I miss the added functionality of RaphaelPlugin--especially for times when I simply want to spin and scale SVG elements using transform without thinking about interpolation, etc. [i'm not exclusively making graphs, but also flying spaceships around, etc.] So I went back and looked at RaphaelPlugin, and it strikes me that you're very close to having a general purpose, library-agnostic SVG plug-in for GSAP. The very few Raphael-specific methods (e.g., matrix, bbox) in RaphaelPlugin are mirrored in the SVG spec (e.g., getCTM, getBBox). With a little hacking, I got a prototype (mostly) working fairly quickly. Is there any interest in the community for such a thing? Have GSAP staff thought about this?
  22. anthonygreco

    Performance of Animating Opacity

    I am attempting to animate opacities of several elements and experiencing some performance issues. Some preface... I'm using Snap.svg and have ported the RaphaelPlugin for Snap in my fork of GreenSock (https://github.com/anthonygreco/GreenSock-JS/blob/master/src/uncompressed/plugins/SnapPlugin.js) so generally speaking if anyone has experience with the RaphaelPlugin, any info you may have on the matter should be at least mostly relevant, though anyone with experience with GSAP may have just as valuable input. Now for the problem at hand. I have roughly 1500 different path elements on a page in which no more than 400+/- of them are animated at any one point and only animating their opacity via staggerTo shows the other simple animations choppy. The most interesting part is that the 400 or so path elements don't seem to be choppy, but the simple animation is. My first question is simple; I may have more afterward but for now.... are there any idiosyncrasies to staggerTo that I may not be aware of from a performance perspective? Eventually, I'll probably rebuild what I've done in a JSFiddle to get more specific circumstances available for assistance, but right now I'm more interested in the overall larger picture and any optimization guidelines anyone may have.
  23. Hi! best wishes for ya'll green(s)®ockers! Good health & what floats your boat! enjoy!! my question: Is it possible to define a gradient of lets say 4 color stops in jquery then loop through an array of colors and one of those array items is that gradient... the rest is a single color. Here is what I have. (it might look dirty... just testing ) The rainbow_array in the color array obviously doesn't work, its just to illustrate what i am after. Many thanks for some insight! var rainbow_array = Array ("e21111", "11e2c2", "a011e2"); var color_array = Array("#ffcc00",rainbow_array, "#e7353a", "#b62727", "#eeeeee", "#d5d5d5", "#0c0c0c"); $('#clickable_thing').click(function(event) { var parent = $(this).parent(); parent = parent.find("rect"); var fillcolor = $(parent).css('fill'); console.log(rgb2hex(fillcolor)); TweenMax.to(parent,.4,{fill: color_array[i]}); if(rgb2hex(fillcolor) == color_array[i]) { if (i < color_array.length-1) { i++; if (i == 1) { /*do gradient*/ } else { TweenMax.to(parent,.4,{fill: color_array[i]}); } } else { i = 0; TweenMax.to(parent,.4,{fill: color_array[i]}); } } });
  24. Matt

    Transform PATH within SVG

    I'm trying to animate a <PATH> within an <SVG> with transform. With the help of another post in the forums, I've managed to get the transform working, but I can't find a way to change the transform origin (css transform-origin doesn't work). It always performs the transform relative to the top left. Here's a basic demo I'm working with at the moment: http://jsbin.com/eyaqOLIY/1/edit?html,js,output In the final version, I will be manipulating an SVG that is created by another javascript library, so I can't change the HTML output much --- I could add classes and such, but I can't go wrapping things in <G> elements, etc. The final will also have multiple paths within a single <SVG>, that I need to animate seperately, so I can't apply the animation to the SVG. I need to animate the <PATH>. Any idea how I can animate the path relative to its center rather than the top left (needs to be compatible with IE9 and FF10)? Thanks! Matt
  25. Rob

    SVGJS Plugin

    Hey All, I have been working with svg.js a lot recently. I noticed you guys have a raphael plugin, which is brilliant. svg.js and Raphael are very similar however svg.js has the added bonus of being able to work with masks and clipping paths. I have created my own plugin which is basically your Raphael plugin with some modifications, it works nicely for transforming svgjs objects, the only thing it doesn't allow you to do alter the transformation origin/anchor, im currently trying to work this out because svg.js doesn't have native support for this unfortunately. If you're interested at all I've dropped it onto a gist All the best, Rob
×
×
  • Create New...