How to list Items in rows of 3 in React - node.js

I have a list of items that I want to display in rows of 3 but it's not displaying in 3 rows. it works in the normal HTML but doesn't work in React.
Here is my Event Component
const Event = (props) => (
<div className="wrap">
<div className="tile">
<img src={props.event.eventImage} />
<div className="text">
<h1>{props.event.title}</h1>
<h2 className="animate-text">More lorem ipsum bacon ipsum.</h2>
<p className="animate-text">{props.event.description}</p>
<div className="dots">
<span />
<span />
<span />
</div>
</div>
</div>
</div>
);
export default class EventsList extends Component {
constructor(props) {
super(props);
this.state = { events: [] };
}
componentDidMount() {
axios
.get("http://localhost:9000/events/")
.then((response) => {
this.setState({ events: response.data });
})
.catch(function (error) {
console.log(error);
});
}
eventList() {
return this.state.events.map(function (currentEvent, i) {
return <Event event={currentEvent} key={i} />;
});
}
render() {
return (
<div>
<div className="row">{this.eventList()}</div>
</div>
);
}
}
and my css
.wrap {
margin: 50px auto 0 auto;
width: 100%;
display: flex;
align-items: space-around;
max-width: 1200px;
}
.tile {
width: 380px;
height: 380px;
margin: 10px;
background-color: #99aeff;
display: inline-block;
background-size: cover;
position: relative;
cursor: pointer;
transition: all 0.4s ease-out;
box-shadow: 0px 35px 77px -17px rgba(0, 0, 0, 0.44);
overflow: hidden;
color: white;
font-family: "Roboto";
}
.tile img {
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 0;
transition: all 0.4s ease-out;
}
.tile .text {
/* z-index:99; */
position: absolute;
padding: 30px;
height: calc(100% - 60px);
}
.tile h1 {
font-weight: 300;
margin: 0;
text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3);
}
.tile h2 {
font-weight: 100;
margin: 20px 0 0 0;
font-style: italic;
transform: translateX(200px);
}
.tile p {
font-weight: 300;
margin: 20px 0 0 0;
line-height: 25px;
/* opacity:0; */
transform: translateX(-200px);
transition-delay: 0.2s;
}
.animate-text {
opacity: 0;
transition: all 0.6s ease-in-out;
}
.tile:hover {
/* background-color:#99aeff; */
box-shadow: 0px 35px 77px -17px rgba(0, 0, 0, 0.64);
transform: scale(1.05);
}
.tile:hover img {
opacity: 0.2;
}
.tile:hover .animate-text {
transform: translateX(0);
opacity: 1;
}
.dots {
position: absolute;
bottom: 20px;
right: 30px;
margin: 0 auto;
width: 30px;
height: 30px;
color: currentColor;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
}
.dots span {
width: 5px;
height: 5px;
background-color: currentColor;
border-radius: 50%;
display: block;
opacity: 0;
transition: transform 0.4s ease-out, opacity 0.5s ease;
transform: translateY(30px);
}
.tile:hover span {
opacity: 1;
transform: translateY(0px);
}
.dots span:nth-child(1) {
transition-delay: 0.05s;
}
.dots span:nth-child(2) {
transition-delay: 0.1s;
}
.dots span:nth-child(3) {
transition-delay: 0.15s;
}
#media (max-width: 1000px) {
.wrap {
flex-direction: column;
width: 400px;
}
}
This is how it's displaying.
But this is what I want to achieve.
I am new to React and I'm learning by building a project.
Here is codepen link of what I want to achieve.
Codepen Link

I have a feeling it's your css, you have your wrap class stretching the whole row width and within it, there is a tile that's only 380px.
Consider making row a grid with three columns.

Ciao, you can use display: 'in-line' like this:
return <Event event={currentEvent} key={i} style={{display: 'in-line'}}/>;

Related

my menu button when clicked isn't opening the nav and it should be

