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

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

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

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

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.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              
<div id="Target"></div>	
	
<!-- START: SourcePins -->
<div class="SourcePins">
	<div class="Pin">
	<iframe  src="https://www.youtube.com/embed/pQB0uAFGqjA" frameborder="0" allowfullscreen></iframe>

		<div class="Caption">
			<h4>Header 1, Pin 2</h4>
			<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.</p>
		</div>
		<div class="Poster">
			<div class="Thumb-Img" style="background-image: url('https://media.licdn.com/dms/image/C4D03AQEdj7BvsmoKFw/profile-displayphoto-shrink_200_200/0?e=1564012800&v=beta&t=TOTqTyaluM22TbzV3PU2rVrdleOVzvSWr8Hn5UHGJlY'); "></div>
			<div class="Thumb-Txt">
				<p>Steffo Dimfelt</p>
			</div>
		</div>
	</div>
</div>

<div class="SourcePins">
	<div class="Pin">
		<div class="PinImg">
			<img src="https://raw.githubusercontent.com/steffodimfelt/steffodimfelt.github.io/master/static/img/cases/foto/2x1-Swedbank-nyckelring.jpg">
		</div>
		<div class="Caption">
			<h4>Header 2, Pin 2</h4>
			<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.</p>
		</div>
		<div class="Poster">
			<div class="Thumb-Img" style="background-image: url('https://media.licdn.com/dms/image/C4D03AQEdj7BvsmoKFw/profile-displayphoto-shrink_200_200/0?e=1564012800&v=beta&t=TOTqTyaluM22TbzV3PU2rVrdleOVzvSWr8Hn5UHGJlY'); "></div>
			<div class="Thumb-Txt">
				<p>Steffo Dimfelt</p>
			</div>
		</div>
	</div>
</div>

<div class="SourcePins">
	<div class="Pin">
		<div class="PinImg">
			<img src="https://raw.githubusercontent.com/steffodimfelt/steffodimfelt.github.io/master/static/img/cases/foto/2x1-Swedbank-nyckelring.jpg">
		</div>
		<div class="Caption">
			<h4>Header 3, Pin 2</h4>
			<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.</p>
		</div>
		<div class="Poster">
			<div class="Thumb-Img" style="background-image: url('https://media.licdn.com/dms/image/C4D03AQEdj7BvsmoKFw/profile-displayphoto-shrink_200_200/0?e=1564012800&v=beta&t=TOTqTyaluM22TbzV3PU2rVrdleOVzvSWr8Hn5UHGJlY'); "></div>
			<div class="Thumb-Txt">
				<p>Steffo Dimfelt</p>
			</div>
		</div>
	</div>
</div>

<div class="SourcePins">
	<div class="Pin">
		<div class="PinImg">
			<iframe src="https://player.vimeo.com/video/97273451" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
		</div>
		<div class="Caption">
			<h4>Header 4, Pin 2</h4>
			<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.</p>
		</div>
		<div class="Poster">
			<div class="Thumb-Img" style="background-image: url('https://media.licdn.com/dms/image/C4D03AQEdj7BvsmoKFw/profile-displayphoto-shrink_200_200/0?e=1564012800&v=beta&t=TOTqTyaluM22TbzV3PU2rVrdleOVzvSWr8Hn5UHGJlY'); "></div>
			<div class="Thumb-Txt">
				<p>Steffo Dimfelt</p>
			</div>
		</div>
	</div>
</div>

<div class="SourcePins">
	<div class="Pin">
		<div class="PinImg">
			<img src="https://raw.githubusercontent.com/steffodimfelt/steffodimfelt.github.io/master/static/img/cases/foto/2x1-Swedbank-nyckelring.jpg">
		</div>
		<div class="Caption">
			<h4>Header 5, Pin 2</h4>
			<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.</p>
		</div>
		<div class="Poster">
			<div class="Thumb-Img" style="background-image: url('https://media.licdn.com/dms/image/C4D03AQEdj7BvsmoKFw/profile-displayphoto-shrink_200_200/0?e=1564012800&v=beta&t=TOTqTyaluM22TbzV3PU2rVrdleOVzvSWr8Hn5UHGJlY'); "></div>
			<div class="Thumb-Txt">
				<p>Steffo Dimfelt</p>
			</div>
		</div>
	</div>
