Pen Settings



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


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


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.


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.


                mixin control(direction, text)
	a(class= direction + " carousel-control", href="#carousel", role="button", data-slide=direction == "left" ? "prev" : "next")
		span(class="glyphicon glyphicon-chevron-"+direction,aria-hidden="true") text
- var ids = ["?random", "?image=999", "?image=967", "?image=916", "?image=921"];
		h1 Bootstrap default carousel with swipe and animation
		p.lead How to add the swipes gesture to comand the Bootstrap carousel on mobile devices.
		p Made by <strong><a href="">Walfter</a></strong>
			each image, index in ids
				li(data-target="#carousel")(data-slide-to=index)(class= index == 0 ? "active" : "")
			each image, index in ids
				.item(class= index == 0 ? "active" : "")
					img(src="" + image)
					.carousel-caption Заголовок
		+control ("left", "Prev")
		+control ("right", "next")


                .carousel-caption {
	background: rgba(black, 0.3);
	padding: 15px;
	margin: 0;
	font-size: 19px;
	margin-bottom: 40px;
.carousel-progress {
	position: absolute;
	bottom: 0;
	left: 0;
	background: rgba(black, 0.3);
	display: block;
	width: 100%;
	height: 5px;


	var swipe_obj = this;
	var mc = new Hammer(swipe_obj);
	mc.on("panleft panright panend panstart", function(event) {
		var obj_width = $(swipe_obj).width();
		xPos = event.deltaX;
		moveRight = xPos > 0;
		moveLeft  = !moveRight;
		prevClass = "right prev";
		nextClass = "next left";
		var percent =(1 - (xPos < 0 ? (xPos * (0-1)) / obj_width : xPos / obj_width)).toFixed(5);
		percent = percent < 0 ? 0 : percent;
		$(swipe_obj).find("").css({"left": xPos+"px", "opacity": percent, "z-index": "9999"});
		if (moveLeft) {
		} else {
		if (event.type == "panend") {
			$(swipe_obj).find(".item").removeClass(nextClass + " " + prevClass);
			clickTo = moveLeft ? "[data-slide=next]" : "[data-slide=prev]";
			$(swipe_obj).find(".item").animate({left: "0", "z-index": '', opacity: 1}, 700);