this is the code for my nav
.nav {
z-index: 1;
width: 100%;
background-color: red;
display: block;
position: absolute;
top: 100%;
}
.nav ul {
display: none;
}
and this is the code for my menu
/* checkbox (for menu) */
.menu-icon-wrap {
/* background color of checkbox */
top: 5.5px;
left: 960px;
/* position of entire menu /w checkbox */
position: absolute;
/* ^ this allows checkbox to be positioned */
cursor: pointer;
z-index: 1;
}
/* (menu) */
.menu-icon {
padding: 15px 20px;
display: block;
float: right;
/* ^ makes the menu go beside(next to) the checkbox */
cursor: pointer;
overflow: hidden;
position: relative;
z-index: 1;
}
.menu-icon .navicon {
position: absolute;
top: 14px;
left: 10px;
width: 20px;
height: 2.5px;
background: black;
border-radius: 4px;
transition: 0.5s;
display: block;
z-index: 1;
}
.menu-icon .navicon:before,
.menu-icon .navicon:after {
content: '';
transform: translateY(-6px);
width: 15px;
height: 2.5px;
background: black;
display: block;
position: relative;
}
.menu-icon .navicon:after {
content: '';
transform: translateY(+4.5px);
height: 2.2px;
width: 10px;
display: block;
position: relative;
background: black;
}
.menu-btn:checked ~ .menu-icon .navicon
{
background: transparent;
}
.menu-btn:checked ~ .menu-icon .navicon:after {
width: 21px;
transform: translateY(0px) rotate(315deg);
transition-delay: 0.125s;
}
.menu-btn:checked ~ .menu-icon .navicon:before {
width: 25px;
transform: translateY(0px) rotate(45deg);
transition-delay: 0.125s;
}
.menu-btn {
display: none;
}
.menu-btn:checked ~ .sub-nav {
display: block;
position: absolute;
top: 100;
left: 920px;
z-index: 2;
width: 100px;
height: 100px;
}
ul {
padding-left: 10px;
padding-top: 35px;
}
li {
display: block;
padding-left: 25px;
padding-top: 2px;
}
--color-link-toc: #878787;
.sub-nav {
display: none;
}
.sub-nav-item {
pointer-events: none;
opacity: 0;
display: block;
margin: 0.35rem 0;
opacity: 0;
}
.sub-nav-title {
pointer-events: none;
color: var(--color-link-toc);
}
and this is the html
<div.navbar class="navbar">
<!-- ^ header -->
<h2 class="nav__chapter"> Home</h2>
<div class="menu-icon-wrap">
<input type="checkbox" class="menu-btn" id="menu-btn">
<label for="menu-btn" class="menu-icon">
<span class="navicon"></span>
</label>
</div>
<nav class="nav">
<!-- ^ nav -->
<ul class="sub-nav">
<li>Home</li>
<li>About</li>
<li>Testimonials</li>
<li>Moodboard</li>
<li>Contact</li>
</ul>
</nav>
</div.navbar>
please help me. I've been banging my head against the table trying to figure this out. I've spent days on this and can't get it working. I should be able to click the menu (checkbox) and when checked it should open the sub-nav or (nav). what am I doing wrong?

menu location adjusment in shopify

