It is necessary to impose a similar block:

enter image description here

I understand that SVG is required here, but so far these elements have quickly flipped into the forehead (the elements start with "Dry mixes" and clockwise):

div.data { height: 720px; padding-top: 90px; box-sizing: border-box; position: relative; } ul { width: 550px; height: 530px; margin: 0 auto; position: relative; } ul li { position: absolute; z-index: 1; } ul li:hover { z-index: 2; } ul li a { width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; text-align: center; position: absolute; top: 0; left: 0; z-index: 1; } ul li a::before { content: ""; width: 100%; height: 100%; background: url("/images/bg/bg-about-item.png") no-repeat center center; transition: background 0.3s; position: absolute; top: 0; left: 0; z-index: 1; } ul li a:hover::before { background: url("/images/bg/bg-about-item-hover.png") no-repeat center center; } ul li a span { font-size: 16px; color: #fff; position: relative; z-index: 2; } ul li:nth-child(1) { top: 0; right: 92px; } ul li:nth-child(2) { top: 157px; right: 0; } ul li:nth-child(3) { bottom: 7px; right: 92px; } ul li:nth-child(4) { bottom: 7px; left: 94px; } ul li:nth-child(5) { top: 155px; left: 4px; } ul li:nth-child(6) { top: 0; left: 94px; } 
 <div class="data"> <ul> <li> <img src="/images/content/cat01.png" alt="" /> <a href="#!"> <span>Сухие строительные смеси</span> </a> </li> <li> <img src="/images/content/cat02.png" alt="" /> <a href="#!"> <span>Тротуарная плитка из бетона</span> </a> </li> <li> <img src="/images/content/cat03.png" alt="" /> <a href="#!"> <span>Тротуарная плитка из резины</span> </a> </li> <li> <img src="/images/content/cat04.png" alt="" /> <a href="#!"> <span>Металлоконструкции</span> </a> </li> <li> <img src="/images/content/cat05.png" alt="" /> <a href="#!"> <span>Облицовочный кирпич</span> </a> </li> <li> <img src="/images/content/cat06.png" alt="" /> <a href="#!"> <span>Теплоблок</span> </a> </li> </ul> </div> 

It makes no sense to run, there are no pictures) But if necessary, I will add.

Each block now on the outer layer has a blackout effect in the form of a translucent png-picture, which changes when you hover on a translucent yellow.

And now the actual questions are: how to impose on the SVG with the filling of each figure with a picture and text (no static, everything changes through the admin area), whether the pseudo-element ::before will work for such figures (in theory it should), and also separate the image in the center element (now there is a logo that is absolute relative to the parent, I don’t show it, for customers)?

PS I don’t draw SVG myself ((I tried to copy examples, but I don’t understand how to manage the coordinates of the points, there’s no grid in my head, and how to push the text there, even more so.

PSS You can just kick in the right direction, for example, how to draw 6-squares for given size of the sidebox.

PSSS I would be glad if Alexandr_TT looked in at the question;)

  • Today, it’s too late, but I don’t want to give an answer in a hurry. Let's go tomorrow. It would be nice to get copyrighted pictures to be one to one. For a good question plus! - Alexandr_TT
  • Forgot to add! In these cells also links should be. - DaemonHK
  • @Alexandr_TT and any pictures, the main thing is that the square ones crawl out of the hexagonal contour, which, in essence, will “push” them through itself. - DaemonHK

2 answers 2

We work in any vector editor, I use Inkscape. I don’t show the drawing process, but I’ll explain that in the editor you need to choose a diamond shape that will be filled with white fill: white; or on hex: fill: #fff and we will duplicate ... We will do clipping masks in SVG, this is the clip-path so as not to produce a bunch of pattern ..

1) We draw a rhombus

enter image description here

2) fill it with white

3) import the image one by one

4) and make a clipping path

enter image description here

5) we do this with all the images and arrange them in the right way.

6) we draw the same rhombuses again and put them above if suddenly they move downwards when moving, we will use this shortcut

enter image description here

Next, we save as Обычный SVG and open it in our favorite text editor, I will use Notepad ++ and assign it to all recurring class elements and remove the unnecessary, for example image have id and create a style in defs and write those styles that are duplicated ...

Duplicate rhombuses with the already created class we give the usual css properties, ie opacity and with hover we show and change the necessary styles in css

