2

I am trying to round the corners of a polygon as can be seen in this image: Screenshot of a rounded rectangle, clipped on the top-left corner by a straight rectangle, with the three angles created by the clip-rect hand-circled

Here is my current code:

@import url("https://fonts.googleapis.com/css?family=K2D");
* {
  box-sizing: border-box;
}

body {
  color: white;
  background: linear-gradient( 290deg, rgba(228, 37, 141, 1) 0%, rgba(254, 130, 202, 1) 100%) fixed;
  background-size: cover;
  min-height: 100vh;
  font-family: K2D, "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
  font-weight: 300;
  line-height: 1.25;
  display: flex;
  justify-content: center;
  margin: 0 auto;
  overflow-x: hidden;
}

b {
  font-weight: 800;
}

.sideheader {
  position: absolute;
  bottom: 25px;
  left: 5px;
  margin: 1em 0 0 0;
  padding: 0;
  font-weight: bold;
  font-size: 2em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}

.topheader {
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
  padding: 5px;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
}

.topheader a {
  color: white;
  text-decoration: none;
}

.wrapper {
  background-color: transparent;
  position: relative;
  margin: 15vmin 20vw 5vmin 20vw;
  width: 100%;
  height: 100%;
}

.flipper {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.8s;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

#submit1:checked+.flipper {
  transform: rotateY(180deg);
}

.front,
.back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.back {
  transform: rotateY(180deg);
}

.container {
  display: flex;
  width: 100%;
  background: rgba(0, 0, 0, 0.25);
  box-shadow: -0.5em 1em 2em rgba(0, 0, 0, 0.5);
}

.container>input,
.wrapper>input {
  position: absolute;
  top: 0;
  left: -9999px;
}

.tab {
  position: absolute;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  text-align: center;
  height: 8vmin;
  width: 100%;
  backface-visibility: hidden;
}

.tab>label {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
  border-right: 1px solid rgba(0, 0, 0, 0.25);
  cursor: pointer;
  letter-spacing: 1px;
}

.tab>label:last-child {
  border: none;
}

.content {
  background: linear-gradient( 45deg, rgba(97, 161, 239, 1) 0%, rgba(135, 92, 207, 1) 29%, rgba(188, 53, 169, 1) 65%, rgba(251, 8, 129, 1) 100%);
  width: 100%;
  backface-visibility: hidden;
  padding: 8vmin 0 5vmin 0;
  align-items: center;
  flex-direction: column;
}

.content.res {
  padding: 1em;
}

#contentFour {
  margin-top: 60px;
  margin-left: 40px;
  clip-path: polygon(75% 8vmin, 75% 0, 100% 0%, 100% 100%, 0 100%, 0 8vmin);
  filter: url('#goo');
}
<div class="sideheader">Exercise &#9601;&#9601;Tracker</div>
<div class="topheader">
  <span>Version 1.9</span>
  <span>API Front-End</span>
  <a href="https://codepen.io/bbx/">made by bbx</a>
</div>
<div class="wrapper">
  <input type="checkbox" id="submit1">
  <div class="flipper">
    <div class="front">
      <div class="container">
        <div class="content" id="contentFour">
          <h1>API Documentation</h1>
        </div>
        <svg style="visibility: hidden; position: absolute;" width="0" height="0" xmlns="http://www.w3.org/2000/svg" version="1.1">
          <defs>
                <filter id="goo"><feGaussianBlur in="SourceGraphic" stdDeviation="8" result="blur" />    
                    <feColorMatrix in="blur" mode="matrix" values="1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 19 -9" result="goo" />
                    <feComposite in="SourceGraphic" in2="goo" operator="atop"/>
                </filter>
            </defs>
        </svg>
      </div>
    </div>
  </div>
</div>
Kaiido
  • 123,334
  • 13
  • 219
  • 285
mooaz
  • 21
  • 1

0 Answers0