I am hopeless and so I hope you could help us with this. I recently just bought a new theme for our site but I just want to place the menu right under the Logo As shown.
this is the screenshot and fake adjustment of what we hope we could change to
As we pressed F12 to inspect the section, we are only able to find the below code in base.css but dont know how to adjust them.
/* Header menu drawer */
.header__icon--menu .icon {
display: block;
position: absolute;
opacity: 1;
transform: scale(1);
transition: transform 150ms ease, opacity 150ms ease;
}
details:not([open]) > .header__icon--menu .icon-close,
details[open] > .header__icon--menu .icon-hamburger {
visibility: hidden;
opacity: 0;
transform: scale(0.8);
}
.js details[open]:not(.menu-opening) > .header__icon--menu .icon-close {
visibility: hidden;
}
.js details[open]:not(.menu-opening) > .header__icon--menu .icon-hamburger {
visibility: visible;
opacity: 1;
transform: scale(1.07);
}
.header__inline-menu details[open] > .header__submenu {
opacity: 1;
transform: translateY(2.7rem);
animation: animateMenuOpen var(--duration-default) ease;
}
/* Header menu */
.header__inline-menu {
margin-left: -1.2rem;
grid-area: navigation;
display: none;
}
.header__inline-menu .header__menu-item {
font-family: var(--font-header-menu-family);
font-style: var(--font-header-menu-style);
font-weight: var(--font-header-menu-weight);
text-transform: var(--font-header-menu-text-transform);
font-size: 1rem;
letter-spacing: 0.125em;
}
.header--top-center .header__heading-link {
margin-left: 0;
}
#media screen and (min-width: 990px) {
.header__inline-menu {
display: inline-block;
}
.header--middle-left .header__inline-menu {
margin-left: 0;
}
}
.header__menu {
padding: 0 1rem;
}
.header__menu-item {
overflow: hidden;
padding: 1.5rem;
text-decoration: none;
color: rgba(var(--color-foreground), 0.75);
}
.header__inline-menu .header__menu-item {
align-items: flex-start;
}
.header__menu-item > span {
position: relative;
display: flex;
flex-direction: column;
backface-visibility: hidden;
transition: var(--duration-default);
overflow: hidden;
}
.header__menu-item span:not(.header__active-menu-item) > span {
display: flex;
flex-direction: column;
backface-visibility: hidden;
transition: var(--duration-default);
}
.header__menu-item span:not(.header__active-menu-item) > span:after {
position: absolute;
transform: translateY(100%);
display: block;
content: attr(title);
color: rgba(var(--color-foreground));
}
.header__menu-item:hover span:not(.header__active-menu-item) > span {
transform: translateY(-100%);
}
.header__menu-item:hover span:not(.header__active-menu-item):after {
}
.header__menu-item .header__active-menu-item {
color: rgba(var(--color-foreground));
}
.header__icon .header__icon-name {
justify-content: flex-start;
align-items: flex-start;
overflow: hidden;
height: 1.5rem;
text-decoration: none;
font-size: 1rem;
}
.header__icon .header__icon-name span {
display: flex;
flex-direction: column;
align-items: flex-start;
height: auto;
backface-visibility: hidden;
transition: var(--duration-default);
}
.header__icon-name span:after {
display: inline-block;
content: attr(title);
margin-top: 0.8rem;
color: rgb(var(--color-foreground));
}
.header__icon:hover .header__icon-name span {
transform: translateY(calc(-50% - 0.8rem / 2));
}
.header__submenu {
transition: opacity var(--duration-default) ease;
transform: var(--duration-default) ease;
z-index: 15;
}
.header__submenu.list-menu {
padding: 0.9rem 2.2rem 0.9rem 2.2rem;
}
.header__submenu .header__menu-item:after {
right: 2rem;
}
.header__submenu .header__menu-item {
padding: 1.3rem 0;
height: auto;
}
.header__submenu .header__menu-item:hover {
color: rgba(var(--color-foreground), 1);
}
.header__submenu li:not(:last-child) {
border-bottom: 1px solid rgba(var(--color-foreground), 0.2);
}
.header__submenu .header__submenu .header__menu-item {
padding-left: 3rem;
}
.header__menu-item .icon-caret {
right: 0.8rem;
z-index: 0;
}
.header__submenu .icon-caret {
right: 0.5rem;
transform: rotate(-90deg);
}
details-disclosure > details {
position: relative;
}
#media screen and (min-width: 990px) {
.header__submenu .header__submenu .header__menu-item {
padding-left: 0;
}
}

Hou to fixe header and menu on mobile mode

