Lunar Eclipse: Clear Skies for Sunday’s Total Eclipse
This HTML code snippet represents a set of social sharing and utility links for a webpage, likely an article on the Czech Radio website (irozhlas.cz). Let’s break down what each part does:
Overall Structure:
: This is the main container for all the social sharing links.The class
Each link contains:
Accessibility (
JavaScript (
URL Shortening: the copy URL link uses a shortened URL provided by
m-socials likely applies specific styling to this section. Each social network (Facebook, Twitter, LinkedIn, Print, Copy URL) is represented by an (anchor) tag, creating a clickable link.Each link contains:
: This span contains text that is visually hidden (using CSS, likely display: none; or visibility: hidden;). This is for accessibility – screen readers will read this text to users, describing the link’s purpose.: This span holds the SVG icon for the respective social network. The classes icon-svg and icon-svg--[network] are used for styling and identifying the specific icon.: This is the SVG (Scalable Vector Graphics) element that actually displays the icon.: This is the key part.It’s an SVG element that references an icon defined in an external SVG file: http://www.irozhlas.cz/sites/all/themes/custom/irozhlas/img/bg/icons-svg.svg?v2. The xlink:href attribute points to a specific icon within that SVG file, identified by a fragment identifier (e.g., #icon-facebook). This is a very efficient way to use icons – the same SVG file is used for all icons, reducing file size and improving performance.Specific Links:
- Facebook:
href: Links to Facebook’s sharing dialog, pre-populated with the article URL.#icon-facebook: References the Facebook icon within the SVG file.
- Twitter:
href: Links to Twitter’s web intent to tweet, pre-populated with the article URL.#icon-twitter: References the Twitter icon.
- LinkedIn:
href: Links to LinkedIn’s share article dialog, pre-populated with the article URL. #icon-linkedin: References the linkedin icon.
- Print:
href: # (a placeholder link). This link likely triggers a javascript function (indicated by js-print) to open the browser’s print dialog.#icon-printer: References the printer icon.
- Copy URL:
href: # (a placeholder link). This link likely triggers a JavaScript function (indicated by js-clipboard) to copy the article URL to the clipboard. The data-url attribute contains the shortened URL.#icon-url: References the URL/link icon.
Key Technologies & Concepts:
SVG (scalable Vector Graphics): A vector image format that’s ideal for icons because they scale well without losing quality. element: A powerful SVG element that allows you to reuse parts of an SVG file. This is very efficient for icons.xlink:href: An attribute used with the element to specify the source SVG file and the specific element within that file to reuse.Accessibility (
vhide class): Providing text alternatives for icons is crucial for users with screen readers.JavaScript (
js-print, js-clipboard): these classes indicate that JavaScript is used to handle the print and copy URL functionality.URL Shortening: the copy URL link uses a shortened URL provided by
cro_yourls.
*this code