At the output we have SVG which is less than the original

 <svg version="1.1" viewBox="0 0 1400 1200" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> <defs> <clipPath id="clipPath1088"> <path d="m-173 116 2-116 101-56 99 60-2 116-101 56z" style="fill:#5599ff;stroke-width:.8;stroke:#000000"/> </clipPath> <clipPath id="clipPath1105"> <path d="m-393 212 2-116 101-56 99 60-2 116-101 56z" style="fill:#ffffff;stroke-width:.8;stroke:#000000"/> </clipPath> <clipPath id="clipPath1137"> <path d="m-523 154 2-116 101-56 99 60-2 116-101 56z" style="fill:#f9f9f9;stroke-width:.8;stroke:#000000"/> </clipPath> <clipPath id="clipPath1154"> <path d="m-687 161 2-116 101-56 99 60-2 116-101 56z" style="fill:#000000;stroke-width:.8;stroke:#000000"/> </clipPath> <clipPath id="clipPath1175"> <path d="m-658 254 2-116 101-56 99 60-2 116-101 56z" style="fill:#000000;stroke-width:.8;stroke:#000000"/> </clipPath> <clipPath id="clipPath1192"> <path d="m-966 116 2-116 101-56 99 60-2 116-101 56z" style="fill:#000000;stroke-width:.8;stroke:#000000"/> </clipPath> <style> .g{ opacity:0; transition:0.34s; } .g:hover{ opacity:1; } .diamont{ fill:#00ffff; stroke-width:1px; stroke:#000000; } .image{ image-rendering:optimizeQuality; } .path{ fill:#000000; stroke-width:1; stroke:#000000 } text{ fill:#fff; font-family:sans-serif; font-size:25px; stroke-width:.3; } .parent{ transform:translateY(10px)translateX(2px); } </style> </defs> <g transform="translate(435 178)"> <image class="image" transform="translate(42 -119)" x="-223" y="-63" width="318" height="270" clip-path="url(#clipPath1088)" preserveAspectRatio="none" xlink:href="https://i.stack.imgur.com/2cSY6.jpg"/> <image class="image" transform="translate(55 129)" x="-414" y="31" width="334" height="267" clip-path="url(#clipPath1105)" preserveAspectRatio="none" xlink:href="https://i.stack.imgur.com/v3tjh.jpg"/> <image class="image" transform="translate(386 191)" x="-542" y="-31" width="397" height="265" clip-path="url(#clipPath1137)" preserveAspectRatio="none" xlink:href="https://i.stack.imgur.com/aork7.jpg"/> <image class="image" transform="translate(355 -168)" x="-692" y="-8" width="213" height="231" clip-path="url(#clipPath1154)" preserveAspectRatio="none" xlink:href="https://i.stack.imgur.com/3dFKn.jpg"/> <image class="image" transform="translate(223 -88)" x="-654" y="81" width="324" height="235" clip-path="url(#clipPath1175)" preserveAspectRatio="none" xlink:href="https://i.stack.imgur.com/FwmVV.jpg"/> <image class="image" transform="translate(932 57)" x="-974" y="-62" width="418" height="252" clip-path="url(#clipPath1192)" preserveAspectRatio="none" xlink:href="https://i.stack.imgur.com/F4Wb3.jpg"/> <g class="parent"> <g class="g" transform="translate(-2 -9)"> <path class="diamont" d="m-331-6 2-116 101-56 99 60-2 116-101 56z" /> <a xlink:href=""><text x="-278.10455" y="-50.342541">текст 1</text></a> </g> <g class="g" transform="translate(-2 -9)"> <path class="diamont" d="m-131-3 2-116 101-56 99 60-2 116-101 56z"/> <a xlink:href=""><text x="-84.960121" y="-50.342541" >текст 2</text></a> </g> <g class="g" transform="translate(-2 -9)"> <path class="diamont" d="m-34 173 2-116 101-56 99 60-2 116-101 56z" /> <a xlink:href=""><text x="13.313688" y="131.08603">текст 3</text></a> </g> <g class="g" transform="translate(-2 -9)"> <path class="diamont" d="m-138 345 2-116 101-56 99 60-2 116-101 56z" /> <a xlink:href=""><text x="-91.007744" y="303.44318" >текст 4</text></a> </g> <g class="g" transform="translate(-2 -9)"> <path class="diamont" d="m-338 341 2-116 101-56 99 60-2 116-101 56z" /> <a xlink:href=""><text x="-286.04346" y="306.46698">текст 5</text></a> </g> <g class="g" transform="translate(-2 -9)"> <path class="diamont" d="m-435 165 2-116 101-56 99 60-2 116-101 56z" /> <a xlink:href=""><text x="-383.41162" y="113.32209">текст 6</text></a> </g> </g> </g> </svg> 

  • @DaemonHK good, good answer (+) For more details, see the chat - Alexandr_TT
  • Thank you so much for such a detailed answer and food for thought ) - DaemonHK
  • and yet it’s not diamonds =) - Stranger in the Q
  • @StrangerintheQ well yes ... these are not diamonds ... these are hexagons .. - MaximLensky

Here, built on d3.js

 <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.7.0/d3.min.js"></script> <script src="https://d3js.org/d3-hexbin.v0.2.min.js"></script> <svg width=300 height=300></svg> <script> var size = 250, r = 40, k = 1.9; var images = [ 'https://i.stack.imgur.com/y7GyM.jpg', 'https://i.stack.imgur.com/gW9Md.png', 'https://i.stack.imgur.com/gFeUb.png', 'https://i.stack.imgur.com/J7hw3.png', 'https://i.stack.imgur.com/vqZZR.png', 'https://i.stack.imgur.com/HWKHf.png' ]; var hexbin = d3.hexbin(); var svg = d3.select('svg') .attr('viewBox', `${-size/2} ${-size/2} ${size} ${size}`); svg.append('defs') .selectAll("path") .data(images) .enter() .append('pattern') .attr('width', 100) .attr('height', 100) .attr('id', (d, i) => `img${i}`) .append('image') .attr('width', 100) .attr('height', 100) .attr('xlink:xlink:href', d => d) svg.selectAll("path") .data(coords(images)) .enter() .append("path") .attr("stroke", 'black') .attr("fill", (d, i) => `url(#img${i})`) .attr("transform", d => `translate(${d[0]*r*k}, ${d[1]*r*k})`) .attr("d", hexbin.hexagon(r)); function coords(arr) { return arr.map((d, i) => i * Math.PI/3 + Math.PI/6) .map(i => [Math.sin(i), Math.cos(i)]) } </script> 

  • 2
    everywhere you have time! :) (+) - Alexandr_TT
  • Thanks for the answer) But, I'm afraid, the libraries will not work ( - DaemonHK
  • @StrangerintheQ I'm talking about js in general) the company's policy is - DaemonHK
  • @DaemonHK But what is the question then how to draw 6 hexagons? stackoverflow is an all-programming resource .. - Stranger in the Q
  • @StrangerintheQ well, not only) - DaemonHK