</div>

<div class="SourcePins">
	<div class="Pin">
		<div class="PinImg">
			<img src="https://raw.githubusercontent.com/steffodimfelt/steffodimfelt.github.io/master/static/img/cases/foto/2x1-Swedbank-nyckelring.jpg">
		</div>
		<div class="Caption">
			<h4>Header 6, Pin 2</h4>
			<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.</p>
		</div>
		<div class="Poster">
			<div class="Thumb-Img" style="background-image: url('https://media.licdn.com/dms/image/C4D03AQEdj7BvsmoKFw/profile-displayphoto-shrink_200_200/0?e=1564012800&v=beta&t=TOTqTyaluM22TbzV3PU2rVrdleOVzvSWr8Hn5UHGJlY'); "></div>
			<div class="Thumb-Txt">
				<p>Steffo Dimfelt</p>
			</div>
		</div>
	</div>
</div>

<div class="SourcePins">
	<div class="Pin">
		<div class="PinImg">
			<img src="https://raw.githubusercontent.com/steffodimfelt/steffodimfelt.github.io/master/static/img/cases/foto/2x1-Swedbank-nyckelring.jpg">
		</div>
		<div class="Caption">
			<h4>Header 7, Pin 2</h4>
			<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.</p>
		</div>
		<div class="Poster">
			<div class="Thumb-Img" style="background-image: url('https://media.licdn.com/dms/image/C4D03AQEdj7BvsmoKFw/profile-displayphoto-shrink_200_200/0?e=1564012800&v=beta&t=TOTqTyaluM22TbzV3PU2rVrdleOVzvSWr8Hn5UHGJlY'); "></div>
			<div class="Thumb-Txt">
				<p>Steffo Dimfelt</p>
			</div>
		</div>
	</div>
</div>

<div class="SourcePins">
	<div class="Pin">
		<div class="PinImg">
			<img src="https://raw.githubusercontent.com/steffodimfelt/steffodimfelt.github.io/master/static/img/cases/foto/2x1-Swedbank-nyckelring.jpg">
		</div>
		<div class="Caption">
			<h4>Header 8, Pin 2</h4>
			<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.</p>
		</div>
		<div class="Poster">
			<div class="Thumb-Img" style="background-image: url('https://media.licdn.com/dms/image/C4D03AQEdj7BvsmoKFw/profile-displayphoto-shrink_200_200/0?e=1564012800&v=beta&t=TOTqTyaluM22TbzV3PU2rVrdleOVzvSWr8Hn5UHGJlY'); "></div>
			<div class="Thumb-Txt">
				<p>Steffo Dimfelt</p>
			</div>
		</div>
	</div>
</div>

<div class="SourcePins">
	<div class="Pin">
		<div class="PinImg">
			<img src="https://raw.githubusercontent.com/steffodimfelt/steffodimfelt.github.io/master/static/img/cases/foto/2x1-Swedbank-nyckelring.jpg">
		</div>
		<div class="Caption">
			<h4>Header 9, Pin 2</h4>
			<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.</p>
		</div>
		<div class="Poster">
			<div class="Thumb-Img" style="background-image: url('https://media.licdn.com/dms/image/C4D03AQEdj7BvsmoKFw/profile-displayphoto-shrink_200_200/0?e=1564012800&v=beta&t=TOTqTyaluM22TbzV3PU2rVrdleOVzvSWr8Hn5UHGJlY'); "></div>
			<div class="Thumb-Txt">
				<p>Steffo Dimfelt</p>
			</div>
		</div>
	</div>
</div>

<div class="SourcePins">
	<div class="Pin">
		<div class="PinImg">
			<img src="https://scontent-arn2-1.xx.fbcdn.net/v/t1.0-9/17200893_10154481900202984_4409551560614059258_n.jpg?oh=98fa375c8a846f8e7ec7a61ea0f0efee&oe=599E603B">
		</div>
		<div class="Caption">
			<h4>Header 10, Pin 2</h4>
			<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Donec libero. Suspendisse bibendum.</p>
		</div>
		<div class="Poster">
			<div class="Thumb-Img" style="background-image: url('https://media.licdn.com/dms/image/C4D03AQEdj7BvsmoKFw/profile-displayphoto-shrink_200_200/0?e=1564012800&v=beta&t=TOTqTyaluM22TbzV3PU2rVrdleOVzvSWr8Hn5UHGJlY'); "></div>
			<div class="Thumb-Txt">
				<p>Steffo Dimfelt</p>
			</div>
		</div>
	</div>
