Mostrando entradas con la etiqueta HTML. Mostrar todas las entradas
Mostrando entradas con la etiqueta HTML. Mostrar todas las entradas

miércoles, 18 de mayo de 2011

Put me in, coach!

Put me in, coach!: "
Currently, I’m just one in a huge crowd, a prospect who has seen so many “dribbbles” and who learned a lot of new techniques.

Today’s post is about… me. With your permission and hoping I’m not too selfish, I’d like to show you some of my latest CSS3 designs.





Multi-level dropdown menu




HTML5 logo






HTML5 search box






Buttons




Happy Holidays


Happy holidays - CSS3 experiment



Ready to play


If you think I’m a good prospect, and you think I’ve got what it takes to became an draftee, then I’d appreciate if you could send me a Dribbble invite.

"

martes, 17 de mayo de 2011

How to convert WordPress theme to HTML5?

How to convert WordPress theme to HTML5?: "
HTML5 offers many improvements and cool features that can be useful while using WordPress.
In this tutorial you will learn How to convert WordPress theme to HTML5. Enjoy!
WordPress Logo
1. Document’s structure
<!doctype html>
<head>
</head>
<body>
<header>
</header>
<section id="content">
<article>
<header>
</header>
</article>
</section>
<aside>
<nav>
</nav>
</aside>
<footer>
</footer>
</body>
</html>
As we can see some new tags have been added. If we add to our CSS:
article, aside, figure, footer, header, hgroup, menu, nav, section { display:block; }
we can format them like other block elements, e.g. <div>
1. Inside <header> we can put elements that can be found usually in tops – nothing special: slider, menu, logo etc. The usage of this tag inside <article> will be presented below.
2. <section> tag helps us keeping the order in document. We can divide our site into sections, e.g. content, comments, gallery etc.
3. <article> can be used to store our entries – each entry in separate tag! The title and meta of entry should be inside <header> – it will have positive impact on our SEO.
4. Our sidebar should be inside <aside> tag. Nothing special, but nobody said that all the innovations will be helpful.
5. <nav> wraps navigation. It isn’t said that in must be inside <aside>, it may as well be in our header or anywhere we want to have our navigation.
6. If we have footer it is a good practice to put it inside <footer>. We can have more than one <footer>, but each should be inside separate <section> and one can be directly inside <body>
Tags <article>, <header>, <footer>, <section> can be used more than one time, but we should keep the proper structure. I propose the following:
<section id="content">
<article>
<header>
</header>
<p>
</p>
<footer>
</footer>
</article>
</section>
Inside <header> we can put <h3> which is in most of wordpress skins as headline of post. If we want place more than one <hX> element we use <hgroup>:
<hgroup>
<h3>Title</h3>
<h4>Subtitle</h4>
</hgroup>
The meta of the post can be wrapped by <footer>, what is a convenient solution.
When it comes to the comments we can treat them like posts and put inside <article> with <header>, <p>, <footer> etc. inside.
When we want to refresh our comment form we should definitely use HTML5. Some new input features have been added. Let’s take a look on this:
<input type="text" name="author" id="comment-form-author" placeholder="Your name" value="" size="22" tabindex="1" required="required">

<input type="email" name="email" id="comment-form-email" placeholder="Your email" pattern="[^ @]*@[^ @]*" value="" size="22" tabindex="2" required="required">

<input type="text" name="url" id="comment-form-url" placeholder="Your website" size="22" tabindex="3" />
As a value of placeholder we can specify a hint for user, it will appear as a text inside the input and after clicking on it will disappear.
pattern attribute allows us to specify a patter than must be followed. Here we have an example of pattern for email address.
HTML5 is powerful tool, but it’s still not supported by every browser. More cool features we can find on http://html5demos.com/

"
Enhanced by Zemanta

Animated Skills Diagram with Raphaël

Animated Skills Diagram with Raphaël: "

View demo Download source
In this tutorial we will show you how to create a diagram using Raphaël – a small JavaScript library that is great for working with vector graphics. The idea is very simple: we will draw some arcs using mathematical functions and we’ll be displaying a skill percentage in a main circle when we hover over those arcs.
Let’s start with the markup.

The Markup

The HTML structure is going to consist of a main container with the class ‘get’. This container stores all data that we need to draw the arcs. Then we create a new div element with the id ‘diagram’ which will be the container for the arcs:
<div id="diagram"></div>
<div class="get">
<div class="arc">
<span class="text">jQuery</span>
<input type="hidden" class="percent" value="95" />
<input type="hidden" class="color" value="#97BE0D" />
</div>
<div class="arc">

