• About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us
AimactGrow
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing
No Result
View All Result
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing
No Result
View All Result
AimactGrow
No Result
View All Result

Revisiting Picture Maps | CSS-Methods

Admin by Admin
May 4, 2025
Home Coding
Share on FacebookShare on Twitter


I discussed final time that I’ve been engaged on a brand new web site for Emmy-award-winning recreation composer Mike Value. He employed me to create a extremely graphical design that showcases his work.

Mike loves ’90s animation, notably Disney’s Duck Tales and different animated sequence. He challenged me to discover a option to incorporate their retro ’90s fashion into his design with out making it a pastiche. However that wasn’t my solely problem. I additionally wanted to attain that ’90s really feel through the use of up-to-the-minute code to keep up accessibility, efficiency, responsiveness, and semantics.

Design by Andy Clarke, Stuff & Nonsense. Mike Worth’s website will launch in April 2025, but you can see examples from this article on CodePen.

Designing for Mike was like a visit again to when mainstream web site design appeared extra spontaneous and fewer ruled by conventions and finest practices. Some individuals describe these designs as “whimsical”:

adjective

  1. spontaneously fanciful or playful
  2. given to whims; capricious
  3. quaint, uncommon, or unbelievable

— Collins English Dictionary

However I’m not so certain that’s fully correct. “Playful?” Positively. “Fanciful?” Probably. However “unbelievable?” That relies upon. “Whimsy” sounds superfluous, so I name it “expressive” as a substitute.

Finding out design from manner again, I remembered how web sites typically included graphics that mixed branding, content material, and navigation. Just about each reference to internet design within the ’90s — after I designed my first web site — talks about Warner Brothers’ Area Jam from 1996.

Space Jam website homepage. The movie logo is in the center of a series of planets that are navigation for other areas of the website against a dark starry background.
Warner Brothers’ Area Jam (1996)

So, I’m not going to try this.

Manufacturers like Nintendo used their house pages to direct individuals to their content material whereas making branded visible statements. Cheestrings mixed graphics with navigation, making me marvel why we don’t see designs like this immediately. Goosebumps typified this strategy, combining cartoon illustrations with brightly coloured shapes right into a purposeful and visually wealthy banner, proving that being helpful doesn’t imply being boring.

Left to proper: Nintendo, Cheestrings, Goosebumps.

Within the ’90s, after I developed graphics for web sites like these, I both sliced them up and put their elements in tables or used principally forgotten picture maps.

A quick overview of properties and values

Let’s run by way of a fast refresher. Picture maps date all the best way again to HTML 3.2, the place, first, server-side maps after which client-side maps outlined clickable areas over a picture utilizing map and space parts. They had been well-liked for graphics, maps, and navigation, however their use declined with the rise of CSS, SVG, and JavaScript.

provides clickable areas to a bitmap or vector picture.


  ...

That

is linked to a picture utilizing the usemap attribute:

These parts can have separate href and alt attributes and will be enhanced with ARIA to enhance accessibility:


  
  ...

The form attribute specifies an space’s form. It may be a primitive circle or rect or a polygon outlined by a set of absolute x and y coordinates:



Regardless of their age, picture maps nonetheless provide loads of advantages. They’re light-weight and wish (virtually) no JavaScript. Extra on that in only a minute. They’re accessible and semantic when used with alt, ARIA, and title attributes. Regardless of being from a distinct period, even fashionable cell browsers help picture maps.

A large illustrated map of a cartoon island.
Design by Andy Clarke, Stuff & Nonsense. Mike Value’s web site will launch in April 2025, however you may see examples from this text on CodePen.

My design for Mike Value contains a number of graphic navigation parts, which made me marvel if picture maps may nonetheless be an applicable answer.

Picture maps in motion

Mike needs his web site to showcase his previous work and the initiatives he’d love to do. To make this facet of his design discoverable and enjoyable, I created a map for individuals to discover by urgent on areas of the map to open modals. This map accommodates numbered circles, and urgent one pops up its modal.