</div>
            
          
!
            
              body {
	padding:0;
	margin:0;
	background:#0aa;
	font-family:arial;
	width:100%;
}
/*PINS -------------------- */

#Target{padding:8px;}

.PinImg img,iframe {border-radius:6px 6px 0 0;}

.SourcePins,
.iframeContainer
{
	border-radius:6px;
	background:#fff;
	box-sizing: border-box;
	padding:0;
	-webkit-box-shadow: 0 1px 2px 0 rgba(0,0,0,0.22);
	box-shadow: 0 1px 2px 0 rgba(0,0,0,0.22);
	display:inline-block;
}

iframe {height:320px;}

.Caption h4 {
	font-size:.9em;
	white-space: nowrap;
	overflow: hidden;
	-ms-text-overflow: ellipsis;
	text-overflow: ellipsis;
	color: #333;
}
.Caption {
	border-top:1px solid #e4e4e4;
	border-bottom:1px solid #e4e4e4;
	padding: .5em;
}
.Caption p {
	font-size:.8em;
	margin-top:.3em;
	color: #333;
	display:inline-block;
	line-height:1.5em;
}
.Poster {padding:.5em;}

.Thumb-Img {
	background-position:center;
	background-repeat:no-repeat;
	background-size:cover;
	display:inline-block;
	border-radius:50%;
	width:2em;
	height:2em;
}
.Thumb-Txt {
	display:inline-block;
	width:80%;
}

.Thumb-Txt p {
	padding-left:.5em;
	white-space: nowrap;
	overflow: hidden;
	-ms-text-overflow: ellipsis;
	text-overflow: ellipsis;
	color: #717171;
	font-size:.65rem;
	text-transform:uppercase;
}

            
          
