Click through transparent image pixel

亡梦爱人 提交于 2020-05-11 00:57:31

问题


I don't want the transparent part of the images to be clickable.
I found <map> but the coordinates are in pixels and I want to do something responsive. Another problem: I can't find why there is some pixels between the bottom of the first picture and the top of the second picture.

https://jsfiddle.net/tsfxy84u/

.container {
  width: 90%;
  margin: 0 auto;
  overflow: auto;
}
.left {
  float: left;
}
.right {
  float: right;
}
.resize {
  width: 50%;
}
img {
  width: 50%;
}
.two {
  -webkit-clip-path: polygon(20% 0, 100% 0%, 100% 100%, 0% 100%);
  clip-path: polygon(20% 0, 100% 0%, 100% 100%, 0% 100%);
}
.one {
  -webkit-clip-path: polygon(0 0, 100% 0, 80% 100%, 0% 100%);
  clip-path: polygon(0 0, 100% 0, 80% 100%, 0% 100%);
}
<section class="container">
  <a class="two" href="#"><img src="_img/test.png" alt="image test" /></a>
  <div class="resize left">
    <h1>Mama mia</h1>
    <p>blabla</p>
  </div>
</section>
<section class="container">
  <div class="resize right">
    <h1>Mama mia</h1>
    <p>blabla</p>
  </div>
  <a class="one" href="#"><img src="_img/test.png" alt="image test" /></a>
</section>

Thanks a lot for your help.


回答1:


Think out of the box:

  1. If at the click coordinates the pixel Alpha channel is transparent (0) - temporarily hide that image, and get the next elementFromPoint(x, y) ← REPEAT •1
  2. If Alpha is not transparent - get that image data and show all temporarily hidden images.
  3. If Target is not IMG - show all hidden images (no visible image pixel was clicked)

PS: instead of Element.hidden we could use CSS's pointer-events: "[none, auto]"

const ctx = document.createElement("canvas").getContext("2d");
let stack = [];

function transPNG(ev, target) {
  if(!target.offsetParent) return;

  // Get click coordinates
  const isImage = /img/i.test(target.tagName),
    x = ev.pageX - target.offsetParent.offsetLeft,
    y = ev.pageY - target.offsetParent.offsetTop,
    w = ctx.canvas.width = target.width,
    h = ctx.canvas.height = target.height;
  let alpha;

  // Draw image to canvas and read Alpha channel value
  if (isImage) {
    ctx.drawImage(target, 0, 0, w, h);
    alpha = ctx.getImageData(x, y, 1, 1).data[3]; // [0]R [1]G [2]B [3]A
  }

  if (alpha === 0) {          // If pixel is transparent...
    target.hidden = 1         // Make image hidden
    stack.push(target);       // Remember
    return transPNG(ev, document.elementFromPoint(ev.clientX, ev.clientY)); // REPEAT
  } else {                    // Not transparent! We found our image!
    stack.forEach(el => (el.hidden = 0)); // Show all hidden elements
    stack = [];               // Reset stack
    console.clear(); console.log(target.getAttribute("alt"));
    // document.location = target.dataset.href; // if you want to navigate to HREF
  }
}

const pngs = document.querySelectorAll("#composite img");
pngs.forEach(img =>img.addEventListener("click", ev => transPNG(ev, ev.currentTarget)));
#composite { position: relative; width: 60px; height: 60px;}
#composite img { position: absolute; top: 0; }
Three overlapping PNG images. Click to explore:<br>
<div id="composite">
  <img alt="Red paint" data-href="page3.html" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS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2fXavofpTTpvyhqeHRpwXjM0tlKmIkqK7oIfmm+xv77/WcbXiHuE7hod8KCIksDpAkH/ZDbFYrZB0IuvY1h48Js0eAdKo14tgdnXpnG8rGTYiEbg0F+l/rWZRm3mBbF86zIHw8V/3heik3lOXF1kXXbnMR7AQFQjFTW64sVpHL4rUObpT97fb65Um2w1dD5yd7pxM9X9V9u2OEhL+QOkMzfUm8X2VJbAeOMwXbXMT97Arw8DCFnYL3cJLZoI6ZV5vXK2nO2YZ1jZeF8fCh3ch/HrizoIZbYaIIaiRF2w+NHXpfKMDIW0YBdkBidZ5lTUU9FIsBzf8I3tTz/2spfKBLRH7Go2Vok2F+lBYvIZNbhGBVn7sJ6OTs+MuAuLaC6MoUDO/qR2zTwx688P/U5EsvdG0ijtokMffh9Pjq8/NWb7iYE1/EWLr5drq5V3aImyTZ8ywjMmnNG5oMjDWv+5PyqfjSVyXGyFv9SbXl589hwNro9YX2I2/KNpVgd8+0VAgEJ/z89/p8AAwDgqbEQ6RqAXQAAAABJRU5ErkJggg=="/>
</div>

The above demo only works for 1:1 untransformed (using CSS object-fit, browser-resized, etc.) images. If that's your case than you should consider to improve the logic for painting the exact image size/position onto the canvas.




回答2:


HTML treats every element as a box that is made up of several layers (see Box Model).

