PrahaSobe Carousel alternative

In this example below you will see how to do a PrahaSobe Carousel alternative with some HTML / CSS and Javascript

Thumbnail
This awesome code was written by kubasanitrak, you can see more from this user in the personal repository.
You can find the original code on Codepen.io
Copyright kubasanitrak ©
  • HTML
  • CSS
  • JavaScript
    <div class="carousell-section"> 
<div class="carousell">
	<div class="carousell-item"> 
		<div class="cta-btn">btn label</div>
	</div>
	<div class="carousell-item">
		<div class="cta-btn">btn label</div> 
	</div>
	<div class="carousell-item">
		<div class="cta-btn">btn label</div>
	</div>
</div>
</div>

/*Downloaded from https://www.codeseek.co/kubasanitrak/prahasobe-carousel-alternative-pKvexe */
    *, *::before, *::after {margin: 0; padding: 0; }
html {box-sizing: border-box} *, *::before, *::after {box-sizing: inherit}


@mixin bgc-offset($n, $color) { @for $i from 1 through $n { &:nth-child(#{$i}) { background-color: darken($color, 0% + ($i * 2)); } } } 
@mixin mq($point) {@if $point == mq-XL {@media screen and (min-width: 90.1rem) { @content; } } @else if $point == mq-L-UP {@media screen and (min-width: 48.1rem)  { @content; } } @else if $point == mq-M-UP {@media screen and (min-width: 40.1rem)  { @content; } } @else if $point == mq-S {@media screen and (max-width: 40rem)  { @content; } } @else if $point == mq-land {@media screen and (orientation: landscape)  { @content; } } @else if $point == mq-portr {@media screen and (orientation: portrait)  { @content; } } }

$carousel-bgc-C: #fee000;
$car-item-pad: 1rem 0;

body {
	width: 100%;
	height: 100%;
}
.carousell-section {
	margin: 20px auto;
	width: 100%;
		background-color: $carousel-bgc-C;
		overflow-y: hidden;
}
.carousell {
	margin: 0 auto;
	display: flex;
	width: 80%;
	height: 90vh;
	flex-direction: column;
	
	@include mq(mq-L-UP) {
		flex-direction: row; 
		// overflow: hidden;
	}
	
	.carousell-item {
		width: calc(100% / 3);
		height: 100%;
		background-color: $carousel-bgc-C;
		display: flex;
		flex-direction: column;
		justify-content: flex-end;
		align-items: center;
		transition: all 0.5s;
		position: relative;
		padding: $car-item-pad;
		transform-origin: center bottom;
		// [horizontal offset] [vertical offset] [blur radius] [optional spread radius] [color];
		box-shadow: 0 0 10px 0 hsla(0, 0%, 0%, 0);  /* Opera 10.5, IE 9, Firefox 4+, Chrome 6+, iOS 5 */
		&:hover {
			cursor: pointer;
			background-color: lighten($carousel-bgc-C, 5%);
			transform: scale(1.05, 1.05);
			
			z-index: 100;
			box-shadow: 0 0 10px 0 hsla(0, 0%, 0%, 0.5);
		}
	}
}

div.cta-btn {
	width: 90%;
	background-color: #000;
	color: #fff;
	text-align: center;
	padding: 1rem; 
}


/*Downloaded from https://www.codeseek.co/kubasanitrak/prahasobe-carousel-alternative-pKvexe */
    

Comments