Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ 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

Auto Save

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 class="pagination black">
	<div class="dot selected"></div>
	<div class="dot"></div>
	<div class="dot"></div>
	<div class="dot"></div>
</div>
<div class="background">
	<div class="shapes">
		<div class="circle c1"></div>
		<div class="circle c2"></div>
		<div class="circle c3"></div>
		<div class="circle c4"></div>
		<div class="circle c5"></div>
		<div class="circle c6"></div>
		<div class="circle c7"></div>
	</div>
	<div class="background background2"></div>
</div>
<div class="flicking">
	<div class="eg-flick-viewport">
		<div class="eg-flick-camera">
			<div class="page main">
				<div class="wheel"></div>
				<div class="container">
					<h1>Flicking</h1>
					<p class="description">You can make flicking gestures, which are ways to navigate left and right to move between panels arranged side by side.</p>
				</div>
			</div>
			<div class="page features">
				<div class="feature">
					<h3>Infinite Flicking</h3>
					<p class="description">You can dynamically add panels to the flicking.</p>
				</div>
				<div class="feature">
					<h3>Free Scroll</h3>
					<p class="description">The panels are freely scrollable..</p>
				</div>
				<div class="feature">
					<h3>Variable Size</h3>
					<p class="description">You can place multiple panels and specify various sizes for each panel.</p>
				</div>
				<div class="feature">
					<h3>Flexible Align</h3>
					<p class="description">Use Hanger and Anchor to provide customizable alignment.</p>
				</div>
				<div class="feature">
					<h3>Progress</h3>
					<p class="description">Indicates the overall progress of the Flicking.</p>
				</div>
				<div class="feature">
					<h3>Bound</h3>
					<p class="description">Bound the panels so that they are not out of the flicking area.</p>
				</div>
			</div>
			<div class="page slogan">
				<div class="container">
					<h2>Everyday <span data-text="30"></span> million people experience. <br/>It's reliable, flexible and extendable carousel.</h2>
				</div>
			</div>
			<div class="page more">
				<div class="container">
					<a href="https://github.com/naver/egjs-flicking" target="_blank"><h2>LEARN&nbsp;<br/>MORE&nbsp;</h2></a>
				</div>
			</div>
		</div>
	</div>
	<div class="imac">
		<div class="screen">
			<div class="container">
				<div class="panels">
					<div class="panel"></div>
					<div class="panel"></div>
					<div class="panel"></div>
					<div class="panel"></div>
				</div>
			</div>
		</div>
		<div class="bottom"></div>
		<div class="stand"></div>
		<div class="stand-bottom"></div>
	</div>
	<div class="macbook">
		<div class="screen ratio062">
			<div class="container">
				<div class="panels">
					<div class="panel"></div>
					<div class="panel"></div>
					<div class="panel"></div>
					<div class="panel"></div>
				</div>
			</div>
		</div>
		<div class="bottom"></div>
	</div>
	<div class="ipad ratio13">
		<div class="container">
			<div class="panels">
				<div class="panel"></div>
				<div class="panel"></div>
				<div class="panel"></div>
				<div class="panel"></div>
			</div>
		</div>
	</div>
	<div class="iphone">
		<div class="head"></div>
		<div class="container">
			<div class="panels">
				<div class="panel"></div>
				<div class="panel"></div>
				<div class="panel"></div>
				<div class="panel"></div>
			</div>
		</div>
		<div class="home"></div>
	</div>
</div>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css?family=Open+Sans:400,700,800&display=swap');

