I did something like this for the level system. But I think I did something wrong because of my carelessness. As an example, I showed the number 10, but this number is 1-2-3, etc. it breaks down when we do. Can you help please
.box {
position: relative;
width: 50px;
height: 50px;
border-radius: 50%;
background: linear-gradient(40deg, #ffffff, #0c8a86 50%, #ffffff);
animation: rotate 12s linear infinite;
display: inline-grid;
top: 15px;
margin-left: 10px;
position: absolute;
}
.box:before,
.box:after {
content: " ";
position: absolute;
inset: 5px;
background: linear-gradient(#1c1734, #534770);
border-radius: inherit;
}
.box:before {
background: linear-gradient(45deg, #ffffff, #ffffff 40%, #ffffff);
filter: blur(8px);
}
#keyframes rotate {
100% {
transform: rotate(360deg);
/*filter: hue-rotate(360deg);*/
}
}
.circle-num {
color: white!important;
position: relative;
place-self: center!important;
display: inline-flex;
font-size: 25px!important;
top: 17.51px;
left: 21.5px;
}
<div class="box"></div>
<div class="circle-num">10</div>
i know I shouldn't do it with the position, but how would the solution to this be?
Set a container with relative to contain the elements inside so that you can set an absolute positioned element (for the numbering).
With a fixed width and height of 50px and some calculation on any existing margin/padding you can easily position your number with flex and align it vertical and horizontally centered with align-items and justify-content.
.container{
position: relative;
display: block;
}
.box {
position: relative;
width: 50px;
height: 50px;
border-radius: 50%;
background: linear-gradient(40deg, #ffffff, #0c8a86 50%, #ffffff);
animation: rotate 12s linear infinite;
display: inline-grid;
top: 15px;
margin-left: 10px;
position: absolute;
}
.box:before,
.box:after {
content: " ";
position: absolute;
inset: 5px;
background: linear-gradient(#1c1734, #534770);
border-radius: inherit;
}
.box:before {
background: linear-gradient(45deg, #ffffff, #ffffff 40%, #ffffff);
filter: blur(8px);
}
#keyframes rotate {
100% {
transform: rotate(360deg);
/*filter: hue-rotate(360deg);*/
}
}
.circle-num {
color: white !important;
position: absolute;
display: flex;
font-size: 25px !important;
width: 50px;
height: 50px;
text-align: center;
margin: 15px 10px;
top: 0px;
left: 0px;
align-items: center;
justify-content: center;
}
<div class="container">
<div class="box"></div>
<div class="circle-num">1</div>
</div>
Related
I'm trying to replicate a graphical design using css, but I have failed for responsive, I can achieve an static form but with tiny defects (due to putting together two elements).
This is the graphical design:
I prefer it a bit more tilted, like: skew(-40deg). But the idea is to have an inner rounded border that wraps that key-button just like in the image.
The html is simple:
<header>
<nav></nav>
</header>
The css:
body > header > nav {
display: flex;
align-items: flex-end;
justify-content: center;
width: 100vw;
height: 90px;
padding: 10px 0;
text-align: center;
z-index: 1
}
body > header > nav::before {
content: '';
position: absolute;
top: 0; left: 0;
width: 80vw; height: 100%;
background-color: rgb(147, 147, 147);
border-bottom-right-radius: 15px;
transform: skew(-40deg);
transform-origin: 100% 0%;
}
body > header > nav::after {
content: '';
position: absolute;
top: 0; right: 0;
width: 28.7%;
border-top: 7px solid rgb(147, 147, 147);
border-left: 50px solid rgb(147, 147, 147);
height: 75px;
border-top-left-radius: 75px;
transform: skew(-33deg);
}
I've prepared a https://jsfiddle.net/uj4qsf37/
Is there a cleaner way to do this? Like not having to use two elements? With one element it would be easy to make it responsive.
I would do it like this:
.header {
border-top: 20px solid blue;
height:100px;
position: relative;
overflow: hidden;
}
.header:before,
.header:after {
content: "";
vertical-align:top;
display: inline-block;
transform-origin: top right;
transform: skew(-40deg);
}
.header:before {
height: 100%;
width: 50%;
border-radius: 0 0 20px 0;
background: blue;
}
.header:after {
height: 20px;
width: 20px;
margin-left:-1px;
background: radial-gradient(circle at bottom right, transparent 68%, blue 73%);
}
/*to illustrate different values of skew*/
.header:before,
.header:after {
animation:change 2s linear infinite alternate;
}
#keyframes change{
from{transform: skew(0deg);}
top{transform: skew(-40deg);}
}
<div class="header"></div>
Here is the code I have. I think it's fairly obvious what I am trying to achieve - I want to remove the black background behind the text, however, when I simply remove the black background css, the gradient layer just shows, since it's not clipped to the text.
body {
margin: 0;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background:url('https://wallpapersite.com/images/pages/pic_w/16658.jpg') no-repeat center center fixed;
background-size: cover;
}
.neon {
position: relative;
overflow: hidden;
filter: brightness(200%);
}
.text {
background-color: black;
color: white;
font-size: 100px;
font-weight: bold;
font-family: sans-serif;
text-transform: uppercase;
position: relative;
user-select: none;
}
.text::before {
content: attr(data-text);
position: absolute;
color: white;
filter: blur(0.02em);
mix-blend-mode: difference;
}
.gradient {
position: absolute;
background: linear-gradient(45deg, #00f7ff, #f545d7, #0085ff, #6945f5, #005aff);
top: 0;
left: 0;
right: 0;
bottom: 0;
mix-blend-mode: multiply;
}
.spotlight {
position: absolute;
top: -100%;
left: -100%;
right: 0;
bottom: 0;
background:
radial-gradient(
circle,
white,
transparent 25%
) center / 25% 25%,
radial-gradient(
circle,
white,
black 25%
) center / 12.5% 12.5%;
animation: light 5s linear infinite;
mix-blend-mode: color-dodge;
}
#keyframes light {
to {
transform: translate(50%, 50%);
}
}
<div class="neon">
<span class="text" data-text="NIGHT SKY">NIGHT SKY</span>
<span class="gradient"></span>
<span class="spotlight"></span>
</div>
Anyway, I have tried a few things like messing around with some of the mix-blend-modes, adding some clipping paths etc, but couldn't get anything close to working. I think it should (?) be possible, but if it isn't, I will try some other methods tomorrow (like converting the text to a png and using the background-clip property)
Another mix-blend-mode will fix it. Use lighten in this case to remove the black part you don't want:
html {
background:#fff; /* this is needed to make sure the blending works fine (any color will do the trick) */
}
body {
margin: 0;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background: url('https://wallpapersite.com/images/pages/pic_w/16658.jpg') no-repeat center center fixed;
background-size: cover;
}
.neon {
position: relative;
overflow: hidden;
filter: brightness(200%);
mix-blend-mode:lighten; /* here */
}
.text {
background-color: black;
color: white;
font-size: 100px;
font-weight: bold;
font-family: sans-serif;
text-transform: uppercase;
position: relative;
user-select: none;
}
.text::before {
content: attr(data-text);
position: absolute;
color: white;
filter: blur(0.02em);
mix-blend-mode: difference;
}
.gradient {
position: absolute;
background: linear-gradient(45deg, #00f7ff, #f545d7, #0085ff, #6945f5, #005aff);
top: 0;
left: 0;
right: 0;
bottom: 0;
mix-blend-mode: multiply;
}
.spotlight {
position: absolute;
top: -100%;
left: -100%;
right: 0;
bottom: 0;
background: radial-gradient( circle, white, transparent 25%) center / 25% 25%, radial-gradient( circle, white, black 25%) center / 12.5% 12.5%;
animation: light 5s linear infinite;
mix-blend-mode: color-dodge;
}
#keyframes light {
to {
transform: translate(50%, 50%);
}
}
<div class="neon">
<span class="text" data-text="NIGHT SKY">NIGHT SKY</span>
<span class="gradient"></span>
<span class="spotlight"></span>
</div>
I want to make the following design:
I tried with :after and :before but it does not work. Here’s my current code:
.design {
background: #ea053a;
display: inline-block;
height: 155px;
margin-left: 33px;
margin-right: 40px;
position: relative;
width: 228px;
}
.design:before {
border-top: 43px solid #ea053a;
border-left: 50px solid transparent;
border-right: 50px solid transparent;
margin-right: 40px;
content: "";
height: 0;
left: 0;
position: absolute;
top: 55px;
margin-top: 100px;
width: 128px;
}
<div class="design"></div>
How could I leave it the same as the original design and with the following two properties?:
box-shadow: 0 1px 10px 0 rgba(0, 0, 0, 0.2);
background-image: linear-gradient(to bottom, #ea053a, #d0021b);
Here is an idea with skew transformation and drop-shadow filter. You simply need some extra element to correctly have the gradient. The trick is to invert the skew to keep the gradient direction correct (not needed if we deal with solid color)
.box {
width: 150px;
height: 150px;
position: relative;
z-index:0;
overflow: hidden;
filter: drop-shadow(0 1px 10px rgba(0, 0, 0, 0.8));
}
.box span {
position: absolute;
z-index:-1;
top: 0;
width: 50%;
height: 100%;
overflow: hidden;
}
.box span:first-of-type {
left: 0;
transform: skewY(35deg);
transform-origin: top right;
}
.box span:last-of-type {
right: 0;
transform: skewY(-35deg);
transform-origin: top left;
}
.box span::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: linear-gradient(to bottom, blue , red );
transform-origin: inherit;
}
.box span:first-of-type::before {
transform: skewY(-35deg);
}
.box span:last-of-type::before {
transform: skewY(35deg);
}
p {
margin:0;
color:#fff;
font-size:45px;
line-height:100px;
text-align:center;
}
<div class="box">
<span></span><span></span>
<p>29</p>
</div>
Here is how we can do with a left or right gradient. In this case we don't need extra elements because the skew will not affect the direction:
.box {
width: 150px;
height: 150px;
position: relative;
z-index:0;
overflow: hidden;
filter: drop-shadow(0 1px 10px rgba(0, 0, 0, 0.8));
}
.box:before,
.box:after{
content:"";
position: absolute;
z-index:-1;
top: 0;
width: 50%;
height: 100%;
overflow: hidden;
background:linear-gradient(to right,blue,red);
background-size:200% 100%;
}
.box:before{
left: 0;
transform: skewY(35deg);
transform-origin: top right;
}
.box:after{
right: 0;
transform: skewY(-35deg);
transform-origin: top left;
background-position:right;
}
p {
margin:0;
color:#fff;
font-size:45px;
line-height:100px;
text-align:center;
}
<div class="box">
<p>29</p>
</div>
And here is with an arbitrary gradient:
.box {
--g:linear-gradient(45deg,blue,red 60%,yellow); /* gradient coloration*/
width: 150px;
height: 150px;
margin:15px;
display:inline-block;
position: relative;
z-index:0;
overflow: hidden;
filter: drop-shadow(0 1px 10px rgba(0, 0, 0, 0.8));
}
.box span {
position: absolute;
z-index:-1;
top: 0;
width: 50%;
height: 100%;
overflow: hidden;
}
.box span:first-of-type {
left: 0;
transform: skewY(35deg);
transform-origin: top right;
}
.box span:last-of-type {
right: 0;
transform: skewY(-35deg);
transform-origin: top left;
}
.box span::before {
content: "";
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: var(--g);
background-size:200% 100%;
transform-origin: inherit;
}
.box span:first-of-type::before {
transform: skewY(-35deg);
}
.box span:last-of-type::before {
transform: skewY(35deg);
background-position:right;
}
p {
margin:0;
color:#fff;
font-size:45px;
line-height:100px;
text-align:center;
}
<div class="box">
<span></span><span></span>
<p>29</p>
</div>
<div class="box" style="--g:linear-gradient(-62deg,blue,red 60%,yellow)">
<span></span><span></span>
<p>29</p>
</div>
Since each element is taking 50% of the width we make the background to be 200% to have its size as the main container then we adjust the position to create the illusion of one background. It's like each element will show half of the main background.
An optimized version using mask
.box {
width: 150px;
height: 150px;
filter: drop-shadow(0 1px 10px rgba(0, 0, 0, 0.8));
}
.box > div {
height: 100%;
background: linear-gradient(35deg, blue, red);
-webkit-mask:
linear-gradient(#fff, #fff) top/100% 70%,
linear-gradient(to bottom right, #fff 49.5%, transparent 50%) bottom right/50% 30%,
linear-gradient(to bottom left, #fff 49.5%, transparent 50%) bottom left /50% 30%;
mask:
linear-gradient(#fff, #fff) top/100% 70%,
linear-gradient(to bottom right, #fff 49.5%, transparent 50%) bottom right/50% 30%,
linear-gradient(to bottom left, #fff 49.5%, transparent 50%) bottom left /50% 30%;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
}
p {
margin: 0;
color: #fff;
font-size: 45px;
line-height: 100px;
text-align: center;
}
<div class="box">
<div>
<p>29</p>
</div>
</div>
Or clip-path
.box {
width: 150px;
height: 150px;
filter: drop-shadow(0 1px 10px rgba(0, 0, 0, 0.8));
}
.box > div {
height: 100%;
background: linear-gradient(35deg, blue, red);
clip-path:polygon(0 0,100% 0,100% 70%,50% 100%,0 70%);
}
p {
margin: 0;
color: #fff;
font-size: 45px;
line-height: 100px;
text-align: center;
}
<div class="box">
<div>
<p>29</p>
</div>
</div>
You can use clip-path as I did. Here is my solution.
.design {
background: #ea053a;
-webkit-clip-path: polygon(50% 0%, 100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
clip-path: polygon(50% 0%, 100% 0, 100% 75%, 50% 100%, 0% 75%, 0 0);
height: 155px;
width: 155px;
}
.month {
text-align:center;
padding: 1rem 0 .25rem 0;
color:#fff;
font-weight:bold;
font-size: 18px;
}
.day {
text-align: center;
font-size: 60px;
font-weight:bold;
color: #fff;
}
<div class="design">
<div class="month">Diciembre</div>
<div class="day">29</div>
</div>
If you change your CSS to the following minor changes, then you can achieve the result that you have expected:
.design {
background: #ea053a;
display: inline-block;
height: 100px;
margin-left: 33px;
margin-right: 40px;
position: relative;
width: 180px;
}
.design:before {
border-top: 43px solid #ea053a;
border-left: 90px solid transparent;
border-right: 90px solid transparent;
margin-right: 40px;
content: "";
height: 0;
left: 0;
position: absolute;
top: 0px;
margin-top: 100px;
width: 0;
}
Here is the working of the above CSS:
.design {
background: #ea053a;
display: inline-block;
height: 100px;
margin-left: 33px;
margin-right: 40px;
position: relative;
width: 180px;
}
.design:before {
border-top: 43px solid #ea053a;
border-left: 90px solid transparent;
border-right: 90px solid transparent;
margin-right: 40px;
content: "";
height: 0;
left: 0;
position: absolute;
top: 0px;
margin-top: 100px;
width: 0;
}
<div class="design">
</div>
Hope this was helpful.
My Fiddle
Change to (only changed lines listed, keep everything else as-is):
.design:before {
...
border-left: 114px solid transparent;
border-right: 114px solid transparent;
...
width: 0;
}
Here is my solution to add shadow and gradient to the shape
.design {
background: #ea053a;
display: inline-block;
height: 155px;
margin-left: 33px;
margin-right: 40px;
position: relative;
width: 228px;
filter: drop-shadow(0 1px 10px rgba(0, 0, 0, 0.8));
}
.triangle {
position: absolute;
height: 100px;
top: 155px;
width: 228px;
-webkit-clip-path: polygon(49% 44%, 0% 100%, 100% 100%);
clip-path: polygon(49% 44%, 0% 100%, 100% 100%);
background-color: #ea053a;
transform: rotate(180deg);
}
<div class="design">
<div class="triangle">
</div>
</div>
I've noticed that there are slight visible breaks in the CSS border image when rotating. Is there a way to prevent this or another method to achieve the same solution?
.box {
margin: 150px;
width: 250px;
height: 250px;
background: lightGray;
border: 20px solid blue;
border-image: linear-gradient(to right, #3acfd5 0%, #3a4ed5 100%);
border-image-slice: 1;
transform: rotate(45deg);
display: flex;
align-items: center;
justify-content: center;
}
.r45 {
transform: rotate(-45deg);
color: red;
}
<div class="box">
<p class="r45">Hello</p>
</div>
Another method to achieve the same solution is using pseudo:after as shown in the below working example, hope it helps :)
.box {
margin: 150px;
width: 250px;
height: 250px;
background: linear-gradient(to right, #3acfd5 0%, #3a4ed5 100%);
transform: rotate(45deg);
display: flex;
align-items: center;
justify-content: center;
position: relative;
}
.box:after {
left: 20px;
right: 20px;
top: 20px;
bottom: 20px;
content: '';
background: lightGray;
position: absolute;
}
.r45 {
transform: rotate(-45deg);
color: red;
position: relative;
z-index: 1;
}
<div class="box">
<p class="r45">Hello</p>
</div>
You can use background and adjust background-clip and you will avoid the strange rendering of border
.box {
margin: 80px;
width: 250px;
height: 250px;
background:
linear-gradient(lightGray,lightGray) padding-box,
linear-gradient(to right, #3acfd5 0%, #3a4ed5 100%) border-box;
border: 20px solid transparent;
display: flex;
align-items: center;
justify-content: center;
transform: rotate(45deg);
}
.r45 {
transform: rotate(-45deg);
color: red;
}
<div class="box">
<p class="r45">Hello</p>
</div>
I have to make a div using HTML and CSS only but not using any background image with more than 4 corners.
How can I do it?
You can use pseudo-element and some css shape tricks to achieve this.
.folder {
width: 190px;
height: 110px;
background: #888;
position: relative;
overflow: hidden;
}
.folder:after {
content: "";
width: 100px;
border: 15px solid transparent;
position: absolute;
right: -15px;
border-top-color: #fff;
top:0;
}
<div class="folder"></div>
There are two examples of code: with CSS ( + animation ) and SVG.
With animation
* {
box-sizing: border-box;
}
html, body {
margin: 0;
padding: 0;
position: relative;
width: 100%;
height: 100%;
background-color: #2196f3;
}
.page {
height: 100%;
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
-moz-box-align: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
-moz-box-pack: center;
-ms-flex-pack: center;
}
.folder {
background-color: #d3eafd;
position: relative;
width: 92px;
height: 64px;
display: block;
border-top-right-radius: 8px;
border-bottom-right-radius: 8px;
border-bottom-left-radius: 8px;
}
.folder-tab {
position: absolute;
height: 10px;
left: 0;
bottom: 100%;
display: block;
width: 40%;
border-top-left-radius: 8px;
background-color: inherit;
}
.folder-tab:after {
content: '';
position: absolute;
display: block;
top: 0;
left: calc(100% - 10px);
border-bottom: 10px solid #d3eafd;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
}
.folder-icn {
padding-top: 12px;
width: 100%;
height: 100%;
display: block;
}
.downloading {
width: 30px;
height: 32px;
margin: 0 auto;
position: relative;
overflow: hidden;
}
.custom-arrow {
width: 14px;
height: 14px;
position: absolute;
top: 0;
left: 50%;
margin-left: -7px;
background-color: #fff;
-webkit-animation-name: downloading;
-webkit-animation-duration: 1.5s;
-webkit-animation-iteration-count: infinite;
animation-name: downloading;
animation-duration: 1.5s;
animation-iteration-count: infinite;
}
.custom-arrow:after {
content: '';
position: absolute;
display: block;
top: 100%;
left: -9px;
border-top: 15px solid #fff;
border-left: 16px solid transparent;
border-right: 16px solid transparent;
}
.bar {
width: 30px;
height: 4px;
background-color: #fff;
margin: 0 auto;
}
#-webkit-keyframes downloading {
0% {
top: 0;
opacity: 1;
}
50% {
top: 110%;
opacity: 0;
}
52% {
top: -110%;
opacity: 0;
}
100% {
top: 0;
opacity: 1;
}
}
#keyframes downloading {
0% {
top: 0;
opacity: 1;
}
50% {
top: 110%;
opacity: 0;
}
52% {
top: -110%;
opacity: 0;
}
100% {
top: 0;
opacity: 1;
}
}
<div class="page">
<div class="folder">
<span class="folder-tab"></span>
<div class="folder-icn">
<div class="downloading">
<span class="custom-arrow"></span>
</div>
<div class="bar"></div>
</div>
</div>
</div>
SVG
<!DOCTYPE html>
<html>
<body>
<svg height="32px" version="1.1" viewBox="0 0 32 32" width="32px" xmlns="http://www.w3.org/2000/svg" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns" xmlns:xlink="http://www.w3.org/1999/xlink"><title/><desc/><defs/><g fill="none" fill-rule="evenodd" id="Page-1" stroke="none" stroke-width="1"><g fill="#157EFB" id="icon-94-folder"><path d="M17,11 L15,7 L4.00276013,7 C2.89666625,7 2,7.88967395 2,8.991155 L2,27.008845 C2,28.1085295 2.89971268,29 3.99328744,29 L29.0067126,29 C30.1075748,29 31,28.1073772 31,27.0049107 L31,12.9950893 C31,11.8932319 30.1029399,11 28.9941413,11 L17,11 Z" id="folder"/></g></g>
</svg>
</body>
</html>
Helpful links:
More about SVG ( W3C )
The Shapes of CSS ( CSS-Tricks )
div {
width: 280px;
height: 280px;
background: #1e90ff;
-webkit-clip-path: polygon(48% 13%, 100% 13%, 100% 60%, 100% 100%, 0 100%, 0 0, 29% 0);
clip-path: polygon(48% 13%, 100% 13%, 100% 60%, 100% 100%, 0 100%, 0 0, 29% 0);
}
/* Center the demo */
html, body { height: 100%; }
body {
display: flex;
justify-content: center;
align-items: center;
}
<div></div>
With only a single block level element, you may style a :before pseudo-element to create the slanted tab above the containing <div>.
div {
margin: 40px;
width: 150px;
height: 80px;
background: red;
position: relative;
padding: 10px;
color: #fff;
}
div:before {
content:"";
position: absolute;
left: 0;
top: -20px;
width: 70px;
height: 0;
border-bottom: 20px solid red;
border-right: 20px solid transparent;
}
<div>content</div>
N.b.: This should have a better support on older browsers (and IE) than using a clip-path solution.
Just another way of doing it using the "canvas" of HTML5:
<div>
<canvas id="cnv" height="200" width="400"></canvas>
<script>
var canvas = document.getElementById('cnv');
if (canvas.getContext) {
var ctx = canvas.getContext('2d');
ctx.beginPath();
ctx.moveTo(0, 0);
ctx.lineTo(100, 0);
ctx.lineTo(130, 25);
ctx.lineTo(200, 25);
ctx.lineTo(200, 125);
ctx.lineTo(0, 125);
ctx.closePath();
ctx.fillStyle = "gray";
ctx.fill();
}
</script>
</div>
You can achieve this using single element and two gradients (one gradient for rectangle, another is for tab):
div {
width: 280px;
height: 200px;
background: linear-gradient(to bottom, transparent 31px, #656d78 31px),
linear-gradient(-135deg, transparent 32%, #656d78 32%);
}
<div></div>
Also this can be achieved via single gradient (for tab) using pseudoelement:
div {
width: 280px;
height: 169px;
background-color: #656d78;
margin-top: 39px;
position: relative;
}
div:after {
content: "";
position: absolute;
top: -31px;
left: 0;
width: 100%;
height: 31px;
background: linear-gradient(-135deg, transparent 50%, #656d78 50%);
}
<div></div>
If you can insert code, you could use a SVG graphic.
If not, you could draw the vector graphic css clip-path as the answer above.
There are some generators, here is one I've found
Another option is to use at least 3 divs, skew one using css transform in one of them and locating each one using relative os absolute positioning.
You can make polygon's div using CSS.
.myDiv {
-webkit-clip-path: polygon(48% 16%, 100% 16%, 100% 100%, 0% 100%, 0 0, 32% 0);
clip-path: polygon(48% 16%, 100% 16%, 100% 100%, 0% 100%, 0 0, 32% 0);
}
Or you can create any type of polygon shape (online) using this website
https://www.cssportal.com/css-clip-path-generator/