I'm trying to pin the header and menu to the top of the page. In pc mode and tablet mode it works, but when I enter mobile mode it stops working.
When I scroll down the menu is not fixed. This only happens in mobile mode.
I've tried to edit the css code in several different ways, but I'm not able to.
HTML code:
<header class="header container-header full-width<?php echo $stickyHeader ? ' ' . $stickyHeader : ''; ?>">
<nav class="navbar">
<div id="logo"><img src="logo.svg"> </div>
<a href="#" class="toggle-button">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</a>
<div class="navbar-links">
<ul>
<li><a href="#sobre_md" >Sobre</a></li>
<li>Oferta</li>
<li>Implementação</li>
<li>Segurança</li>
<li>FAQ</li>
<li>Imprensa</li>
</ul>
</div>
</nav>
</header>
<script>
const toggleButton = document.getElementsByClassName('toggle-button')[0]
const navbarLinks = document.getElementsByClassName('navbar-links')[0]
const links = navbarLinks.querySelectorAll("a")
toggleButton.addEventListener('click', () => {
navbarLinks.classList.toggle('active')
});
for(let link of links){
link.addEventListener('click', () => {
navbarLinks.classList.toggle('active')
});
}
</script>
.grid-child.container-component {
grid-column: full-start/full-end !important;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
body {
margin: 0;
padding: 0;
position: relative;
}
.navbar {
margin: 0;
padding: 0;
display: flex;
position: relative;
justify-content: space-between;
align-items: center;
color: white;
background-color: #5aaddd;
}
#logo{
height: 60px;
width: 60px;
}
#logo img{
margin-left: 30%;
height: 100%;
display: flex;
padding: 0.5rem;
padding-top: 10px;
}
.brand-title {
font-size: 1.5rem;
margin: .5rem;
}
.navbar-links {
height: 100%;
}
.navbar-links ul {
display: flex;
margin: 0;
padding: 0;
}
.navbar-links li {
list-style: none;
}
.navbar-links li a {
display: block;
text-decoration: none;
color: white;
padding: 1rem;
}
.navbar-links li:hover {
background-color: #555;
}
.toggle-button {
position: absolute;
top: .75rem;
right: 1rem;
display: none;
flex-direction: column;
justify-content: space-between;
width: 30px;
height: 21px;
}
.toggle-button .bar {
height: 3px;
width: 100%;
background-color: white;
border-radius: 10px;
}
#media (max-width: 800px) {
.navbar {
flex-direction: column;
align-items: flex-start;
}
.toggle-button {
display: flex;
}
.navbar-links {
display: none;
width: 100%;
}
.navbar-links ul {
width: 100%;
flex-direction: column;
}
.navbar-links ul li {
text-align: center;
}
.navbar-links ul li a {
padding: .5rem 1rem;
}
.navbar-links.active {
display: flex;
}
}
#button {
display: inline-block;
background-color: #DEDB45;
width: 50px;
height: 50px;
text-align: center;
border-radius: 4px;
position: fixed;
bottom: 30px;
right: 30px;
transition: background-color .3s,
opacity .5s, visibility .5s;
opacity: 0;
visibility: hidden;
z-index: 1000;
}
#button::after {
content: "\f077";
font-family: FontAwesome;
font-weight: normal;
font-style: normal;
font-size: 2em;
line-height: 50px;
color: #fff;
}
#button:hover {
cursor: pointer;
background-color: #333;
}
#button:active {
background-color: #555;
}
#button.show {
opacity: 1;
visibility: visible;
}

how to close mobile navigation menu on click outside responsive menu

