Thứ Hai, 17 tháng 10, 2016

Random Facts About Animals in Google Search

Did you know that "male lions defend the pride's territory while females do most of the hunting"? Did you know that "the name humpback whale describes the motion it makes as it arches its back out of the water in preparation for a dive"? What about this one: "ostriches have the largest eyes of any land living animal and they measure 50 mm (2 inches) in diameter"?

Google now shows random facts about animals in the "did you know" section of the Knowledge Graph card. They're extracted from various sites and Google actually links to the source.



Some example of queries that return random facts: [cat], [lion], [tiger], [alpaca], [giraffe], [ostrich], [duck], [elk], [raccoon], [shark]. It's worth pointing out that you can get another random fact by reloading the page or searching again for the same animal.

Thứ Bảy, 15 tháng 10, 2016

Found in Related Searches

Google Knowledge Graph has more than one billion entities and more than 70 billion facts about these entities (people, places, things). It's huge and it brings a different dimension to search: understanding concepts and the relation between them.

Mobile Google Search now has a section called "found in related search", which shows a few entities frequently mentioned in other related searches. For example, I searched for [ethanol molar mass] and Google showed 2 lists of organic and inorganic compounds: one of them was found in the related search [properties of alkanes] and the other was for [polar solvents]. Ethanol is a polar solvent which can be obtained from alkenes, while alkenes can be derived from alkanes, so Google's suggestions are somewhat useful.


This feature is not limited to chemistry, it also works for other topics. Here's a different query: [tour eiffel design], which shows other "towers of the world" and "tourist attractions in France".



Thứ Sáu, 14 tháng 10, 2016

Google Converts Queries Into Questions

I noticed an interesting Google Search experiment in the mobile/tablet interface. When searching for [alcohol with the highest boiling], Google converted my query into a question: "Which alcohol has the highest boiling point?", then it tried to answer the question using a snippet from a web page and then it added a "more results" link. Google's link sent to me to the search results page for the question inferred by Google.

Google's Card for Directions

When you search Google for [directions] or [get directions], you get an error message: "No results for that place. Try entering it below to get suggestions." Google shows a special card for directions with cool features like autocomplete, but the error message is out of place because you haven't typed a location.


Suggestions aren't very smart. For example, I typed "Brisbane, Australia" as the starting point and then I started to type "Mel" as the destination. Google suggested 3 places from California, strictly based on my location, while ignoring that Melbourne is a much better suggestion.


Google shows directions inside the card and you can pick between driving, walking, cycling or using public transportation.


To see the directions, just click the text that describes your favorite route. If there is only one route, pick that one. Another option is to click "directions" and go to the Google Maps site.

Add Home Screen Shortcuts to Google Maps Directions

I'm not sure if this is a new feature, but it must be pretty recent. Google Maps for Android lets you add home screen shortcuts to directions directly from the app. Just search for directions, tap the menu icon and pick "add route to Home screen". This works best when you select the current location, but it's not a requirement.



You may also see this message: "Go here often? Add this route. Tap here to add a Home screen shortcut to this route."


Another option is to add the directions widget, which lets you pick the shortcut name, whether to start turn-by-turn navigation and more.

Thứ Ba, 11 tháng 10, 2016

CSS Rollover Image Effect - Change Image on Hover

Rollover image is a design feature where an image changes when your mouse hovers over it. Think of a light bulb that turns on and off when you move your mouse cursor into that area of a page. When a page is loading, rollover images are preloaded into it to ensure that the rollover effect is displayed quickly.

This used to be implemented using JavaScript, which is fairly easy with just a small amount of script involved. To make rollover images functional, onmouseover and onmouseout attributes are used to a link tag. The code is then added to a blog gadget or into a new post. It proved to have a number of disadvantages, however, which is why many web developers are using a CSS-only method.

css rollover image

How to create a rollover image using CSS

Here is how to implement a rollover image using CSS. Before getting started, we need to have two images ready, one in its initial/static state as well as its rollover state.

The Image

Place both the static and rollover image in one file and make sure that the rollover image is placed on top of the static one. To achieve the rollover effect, we'll write a code to display the static image and crop the hover image, so that only one image state is displayed at a time.

For this tutorial, we'll use the following as a CSS rollover image.

html rollover image

Creating an HTML Anchor Element for our Image

Instead of adding the image file in a <img> tag, we'll display it as a background image of an </a> (anchor) tag. Here's the HTML that we need to add:
<a class="rolloverimage" href="#URL">Rollover Image</a>
Note: if you want to make the image clickable, replace #URL with the url of the webpage where you want the link to point to.

Using CSS to Set a Background Image

To create the mouseover image effect, we'll use the :hover CSS pseudo-class. Then, we'll use the background-position property and set the values to 0 0 to move the background image to the upper left corner which will create the rollover effect.
<style type="text/css">
.rolloverimage{
display: block;
width: 56px;
height: 90px;
background: url('https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilJu0oTWrof9hrAqEvAzlZr2FCuKTU5pZ8nXZ1jtphlkjDNNgaBXT6LuZsBWvgkEw_Xc1cdeguVYAfOhaeFg4kKEA9RcMGdv0aY0s_MAknSrtYaQ-z3bU7auD2CEhzh07c0gk7MeW8iRaC/s180/rollover-image-light-bulb-on-off.png') bottom;
text-indent: -99999px;
}
.rolloverimage:hover{
background-position: 0 0;
}
</style>
Note: Replace the text in blue with the url of your image file. Please pay attention on the width and height values marked in red, these should be different depending on your file, where the height value is for only one image and not the entire image file!

The result

Hover your mouse cursor over the light bulb to see the rollover image effect in action:

Rollover Image

Adding Rollover Image to Blogger

To add the rollover image as a gadget: copy both the HTML/CSS codes and go to 'Layout', click on the 'Add a Gadget' link > select HTML/JavaScript, then paste the codes in the 'Content' box.

Or, if you want to add it inside one of your posts, when you create a New Post, switch to the 'HTML' tab and paste the codes inside the empty box.

And this is how you make images swap on mouseover using CSS. Enjoy!

Thứ Hai, 10 tháng 10, 2016

Google Color Converter

Google has a special card that's both a color picker and a color converter. For example, you can search for HEX color codes like #123456 and Google shows the color and converts it to other formats: RGB, HSV, HSL, CMYK.  Google's card also shows up when you search for RGB values like rgb(255,0,255). The most interesting feature of the card lets you pick a color interactively.


Other queries that trigger Google's card: RGB to HEX, color picker.

This is not a new feature, but it's worth pointing out that Chrome has its own color picker and converter in the developer tools. Click a color in the styles tab to open the color picker and shift-click a color to convert it to a different format.


{ via Android Police }