Hexagon Portfolio Code

HTML CODE:

				
					<div class="grid">
    <ul id="hexGrid">
      <li class="hex">
        <div class="hexIn">
          <a class="hexLink" href="https://diywebsitespro.com/elementor-pro-tutorials/">
            <div class='img' style='background-image:url(https://diywebsitespro.com/wp-content/uploads/2022/12/Hex-Image-5.jpg?ixlib=rb-0.3.5&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;w=1080&amp;fit=max&amp;s=faa4e192f33e0d6b7ce0e54f15140e42);'></div>
            <p id="demo2">sarah</p>
          </a>
        </div>
      </li>
        
      <li class="hex">
        <div class="hexIn">
          <a class="hexLink" href="https://diywebsitespro.com/rank-math-tutorials/">
                <div class='img' style='background-image: url(https://diywebsitespro.com/wp-content/uploads/2022/12/Hex-Image-4-e1670434591486.jpg?ixlib=rb-0.4.5&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;w=1080&amp;fit=max&amp;s=49dab7a5e4b2e28b5707bc2db974c94b);'></div>
            <p id="demo2">Steve</p>
          </a>
        </div>
      </li>
      <li class="hex">
        <div class="hexIn">
          <a class="hexLink" href="https://diywebsitespro.com/namehero-tutorials/">
            <div class='img' style='background-image: url(https://diywebsitespro.com/wp-content/uploads/2022/12/Hex-Image-3.jpg?ixlib=rb-0.3.5&amp;q=80&amp;fm=jpg&amp;crop=entropy&amp;w=1080&amp;fit=max&amp;s=d453ab3dec298c43415526458b360fa6);'></div>
            <p id="demo2">Hope</p>
          </a>
        </div>
      </li>
        <li class="hex">
        <div class="hexIn">
          <a class="hexLink" href="https://diywebsitespro.com/wordpress-tutorials/">
            <div class='img' style='background-image: url(https://diywebsitespro.com/wp-content/uploads/2022/12/Hex-Image-2-e1670435064611.jpg?crop=entropy&amp;fit=crop&amp;fm=jpg&amp;h=1375&amp;ixjsv=2.1.0&amp;ixlib=rb-0.3.5&amp;q=80&amp;w=1725);'></div>
            <p id="demo2">Simon</p>
          </a>
        </div>
      </li>
      <li class="hex">
        <div class="hexIn">
          <a class="hexLink" href="https://diywebsitespro.com/nordvpn-tutorials/">
            <div class='img' style='background-image: url(https://diywebsitespro.com/wp-content/uploads/2022/12/Hex-Image-1.jpg?crop=entropy&amp;fit=crop&amp;fm=jpg&amp;h=1375&amp;ixjsv=2.1.0&amp;ixlib=rb-0.3.5&amp;q=80&amp;w=1725);'></div>
            <p id="demo2">Simon</p>
          </a>
        </div>
      </li>
      <li class="hex">
        <div class="hexIn">
          <a class="hexLink" href="https://diywebsitespro.com/tutorials/">
            <div class='img' style='background-image: url(https://diywebsitespro.com/wp-content/uploads/2022/12/Hex-Image-6-e1670435031461.jpg?crop=entropy&amp;fit=crop&amp;fm=jpg&amp;h=1375&amp;ixjsv=2.1.0&amp;ixlib=rb-0.3.5&amp;q=80&amp;w=1725);'></div>
            <p id="demo2">Simon</p>
          </a>
        </div>
      </li>
    </ul>
      </div>
  </body>

				
			

CSS CODE:

				
					* {
    margin: 0;
    padding: 0;
}
body {
    background: rgb(4,19, 42);
}


#hexGrid {
  display: flex;
  flex-wrap: wrap;
  width: 90%;
  margin: 0 auto;
  overflow: visible;
  font-family: sans-serif;
  list-style-type: none;
}