This means any embedded image to an HTML page will be wrapped within a box (square). Therefore, when we wrap an image tag <img> with a link tag <a>, the entire image-box will be treated as a link (clickable).

As you mentioned, one way to change this default behavior is by using <map> element. But, this is not very "flexible" and not always the best solution for our case. For example, an image could be shaped with an irregular shape that makes it herder to define a precise map for it.

However, the solution for this problem is to design or use images under .svg image file format.

Scalable Vector Graphics (SVG) format is supported by HTML 5 and has its own HTML tag <svg>. This format is, in fact, used a lot in interactive web development. The key to SVG, in simple terms, is that SVG groups the different shapes within an image in a vector form inside the <svg> tag.

After we have our .svg image that we want to make clickable exactly where there is actually an image, we can follow the simple steps below (there are other ways to do it):

  • Open your .svg image with a text editor.
  • Copy the <svg> tag and all its nested elements.
  • Paste the <svg> tag into the HTML document's body.
  • Add the <a> tag inside the inner-most nested <g> tag.

DONE!

You should have a "perfectly" clickable image as you desired. For JSFiddle playground, click here.

Here is a quick snippet:

<body>

  <!-- The SVG tag below was copied exactly as is from our .svg file -->
  <!-- Then added the <a> tag inside the inner-most nested <g> tag -->
  <svg version="1.0" xmlns="http://www.w3.org/2000/svg" width="300.000000pt" height="300.000000pt" viewBox="0 0 300.000000 300.000000" preserveAspectRatio="xMidYMid meet">
    <g transform="translate(0.000000,300.000000) scale(0.050000,-0.050000)" fill="#000000" stroke="none">
      <!-- The <a> tag we've added -->
      <a href="https://mojly.com/wp-content/uploads/2017/10/hilarious-animal-pics-01-animals-with-human-teeth.jpg">
        <path d="M4390 5952 c-113 -53 -289 -221 -427 -409 -84 -114 -98 -125 -153
-117 -171 27 -523 -80 -714 -217 l-98 -71 -97 71 c-186 137 -427 215 -661 215
l-115 0 -91 123 c-228 310 -551 543 -524 378 5 -30 19 -167 31 -305 12 -137
30 -281 40 -318 17 -66 13 -74 -119 -213 -336 -354 -415 -830 -210 -1265 l50
-106 -38 -104 c-235 -632 -120 -1587 226 -1874 64 -53 11 -59 -607 -64 l-636
-6 -79 -55 c-242 -167 -208 -515 61 -637 75 -34 153 -37 1058 -38 l977 0 -13
-75 c-25 -132 -109 -254 -295 -425 -213 -197 -351 -454 -221 -414 553 173 689
197 799 139 298 -158 287 -155 466 -155 179 0 168 -3 466 155 110 58 246 34
799 -139 130 -40 -8 217 -221 414 -186 171 -270 293 -295 425 l-13 75 977 0
c905 1 983 4 1058 38 269 122 303 470 61 637 l-79 55 -636 6 c-618 5 -671 11
-607 64 346 287 461 1244 225 1877 l-39 107 51 103 c208 416 127 909 -208
1262 -135 141 -136 144 -120 222 10 43 27 178 39 299 13 121 27 258 32 305 5
47 7 85 5 85 -3 0 -50 -22 -105 -48z m-1960 -899 c250 -67 549 -348 550 -518
0 -19 9 -35 20 -35 11 0 20 16 20 35 1 170 300 451 550 518 734 196 1249 -740
706 -1280 -233 -231 -581 -286 -874 -138 -71 36 -130 63 -132 60 -2 -3 -61
-115 -132 -250 -70 -135 -132 -245 -138 -245 -6 0 -68 110 -138 245 -71 135
-130 247 -132 250 -2 3 -61 -24 -132 -60 -297 -151 -682 -79 -905 167 -500
553 23 1441 737 1251z m-55 -3239 c25 -23 45 -55 45 -72 0 -19 25 -1 61 43 78
95 190 105 270 26 47 -47 49 -60 49 -311 0 -251 -2 -264 -49 -311 -80 -79
-192 -69 -270 26 -40 49 -61 63 -61 41 0 -104 -198 -150 -294 -68 l-56 49 0
260 c0 246 3 262 47 310 75 79 175 82 258 7z m1146 -31 c36 -44 59 -60 59 -41
0 114 205 162 298 70 51 -52 52 -59 52 -314 l0 -261 -56 -49 c-93 -80 -294
-37 -294 63 0 16 -9 29 -20 29 -11 0 -20 -11 -20 -24 0 -108 -203 -155 -291
-67 -54 55 -75 504 -27 594 57 108 210 108 299 0z" />
        <path d="M2090 4647 c-352 -186 -235 -697 160 -697 391 0 514 514 166 692 -91
46 -243 48 -326 5z" />
        <path d="M3590 4647 c-352 -186 -235 -697 160 -697 391 0 514 514 166 692 -91
46 -243 48 -326 5z" />
      </a>
    </g>
  </svg>
</body>

More SVG Examples (Here is a good one)



来源:https://stackoverflow.com/questions/31909577/click-through-transparent-image-pixel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!