Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                	<div id="root">Please stand by..</div>
              
            
!

CSS

              
                body {
	background-color: #f6f6f6;
	text-align: center;
	color: white;
	margin: 0;
}
a,
a:hover {
	text-decoration: none;
	cursor: default;
}
.carousel {
	max-width: 1002px;
	margin: auto;
}
.card-container {
	position: relative;
	display: inline-block;
	overflow: hidden;
	margin: 26px auto 0 auto;
	min-width: 230px;
	max-width: 308px;
	width: 100%;
	color: #000;
	font-size: 16px;
	text-align: left;
	box-shadow: 0px 1px 1px 0px #ccc;
}
.card-container * {
	-webkit-box-sizing: border-box;
	box-sizing: border-box;
	-webkit-transition: all 0.25s ease;
	transition: all 0.25s ease;
}
.card-container:before {
	position: absolute;
	top: 10px;
	bottom: 10px;
	left: 10px;
	right: 10px;
	content: "";
	-webkit-transition: all 0.25s ease;
	transition: all 0.25s ease;
	-webkit-transition-delay: 0.25s;
	transition-delay: 0.25s;
}
.card-container a {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 1;
}
.card {
	padding: 0;
	box-shadow: 0px 1px 1px 0px #ccc;
	height: 323px;
}
.card-hero-img {
	width: 100%;
	height: 133px;
}
.card-heading-container {
	padding: 19px 19px 0;
	display: flex;
	align-items: center;
}
.card-social-icon {
	padding: 0;
	border-radius: 50px;
	max-width: 45px;
}
.card-title-container {
	padding-left: 10px;
	text-align: left;
}
h3.card-title {
	font-size: 23px;
	color: #3a3a3a;
	font-family: arial;
	font-weight: bold;
	margin: 0;
}
.card-sub-title {
	font-size: 12px;
	color: #adadad;
	font-family: arial;
	text-transform: uppercase;
	font-weight: bold;
	margin: 0;
}
.icon-container {
	position: absolute;
	bottom: 0;
	width: 100%;
	display: flex;
}
.card-text-container {
	position: relative;
}
.card-text {
	font-size: 12px;
	line-height: 1.584;
	color: #3a3a3a;
	font-family: arial;
	padding: 19px;
	margin: 0;
	text-align: left;
}
/* HEART ICON - NOT LIKED*/
.far.fa-heart,
.fas.fa-heart {
	padding: 0 0px 19px 19px;
	color: #2a8631;
	z-index: 9999999;
	display: flex;
}

.far.fa-heart,
.fas.fa-heart:hover {
	cursor: pointer;
}

.heart-liked-text {
	margin: 0;
	display: inline-block;
	padding-left: 10px;
	text-transform: uppercase;
	font-family: arial;
	font-weight: 700;
	font-size: 12px;
	margin-top: 1px;
	color: #f6f6f6;
	-webkit-transition: ease-in-out all 0.3s;
	transition: ease-in-out all 0.3s;
}
.liked {
	color: #ed1965;
}
@media (max-width: 800px) {
	h3.card-title {
		font-size: 18px;
	}
	.card-sub-title {
		font-size: 12px;
	}
	.card-text {
		font-size: 12px;
	}
}
/* -------------------------------------------------------------- */
/* SLICK REACT CAROUSEL */
/* -------------------------------------------------------------- */
.slick-next,
.slick-prev {
	top: 108.5%;
}
.slick-next {
	right: 0;
	text-align: left;
	width: 49.3%;
}
.slick-prev {
	left: 0;
	text-align: right;
	margin-right: 1.4%;
	width: 49.3%;
}
.slick-prev:before,
.slick-next:before {
	font-family: "Font Awesome\ 5 Free";
	font-size: 19px;
	color: #2a8631;
	line-height: 1;
	opacity: 0.75;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-weight: 900;
}
.slick-prev:before {
	content: "\f053";
}
[dir="rtl"] .slick-prev:before {
	content: "\f054";
}
[dir="rtl"] .slick-next {
	left: -10px;
	top: 70px;
	right: auto;
}
.slick-next:before {
	content: "\f054";
}
[dir="rtl"] .slick-next:before {
	content: "\f053";
}

              
            
!