A large illustrated cartoon map of an island. 6 annotations are on the map and a tooltip is exposed showing detail of one of the annotations.

My first thought was to embed anchors into the exterior map SVG:

Projects


  ...
  
    
    
  

This strategy is problematic. These anchors are solely lively when SVG is inline and don’t work with an ingredient. However picture maps work completely, although specifying their coordinates will be laborious. Luckily, loads of instruments can be found, which make defining coordinates much less tedious. Add a picture, select form varieties, draw the shapes, and replica the markup:




  
  
  ...

Picture maps work effectively when photographs are fastened sizes, however versatile photographs current an issue as a result of map coordinates are absolute, not relative to a picture’s dimensions. Making picture maps responsive wants just a little JavaScript to recalculate these coordinates when the picture modifications measurement:

operate resizeMap() {
  const picture = doc.getElementById("initiatives");
  const map = doc.querySelector("map[name="projects-map"]");
  
  if (!picture || !map || !picture.naturalWidth) return;
  
  const scale = picture.clientWidth / picture.naturalWidth;
  map.querySelectorAll("space").forEach(space => {
  
    if (!space.dataset.originalCoords) {
      space.dataset.originalCoords = space.getAttribute("coords");
    }

    const scaledCoords = space.dataset.originalCoords
    
    .break up(",")
    .map(coord => Math.spherical(coord * scale))
    .be part of(",");
    space.setAttribute("coords", scaledCoords);
  });
}

["load", "resize"].forEach(occasion =>
  window.addEventListener(occasion, resizeMap)
);

I nonetheless wasn’t pleased with this implementation as I needed somebody to have the ability to press on a lot bigger map areas, not simply the numbered circles.

Each has coordinates which outline the way it’s drawn, they usually’re relative to the SVG viewBox:


  

Alternatively, a map’s

coordinates are absolute to the top-left of a picture, so values should be transformed. Luckily, Raphael Monnerat has written PathToPoints, a software which does exactly that. Add an SVG, select the purpose frequency, copy the coordinates for every path, and add them to a map space’s coords:


  
  
  
  ...

Extra points with picture maps

Picture maps are hard-coded and time-consuming to create with out instruments. Even with instruments for producing picture maps, changing paths to factors, after which recalculating them utilizing JavaScript, they might be difficult to keep up at scale.

parts aren’t seen, and apart from a change within the cursor, they supply no visible suggestions when somebody hovers over or presses a hyperlink. Plus, there’s no simple manner so as to add animations or interplay results.

However the deal-breaker for me was that a picture map’s pixel-based values are unresponsive by default. So, what could be another answer for implementing my map utilizing CSS, HTML, and SVG?

A large illustrated map of a cartoon island cut out against a transparent background.

Anchors positioned completely over my map wouldn’t resolve the pixel-based positioning downside or give me the irregular-shaped clickable areas I needed. Anchors inside an exterior SVG wouldn’t work both.

However the answer was staring me within the face. I noticed I wanted to:

  1. Create a brand new SVG path for every clickable space.
  2. Make these paths invisible.
  3. Wrap every path inside an anchor.
  4. Place the anchors under different parts on the finish of my SVG supply.
  5. Substitute that exterior file with inline SVG.
The same illustrated map of an island but the six regions are represented by solid colors.