* {
	font-family: 'Open Sans', sans-serif;
	letter-spacing: 0.5px;
}
.ratio13:before {
	content: "";
	position: relative;
	display: block;
	width: 100%;
	padding-top: 130%;
}
.ratio062:before {
	content: "";
	position: relative;
	display: block;
	width: 100%;
	padding-top: 66%;
}
html, body, .flicking, .background {
	position: relative;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
}
.flicking, .background {
	position: absolute;
	overflow: hidden;
}
.background .rect,
.background .circle,
.background .star,
.background .triangle {
	position: absolute;
}
.background .circle {
	border-radius: 50%;
}
.background .circle:before {
	content: "";
	position: relative;
	display: block;
	width: 100%;
	padding-top: 100%;
}
.c1 {
	width: 60vmax;
	min-width: 1000px;
	bottom: 50%;
	right: 45%;
	background: #E46865;
}
.c2 {
	width: 50%;
	min-width: 800px;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	border: 30px solid #f0f0f0;
	z-index: -1;
}
.c3 {
	width: 40%;
	min-width: 600px;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: #F2B51D;
	z-index: -1;
}
.c4 {
	width: 60vmax;
	min-width: 1000px;
	top: 50%;
	left: 45%;
	background: #30B78E;
}
.c5 {
	width: 20%;
	min-width: 300px;
	bottom: 60%;
	left: 70%;
	border: 40px solid #ea905d;
}
.c6 {
	width: 20%;
	min-width: 300px;
	top: 60%;
	right: 70%;
	border: 40px solid #5d95ea;
}
.c7 {
	width: 60vmax;
	min-width: 1000px;
	left: 50%;
	top: 80%;
	background: #6692CA;
}
.r1 {
	width: 20px;
	height: 20px;
	top: 90%;
	right: 65%;
	border: 3px solid #7095DD;
	border-radius: 2px;
}
.t1 {
	width: 22px;
	bottom: 90%;
	left: 65%;
}
.iphone, .ipad, .macbook, .imac {
	z-index: 2050;
	transform: translateY(100vh);
}
.iphone {
	position: absolute;
	width: 200px;
	height: 400px;
	border-radius: 20px;
	background: #eee;
	box-shadow: rgba(100, 100, 100, 0.4) 5px 5px;
	left: 50%;
	top: 100%;
	transform: translate(-50%, -90px);
	margin: auto;
	transform-origin: bottom;
}
.iphone .head {
	position: absolute;
	width: 36px;
	height: 8px;
	top: 22px;
	left: 0;
	right: 0;
	border-radius: 4px;
	margin: auto;
	background: #ddd;
}
.iphone .container {
	position: absolute;
	width: calc(100% - 16px);
	height: calc(100% - 100px);
	background: transparent;
	border: 2px solid #ddd;
	background: #eee;
	position: absolute;
	border-radius: 5px;
	left: 0;
	right: 0;
	margin: auto;
	bottom: 52px;
}
.iphone .home {
	position: absolute;
	width: 36px;
	height: 36px;
	border: 2px solid #ccc;
	background: #eee;
	border-radius: 50%;
	bottom: 6px;
	left: 0;
	right: 0;
	margin: auto;
}

.panels {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 100%;
	height: 150px;
}
.panels .panel {
	position: relative;
	width: 70%;
	height: 100%;
	border-radius: 10px;
	background: #f55;
}
.panels .panel:nth-child(4n + 1) {
	background-color:#78CAFF;
}
.panels .panel:nth-child(4n + 2) {
	background-color:#FFD99D;
}
.panels .panel:nth-child(4n + 3) {
	background-color:#FFB0B9;
}
.panels .panel:nth-child(4n) {
	background-color:#B5F6B9;
}
.ipad {
	position: absolute;
	width: 150px;
	background: #444;
	border-radius: 5px;
	left: 50%;
	bottom: 50%;
}
.ipad .container {
	position: absolute;
	left: 6px;
	top: 6px;
	bottom: 6px;
	right: 6px;
	background: #eee;
	border-radius: 3px;
}
.ipad .panels {
	height: 80px;
}
.ipad .panels .panel {
	width: 40%;
}
.imac {
	position: absolute;
	width: 280px;
	left: 50%;
	bottom: 50%;
}
.imac .screen {
	position: relative;
	width: 100%;
	height: 170px;
	margin: auto;
	background: #444;
	border-radius: 5px 5px 0px 0px;
}
.imac .screen .container {
	position: absolute;
	left: 8px;
	right: 8px;
	top: 12px;
	bottom: 12px;
	background: #eee;
}
.imac .panels {
	height: 60px;
}
.imac .panels .panel {
	width: 50px;
}

.imac .bottom {
	position: relative;
	width: 100%;
	height: 26px;
	margin: auto;
	background: #eee;
	border-radius: 0px 0px 5px 5px;	
}
.imac .stand {
	position: relative;
	margin: auto;
	width: 40px;
	border-bottom: 35px solid #eee;
	border-left: 15px solid transparent;
	border-right: 15px solid transparent;
}
.imac .stand-bottom {
	position: relative;
	margin: auto;
	width: 100px;
	height: 6px;
	border-radius: 3px;
	background: #e5e5e5;
}
.macbook {
	position: absolute;
	width: 240px;
	left: 50%;
	bottom: 50%;
}
.macbook .screen {
	position: relative;
	width: 200px;
	margin: auto;
	background: #444;
	border-radius: 5px;
}
.macbook .screen .container {
	position: absolute;
	left: 6px;
	top: 6px;
	bottom: 6px;
	right: 6px;
	background: #eee;
	border-radius: 3px;
}
.macbook .panels {
	height: 50px;
}
.macbook .panels .panel {
	width: 40px;
}
.macbook .bottom {
	position: relative;
	width: 240px;
	height: 10px;
	background: #eee;
	margin: 3px auto 0px;
	border-radius: 5px;
}