I have a menu on my website and it works ok on laptop browser. But on the mobile version, the menu opens and close when i chose a option. But when i click outside de menu it doesn't close.
I would like to know how can i do so that when the user clicks or taps outside the menu the menu closes.
Can someone help please?
My code is:
const toggleButton = document.getElementsByClassName('toggle-button')[0]
const navbarLinks = document.getElementsByClassName('navbar-links')[0]
const links = navbarLinks.querySelectorAll("a")
toggleButton.addEventListener('click', () => {
navbarLinks.classList.toggle('active')
});
for(let link of links){
link.addEventListener('click', () => {
navbarLinks.classList.toggle('active')
});
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
.container-header nav{
margin-top:0em;
}
.position-sticky {
position: sticky!important;
}
body {
margin: 0;
padding: 0;
position: relative;
}
.navbar {
margin: 0;
padding: 0;
display: flex;
position: relative;
justify-content: space-between;
align-items: center;
color: white;
background-color:#5aaddd;
box-shadow: rgba(0, 0, 0, 0.35) 0px 0px 20px 0px;
}
#logo{
height: 60px;
width: 85px;
}
#logo img{
margin-left: 35%;
margin-top: 8%;
height: 80%;
display: flex;
padding: 0;
}
.brand-title {
font-size: 1.5rem;
margin: .5rem;
}
.navbar-links {
height: 100%;
}
.navbar-links ul {
display: flex;
margin: 0;
padding: 0;
}
.navbar-links li {
list-style: none;
}
.navbar-links li a {
display: block;
text-decoration: none;
color: white;
padding: 1rem;
font-family: 'Signika Negative', sans-serif;
font-size:15pt;
}
.navbar-links li:hover {
background-color: #555;
}
.toggle-button {
position: absolute;
top: 1.3rem;
right: 1rem;
display: none;
flex-direction: column;
justify-content: space-between;
width: 30px;
height: 21px;
}
.toggle-button .bar {
height: 3px;
width: 100%;
background-color: white;
border-radius: 10px;
}
#media (max-width: 800px) {
.navbar {
flex-direction: column;
align-items: flex-start;
}
.position-sticky {
position: sticky!important;
}
.toggle-button {
display: flex;
}
.navbar-links {
display: none;
width: 100%;
}
.navbar-links ul {
width: 100%;
flex-direction: column;
transition: transform 200ms;
}
.navbar-links ul li {
text-align: center;
}
.navbar-links ul li a {
padding: .5rem 1rem;
}
.navbar-links.active {
display: flex;
}
}
<nav class="navbar">
<div id="logo"><img src="/images/logo/logo.png"> </div>
<a href="#" id="toggle" class="toggle-button">
<span class="bar"></span>
<span class="bar"></span>
<span class="bar"></span>
</a>
<div id="topbar" class="navbar-links">
<ul>
<li>Sobre</li>
<li>Oferta</li>
<li>Implementação</li>
<li>Segurança</li>
<li>FAQ</li>
<li>Imprensa</li>
</ul>
</div>
</nav>

ReactJS responsive carousel from scratch

