Some websites, such as Google Docs, employ a single image file divided into sprites in order to show all the icons on the UI.
Here's an example: https://ssl.gstatic.com/docs/documents/share/images/sprite-24.svg
The image is used as background and translated to only show the wanted icon.
I'm looking to gain some knowledge on why this pattern is used. Are there any advantages, for example from a performance standpoint?
Just by looking at it, I can see how it'd make it more tedious for example to change an icon, requiring a change of the whole image. Also, positioning the icons correctly across devices looks like a pain.
Why would an app developer choose to use this pattern to display icons on a UI?
I'm using a slideshow on my website, basic functions...left and right buttons.
For some of the images, it would be nice to have an additional viewing option, where there would be mini images to the right of the main slide show image, and if you click on an individual image, it would replace the main image with that.
My reasoning is, this is an art website, and for some works it would be nice to view it from a different angle.
Does anyone know any good examples of something like this?
For reference, this is what I'm more or less using at the moment: http://www.w3schools.com/w3css/tryit.asp?filename=tryw3css_slideshow_self
Thank you for any help.
I have replaced a header logo image which was just text in an arc on the following website: Leeds Magic Circle
Disclaimer: I did not design or create this website I am just performing some small modifications to it.
The original image said "1919 - 2015" and needed updating, hence I chose SVG to replace it with a bit of javascript to update the date portion.
It looks good, however it doesn't scale down when the browser is reduced or viewed on a mobile device.
I need the SVG to fit the 800x116 which replaced the original image, but I need it to scale down too.
I am very new to playing with SVG and the answers on the web are somewhat confusing so hopefully someone here can help.
Also open to alternative methods to achieve this goal.
Thank you
I was browsing different websites for some images that I'd like to use for links. One, for example, is a Twitter image.
Normally you can hover over an image and press "control + click" to save as.
But on this particular website, the images are icons and don't allow me to grab them.
Here is a screen of select element which the image I want highlighted, and the html and css that goes with it.
How would I grab this icon? The icons are on this website: https://uchaguzi.co.ke/
If you want to convert Font Awesome icons to png, you may use this software:
https://github.com/odyniec/font-awesome-to-png
however... if fontawesome fits your needs (it has a huge collection of really well-designed icons), I warmly suggest you to use the web font as explained here: http://fortawesome.github.io/Font-Awesome/get-started/
Assuming there is no og:image or link rel img_source, does anyone have any real-world experience or advice on better-than-random techniques to choose an image that best represents a web page?
Update: All answers are good, so upvoted them all and selected one, although it seems there is no great way of doing this. I will experiment with largest picture and screenshot of what it would like on a low-res client. Thanks all!
PS: I'm finding that quite a few pages seem to have og:image or link rel img_source anyway. More than I expected
Taking a screenshot of the website in its smallest possible form, how it would look on a notebook laptop or even a mobile (but not the mobile site version), would be a non-random approach.
Most good web designers will try to make sure users are able to see what the page is about immediately upon loading and include the most important and relevant information 'above the fold' as they say.
Choose the logo of your page as the og:image. That way your brand becomes associated with all your posts, without having to worry about what image best defines each individual page.
For other pages, you cannot control what image they have.
You could investigate how sharer.php works but other than that there is no silver bullet as to choose which image for a web page that has no definable image.
I don't have any experience with Facebook opengraph, but one trick I've used before is to grab favicons of sites I've linked to and use them as link button icons... They're small and are usually always associated with the company name and/or logo, and they're pretty universal across most professional websites. And the usually univeral filename favicon.ico makes it really easy to pick out of the html (or the link attributes if they change the filename).
Might give that a shot if that could be adapted into what you are trying to do. If you find that doesn't look too good, you can try a more "web 2.0" take and check for iPhone/iPad button apple-touch-icon png images (probably only find them on big name sites though)http://developer.apple.com/library/ios/#DOCUMENTATION/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
I would normally suggest that you simply scrape the page of img tags. However, these days, CSS background images are frequently applied to h1/header/div/a/etc. tags to display logos in place of text.
One possible solution is to grab all elements with 'logo' in their ID/class name:
var l = $('[id*="logo"],[id*="Logo"],[class*="logo"],[class*="Logo"]');
If this is/contains an img tag, chances are you have the site's logo. Otherwise, if it's a div or other such container, you'll need to dig into the child elements' CSS properties to see if they have a background image.
From this you can build a set of candidate images, which when combined with a heuristic based on (for example) image dimensions, should hopefully spit out a logo every time.
I hope this helps you on your way!
Going for the logo is usually the wrong way. Seeing it from a user of your website's point of view I would rather want no image than a logo all the time. This is the same as in Google+ or Facebook links. Only show images when it really does make sense.
However finding the corresponding image may not always be trivial if there is no og:image or rel="image_source" provided.
An article usually has a title which is presented as <h1> or <h2> tag. The nearest image may be the right one. However the nearest may also be a logo so this can go wrong.
I would do that very pragmatic. I would fetch the most likely image first and read the given EXIF data, if this is a real image there are informations provided. If this is just a logo, spacer or some other kind of layout graphic it does not have EXIF data and therefore is not relevant. If the first picture is not the right tough, I would fetch the next one and so on.
Another clue may be the HTML5 <article> tag which usually has the corresponding image to the post nested.
Nevertheless there are several web designer not using standards and their webpage may not be parable nicely.