.background2 {
	background: #9c5dea;
	z-index: -1;
	transform: translateY(100vh);
}
.flicking .eg-flick-viewport,
.flicking .eg-flick-camera,
.flicking .page {
	position: relative;
	width: 100%;
	height: 100%;	
}
.flicking .page .container {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
}
.flicking .page.main h1, .flicking .page.main .description {
	text-align: center;
} 
.flicking .page.main h1 {
	font-size: 60px;
	padding: 0;
	margin-bottom: 15px;
	color: #fff;
}
.flicking .page.main .description {
	font-size: 16px;
	max-width: 600px;
	margin: 0px auto;
	padding: 5px;
	box-sizing: border-box;
	color: #fff;
}

.flicking .page.features h3,
.flicking .page.features .description {
	color: #fff;
}
.flicking .page.features .feature {
	position: absolute;
	width: 200px;
	top: 50%;
	left: 50%;
}

.flicking .page.slogan h2 span[data-text]:before {
	content: attr(data-text);
}
.flicking .page.slogan .container {
	min-width: 600px;
	height: 350px;
	text-align: center;
	color: #eee;
}
.flicking .page.more a {
	text-decoration: underline;
	color: #eee;
}
.flicking .page.more h2 {
	width: 110px;
	padding: 5px 10px 5px 10px;
	border: 3px solid #eee;
	color: #eee;
}



.pagination {
	position: fixed;
	right: 0;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2080;
}
.pagination .dot {
	position: relative;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.4);
	margin: 10px 10px;
	transition: background-color ease 0.5s;
	cursor: pointer;
}
.pagination.black .dot.selected {
	background: #333;
}
.pagination.black .dot {
	background: rgba(100, 100, 100, 0.4);
}
.pagination .dot.selected {
	background: white;
}

.wheel {
	position: absolute;
	bottom: 110px;
	width: 2px;
	height: 10px;
	left: 50%;
	transform: translate(-50%, 0);
	background: #eee;
}
              
            
!

JS

              
                
// https://github.com/naver/egjs-flicking
const flicking = new eg.Flicking(".flicking", {
	horizontal: false,
	autoResize: true,
	duration: 700,
});

const pagination = document.querySelector(".pagination");
const dots = [].slice.call(pagination.querySelectorAll(".dot"));


dots.forEach((dot, i) => {
	dot.addEventListener("click", () => {
		flicking.moveTo(i);
	});
})
flicking.on("change", e => {
	const index = e.index;

	if (index === 0 || index === 3) {
		pagination.classList.add("black");
	} else {
		pagination.classList.remove("black");
	}
	dots[flicking.getIndex()].classList.remove("selected");
	dots[index].classList.add("selected");
});



new eg.Flicking(".iphone .panels", {
	circular: true,
	gap: 10,
});

new eg.Flicking(".ipad .panels", {
	circular: true,
	gap: 5,
});

new eg.Flicking(".imac .panels", {
	circular: true,
	gap: 5,
});

new eg.Flicking(".macbook .panels", {
	circular: true,
	gap: 5,
});




