flexbox carousel template

In this example below you will see how to do a flexbox carousel template with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by 1zm0, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright 1zm0 ©
  • HTML
  • CSS
  • JavaScript
    <body>
  <!-- custom carousel template created with flexbox -->
<div class="wrapper">
    <div class="left-trigger">
     <div class="left-top"></div>
     <div class="left-bottom"></div>
  </div>
  <div class="right-trigger">
     <div class="right-top"></div>
     <div class="right-bottom"></div>
  </div>  
</div>
</body>

/*Downloaded from https://www.codeseek.co/1zm0/flexbox-carousel-template-dexmVq */
    * {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  height: 100vh;
  width: 100vw;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background-color: grey;
}
.wrapper {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  background-color: skyblue;
  height: 65%;
  width: 50%;
  margin: 0;
  padding: 0;
  border-radius: 5px;
}

.left-trigger {
 width: 50px;
 height: 50px;
  background-color: green;
  border-radius: 5px;
}

.right-trigger {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  width: 25px;
  height: 40px;
  background-color: green;
  border-radius: 5px;
}
.right-trigger:hover {
  cursor: pointer;
}
.right-top {
  height: 5px;
  background-color: black;
  border-radius: 5px;
  transform: rotate(45deg);
}

.right-bottom {
  height: 5px;
  background-color: black;
  border-radius: 5px;
  transform: rotate(-45deg);
}

.left-trigger {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  width: 25px;
  height: 40px;
  background-color: green;
  border-radius: 5px;
}
.left-trigger:hover {
  cursor: pointer;
}
.left-top {
  height: 5px;
  background-color: black;
  border-radius: 5px;
  transform: rotate(-45deg);
}

.left-bottom {
  height: 5px;
  background-color: black;
  border-radius: 5px;
  transform: rotate(45deg);
}




/*Downloaded from https://www.codeseek.co/1zm0/flexbox-carousel-template-dexmVq */
    

Comments