Sunday, 23 February 2014

CSS3 Transition Property Basics

While browsing some sites, we can see an interesting effect on some links. Most of the time, when you hover over a link, something changes in its style: it will either change its color or background, or will become underlined.

What about this cool effect that consists in gradual transition from one style to another that you can see in the example below:
Hover Over Me!

This transition is achieved by using the CSS3 transition property - property which is supported in all major browsers such as Chrome, Firefox, Opera, Safari (for Safari we will need the -webkit- prefix to get this effect).

The CSS3 Transition Syntax

The syntax of the transition supports four values:
  • the property affected by the transition, such as color, border, background, width, etc.
  • the duration of this transition in seconds, i.e. how long will it take to change your style completely
  • the delay time for the transition to be executed, also in seconds, i.e. how long it takes for the transition to start when the mouse hovers over that element;
Check out the code below:
.example {
 transition-property: width; /* property that undergoes a transition */
 transition-duration: 2s; /* duration of the transition */
 transition-timing-function: linear; /* timing-function */
 transition-delay: 0; /* length of time to delay the start of a transition */
/* now we will repeat the entire declaration with the -webkit- prefix for the effect to work in Chrome and Safari */
 -webkit-transition-property: width;
 -webkit-transition-duration: 2s;
 -webkit-transition-timing-function: linear;
 -webkit-transition-delay: 0;
}
In the example above, the elements with the .example class will become wide within two seconds as the mouse passes over them.

When we define the style of a link, usually we need to use the a:link selector, and when defining the style when the mouse is over the link, we need to use the :hover selector. However, the transition can be used in any HTML element, not just links.

To make the transition effect to work properly, we should define two blocks of style for that element, i.e. the normal style for a tag/id/class and the style on mouse :hover for a specific tag/id/class.

For example:
tag, #id, .class {
/* insert here the styles that you want for the selector */
/* insert below the transition effects */

}
tag:hover, #id:hover, class:hover {
/* Insert here the styles for when the mouse is over the element */
/* here it is not necessary to repeat the declaration of the transition */

}
You can add the same style on multiple selectors separated by commas as you can see above, although it is not necessary.

Below are some transition examples with their respective CSS codes. I will not use the transition-timing-function in these examples because it makes no difference, as the first value is the duration in seconds and the second is the delay.

Example 1:

Transition example

/* with a single property */
#example1 {
 background-color: #FFFF00;
-moz-transition-property: background-color;
-moz-transition-duration: 2s;
-webkit-transition-property: background-color;
-webkit-transition-duration: 2s;
-o-transition-property: background-color;
-o-transition-duration: 2s;
}
#example1:hover {
background-color: #B5E2FF;
}

Example 2:

Transition example

/* with four properties and delay */
#example2 {
background-color: #9c3;
border: 8px solid #690;
padding: 20px;
color: #fff;
-moz-transition-property: background-color,border;
-moz-transition-duration: 1s;
-webkit-transition-property: background-color,border;
-webkit-transition-duration: 1s;
-o-transition-property: background-color,border;
-o-transition-duration: 1s;
}
#example2:hover {
background-color: #690;
border: 8px dashed #fff;
color: #FFFF00;
-moz-transition-property: background-color,border;
-moz-transition-duration: 2s;
-webkit-transition-property: background-color,border;
-webkit-transition-duration: 2s;
-o-transition-property: background-color,border;
-o-transition-duration: 2s;
}
Example 3:

Transition example

/* with seven properties and delay */
#example3 {
padding: 15px;
background-color: #FF7CA6;
font-size: 16px;
width: 30%;
font-weight: bold;
color: #fff;
height: 20px;
-moz-transition-property: background-color,width,height,padding,font-size,color;
-moz-transition-duration: 1s;
-webkit-transition-property: background-color,width,height,padding,font-size,color;
-webkit-transition-duration: 1s;
-o-transition-property: background-color,width,height,padding,font-size,color;
-o-transition-duration: 1s;
}
#example3:hover {
background-color:#9c3;
width: 60%;
height: 60px;
padding: 50px;
font-size: 30px;
color: #FFFF00;
-moz-transition-property: background-color,width,height,padding,font-size,color;
-moz-transition-duration: 2s;
-webkit-transition-property: background-color,width,height,padding,font-size,color;
-webkit-transition-duration: 2s;
-o-transition-property: background-color,width,height,padding,font-size,color;
-o-transition-duration: 2s;
}
Example 4:

Transition example

/* with all the properties simultaneously */
#example4 {
padding: 15px;
background-color: #9c3;
color: #fff;
font-size: 16px;
width: 30%;
font-weight: bold;
transition: all 2s;
-webkit-transition: all 2s;
}
#example4:hover {
background-color: #FF7CA6;
color: #242424;
width: 60%;
}

Final words:

  • the transition declarations need to appear in the CSS. In Blogger, the CSS is located before ]]</b:skin>
  • as you can see in the examples above, you can assign different rules for the transitions of different elements in a single rule - just separate them with commas.
  • it is not mandatory to use the four properties in the transition declaration, but their order must always look like this: property/duration/timing-function/delay.
  • the duration and delay values ​​must be expressed in seconds, but sometimes a second is a long time for a transition. In this case, you can use values with milliseconds, for example, .5s means half a second.
  • In small time intervals, the timing of the transition-function property does not give a remarkable effect being most useful only in more advanced animations. The possible values are either ease (the default, which makes the transition with a slow beginning, then gets faster and ends slowly), linear (the same transition speed from beginning to end), ease-in (transition begins slowly and then the speed increases), ease-out (transition starts fast and slows down at the end) and ease-in-out

FlightGear 3.0 and Bombable add-on

This week saw finally saw the official release of version 3.0 of FlightGear.

Notable changes:
Highlights in this release include integration of the FGCom voice communications client within the simulator, improved terrain rendering, faster scenery loading, and improved usability. This release also coincides with the release of FlightGear World Scenery 2.0 – massively improved scenery data covering the entirety of the planet and incorporating OpenStreetMap roads and detailed terrain information from a variety of sources.
Also interesting is the "Bombable" add-on, which adds combat mechanics:

Saturday, 22 February 2014

RSS feed reader options - the saga continues

When Google Reader was retired, I posted about my search for a replacement.

Eventually I settled on TheOldReader.   This had a few headaches - too many other people made the same choice, so they had performance problems.  Then they were going to shut down.   They they got help and weren't shutting any more.   Now they've siaid that only the first 100 subscriptions are free, and that people need to pay to have more than this.   The design still looks a bit clunky.

I may yet end up paying them $30/year - it's not unreasonable for the service.   But OTOH, I don't see paying a small amount for any service as a guarantee that it will actually survive.

But in the meantime, I'm hunting for options again.    Here's some info about what I've tried.




InoReader

The first tool that has caught my eye is InoReader.   It is
... a Cloud based RSS Reader aimed to fully replace Google Reader and even provide additional tools and functionalities for power users.
Initially it came to life as a proof of concept project, but the author quickly realized that such system cannot be managed and handled by single person for a long time, so the development and support was handled to a company ...

You can register separately, or log in using Facebook or Google accounts. It will import subscription files from the reader part of Google's Takeout file, or other OPML format files.

Add Author's Profile Picture and Name in Multi Author Blog

In this tutorial, we will see how to add the author's profile picture and name on a Blogger blog just below the post title. Not only that this can give your blog that personal touch but attaching an image to your blog posts in Blogger can help visitors identify, and perhaps have a level of trust with you. Also, this could be a great addition to blogs with multiple authors, since the info for each publisher will be shown below the titles of their respective posts and this way, they will get the proper credit for their work.
multi-author blog, blogger tricks

Related: How to Add or Invite Multiple Authors in Blogger

Adding the Author's Profile Picture / Avatar and Name in Blogger

Step 1. From the Blogger Dashboard, go to "Template" and click the "Edit HTML" button.


Step 2. Click anywhere inside the code area and press the CTRL + F keys to open the search box. Paste the following code inside the search box, then hit Enter to find it:
<span class='post-author vcard'>
Just below this line is the rest of code, which should look something like this:
              <span class='post-author vcard'>
                <b:if cond='data:top.showAuthor'>
                  <b:if cond='data:post.authorProfileUrl'>
                    <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'>
                      <meta expr:content='data:post.authorProfileUrl' itemprop='url'/>
                      <a expr:href='data:post.authorProfileUrl' rel='author' title='author profile'>
                        <span itemprop='name'><data:post.author/></span>
                      </a>
                    </span>
                  <b:else/>
                    <span class='fn' itemprop='author' itemscope='itemscope' itemtype='http://schema.org/Person'>
                      <span itemprop='name'><data:post.author/></span>
                    </span>
                  </b:if>
                </b:if> 