Okay, so basically I am trying to write a carousel for ReactJS from scratch.
I've accomplished to code must of the features required as navigation, slides and so on.
The main purpose of this is to make it responsive, but that is what I am having a hard time figuring out how to do.
carousel.js
import React from 'react'
import { NavLink } from 'react-router-dom'
import classNames from 'classnames'
export default class Carousel extends React.Component {
constructor(props) {
super(props)
this.handleNext = this.handleNext.bind(this)
this.handlePrev = this.handlePrev.bind(this)
this.state = {
innerWidth: 0,
navPrevDisabled: true
}
}
componentWillMount() {
var stateItems = []
for(let i in this.props.items) {
stateItems.push(
<div className="react-item movie" key={i}>
<div className="front">
<div className="front-image" style={{backgroundImage: `url(${this.props.items[i].poster})`}}>
</div>
<div className="backdrop medium">
<div className="react-play-button fill">
<figure className="icon-content"></figure>
</div>
</div>
</div>
</div>
)
}
this.setState({
items: stateItems
})
}
componentWillUnmount() {
window.removeEventListener("resize", this.updateCarousel, false)
}
updateCarousel = () => {
var $reactItem = $('.carousel-wrapper .carousel-inner .react-item')
var maxw = $('.carousel-wrapper').width()
/*var slideItemsFit = $reactItem.filter(function () {
return $(this).position().left < maxw
}).length*/
var itemsFitSlide = Math.floor(maxw / $reactItem.outerWidth(true))
console.log(itemsFitSlide)
var margin = $reactItem.outerWidth(true) * itemsFitSlide
margin = (maxw - margin) / itemsFitSlide / 2
$reactItem.css({marginLeft: `${margin}px`, marginRight: `${margin}px`})
this.setState({
itemsShownTotal: itemsFitSlide,
itemWidth: $reactItem.outerWidth(true),
navNextDisabled: (itemsFitSlide === this.state.items.length),
itemsFitSlide: itemsFitSlide
})
}
componentDidMount() {
this.updateCarousel()
window.addEventListener("resize", this.updateCarousel, false)
}
handleNext(e) {
var state = this.state
var maxw = $('.carousel-wrapper').width()
var innerWidth = -Math.abs(state.innerWidth - (state.itemWidth * state.itemsFitSlide))
var itemsLeft = state.items.length - state.itemsShownTotal
var lastSlide = state.itemsFitSlide > itemsLeft
if(lastSlide) {
innerWidth = -Math.abs(state.innerWidth - (state.itemWidth * itemsLeft))
}
var itemsShownTotal = (lastSlide)
? state.itemsShownTotal + itemsLeft
: state.itemsShownTotal + state.itemsFitSlide
this.setState({
itemsShownTotal: itemsShownTotal,
innerWidth: innerWidth,
navPrevDisabled: false,
navNextDisabled: itemsShownTotal === state.items.length
})
}
handlePrev(e) {
var state = this.state
var innerWidth = state.innerWidth + (state.itemWidth * state.itemsFitSlide)
//var itemsLeft = state.itemsFitSlide - state.itemsShownTotal
var firstSlide = false
if(innerWidth >= 0) {
firstSlide = true
innerWidth = 0
}
var itemsShownTotal = (firstSlide)
? state.itemsFitSlide
: state.itemsShownTotal - state.itemsFitSlide
this.setState({
itemsShownTotal: itemsShownTotal,
innerWidth: innerWidth,
navPrevDisabled: firstSlide,
navNextDisabled: false
})
}
render() {
var nav = {
prev: classNames({
navigation: true,
prev: true,
disabled: this.state.navPrevDisabled,
whiteframe: true
}),
next: classNames({
navigation: true,
next: true,
disabled: this.state.navNextDisabled,
whiteframe: true
})
}
return (
<section className="block collection carousel portrait">
<div className="scaffold">
<i className={nav.prev} onClick={this.handlePrev}></i>
<i className={nav.next} onClick={this.handleNext}></i>
<header className="collection-header">
<NavLink to={this.props.route}>
<h2>{this.props.title}</h2>
</NavLink>
</header>
<div className="carousel-wrapper">
<div className="carousel-inner use-transition" style={{transform: `translateX(${this.state.innerWidth}px)`}}>
{this.state.items}
</div>
</div>
</div>
</section>
)
}
}
Basically let's say there's 5 images in a slide, but only width enough in the wrapper to fit 4 images, I then want to redo the process and margin the 4 images to fit the center of the wrapper.
carousel.css
.scaffold {
position: relative;
}
.block.collection .collection-header {
margin: 0 0 20px;
position: relative;
padding-top: 20px;
}
.block.collection .collection-header h2 {
outline: none;
text-decoration: none;
margin: 0;
color: #212d33;
font-size: 2.6rem;
letter-spacing: -0.01em;
line-height: 36px;
font-weight: normal;
}
.block.collection.carousel .carousel-wrapper {
overflow: hidden;
width: 100%;
}
.block.collection.carousel .carousel-wrapper .carousel-inner {
display: inline-block;
margin-right: 5px;
white-space: nowrap;
}
.block.collection.carousel .carousel-wrapper .carousel-inner.use-transition {
transition: transform 0.5s ease-out;
}
.block.collection.portrait .react-item {
width: 186px;
margin: 0 0px 20px 0px;
}
.block.collection.portrait .react-item.hidden {
opacity: 0;
}
.block.collection .react-item {
position: relative;
display: inline-block;
vertical-align: top;
margin-top: 10px;
margin-bottom: 10px;
}
.block.collection.portrait .react-item .front {
height: 279px;
}
.block.collection .react-item .front {
background-color: #212d33;
position: relative;
display: block;
text-decoration: none;
}
.block.collection .react-item .front .front-image {
animation: fadein 500ms;
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
background-size: cover;
}
.block.collection .react-item .backdrop {
transition: opacity 0.1s ease-in-out;
opacity: 0;
height: 100%;
position: absolute;
width: 100%;
top: 0;
left: 0;
z-index: 5;
text-align: center;
background: rgba(15, 22, 26, 0.25);
}
.block.collection .react-item .backdrop:hover {
opacity: 1;
}
.react-play-button.fill {
margin: 0;
width: 100%;
height: 100%;
background-size: 68px;
}
.react-play-button {
display: flex;
align-items: center;
justify-content: center;
background-color: transparent;
border: 0;
padding: 0;
cursor: pointer;
}
.react-play-button .icon-content {
width: 68px;
height: 68px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHN2ZyBoZWlnaHQ9IjEwMCUiIHdpZHRoPSIxMDAlIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgdmVyc2lvbj0iMS4wIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIj4KICAgIDxzdHlsZT48IVtDREFUQVsKICAgICAgICBnIHsKICAgICAgICAgICAgc3Ryb2tlOiAjZmZmOwogICAgICAgIH0KICAgICAgICBnIGNpcmNsZSB7CiAgICAgICAgICAgIGZpbGw6IHJnYmEoMCwwLDAsMC4wKTsKICAgICAgICAgICAgc3Ryb2tlLXdpZHRoOiA0OwogICAgICAgIH0KICAgICAgICBnIHBvbHlsaW5lIHsKICAgICAgICAgICAgZmlsbDogdHJhbnNwYXJlbnQ7CiAgICAgICAgICAgIHN0cm9rZS13aWR0aDogMTA7CiAgICAgICAgfQogICAgXV0+PC9zdHlsZT4KCiAgICA8Zz4KICAgICAgICA8Y2lyY2xlIHI9IjQ4IiBjeD0iNTAiIGN5PSI1MCIgLz4KICAgICAgICA8cG9seWxpbmUgcG9pbnRzPSI0MSwyOCA2Myw1MCA0MSw3MiIgLz4KICAgIDwvZz4KPC9zdmc+);
background-size: contain;
background-position: center;
background-repeat: no-repeat;
}
.block.collection.carousel .navigation {
top: 49%;
border: none;
cursor: pointer;
position: absolute;
width: 66px;
background: rgba(249, 249, 251, 0.7);
width: 48px;
height: 60px;
display: block;
font-size: 0;
border-radius: 2px;
z-index: 10;
opacity: 1;
pointer-events: auto;
transition: opacity .3s ease-in-out;
}
.block.collection.carousel .navigation.disabled {
opacity: 0;
pointer-events: none;
}
.block.collection.carousel .navigation:hover {
background-color: #FFF;
}
.block.collection.carousel .navigation:hover::after {
opacity: 1;
}
.block.collection.carousel .navigation.prev {
left: -25px;
}
.block.collection.carousel .navigation.next {
right: -25px;
}
.block.collection.carousel .navigation::after {
transition: opacity .5s ease;
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDE5LjIuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxMy40IDI0IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxMy40IDI0OyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+Cgkuc3Qwe2ZpbGw6IzIxMkQzMzt9Cjwvc3R5bGU+CjxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0wLDEuNEwxMC42LDEyTDAsMjIuNkwxLjQsMjRsMTItMTJMMS40LDBMMCwxLjR6Ii8+Cjwvc3ZnPgo=) no-repeat;
width: 16px;
height: 24px;
content: '';
position: absolute;
top: 18px;
left: 18px;
opacity: 0.7;
}
.block.collection.carousel .navigation.prev::after {
left: 13px;
transform: rotate(180deg);
}

Resources