// https://github.com/daybrush/scenejs
const scene = new Scene({
	".c1": {
		0: {
			right: "45%",
			transform: "translate(0%, 0vh) translateY(0%)",
		},
		1: {
			right: "60%",
			transform: "translate(0%, 50vh) translateY(60%)",
		},
		2: {
			right: "85%",
			transform: "translate(40%, 20vh) translateX(0vw) translateY(0%) scale(1)",
		},
		3: {
			right: "50%",
			transform: "translateX(7vw) translate(50%, 8vh) translateY(50%) scale(0.3)",
		}
	},
	".c2": {
		0.4: {
			transform: "translate(-50%, -50%) scale(1)",
		},
		1: {
			transform: "scale(0)",
		}
	},
	".c3": {
		0.5: {
			width: "40vmax",
		},
		0.8: {
			"border-radius": "50%",
		},
		1: {
			width: "120vmax",
			"border-radius": "0%",
			transform: "translate(-50%, -50%) translateY(0vh)",
		},
		2: {
			width: "120vmax",
			transform: "translateY(-100vh) translate(-50%, -50%) scale(1)",
			"border-radius": "0%",
		},
		2.2: {
			"border-radius": "50%",
		},
		3: {
			width: "40vmax",
			transform: "translate(-65%, -40%) translateY(0vh) scale(0.5)",
		}
	},
	".c4": {
		0: {
			transform: "translate(0%, 0vh) translateY(0%)",
			left: "45%",
		},
		1: {
			transform: "translate(0%, -50vh) translateY(-60%)",
			left: "60%",
		},
		2: {
			transform: "translate(0%, -100vh) translateY(-100%)  scale(1)",
			left: "85%",
		},
		3: {
			left: "57%",
			transform: "translate(-50%, 0vh) translateY(-60%) scale(0.27)",
		}
	},
	".c5": {
		0: {
			transform: "translate(0, 0%)",
		},
		1: {
			transform: "translate(0, -100%)",
		},
	},
	".c6": {
		0: {
			transform: "translate(0, 0%) translate2(0vw, 0vh)",
		},
		1: {
			transform: "translate(0, -100%) translate2(0vw, -100vh)",
		},
	},
	".iphone": {
		0: {
			transform: "translate(-50%, -90px) translateY(0vh) translateY2(0%)",
		},
		1: {
			transform: "translate(-50%, 0px) translateY(-50vh) translateY2(-50%) translateX(0px) translateY3(0vh) scale(1)",
			background: "#eee",
		},
		2: {
			transform: "translate(-50%, -30px) translateX(120px) translateY2(-50%) translateY3(0vh) scale(0.3)",
			background: "#444",
		},
		3: {
			transform: "translateY3(-50vh) translateY2(-100%)",
		}
	},
	".imac": {
		1: {
			transform: "translate(-50%) translate2(0px, 170px) translateY(50vh)",
			opacity: 0,
		},
		2: {
			transform: "translateY(0vh) translateY2(0%)",
			opacity: 1,
		},
		3: {
			transform: "translateY(-50vh) translateY2(-100%)",
		},
	},
	".macbook": {
		1: {
			transform: "translate(-50%) translate2(-200px, 170px) translateY(70vh)",
			opacity: 0,
		},
		2: {
			transform: "translateY(0vh) translate2(-200px, 170px) translateY2(0%)",
			opacity: 1,
		},
		3: {
			transform: "translateY(-50vh) translate2(-200px, 0px) translateY2(-150%)",
		},
	},
	".ipad": {
		1: {
			transform: "translate(-50%) translate2(200px, 170px) translateY(70vh)",

		},
		1.3: {
			opacity: 0,
		},
		2: {
			transform: "translateY(0vh) translate2(200px, 170px) translateY2(0%)",
			opacity: 1,
		},
		3: {
			transform: "translateY(-50vh) translate2(200px, 50px) translateY2(-100%)",
		},
	},
	".background2": {
		1: {
			transform: "translateY(100vh)",
		},
		2: {
			transform: "translateY(0vh)",
		},
		3: {
			transform: "translateY(-100vh)",
		}
	},
	".iphone .container": {
		0.9: {
			opacity: 0,
		},
		1: {
			opacity: 1,
		},
	},
	".feature": i => ({
		0.9: {
			transform: "translate(-50%, -50%) translate2(0px, 0px)",
			opacity: 0,
		},
		1: {
			transform: `translate2(${(i % 2 ? 1 : -1) * 220}px, ${(Math.floor(i / 2) - 1) * 120}px)`,
			opacity: 1,
		},
		2: {
			opacity: 0,
		}
	}),
	".panel.slogan h2": {
		1.7: {
			opacity: 0,
		},
		2: {
			opacity: 1,
		}
	},
	".c7": {
		1: {
			transform: "translate(0%, 0%)",
			top: "100%",
		},
		2: {
			transform: "translate(0%, 0%) scale(1)",
			top: "80%",
		},
		3: {
			top: "50%",
			transform: "translate(-60%, -60%) scale(0.3)",
		},
	},
}, {
	selector: true,
}).setTime(0);


flicking.on("move", e => {
	scene.setTime(`${e.progress * 100}%`);
});

new Scene({
	".wheel": {
		0: {
			transform: "translate(-50%, -90px)",
			height: "0px",
		},
		0.5: {
			height: "30px",
		},
		1: {
			height: "0px",
			transform: "translate(-50%, 0px)",
		}
	},
}, {
	selector: true,
	easing: "ease-in-out",
	iterationCount: "infinite",
}).playCSS();


let isEnableScroll = true;
let timerId = 0;

function setScrollTimer() {
	isEnableScroll = false;
	if (timerId) {
		clearTimeout(timerId);
	}
	timerId = setTimeout(function () {
		isEnableScroll = true;
	}, 600);
}
window.addEventListener("wheel", function (e) {
	if (!isEnableScroll || flicking.isPlaying()) {
		return;
	}
	e.preventDefault();
	var delta = e.deltaY;

	if (Math.abs(delta) > 40) {
		setScrollTimer();
		if (delta > 0) {
			flicking.next();
		} else if (delta < 0) {
			flicking.prev();
		}
	}
}, {
	passive: false,
});
              
            
!
999px

Console