CSS3 dynamic animation tag

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
User avatar
jd447
Forum Members
Forum Members
Posts: 134
Joined: Wed Jun 20, 2007 7:06 am

CSS3 dynamic animation tag

Post by jd447 »

Hello!

I was wondering, would it be possible to do a kind of tag to ease the use of CSS3 animations. Let me explain myself.

Would be nice to have some kind of:

[[$css3]] rotate(0deg) scale(1.03) skew(0deg) translate(0px);

instead of:
-webkit-transform: rotate(0deg) scale(1.03) skew(0deg) translate(0px);
-moz-transform: rotate(0deg) scale(1.03) skew(0deg) translate(0px);
-o-transform: rotate(0deg) scale(1.03) skew(0deg) translate(0px);

which would dynamically create the 3 needed code lines.

any clue?

jd
spcherub
Power Poster
Power Poster
Posts: 402
Joined: Fri Jun 06, 2008 5:54 pm

Re: CSS3 dynamic animation tag

Post by spcherub »

You can do this with a UDT. Something like this should work:

Code: Select all

$styles = $params['styles'];

if( $styles != '') {
	print "-webkit-transform: ".$styles.";";
	print "-moz-transform: ".$styles.";";
	print "-o-transform: ".$styles.";";
}
Name it "my_css3_animation" or something like that. Then you can call it in your stylesheet like this:

Code: Select all

[[my_css3_animation style="rotate(0deg) scale(1.03) skew(0deg) translate(0px)"]]
NOTE: I've not tested the above code, but it should work in principle.

Hope that helps.
-S
Post Reply

Return to “Layout and Design (CSS & HTML)”