</span>
Note: If you are using a custom template, it could look something like this:
<span class='post-author vcard'>
<b:if cond='data:top.showAuthor'>
<data:top.authorLabel/>
<span class='fn'><data:post.author/>
</span>
</b:if>
</span>
Step 3. Now that you found the code, delete it. Please note that it should start and end with the tags marked in yellow. This code is repeated two times in the template's code and you will need to remove both occurrences.

Step 4. Next, search for this line (you'll find it twice but stop on the second one):
<div class='post-header-line-1'/>
Step 5. Just below the line, paste the following code:
<span class='post-author vcard'>
<b:if cond='data:post.author == &quot;AuthorName&quot;'>
<span class='author'><a href='Author-Profile-URL'><img src='Author-Image-URL'/></a></span>
</b:if>
        <b:if cond='data:top.showAuthor'>
          <data:top.authorLabel/>
            <b:if cond='data:post.authorProfileUrl'>
              <span class='fn'>
                <a expr:href='data:post.authorProfileUrl' itemprop='author' rel='author' title='author profile'>
                  <data:post.author/>
                </a>
              </span>
            <b:else/>
              <span class='fn'><data:post.author/></span>
            </b:if>
        </b:if>
      </span>
Replace the AuthorName text with the EXACT name that appears on the Blogger profile, i.e. the one that appears in the posts or comments. If it is added in a different way, Blogger will not recognize the username, nor the image and the code will not work.

To display the author's pic, add the URL of the author's Blogger profile and the image URL by replacing the text in blue. It is recommended to use an image with a maximum height of 40px and 40px wide. Once done, the photo of the author will appear next to the "posted by" text just below the post title.

Now for those who maintain a blog with more than one author, you will need to add the following code just above <b:if cond='data:top.showAuthor'>
<b:if cond='data:post.author == &quot;AuthorName2&quot;'>
<span class='author'><a href='Author2-Profile-URL'><img src='Author2-Image-URL'/></a></span>
</b:if>
If you have more than two authors, repeat this block of code for each author that you want to add.

Now, let's go one step further and add the CSS styles.

Step 6. Search using CTRL + F for this tag:
]]></b:skin>
Just above the ]]></b:skin> tag, paste the following CSS code:
.post-header {
width: 100%;
padding: 2px 5px;
margin: 5px;
clear: both;
float: left;
}
.author img{
float: left;
margin: 0px 5px 10px 0px;
max-width:100%;
height:45px;
border-radius: 10px;
}
.post-author{
color:#777;
font-size: 13px;
font-style: italic;
}
.post-author a {
color:#777; }
Note: to change the size of avatar, modify the 45px> value.

Step 7. Click on the "Save template" button and that's it. You should see now the profile picture and name of the Blogger author below the title of each post.

PageRank Checker - Check Your Google Page Rank

PageRank is an algorithm used by Google Search to rank websites in their search engine results. Page Rank was named after Larry Page, one of the founders of Google as a way of measuring the importance of website pages.

What is Google PageRank and Why Is It Important

According to Google:
"PageRank works by counting the number and quality of links to a page to determine a rough estimate of how important the website is. The underlying assumption is that more important websites are likely to receive more links from other websites."

Briefly, the Page Rank is an assessment of the importance of a web page. This relevance is calculated and published on a scale from 0 to 10. Google basically takes into account the number of backlinks that each page receives, however, the number doesn't matter that much if we don't build high quality backlinks from sites which are related to our links, preferably internal links.

A greater importance has the quantity of internal links linked by other websites, which happens when you create a post and someone publishes the link that redirects to this post that you created. So, the more backlinks your blog or site has, the higher is the chance of having a good PageRank.
pagerank, check page rank

Now that we have a basic understanding of what Page Rank is, how about checking yours?

Check Google Page Rank using the PageRank Checker

You can easily calculate your page rank and check the importance of your page. Just enter the address of your website / blog below and check it out:

Check Page Rank of your Web site pages instantly:

This page rank checking tool is powered by Page Rank Checker service

Do you want to share your page rank with your visitors? You can add a button to your blog by visiting the PageRank Buttons page.