<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	>

<channel>
	<title>RD - riccardodegni.net &#124; Blog</title>
	<atom:link href="http://www.riccardodegni.net/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.riccardodegni.net/blog</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Fri, 08 May 2009 12:17:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>GX wants you</title>
		<link>http://www.riccardodegni.net/blog/gx-wants-you</link>
		<comments>http://www.riccardodegni.net/blog/gx-wants-you#comments</comments>
		<pubDate>Fri, 08 May 2009 12:17:22 +0000</pubDate>
		<dc:creator>RD</dc:creator>
		
		<category><![CDATA[GX]]></category>

		<guid isPermaLink="false">http://www.riccardodegni.net/blog/?p=45</guid>
		<description><![CDATA[The GX framework aims to become one of the best, full-featured, simpler and easier-to-use framework for creating animations in a Web page using Javascript. With the latest release GX has improved its powers dramatically, but there are a lot of new things to implement, including a solid alghoritm for handling all possibile CSS properties/values and [...]]]></description>
			<content:encoded><![CDATA[<p>The <strong>GX framework</strong> aims to become one of the best, full-featured, simpler and easier-to-use framework for creating animations in a Web page using Javascript. With the <a href="http://www.riccardodegni.net/blog/gx-pack-12-released" target="_blank">latest release</a> GX has improved its powers dramatically, but there are a lot of new things to implement, including a solid alghoritm for handling all possibile CSS properties/values and particluar tecnhiques for handling each kind of multiple-element situations that could happen with a system for saving resources and improving performances.</p>
<p>Therefore, the main goal is to push GX in a new dimension of  Javascript animations frameworks with next release. </p>
<p>However, there are a lot of things to do, besides developing the software: writing full detailed and downloadable documentaition, writing complex and detailed demos, handling the new Website that will be a lot more Web 2.0, handling the blog (currently not available) and so on. All these tasks are essential to improve the framework quality and the community quality: in a few words, for the software growth.</p>
<p>This is why we are looking for members that could help us out with GX production (yes, we are looking for a Dev Team). Currently we are looking for 3-4 members that should provide the following tasks:</p>
<ul>
<li>Creating demos</li>
<li>Wrinting documentation (engine and relative syntax are already completed)</li>
<li>Directing the new Website and the Blog (very important!!)</li>
<li>Helping in the code/software production</li>
</ul>
<p>If you are intersted in helping us out providing one or more of these tasks (and in sharing your knowledges for creating a new, better and amazing Javascript animations framework), <strong>do not reply to this post</strong>, but send a mail to <a href="mailto:riccardo.degni@gmail.com">riccardo.degni@gmail.com</a>. Otherwise, if you have any question to expose, you can either send a mail or leave a comment directly here.</p>
<p>Until the <strong>Dev Team</strong> isn&#8217;t composed, the GX works are currently stopped.</p>
<p> </p>
<p><em>Riccardo Degni</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.riccardodegni.net/blog/gx-wants-you/feed</wfw:commentRss>
		</item>
		<item>
		<title>GX Pack 1.2 released</title>
		<link>http://www.riccardodegni.net/blog/gx-pack-12-released</link>
		<comments>http://www.riccardodegni.net/blog/gx-pack-12-released#comments</comments>
		<pubDate>Wed, 22 Apr 2009 12:26:23 +0000</pubDate>
		<dc:creator>RD</dc:creator>
		
		<category><![CDATA[GX]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[RD]]></category>

		<category><![CDATA[Softwares]]></category>

		<guid isPermaLink="false">http://www.riccardodegni.net/blog/?p=34</guid>
		<description><![CDATA[The new GX package is now available! This is a recommended upgrade for all users who have previously downloaded GX.
IMPORTANT: we&#8217;re building out a list of resources that use GX. Therefore, if you are using or will use GX for your Websites, projects and/or applications, please report them to us. It can either help us [...]]]></description>
			<content:encoded><![CDATA[<p>The new <a href="http://gx.riccardodegni.net/" target="_blank">GX package</a> is now available! This is a recommended upgrade for all users who have previously downloaded GX.</p>
<p><strong>IMPORTANT</strong>: we&#8217;re building out a list of resources that use GX. Therefore, if you are using or will use GX for your Websites, projects and/or applications, please <a href="http://gx.riccardodegni.net/#report" target="_blank">report</a> them to us. It can either help us out to discover new features/usages and help you to share your works.</p>
<p>Now let&#8217;s see the new features!</p>
<h3>GX Core</h3>
<p><strong>Multi-element animations</strong></p>
<p>This new release of GX increases the internal power of the Core engine, for handling very complex DOM multi-element animations with single function calls.</p>
<p>While testing GX, Christop Stickel has noted that GX didn&#8217;t handle complex multi-element animations that needed mulitple DOM operations which may include the same elements.<br />
For example, if in a page we have 3 divs, it&#8217;s perfectly legal to animate all divs simultaneously and a specific div, for example the one with the id &#8220;#el2&#8243;.<br />
That element appears in both the two set of elements (&#8221;div&#8221; and &#8220;#el2&#8243;), so the second animation didn&#8217;t fire correctly.</p>
<p>Another case could be a multiple-element animation that involves the use of relative values.</p>
<p>This happened because GX haven&#8217;t been designed for handling multi-element animations. As I said a while ago, it would have been an additional task provided by a Plug-In.</p>
<p>By now this isn&#8217;t needed anymore: with the release <strong>1.2</strong> that feature is included directly in the <strong>Core engine</strong>. This is a very important point: first of all, since this a part of the Core, it&#8217;s available with all the GX extensions (as GX Extras). Secondly, you don&#8217;t have to worry about downloading a lot of scripts&#8230; it&#8217;s all in one place.</p>
<p><span id="more-34"></span></p>
<p> </p>
<p><strong>How GX handles multiple element animations</strong></p>
<p>I have slightly modified the core engine and added additional features for handling all the multi-element animations you need, in a super-comfortable way and with all the features provided by GX. If you&#8217;ll use GX with single-element animations, you won&#8217;t notice any difference: the behaviour is perfectly the same.<br />
The difference comes when you handle multiple-element animations, as the ones I described above. Now all elements are handled correctly, doesn&#8217;t matter the DOM set they belong to.</p>
<p>All elements will have a well-defined animation&#8217;s state that keeps track of all their features. Now, a totally new universe of animations could be realized!</p>
<p>To better understand this concept take the example I mentioned before: when you animate all the &#8220;div&#8221; elements of your DOM with $(&#8217;div&#8217;), a single instance will be created for each element in the DOM set. After (or simultaneously) you&#8217;re going to animate a single div element, the one with id &#8220;#el2&#8243; by writing $(&#8217;#el2&#8242;). The instance that keeps track of the this element&#8217;s state has been already created with the previous function call, so it will be reused.</p>
<p>This has two important consequences: firstly, the resource will be saved. Secondly, but not less important, the animation&#8217;s state will always be well-defined: you&#8217;ll be able to queue, cancel, pause and resume single or multiple set of elements with the expected results.</p>
<p><img class="aligncenter size-full wp-image-38" title="gx_multi_element" src="http://www.riccardodegni.net/blog/wp-content/uploads/2009/04/gx_multi_element.gif" alt="gx_multi_element" width="395" height="341" /></p>
<p>Take a look at these two examples which explain these concepts well:</p>
<ul>
<li><a href="http://www.riccardodegni.net/_demos/gx/1.2/GX_multi_1.html" target="_blank">Multiple over-out animation menù (note the differences with the jQuery Core engine)</a></li>
<li><a href="http://www.riccardodegni.net/_demos/gx/1.2/GX_multi_2.html" target="_blank">Multiple element animation using relative values and different transitions</a></li>
<li><a href="http://www.riccardodegni.net/_demos/gx/1.2/GX_multi_3.html" target="_blank">Multiple element animation using different Extra methods</a></li>
</ul>
<p>Another killer news is that the size has not changed: it&#8217;s <strong>10kb</strong> uncompressed!</p>
<p>Obviously, multiple-element animations use up more resources than a single-element animations, so use it with care, and remember: &#8220;with great power, comes great responsibility&#8221;.</p>
<p> </p>
<p><strong>New kind of animations</strong></p>
<p>As you could see, <strong>an infinte number of complex animations can be realized</strong> writing, as usual with GX, less code than any other script.</p>
<p><img class="aligncenter size-full wp-image-39" title="gx_multi_element_2" src="http://www.riccardodegni.net/blog/wp-content/uploads/2009/04/gx_multi_element_2.gif" alt="gx_multi_element_2" width="395" height="341" /></p>
<p> </p>
<p>For example, take the case in which you want to animate simultaneously all the divs in the page with a Linear transition, except the second div, that have to be animated with a Bounce transition, and you want to do this in a single function call.</p>
<p>This is possibile with GX:</p>
<pre>// we want a Bounce transition for the second div
$('#el2').gxInit({easing: 'Bounce'});

// animate all divs in the current DOM. All divs except the second will have
// a Linear transition
$('div').gx({width: '+=100px'}, 1000)
	.gx({height: '50px'}, 2000);</pre>
<p>Another good example could be a multiple-element animation in which when you click on a div, it&#8217;s height increases by a relative size and simultaneously the height of all the other divs decreases, to see what div has got more clicks:</p>
<pre>// assume that the div gets the right class name
$('div.hovered').click(function() {
  $(this).gx({'height': '+=50px'});
  $('div:not(.hovered)').gx({'height': '-=50px'});
});</pre>
<p>Of course, all the new multi-element animations you could realize with GX Core, can be realized with the methods provided by <strong>GX Extras</strong>:</p>
<pre>// fades all divs out
$('div').fadeOut();

// and then fades the div with id #el3 in after completion of the previous animation
$('#el3').fadeIn();</pre>
<p>Or again:</p>
<pre>// scale all div increasing their current widths and heights. Then move them
// by a relative value
// NOTE: all starting/ending points vary from div to div
$('div').scale("+=100px", "+=100px")
        .move("+=200px", "+=200px");</pre>
<p>So really, there&#8217;s no limit for animations.</p>
<p> </p>
<p><strong>Minor improvements</strong></p>
<p>The full multi-element animation support is clearly the main feature of this new release, but I made some others minor improvements, especially in the speed/performance scenario. Here we have a quick list of the main changelogs:</p>
<ul>
<li>GX can now be used when jQuery is run under <strong>compatibility mode</strong>. For example, you can use GX with jQuery and Prototype placed in the same page. (thanks Christop Stickel for suggestion)</li>
<li>The engine of the 1.2 version is faster than the previous one, now function calls are made only where they&#8217;re absolutely needed.</li>
<li>The element is initialized only the first time the gx method is called, by the new internal init method. The element locking is no more required, with the result of speeding up the things.</li>
</ul>
<h3>GX Extras</h3>
<ul>
<li>The GX Extras engine has been improved internally to be faster and lighter.</li>
<li>With the new GX Core engine, all the extra methods can be used on multiple set of elements, as learnt before.</li>
<li>The <strong>scale</strong> method has been added for scaling element&#8217;s sizes (width and height) with ease.</li>
<li>GX Extras engine can now be used when jQuery is run under compatibility mode too.</li>
</ul>
<h3>1.3 will bring&#8230;</h3>
<p>Amazing features are being planned for <strong>GX 1.3</strong>. First of all, <strong>performances</strong>. All possible improvements in the performance/speed scenario will be studied and provided. Furthermore, a new <em>queue system</em> is being planned and tested, to observe what kind of improvements could be added to the Core.</p>
<p>A large collection of <strong>new Extra methods</strong> will be added, to cover all possible next-gen animations you can need for (as, for example: shake, switchOff, fold, &#8230;).  Too kb? No way! You&#8217;ll be able to insert only the extra methods you want with the GX Extras Download Builder!</p>
<p>As usual, please, post here your considerations, tips, suggestions, requests and reports that can absolutely help us out.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.riccardodegni.net/blog/gx-pack-12-released/feed</wfw:commentRss>
		</item>
		<item>
		<title>GX 1.1 and GX Extras are come</title>
		<link>http://www.riccardodegni.net/blog/gx-11-and-gx-extras-are-come</link>
		<comments>http://www.riccardodegni.net/blog/gx-11-and-gx-extras-are-come#comments</comments>
		<pubDate>Tue, 31 Mar 2009 10:26:01 +0000</pubDate>
		<dc:creator>RD</dc:creator>
		
		<category><![CDATA[GX]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[RD]]></category>

		<category><![CDATA[Softwares]]></category>

		<guid isPermaLink="false">http://www.riccardodegni.net/blog/?p=21</guid>
		<description><![CDATA[Today there are two great news: either the version 1.1 of the GX framework and the its extension called GX Extras are now available. In this post I&#8217;ll expose either the major changesets that affected the previous version and the new features, and I&#8217;ll explain how to use them properly.
GX 1.1
This new release brings many [...]]]></description>
			<content:encoded><![CDATA[<p>Today there are two great news: either the version <strong>1.1</strong> of the <a href="http://gx.riccardodegni.net/" target="_blank">GX framework</a> and the its extension called <strong>GX Extras</strong> are now available. In this post I&#8217;ll expose either the major changesets that affected the previous version and the new features, and I&#8217;ll explain how to use them properly.</p>
<h3>GX 1.1</h3>
<p>This new release brings many changes, especially in the API usage/naming. Now the engine is more consistent and the size is.. smaller! Right, the incredible super tiny size of the previous version has been reduced: now the uncompressed version weights about <strong>10.0</strong><strong>kb</strong> , against the 10.4kb of the 1.0.</p>
<p>Now let&#8217;s talk about the changesets:</p>
<ul>
<li> the <strong>gxPause</strong> and the <strong>gxResume</strong> methods are gone in favor of the <strong>gx</strong> method, that is the unique method for creating, pausing and resuming animations. You can now pause and resume your effects by writing the following:
<pre>// pauses an animation
$('myEl').gx('pause');

// resumes an animation
$('myEl').gx('resume');</pre>
<p>The API is now more solid and less verbose.</li>
<li>there are no more aliases: the <strong>anime</strong> method is gone.</li>
<li>the new <strong>delay</strong> option is now available (see a <a href="http://gx.riccardodegni.net/demos#delay" target="_blank">demo</a>): you can delay all the animations in the queue by specifing the &#8220;delay&#8221; option. In opposite to the standard behaviour, where animations are fired immediately one after another, with the delay option you can delay all step in the queue:
<pre>$('myEl').gxInit({delay: 2000});

$('myEl').gx({width: 200}, 4000)
         .gx({width: 0})     // after 2000ms (+4000ms of the previous ring)
         .gx({width: 400})   // after 2000ms (...)</pre>
</li>
<li>the GX Extras API has been added (see below)</li>
</ul>
<p><span id="more-21"></span></p>
<h3>GX Extras</h3>
<p>As previously mentioned, the new <strong>GX.Extras.js</strong> script is now available and downloadable directly in the GX&#8217;s home page! It wheights about <strong>2kb compressed with the DE Packer</strong> (is about 3kb uncompressed) and contains extra methods for creating animations based on GX, in the easiest way you can imagine. That collection of methods (12 in total) includes:</p>
<ul>
<li>fade, fadeIn, fadeOut, fadeToggle</li>
<li>slide, slideIn, slideOut, slideToggle</li>
<li>show, hide</li>
<li>gradient</li>
<li>move</li>
</ul>
<p><strong>IMPORTANT</strong>: some of these methods will overwrite the ones placed in the jQuery core that have the same namespace.</p>
<p>The main goal of the GX.Extras.js script is to provide an easy and comfortable way for creating animations based on common practices that a Javascript user usually meet in their works, <strong>writing less code than each other framework currently available on the Web</strong>, and with the full support of all the features provided by the GX core.</p>
<p>Let&#8217;s see the features offered by these new methods.</p>
<p><strong>Arguments&#8217; freedom</strong></p>
<p>With GX.Extras.js you&#8217;ll get the capability to build super powerful animations and you&#8217;ll be able to pass the arguments you need in the order you prefer. Look at the following example:</p>
<pre>$('myEl').fadeOut(2000, 'Bounce:Out')
         .fadeIn('Elastic', function() { alert("Completed!"); })
         .fadeOut()
         .fadeIn('verySlow');</pre>
<p>Super simple, isn&#8217;t it?</p>
<p>In addition, you can use the shortcut methods as <strong>fade</strong>, <strong>slide</strong> and <strong>gradient</strong>, where you have to pass the &#8220;mode type&#8221; as the first argument and an array that contains the preferred options as second:</p>
<pre>$('myEl').fade('out', ['slow', 'Back:InOut'])
         .fade('in', [function() { alert("Done!"); }, 2000])
         .gradient('#f0f', [1600])
         .slide('toggle');</pre>
<p>As you can see, you could queue an infinite number of methods to build out a rich and powerful sequence of animations, easily and with all the features provided by the GX core of course.</p>
<p><strong>The &#8220;mode&#8221;</strong></p>
<p>Another important feature of the GX Extras engine is the &#8220;mode&#8221; option. It depends on the method you are using and allows to completely alter its behaviour. For example, with the methods of the &#8220;slide&#8221; family, you can use either the &#8220;vertical&#8221; (default) and the &#8220;horizontal&#8221; mode. With the gradient method you can use either the &#8220;bg&#8221; (default) or the &#8220;fg&#8221; mode and so on.</p>
<pre>// this will slide our element vertically, with a height transition
// (default behaviour)
$('myEl').slide('toggle', [1400, 'vertical']);

// this will slide our element horizontally, with a width transition
$('myEl').slide('toggle', [2200, 'horizontal']);

// this will change the bg color of our element (default behaviour)
$('myEl').gradient('#f0f', [1400, 'bg']);

// this will change the bg color of our element, too
$('myEl').gradient('#f0f', [1400]);

// this will change the fg color of our element
$('myEl').gradient('#f0f', [1400, 'fg']);</pre>
<p>As you can see, there can be different behaviours in one method, all in 3kb uncompressed. Obviously, you can learn what kind of keywords is required by every methods by reading the detailed <a href="http://gx.riccardodegni.net/docs" target="_blank">documentation</a>.</p>
<p>Now that we have learnt how to use the methods provided by GX.Extras.js, let&#8217;s see them!</p>
<p><strong>Show/Hide capability</strong></p>
<p>The show/hide functionality is one of the most used by jQuery/Javascript programmers. Therefore, the GX Extras provides a solid mechanism that is very similar to the jQuery&#8217;s one. If you pass the duration to these two methods, they&#8217;ll show/hide elements with an animation, otherwise they&#8217;ll show/hide elements directly (and further arguments will have no effect).</p>
<p><strong>Fade capability</strong></p>
<p>With the methods of the &#8220;fade&#8221; family you&#8217;ll get a full-featured set of functionality for fading elements. You can choose from the the standard fadeIn, fadeOut and fadeToggle methods or the shortcut method fade.</p>
<p><strong>Slide capability</strong></p>
<p>As for the &#8220;fade&#8221; familiy, the &#8220;slide&#8221; family of methods provides a complete set of functionality for sliding elements, either vertically and horizontally.</p>
<p><strong>Gradient capability</strong></p>
<p>This is a very useful shortcut that allows you to change the bg or the fg color of your elements wrinting less code than you can imagine.</p>
<p><strong>Move capability</strong></p>
<p><strong></strong>Another important shortcut is the move method: it allows to move every element of your pages on the x/y axis without the need of additional checks:</p>
<pre>// move the element to another position and then restore its original position within 6000ms
$('myEl').move(100, -240, ['Bounce', 2000])
         .move(0, 0, [4000]);</pre>
<h3>Sizes</h3>
<p>The super small size is and will be always one of the main features of GX and its related extension. Now the final size of the core engine is smaller than the previous although new features have been added. The following are the sizes of GX&#8217;s scripts compressed with the DE Packer (you can apply GZip too &#8212; for a total of a couples of kb):</p>
<ul>
<li>GX.js: 5kb</li>
<li>GX.Transitions.js: 2kb</li>
<li>GX.Extras.js: 2kb</li>
</ul>
<h3>Conclusion</h3>
<p>In this new representation of the GX engine I kept in mind some of the suggestions you have previously written in the first post about GX, that I found very interesting as weel as useful, especially the tip of <a href="http://www.riccardodegni.net/blog/gx-full-featured-javascript-animations-framework#comment-20" target="_blank">Joan Piedra</a> about the pause/resume API and the request of <a href="http://www.riccardodegni.net/blog/gx-full-featured-javascript-animations-framework#comment-5" target="_blank">sponge</a> about the delay option. GX is, in fact, an <strong>open-source</strong> project and I&#8217;ll always be glad to hear your suggestions and your tips, as weel as your opinions that aims to make a better product.</p>
<p>So, don&#8217;t hesitate to let me know your thoughts in the comment box!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.riccardodegni.net/blog/gx-11-and-gx-extras-are-come/feed</wfw:commentRss>
		</item>
		<item>
		<title>GX Tutorial #1: handling colors</title>
		<link>http://www.riccardodegni.net/blog/gx-tutorial-1-handling-colors</link>
		<comments>http://www.riccardodegni.net/blog/gx-tutorial-1-handling-colors#comments</comments>
		<pubDate>Wed, 18 Mar 2009 23:02:41 +0000</pubDate>
		<dc:creator>RD</dc:creator>
		
		<category><![CDATA[GX]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.riccardodegni.net/blog/?p=17</guid>
		<description><![CDATA[Before starting the tutorial, I would like to thank Dion Almaer of Ajaxian for his kidness and for having dedicated a post about the GX framework (which I appreciated very much) as well as all the users that downloaded and are downloading GX in these days. I&#8217;m glad to report here the responses directly from [...]]]></description>
			<content:encoded><![CDATA[<p>Before starting the tutorial, I would like to thank <a href="http://www.almaer.com/blog/" target="_blank">Dion Almaer</a> of <a href="http://ajaxian.com/" target="_blank">Ajaxian</a> for his kidness and for having dedicated a <a href="http://ajaxian.com/archives/gx-a-new-animation-framework" target="_blank">post</a> about the <a href="http://gx.riccardodegni.net/" target="_blank">GX</a> framework (which I appreciated very much) as well as all the users that downloaded and are downloading GX in these days. I&#8217;m glad to report here the responses directly from the Download Counter:</p>
<ul>
<li>Friday: 288</li>
<li>Saturday: 493</li>
<li>Sunday: 637</li>
<li>Monday: 894</li>
<li>Tuesday: 1026</li>
<li>Wednesday: 1081</li>
</ul>
<p>I&#8217;m very happy to read the data informations placed above and I hope you&#8217;ll enjoy GX in all its features.</p>
<p>Now stop talking and let&#8217;s start the tutorial!</p>
<p> </p>
<p><span id="more-17"></span></p>
<h3>Handling hexadecimal notations</h3>
<p>As you probably have read from the <a href="http://gx.riccardodegni.net/docs" target="_blank">Docs</a>, with GX you can handle CSS colors in a variety of ways, one of which includes the <em>hexadecimal notation</em>, either <strong>full</strong> and <strong>short</strong>. See the following example:</p>
<pre>// full-hex notation
$('el').gx({color: '#ff00ff'}, 2000, 'Bounce');

// short-hex notation
$('el').gx({color: '#f0f'}, 2000, 'Bounce');</pre>
<p>Obviously, both the previous examples will give the same result.</p>
<h3>Handling Array notations</h3>
<p>Another way for handling colors with GX is to use the <em>Array notation</em>. See the following:</p>
<pre>// animate to white
$('el').gx({color: [255, 255, 255]}, 600, 'Elastic');

// animate to blue
$('el').gx({color: [0, 0, 255]}, 600, 'Elastic');

// and so on...</pre>
<p>As you can see, using the Array notation can be very useful, like in the case you know exactly the <em>r</em>, <em>g</em> and <em>b</em> percentages (probably it represents the best choice for some particular Plug-Ins based on GX).</p>
<h3>Handling Custom colors</h3>
<p>The real killer feature of handling colors with GX comes with the <em>Custom Colors</em>, or <em>color keywords</em>. GX has in fact the capability to handle color &#8220;strings&#8221; or well, &#8220;keywords&#8221;, and has 5 internal core values that you can actually use: &#8220;red&#8221;, &#8220;green&#8221;, &#8220;blue&#8221;, &#8220;black&#8221; and &#8220;white&#8221;.</p>
<pre>// predefined color keywords
$('el').gx({'color': 'white',
            'border-color': 'blue'});</pre>
<p>Moreover, you can add additional keywords by extending the <em>GX.Color.customColors</em> object, like for example, the <a href="http://www.w3schools.com/css/css_colornames.asp" target="_blank">CSS standards colors</a>:</p>
<pre>// adds the 'fuchsia' and 'aqua' colors
Fns.Extend(GX.Color.customColors, {
  fuchsia: [255, 0, 255],
  aqua: [0, 255, 255]
});

// let's use them!
$('el').gx({'color': 'fuchsia',
            'border-right-color': 'aqua'});</pre>
<p>In this code snippet I used the internal <em>Fns.Extend</em> method to extend the <em>GX.Color.customColors</em> object to be more consistent with the GX syntax, but you can extend it in every way.</p>
<p>Of course, if you don&#8217;t remember exactly the required Array notation, you can use the <em>GX.Color.cssToRgb</em> method and pass the hex notation as string to it: GX will do the dirty job for us:</p>
<pre>// adds the 'coral' and 'chocolate' colors
Fns.Extend(GX.Color.customColors, {
  coral: GX.Color.cssToRgb('#ff7f50'),
  chocolate: GX.Color.cssToRgb('#d2691e')
});

// let's use the new color keywords!
$('el').gx({'color': 'chocolate',
            'border-left-color': 'coral'});</pre>
<h3>Let&#8217;s use our Custom colors!</h3>
<p>Although it&#8217;s possible to extend the <em>GX.Color.customColors</em> object by adding the standard colors, the amazing feature comes when you add YOUR custom colors!</p>
<p>For example, if you have a template with a specified color scheme and you have to create animations for handling these colors, it can be very tedious to repeat the same operation more than once by writing redundant code as in the following snippet (I picked the color values directly from my template, for the sake of convenience):</p>
<pre>// first script...
$('el').gx({color: '#a18385'})
       .gx({color: '#aab3c2'})
       .gx({color: '#a18385'})
       .gx({color: '#aab3c2'});

// second script...
$('otherEl').gx({'background-color': '#a18385'})
            .gx({'background-color': '#aab3c2'})
            .gx({'background-color': '#a18385'})
            .gx({'background-color': '#aab3c2'});</pre>
<p>Sure, it&#8217;s tedious.</p>
<p>Of course, you can create your personal color keywords and use/reuse them in all the pages of your application. For example, in my case, I created a new file called <em>myGXColors.js</em> that contains my personal custom colors. It&#8217;s like the following:</p>
<pre>/* myGXColors.js */

// RD Theme Colors
Fns.Extend(GX.Color.customColors, {
  RDviolet: GX.Color.cssToRgb('#a18385'),
  RDdark: GX.Color.cssToRgb('#aab3c2')
});</pre>
<p>Then, I put the script in my pages and I&#8217;m done:</p>
<pre>&lt;script src="jquery.js" <span class="nodeLabelBox repTarget"><span class="nodeAttr editGroup"><span class="nodeName editable">type</span>="<span class="nodeValue editable">text/javascript</span>"</span></span>&gt;&lt;/script&gt;
&lt;script src="GX.js" <span class="nodeLabelBox repTarget"><span class="nodeAttr editGroup"><span class="nodeName editable">type</span>="<span class="nodeValue editable">text/javascript</span>"</span></span>&gt;&lt;/script&gt;
&lt;script src="myGXColors.js" <span class="nodeLabelBox repTarget"><span class="nodeAttr editGroup"><span class="nodeName editable">type</span>="<span class="nodeValue editable">text/javascript</span>"</span></span>&gt;&lt;/script&gt;
&lt;script <span class="nodeLabelBox repTarget"><span class="nodeAttr editGroup"><span class="nodeName editable">type</span>="<span class="nodeValue editable">text/javascript</span>"</span></span>&gt;
// ...
// first script...
$('el').gx({color: 'RDviolet'})
       .gx({color: 'RDdark'})
       .gx({color: 'RDviolet'})
       .gx({color: 'RDdark'});
&lt;/script&gt;</pre>
<p>As you can see, this technique allows you to modularize your code and vastly reduces redundancy. If later, for any reason, you need to change your template or its color scheme, you won&#8217;t have to worry about changing values in all scripts, you will only have to update the <em>myGXColors.js</em> script and you&#8217;ll be done.</p>
<h3>Conclusion</h3>
<p>In this tutorial we have learnt how to handle CSS colors with GX in all the features offered by it.</p>
<p>As usual, if you have any doubt, suggestion, tip or whatever you want, don&#8217;t hesitate to post them here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.riccardodegni.net/blog/gx-tutorial-1-handling-colors/feed</wfw:commentRss>
		</item>
		<item>
		<title>GX - Full-featured Javascript Animations Framework</title>
		<link>http://www.riccardodegni.net/blog/gx-full-featured-javascript-animations-framework</link>
		<comments>http://www.riccardodegni.net/blog/gx-full-featured-javascript-animations-framework#comments</comments>
		<pubDate>Tue, 10 Mar 2009 14:37:11 +0000</pubDate>
		<dc:creator>RD</dc:creator>
		
		<category><![CDATA[GX]]></category>

		<category><![CDATA[Javascript]]></category>

		<category><![CDATA[jQuery]]></category>

		<category><![CDATA[RD]]></category>

		<category><![CDATA[Softwares]]></category>

		<guid isPermaLink="false">http://www.riccardodegni.net/blog/?p=9</guid>
		<description><![CDATA[
GX, my latest project, is come.
As the official page says, &#8220;GX is a full-featured, cross-browser, super-tiny (10kb uncompressed) Javascript Animations Framework.  			Using GX you can create complex animations working with every w3c CSS property.  			Currently, GX is designed in order to work with the  			jQuery Javascript Library and is being released under [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-10 block_img" title="GX_logo" src="http://www.riccardodegni.net/blog/wp-content/uploads/2009/03/gx_logo_2.gif" alt="GX_logo" width="214" height="89" /></p>
<p><a href="http://gx.riccardodegni.net/" target="_blank">GX</a>, my latest project, is come.</p>
<p>As the <a href="http://gx.riccardodegni.net/" target="_blank">official page</a> says, <strong class="gx">&#8220;GX</strong> is a full-featured, cross-browser, super-tiny <span style="font-size: 0.9em;">(10kb uncompressed)</span> Javascript Animations Framework.  			Using <strong class="gx">GX</strong> you can create complex animations working with <em>every w3c CSS property</em>.  			Currently, <strong class="gx">GX</strong> is designed in order to work with the  			<a href="http://jquery.com/" target="_blank">jQuery</a> Javascript Library and is being released under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT License</a>&#8220;.</p>
<p>That&#8217;s not all. GX is not like an usual library for creating animations, its main goal goes further, in order to build a real FULL-FEATURED framework for creating smooth, custom and complex animations WITH EASE.</p>
<p>First of all, i want to start saying that GX is designed for everyone: beginner, intermediate and expert Javascript users. I decided to integrate GX with the <strong>jQuery</strong> Javascript Library for two main reasons: first, i really like the jQuery framework and its awesome community, and i find that the former is one of the best open source products available on the Web.</p>
<p>However, when i needed to make some complex animations, i was really getting mad (too many scripts required and placed in the same page for extending the core engine, too many kb). Secondly, i have already developed a software based on <strong>MooTools</strong> called <a href="http://www.moord.it/" target="_blank">moo.rd</a>, so i wanted to  create something else based on another library.</p>
<p>I&#8217;ve developed <strong>GX</strong> keeping in mind mainly two Design Patterns:</p>
<ul>
<li>the &#8220;<strong>Write Less, Do More</strong>&#8221; Pattern picked from the <strong>jQuery</strong> Library. With GX you&#8217;ll always write as less code as possible to get the best results.</li>
<li>the <a href="http://en.wikipedia.org/wiki/Don%27t_repeat_yourself" target="_blank">DRY</a> (Don&#8217;t Repeat Yourself) Pattern. If a GX&#8217;s functionality is needed more than once, it will be internally reused with no duplicate.</li>
</ul>
<p><strong>GX</strong> respects the Strict Standards and doesn&#8217;t generate CSS/Javscript warnings. Moreover it prevents possible Memory Leaks because it will always use the same instance for a determinate element (say goodbye to &#8220;flickering&#8221;) to avoid either memory leaks and flickering issues. This technique allows you to always keep track of your animation&#8217;s state.</p>
<p>Although <strong>GX</strong> is completely cross-browser, it doesn&#8217;t contain <strong>any Browser sniffing</strong>: it&#8217;s 100% pure Javascript engine.</p>
<p><span id="more-9"></span></p>
<h3>Online resources</h3>
<p>You can find deep informations on GX as well as see it in action at <a href="http://gx.riccardodegni.net/" target="_blank">http://gx.riccardodegni.net/</a>. <a href="http://gx.riccardodegni.net/docs" target="_blank">Documentation</a> and <a href="http://gx.riccardodegni.net/demos" target="_blank">Demos</a> availables.</p>
<h3>Sizes in kb</h3>
<p>One of the greatest features of GX is the lightness: it&#8217;s super-tiny! The following are the sizes of the version <strong>1.0</strong>:</p>
<p><span style="text-decoration: underline;"><em>GX.js</em></span>: 10kb (raw sourcecode, with comments) | 5kb (packed with Dean Edwards Packer) | 1kb (Gzipped)</p>
<p><span style="text-decoration: underline;"><em>GX.transitions.js</em></span>: 3kb (raw sourcecode, with comments) | 2kb (packed with Dean Edwards Packer) | 0.3kb (Gzipped)</p>
<p>Note: i have adapted the complex Easing Equations provided by Robert Penner (10 equations and 30 easing types) to be used with GX in a super-small script that wheights only 3kb uncompressed.</p>
<h3>Integrate GX with your pages</h3>
<p><strong>GX</strong> can be easily integrated into your pages by inserting it after the desired jQuery script. No more operations, it&#8217;s done.</p>
<pre>&lt;script src="jquery_1.3.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script src="GX.js" type="text/javascript"&gt;&lt;/script&gt;
&lt;script type="text/javascript"&gt;
  $(document).ready(function() {
    // do stuff with jQuery and GX...
  });
&lt;/script&gt;</pre>
<h3>Simple animations</h3>
<p>Now let&#8217;s start speaking about the GX engine. In a few words, with GX you can animate every CSS properties at once, and you can do this in an extremely easy way. Look at the following example:</p>
<pre>$('element').gx({'width':'+=200px', 'height':'4em', 'opacity':0.4, 'color':'#ff0'},
4000);</pre>
<p>Using the <strong>gx</strong> (or the alias <strong>anime</strong>) method, you can animate the described CSS properties of the &#8216;element&#8217; DOM element within 4000 ms. As you can see, you can use either normal values and relative values, as integers. For colors, you can use the full hex notation, the short hex notation, an array of three values and the Color&#8217;s keywords that you can create and customize in every way (i will describe it better the next week  with a great article).</p>
<h3>Queue and cancel</h3>
<p><strong>GX</strong> offerts a complete control over animations. By default, you can queue an infinite number of animations, that will be executed one after another. The following code will animate the &#8216;width&#8217; property four times:</p>
<pre>$('element').gx({width: 0}, 200)
            .gx({width: 200}, 4000)
            .gx({width: 0}, 'verySlow')
            .gx({width: 100}, 'slow');</pre>
<p>However, you can decide to cancel the current animation and replace it with another (e.g. when you hover the links). To do this, you need to alter the GX option called &#8216;queue&#8217; of your element using the <strong>gxInit</strong> method:</p>
<pre>// first set the 'queue' option
$('element').gxInit({queue: 'cancel'});

// later
$('anotherElement').hover(function() {
  $('element').gx({width: 0}, 200);
}, function() {
  $('element').gx({width: 200}, 200);
});</pre>
<p>Using &#8216;wait&#8217; as value of the queue option, further calls will be ignored if the animation is running.</p>
<h3>Build a complex animation: Transitions and Callback(s)</h3>
<p>With <strong>GX</strong> you can create very complex animations. If you insert the <strong>GX.transitions.js</strong> script, you&#8217;ll be able to use all the <strong>GX Easing Equations</strong> (based on the Robert Penners&#8217;  ones), otherwise you can only use the default &#8216;Linear&#8217; transition. Easing is the third parameter of the <strong>gx</strong> method, and can be passed in two ways: &#8216;Easing&#8217; and &#8216;Easing:Type&#8217;. For example: &#8216;Bounce&#8217;, &#8216;Elastic:In&#8217;, &#8216;Back:Out&#8217;, &#8216;Bounce:InOut&#8217;. If you don&#8217;t specify the type, &#8216;InOut&#8217; keyword will be used.</p>
<p>There are a lot of transitions available with GX.transitions.js: Sine, Quint, Quart, Quad, Expo, Elastic, Cubic, Circ, Bounce and Back.</p>
<p>The callbacks allow you to either call a function when the animation is completed (by using a function) or when the animation starts and finishes (by using an object). The element you are animating and its GX instance will be passed as arguments. See the following:</p>
<pre>// 'Complete' callback
$('element').gx({width: 200, height: 200}, 2000, 'Bounce', function(el) {
  el.html('The animation is completed!');
});

// 'Start' and 'Complete' callbacks
$('element').gx({width: 200, height: 200}, 2000, 'Bounce',
  {'start': function(el) { el.html('The animation is started!'); },
   'complete': function(el) { el.html('The animation is completed!'); } }
);</pre>
<h3>Pause and Resume</h3>
<p>One of my favourite features of <strong>GX</strong> is the full pause/resume support. I absolutely consider that one of the best feature of the framework: you can pause and resume the animations as you want. How to do this? Simply: use respectively the new <strong>gxPause</strong> and <strong>gxResume</strong> methods:</p>
<pre>// start the animation (usually do this within an event handler)
$('element').gx({width: 200, height: 200}, 2000, 'Elastic');

// pause the animation
$('element').gxPause();

// later... resume the animation from the previous break point
$('element').gxResume();</pre>
<p>Remember that you can pause and resume your GX animations any time and how many times you need.</p>
<h3>Special values</h3>
<p><strong>GX</strong> is designed in order to be easily extended with new classes/methods (coming soon some new amazing features). Because of this, i added a full support for the &#8220;special&#8221; values, so the &#8220;show&#8221;, &#8220;hide&#8221; and &#8220;toggle&#8221; keywords can be used as values (obviously, this makes sense only with a small set of CSS properties).</p>
<p>Using the special keywords you can &#8220;toggle&#8221; the value of a property:</p>
<pre>// toggle opacity four times
$('element').gx({opacity: "toggle"}, 2000)
            .gx({opacity: "toggle"}, 1000)
            .gx({opacity: "toggle"}, 400)
            .gx({opacity: "toggle"}, 2000);

// toggle width three times
$('element').gx({width: "hide"}, 2000)
            .gx({width: "show"}, 1000)
            .gx({width: "hide"}, 400);</pre>
<h3>Future proofs</h3>
<p>Although <strong>GX</strong> can be currently defined &#8220;full-featured&#8221;, there are many others features i want to add. First of all, a method which allows to animate multiple elements at once (with some special add-ons). A better &#8220;getter&#8221; method for retrieve complex CSS values (currently the jQuery.fn.css method doesn&#8217;t work well with some complex CSS properties, as &#8216;border-width&#8217;, &#8216;border-color&#8217; and so on).</p>
<p>Last but not least, i&#8217;m developing a new script file called <strong>GX.animations</strong> which provides new shortcut-methods for creating animations based on the gx methods (expect a &#8216;fade&#8217;, &#8216;gradient&#8217;, &#8217;slide&#8217; methods and so on). Morevover you&#8217;ll be able to use the parameters in the desired order:</p>
<pre>$('element').slideUp(2000, function(el) {el.css('Done!');});
$('elemen').fadeOut('Bounce', 'verySlow');
// ...</pre>
<h3>Conclusion</h3>
<p>Currently, i&#8217;m using the GX engine in collaboration with <em>every</em> jQuery application i created. I&#8217;d be very pleased to hear the opinions of the jQuery Gurus about my project, their suggestions, and if there&#8217;s some way for it to be integrated with the jQuery Library.</p>
<p>At this point the best thing you can do is download GX and start to play with it.  Learning GX and integrate it with your applications will really be a simple joke. Moreover, I&#8217;ll post a collection of tutorials that will show the potentiality of GX as well as its hidden features.</p>
<p>Don&#8217;t  hesitate to  post your suggestions, tips, thoughs, doubts, requests, possible bugs and so on!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.riccardodegni.net/blog/gx-full-featured-javascript-animations-framework/feed</wfw:commentRss>
		</item>
		<item>
		<title>Introduction</title>
		<link>http://www.riccardodegni.net/blog/introduction</link>
		<comments>http://www.riccardodegni.net/blog/introduction#comments</comments>
		<pubDate>Mon, 09 Mar 2009 17:22:26 +0000</pubDate>
		<dc:creator>RD</dc:creator>
		
		<category><![CDATA[General]]></category>

		<category><![CDATA[RD]]></category>

		<guid isPermaLink="false">http://www.riccardodegni.net/blog/?p=3</guid>
		<description><![CDATA[This is the very first post on this blog.
In these pages you’ll find a lot about my projects and my works, as well as my personal opinions about Web technologies, Web programming and, of course, all the related topics.
My blog isn’t and will never be a periodic magazine nor a truly-defined “blog”, it simply represents [...]]]></description>
			<content:encoded><![CDATA[<p>This is the very first post on this blog.</p>
<p>In these pages you’ll find a lot about my projects and my works, as well as my personal opinions about Web technologies, Web programming and, of course, all the related topics.</p>
<p>My blog isn’t and will never be a periodic magazine nor a truly-defined “blog”, it simply represents the preferred way to expose my projects and my opinions to Web.</p>
<p>Now let’s talk about the theme. I developed the blog section of my official Website using Wordpress and choosing to create a usable, simple and funny theme with a dark-toon color scheme. It&#8217;s 100% <em>valid XHTML</em> and 100% <em>valid CSS</em> because, as i wrote in my <a href="http://www.riccardodegni.net/profile" target="_blank">Profile</a>, i love either the standards and all the recent stricts.</p>
<p>I think you’ll find it very simple to use and explore.</p>
<p>I’ll be very glad to hear your suggestions, your tips and your personal opinions about my projects and my topics and I hope you’ll let me know what you think about them!</p>
<p><span style="text-decoration: underline;"><em>Riccardo Degni</em></span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.riccardodegni.net/blog/introduction/feed</wfw:commentRss>
		</item>
	</channel>
</rss>