I created a set of six a lot bigger paths which outline the clickable areas, every with its personal fill to match its numbered circle. I positioned every anchor on the finish of my SVG supply:



  
  ...

  `
  `
    `
    `
    `
    ...
  

Then, I diminished these anchors’ opacity to 0 and added a brief transition to their full-opacity hover state:

#hyperlinks a {
  opacity: 0;
  transition: all .25s ease-in-out;
}

#hyperlinks a:hover {
  opacity: 1;
}

Whereas utilizing a picture map’s

sadly offers no visible suggestions, embedded anchors and their content material can reply to somebody’s motion, trace at what’s to come back, and add element and depth to a design.

The illustrated regions of the cartoon map in three states, from left to right: annotated, with visual markers, and with both visual markers and labels.

I’d add gloss to these numbered circles to be in keeping with the branding I’ve designed for Mike. Or, I might embody photographs, titles, or different content material to preview the pop-up modals:


  
    
    
  

Strive it for your self:

Expressive design, fashionable strategies

Designing Mike Value’s web site gave me an opportunity to mix expressive design with fashionable growth strategies, and revisiting picture maps jogged my memory simply how necessary a software picture maps had been through the interval Mike loves a lot.

In the end, picture maps weren’t the best software for Mike’s web site. However exploring them helped me perceive what I actually wanted: a option to recapture the expressiveness and persona of ’90s web site design utilizing fashionable strategies which are accessible, light-weight, responsive, and semantic. That’s what design’s about: choosing the proper software for a job, even when that generally means wanting again to maneuver ahead.


Biography: Andy Clarke

Also known as one of many pioneers of internet design, Andy Clarke has been instrumental in pushing the boundaries of internet design and is understood for his artistic and visually gorgeous designs. His work has impressed numerous designers to discover the total potential of product and web site design.

Andy’s written a number of industry-leading books, together with Transcending CSS, Hardboiled Net Design, and Artwork Route for the Net. He’s additionally labored with companies of all sizes and industries to attain their targets by way of design.

Go to Andy’s studio, Stuff & Nonsense, and take a look at his Contract Killer, the favored internet design contract template trusted by 1000’s of internet designers and builders.

Tags: CSSTricksimageMapsRevisiting
Admin

Admin

Next Post
Nintendo Responds To Followers’ Discontent With Nintendo Change 2

Nintendo Sues Peripheral Maker Genki Over Early Swap 2 Mockups

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended.

7 tricks to write good, high-quality content material • Yoast

7 tricks to write good, high-quality content material • Yoast

April 1, 2025
China hosts world’s first mechanical combined martial arts match

China hosts world’s first mechanical combined martial arts match

May 28, 2025

Trending.

Industrial-strength April Patch Tuesday covers 135 CVEs – Sophos Information

Industrial-strength April Patch Tuesday covers 135 CVEs – Sophos Information

April 10, 2025
Expedition 33 Guides, Codex, and Construct Planner

Expedition 33 Guides, Codex, and Construct Planner

April 26, 2025
How you can open the Antechamber and all lever places in Blue Prince

How you can open the Antechamber and all lever places in Blue Prince

April 14, 2025
Important SAP Exploit, AI-Powered Phishing, Main Breaches, New CVEs & Extra

Important SAP Exploit, AI-Powered Phishing, Main Breaches, New CVEs & Extra

April 28, 2025
Wormable AirPlay Flaws Allow Zero-Click on RCE on Apple Units by way of Public Wi-Fi

Wormable AirPlay Flaws Allow Zero-Click on RCE on Apple Units by way of Public Wi-Fi

May 5, 2025

AimactGrow

Welcome to AimactGrow, your ultimate source for all things technology! Our mission is to provide insightful, up-to-date content on the latest advancements in technology, coding, gaming, digital marketing, SEO, cybersecurity, and artificial intelligence (AI).

Categories

  • AI
  • Coding
  • Cybersecurity
  • Digital marketing
  • Gaming
  • SEO
  • Technology

Recent News

Borderlands 4 is a daring departure for the collection, however 2K could have carved off a few of its soul within the pursuit of killing cringe – preview

Borderlands 4 is a daring departure for the collection, however 2K could have carved off a few of its soul within the pursuit of killing cringe – preview

June 18, 2025
Coding a 3D Audio Visualizer with Three.js, GSAP & Internet Audio API

Coding a 3D Audio Visualizer with Three.js, GSAP & Internet Audio API

June 18, 2025
  • About Us
  • Privacy Policy
  • Disclaimer
  • Contact Us

© 2025 https://blog.aimactgrow.com/ - All Rights Reserved

No Result
View All Result
  • Home
  • Technology
  • AI
  • SEO
  • Coding
  • Gaming
  • Cybersecurity
  • Digital marketing

© 2025 https://blog.aimactgrow.com/ - All Rights Reserved