<span class="text">CSS3</span>
<input type="hidden" class="percent" value="90" />
<input type="hidden" class="color" value="#D84F5F" />
</div>
<div class="arc">
<span class="text">HTML5</span>
<input type="hidden" class="percent" value="80" />
<input type="hidden" class="color" value="#88B8E6" />

</div>
<div class="arc">
<span class="text">PHP</span>
<input type="hidden" class="percent" value="53" />
<input type="hidden" class="color" value="#BEDBE9" />
</div>
<div class="arc">
<span class="text">MySQL</span>
<input type="hidden" class="percent" value="45" />
<input type="hidden" class="color" value="#EDEBEE" />
</div>
</div>

The CSS

In the CSS we will only do two things: hide the elements with the class ‘get’ and set the width and height of the div with the id ‘diagram’:
.get {
display:none;
}

#diagram {
float:left;
width:600px;
height:600px;
}

The JavaScript

The main idea is to first create a new Raphael object (variable ‘r’) and draw our first circle with a radius that we specify in ‘rad’.
Then we create a new circle in the Raphael object. We center the circle (x: 300px and y: 300px) and we add some text to it.
var o = {
init: function(){
this.diagram();
},
random: function(l, u){
return Math.floor((Math.random()*(u-l+1))+l);
},
diagram: function(){
var r = Raphael('diagram', 600, 600),
rad = 73;

r.circle(300, 300, 85).attr({ stroke: 'none', fill: '#193340' });

var title = r.text(300, 300, 'Skills').attr({
font: '20px Arial',
fill: '#fff'
}).toFront();

}
}
Now, let’s go one step further.
We’ll extend the Raphael object with some custom attributes:
  • alpha – angle of the arc
  • random – random number from the specified range
  • sx, sy – start drawing from this point
  • x, y – end drawing at this point
  • path
var o = {
init: function(){
this.diagram();
},
random: function(l, u){
return Math.floor((Math.random()*(u-l+1))+l);
},
diagram: function(){
var r = Raphael('diagram', 600, 600),
rad = 73;

r.circle(300, 300, 85).attr({ stroke: 'none', fill: '#193340' });

var title = r.text(300, 300, 'Skills').attr({
font: '20px Arial',
fill: '#fff'
}).toFront();

r.customAttributes.arc = function(value, color, rad){
var v = 3.6*value,
alpha = v == 360 ? 359.99 : v,
random = o.random(91, 240),
a = (random-alpha) * Math.PI/180,
b = random * Math.PI/180,
sx = 300 + rad * Math.cos(b),
sy = 300 - rad * Math.sin(b),
x = 300 + rad * Math.cos(a),
y = 300 - rad * Math.sin(a),
path = [['M', sx, sy], ['A', rad, rad, 0, +(alpha > 180), 1, x, y]];
return { path: path, stroke: color }
}

$('.get').find('.arc').each(function(i){
var t = $(this),
color = t.find('.color').val(),
value = t.find('.percent').val(),
text = t.find('.text').text();

rad += 30;
var z = r.path().attr({ arc: [value, color, rad], 'stroke-width': 26 });

z.mouseover(function(){
this.animate({ 'stroke-width': 50, opacity: .75 }, 1000, 'elastic');
if(Raphael.type != 'VML') //solves IE problem
this.toFront();
title.animate({ opacity: 0 }, 500, '>', function(){
this.attr({ text: text + '\n' + value + '%' }).animate({ opacity: 1 }, 500, '<');
});
}).mouseout(function(){
this.animate({ 'stroke-width': 26, opacity: 1 }, 1000, 'elastic');
});
});
}
}
Then we’ll retrieve all the data needed, such as the percentage value, the color of the arc and the text. We increase the radius value for each arc and finally create a new arc path.
In the last step we are adding some animations on hover. When the mouse will be over the arc the title (which is placed in the main circle) is changing. Also, we’ll make the arc a little bit bigger.

Conclusion

In today’s tutorial you’ve learned some first steps on how to use Raphaël. It is a powerful library and you can do a lot of great stuff with it. Visit the Raphaël website for more examples.
View demoDownload source
Share and Enjoy:Diggdel.icio.usFacebookLinkedInRedditRSSTwitterGoogle BookmarksStumbleUponTechnoratiDZoneemailblogmarksDesign FloatDiigoFriendFeedGoogle BuzzIdenti.caMisterWongNewsVinePing.fmPlurkPosterousSlashdotSuggest to Techmeme via TwitterTumblr

"