JS

              
                $(document).ready(function() {
// -----------------------------------------------------------------------------
// THESE CARDS OBJECTS CAN BE EDITED, MOVED OR COPIED FOR ADDED FLEXIBLITY
// -----------------------------------------------------------------------------
	var cards = [
		
		// 			 CARD 1
		
		{
			image: "https://res.cloudinary.com/cloudinary-ls-images/image/upload/v1558290036/img/website-banner.jpg",
			imageAlt: "Lloyd Sibson's Website Banner",
			imageTitle: "Lloyd Sibson's Logo",
			imageSocial:
				"https://res.cloudinary.com/cloudinary-ls-images/image/upload/b_black/v1558290036/img/logo-medium.jpg",
			imageSocialAlt: "Lloyd Sibson's Social Icon",
			imageSocialTitle: "Social Icon",
			link: "https://lloydsibson.com/",
			title: "Lloyd Sibson",
			subTitle: "Front-End Developer",
			text:
				"BA Front-End Web Developer, UI/UX and Graphic Designer from Leicester, UK. Specialising in jQuery, ReactJS and JavaScript."
		},

		// 			 CARD 2
		
		{
			image: "https://res.cloudinary.com/cloudinary-ls-images/image/upload/v1558290036/img/website-banner.jpg",
			imageAlt: "Lloyd Sibson's Website Banner",
			imageTitle: "Lloyd Sibson's Logo",
			imageSocial:
				"https://res.cloudinary.com/cloudinary-ls-images/image/upload/b_black/v1558290036/img/logo-medium.jpg",
			imageSocialAlt: "Lloyd Sibson's Social Icon",
			imageSocialTitle: "Social Icon",
			link: "https://lloydsibson.com/",
			title: "Lloyd Sibson",
			subTitle: "Front-End Developer",
			text:
				"BA Front-End Web Developer, UI/UX and Graphic Designer from Leicester, UK. Specialising in jQuery, ReactJS and JavaScript."
		},
		
		// 			 CARD 3
		
		{
			image: "https://res.cloudinary.com/cloudinary-ls-images/image/upload/v1558290036/img/website-banner.jpg",
			imageAlt: "Lloyd Sibson's Website Banner",
			imageTitle: "Lloyd Sibson's Logo",
			imageSocial:
				"https://res.cloudinary.com/cloudinary-ls-images/image/upload/b_black/v1558290036/img/logo-medium.jpg",
			imageSocialAlt: "Lloyd Sibson's Social Icon",
			imageSocialTitle: "Social Icon",
			link: "https://lloydsibson.com/",
			title: "Lloyd Sibson",
			subTitle: "Front-End Developer",
			text:
				"BA Front-End Web Developer, UI/UX and Graphic Designer from Leicester, UK. Specialising in jQuery, ReactJS and JavaScript."
		},

		// 			 CARD 4

		{
			image: "https://res.cloudinary.com/cloudinary-ls-images/image/upload/v1558290036/img/website-banner.jpg",
			imageAlt: "Lloyd Sibson's Website Banner",
			imageTitle: "Lloyd Sibson's Logo",
			imageSocial:
				"https://res.cloudinary.com/cloudinary-ls-images/image/upload/b_black/v1558290036/img/logo-medium.jpg",
			imageSocialAlt: "Lloyd Sibson's Social Icon",
			imageSocialTitle: "Social Icon",
			link: "https://lloydsibson.com/",
			title: "Lloyd Sibson",
			subTitle: "Front-End Developer",
			text:
				"BA Front-End Web Developer, UI/UX and Graphic Designer from Leicester, UK. Specialising in jQuery, ReactJS and JavaScript."
		},

		// 			 CARD 5
		
		{
			image: "https://res.cloudinary.com/cloudinary-ls-images/image/upload/v1558290036/img/website-banner.jpg",
			imageAlt: "Lloyd Sibson's Website Banner",
			imageTitle: "Lloyd Sibson's Logo",
			imageSocial:
				"https://res.cloudinary.com/cloudinary-ls-images/image/upload/b_black/v1558290036/img/logo-medium.jpg",
			imageSocialAlt: "Lloyd Sibson's Social Icon",
			imageSocialTitle: "Social Icon",
			link: "https://lloydsibson.com/",
			title: "Lloyd Sibson",
			subTitle: "Front-End Developer",
			text:
				"BA Front-End Web Developer, UI/UX and Graphic Designer from Leicester, UK. Specialising in jQuery, ReactJS and JavaScript."
		},

		// 			 CARD 6
		
		{
			image: "https://res.cloudinary.com/cloudinary-ls-images/image/upload/v1558290036/img/website-banner.jpg",
			imageAlt: "Lloyd Sibson's Website Banner",
			imageTitle: "Lloyd Sibson's Logo",
			imageSocial:
				"https://res.cloudinary.com/cloudinary-ls-images/image/upload/b_black/v1558290036/img/logo-medium.jpg",
			imageSocialAlt: "Lloyd Sibson's Social Icon",
			imageSocialTitle: "Social Icon",
			link: "https://lloydsibson.com/",
			title: "Lloyd Sibson",
			subTitle: "Front-End Developer",
			text:
				"BA Front-End Web Developer, UI/UX and Graphic Designer from Leicester, UK. Specialising in jQuery, ReactJS and JavaScript."
		}
	];
	var Article = React.createClass({
		render: function() {
			var image = this.props.data.image,
				imageAlt = this.props.data.imageAlt,
				imageTitle = this.props.data.imageTitle,
				imageSocial = this.props.data.imageSocial,
				imageSocialAlt = this.props.data.imageSocialAlt,
				imageSocialTitle = this.props.data.imageSocialTitle,
				title = this.props.data.title,
				subTitle = this.props.data.subTitle,
				text = this.props.data.text,
				link = this.props.data.link;
			return (
				<figure className="card-container">
					<div className="card">
							<img
								className="card-hero-img"
								src={image}
								alt={imageAlt}
								title={imageTitle}
							/>
							<div className="card-heading-container">
								<img
									className="card-social-icon"
									src={imageSocial}
									alt={imageSocialAlt}
									title={imageSocialTitle}
								/>
								<div className="card-title-container">
									<h3 className="card-title">{title}</h3>
									<p className="card-sub-title">{subTitle}</p>
								</div>
							</div>
							<div className="card-text-container">
								<p className="card-text">{text}</p>
							</div>
							<div className="icon-container">
								<i className="far fa-heart heart-icon" />
								<p className="heart-liked-text">Liked +1</p>
							</div>
					</div>
					<a href={link} target="_blank" />
				</figure>
			);
		}
	});
// -----------------------------------------------------------------------------
// 	REACT SLICK CAROUSEL - DUE TO TIME CONTRAINTS A PLUG-IN WAS USED. APOLOGIES.
// -----------------------------------------------------------------------------
	var News = React.createClass({
		render: function() {
			var data = this.props.data;
			var newsTemplate;
			var settings = {
				dots: false,
				infinite: false,
				accessibility: true,
				slidesToShow: 3,
				slidesToScroll: 1,
				responsive: [
					{
						breakpoint: 1024,
						settings: {
							slidesToShow: 2,
							slidesToScroll: 1
						}
					},
					{
						breakpoint: 700,
						settings: {
							slidesToShow: 1,
							slidesToScroll: 1
						}
					}
				]
			};
			if (data.length > 0) {
				newsTemplate = data.map(function(item, index) {
					return (
						<div key={index}>
							<Article data={item} />
						</div>
					);
				});
			} else {
				newsTemplate = <p>Please add some cards</p>;
			}
			return (
				<div className="news">
					<Slider {...settings}>{newsTemplate}</Slider>
				</div>
			);
		}
	});
	var Carousel = React.createClass({
		render: function() {
			return (
				<div className="carousel">
					<News data={cards} />
				</div>
			);
		}
	});
	ReactDOM.render(<Carousel />, document.getElementById("root"));

// -----------------------------------------------------------------------------
// JAVASCRIPT
// -----------------------------------------------------------------------------

// CHANGES HEART ICON ON CLICK AND ALSO TOGGLES THE WORD 'LIKED'
	
	$(".heart-icon").on("click", function() {
		$(this).toggleClass("fas");
		$(this)
			.siblings("p")
			.toggleClass("liked");
	});
	
// END	
}); 


              
            
!
999px

Console