!
            
              $(function(){

/*
	Name: Sluggo Pins, Mark III
	Version: 3.2
	Developer: Steffo Dimfelt, 2016-2017
	Mail: steffo.dimfelt@gmail.com
	Web: http://sluggowebdev.blogspot.se/
	Sluggo Pins uses jQuery
*/
function SluggoPins (Target, Source, Array_Columns, Array_Break, Pin_Space)
{	

			
			//ADD a new stylesheet (In case of...)
			$('head').append('<style></style>');
			
			//FORMAT output containers
			var outerContainer = "containerOuter_"+Source.slice( 1 );
			var innerContainer = "containerInner_"+Source.slice( 1 )+'_';

			var TagType = Source.charAt(0);
			if (TagType=='.'){
			var TagTypeOut='class="'+Source.slice( 1 )+'"';
			}else if (TagType=='#'){
			var TagTypeOut='id="'+Source.slice( 1 )+'"';
			}
			
			//FORMAT Pin Space
			var Pin_SpaceOut = Pin_Space.toString();
				if (Pin_SpaceOut.slice(-1)=="m"||Pin_SpaceOut.slice(-1)=="x"||Pin_SpaceOut.slice(-1)=="%")
				{}else{
					Pin_SpaceOut+="px";
				}

			//FORMAT Breakpoints Array
			if (Array_Break[0]!=0){Array_Break.unshift(0);}//Adds 0 to beginning of array if there isn't any.
			Array_Break.push(1000000);//Adds a very high number at the end.		
			
			//DEFAULT settings
			$(Target).html("");
			var PinsOut=""
			var MediaQueryOut=""
			$(Source).css("display","none")
			var LastNmbColumns = Array_Columns.slice(-1)[0]
			$('iframe').removeAttr('width').removeAttr('height');
			
			//SETUP Pins
			var PinLen = $(Source).length;
			PinsOut+='<div class="'+outerContainer+'">';
			for(i=1;i<=LastNmbColumns;i++)
			{
						
						if (i>=2)
						{
						PinsOut+='<div class="innerSpace"></div>';
						}
						
						PinsOut+='<div class="'+innerContainer+i+'" >';
						for(x=0;x<PinLen;x++)
						{
							var TempSource = $(Source+':eq('+x+')').html();	
							
			//CHECK iframes in HTML
							if (TempSource.includes("iframe"))
							{
								PinsOut+='<div class="iframeContainer" '+TagTypeOut+'>'+TempSource+'</div>';
							}else{
								PinsOut+='<div '+TagTypeOut+'>'+TempSource+'</div>';
							}
						}
				PinsOut+='</div>';//End innerContainer
			}
			PinsOut+='</div>';	//End outer pins			
			$(PinsOut).appendTo(Target)			
			
			//SETUP MediaQuery
			Array_Columns.forEach(function(ArrayNmb,ArrayIndx){
				MediaQueryOut+='@media screen and (min-width:'+Array_Break[ArrayIndx]+'px) {';
				var innerColumnWidth = 100/Array_Columns[ArrayIndx]
				for (i=1;i<=LastNmbColumns;i++)
				{
					if(i<=ArrayNmb)
					{
						if (i>1)
						{
						MediaQueryOut+='.'+innerContainer+i+'{display:table-cell; vertical-align: top; }';
						}	
						
						MediaQueryOut+='.'+innerContainer+i+'{display:table-cell; vertical-align: top; width:'+innerColumnWidth+'%;}';
						MediaQueryOut+='.'+innerContainer+i+' img{max-width:100%;}';

						for (ii=1;ii<=LastNmbColumns;ii++)
						{
							if (ii==i)
							{
							MediaQueryOut+='.'+innerContainer+ii+' > div:nth-child('+ArrayNmb+'n+'+i+'){display:block;margin-bottom:'+Pin_SpaceOut+'  }';
							
							}else{
							MediaQueryOut+='.'+innerContainer+ii+' > div:nth-child('+ArrayNmb+'n+'+i+'){display:none;}';	
							}
						}
					}else{
						MediaQueryOut+='.'+innerContainer+i+'{display:none;}';
					}
				MediaQueryOut+='.'+innerContainer+i+' div:last-child {margin-bottom:0px;}';	
				}
				
				//SETUP Innerspace
				if (ArrayNmb<=1)
				{
					MediaQueryOut+=Target+' .innerSpace {display:none;}';
				}else{
					for (y=1;y<=ArrayNmb;y++)
					{
						if (y<ArrayNmb)
						{
							MediaQueryOut+=Target+' .innerSpace:nth-child('+y*2+'){display:table-cell;padding-left:'+Pin_SpaceOut+'}';
						}else{
							MediaQueryOut+=Target+'.innerSpace:nth-child('+y*2+'){display:none;}';
						}
					}
				}

				MediaQueryOut+='}'//End media query
			})
			MediaQueryOut+='.'+outerContainer+' {display:table;width:100%;}';	
			MediaQueryOut+='.'+outerContainer+' img {width:100%; display: block; }';
			MediaQueryOut+='.'+outerContainer+' img {-webkit-box-sizing: border-box;-moz-box-sizing: border-box;  box-sizing: border-box;}';				
			MediaQueryOut+='.iframeContainer{position: relative;width: 100%;height: 100%;}';	
			MediaQueryOut+='iframe { display:block; top: 0;left: 0;width: 100%; }';	
			
			document.querySelector('style').textContent += MediaQueryOut;	//SEND MediaQuery	
			
			//Empty arrays (In case of...)
			Array_Columns.length=0;
			Array_Break.length=0;

}

//Your Input goes here -------------------------

		SluggoPins ("#Target",".SourcePins",[1,2,3,4,5],[0,350,500,800,1200],8)
		//#1 OUTPUT Tag
		//#2 INPUT Tag
		//#3 Columns, array (Same amount of elements as #4)
		//#4 Breakpoints, window width in pixels, Ascending, Array (Same amount of elements as #3). ALWAYS begin with 0.
		//#5 Space between Pins. Can be set as number or string (example 8, "8px", "2em"). Only number = space in pixels. 
		
});//END jQuery	
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console