.hex {
  position: relative;
  visibility:hidden;
  outline:1px solid transparent; 
  transition: all 0.5s;
  backface-visibility: hidden;
  will-change: transform;
  transition: all 0.5s;
}
.hex::after{
  content:'';
  display:block;
  padding-bottom: 86.602%;  
}
.hexIn{
  position: absolute;
  width:96%;
  padding-bottom: 110.851%; 
  margin: 2%;
  overflow: hidden;
  visibility: hidden;
  outline:1px solid transparent; 
  -webkit-transform: rotate3d(0,0,1,-60deg) skewY(30deg);
      -ms-transform: rotate3d(0,0,1,-60deg) skewY(30deg);
          transform: rotate3d(0,0,1,-60deg) skewY(30deg);
    transition: all 0.5s;
}
.hexIn * {
  position: absolute;
  visibility: visible;
  outline:1px solid transparent; 
}
.hexLink {
    display:block;
    width: 100%;
    height: 100%;
    text-align: center;
    color: white;
    overflow: hidden;
    -webkit-transform: skewY(-30deg) rotate3d(0,0,1,60deg);
        -ms-transform: skewY(-30deg) rotate3d(0,0,1,60deg);
            transform: skewY(-30deg) rotate3d(0,0,1,60deg);
}
.hex img {
  left: -100%;
  right: -100%;
  width: auto;
  height: 100%;
  margin: 0 auto;
}

.hex h1, .hex p {
  width: 100%;
  padding: 5%;
  box-sizing:border-box;
  font-weight: 300;
  opacity: 0;
}

#demo1 {
  color: #fff;
  text-transform: capitalize;
    text-align: center;
  bottom: 40%;
  padding-top:50%;
  font-size: 1.5em;
  z-index: 1;
}
.hex h1:before, .hex h1:after {
  display: inline-block;
  margin: 0 0.5em;
  width: 0.25em;
  height: 0.03em;
  background: #fff;
  content: '';
  vertical-align: middle;
  transition: all 0.3s;
  text-align:center;
}

#demo2 {
top: 70%;
text-align: center;
text-transform: uppercase;
    
}

.img {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-position: center center;
  background-size: cover;
  overflow: hidden;
-webkit-clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.img:before, .img:after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  content: '';
  opacity: 0;
  transition: opacity 0.5s;
}
.img:before {
  background: rgba(22, 103, 137, 0.3)
}
.img:after {
  background: linear-gradient(to top, transparent, rgba(0, 0, 0, 0.5), transparent);
}

.hexLink:hover h1, .hexLink:focus h1,
.hexLink:hover p, .hexLink:focus p{
opacity:1;
transition: 0.8s;
}


.hexIn:hover .img:before,
.hexIn:hover .img:after,
.hexIn:hover .hexLink {
  opacity: 1;
}


@media (min-width:1201px) { 
  #hexGrid{
    padding-bottom: 4.4%
  }
  .hex {
    width: 20%; 
  }
  .hex:nth-child(9n+6){ 
    margin-left:10%;  
  }
}

@media (max-width: 1200px) and (min-width:901px) { 
  #hexGrid{
    padding-bottom: 5.5%;
    font-size: 13px;
  }
  .hex {
    width: 25%; 
  }
  .hex:nth-child(7n+5){ 
    margin-left:12.5%;  
  }
}

@media (max-width: 900px) and (min-width:601px) { 
  #hexGrid{
    padding-bottom: 7.4%;
    font-size: 14px;
  }
  .hex {
    width: 33.333%; 
  }
  .hex:nth-child(5n+4){ 
    margin-left:16.666%;  
  }
}

@media (max-width: 600px) { 
  #hexGrid{
    padding-bottom: 11.2%;
    font-size: 12px;
  }
  .hex {
    width: 50%; 
  }
  .hex:nth-child(3n+3){ 
    margin-left:25%;  
  }
}

@media (max-width: 400px) {
    #hexGrid {
        font-size: 8px;
    }
  

  
 
}