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 is required to process package imports. If you need a different preprocessor remove all packages first.

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

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 class="wrapper">
 <a class="button" href="#modal1">Click!</a>
 <button onclick="location.href='#sponsor1'" class="btn">GDrive sponsor1</button>
 <button onclick="location.href='#sponsor2'" class="btn">GDrive sponsor2</button>
 <button onclick="location.href='#sponsor3'" class="btn">GDrive sponsor3</button>
</div>

<div id="modal1" class="modaloverlay">
 <div class="modal">
  <a class="close" href="#"><i class="fa fa-times-circle"></i></a>
  <div class="content">
   <h4>This is the first modal window!</h4>
   <p>Fusce cursus nec sem ut porttitor. Morbi imperdiet erat magna, et sollicitudin nibh iaculis ac. Donec pulvinar eros in eleifend pulvinar. Curabitur placerat augue at lorem lobortis faucibus. Maecenas quis diam lobortis, eleifend augue eget, rutrum
    tortor. Morbi congue laoreet risus hendrerit suscipit. Donec egestas nulla ut accumsan tempus. Sed rhoncus mauris non mi varius commodo.</p>
  </div>
 </div>
</div>

<div id="sponsor1" class="modaloverlay">
 <div class="modal">
  <a class="close" href="#"><i class="fa fa-times-circle"></i></a>
  <table class="sponsor1"></table>
 </div>
</div>

<div id="sponsor2" class="modaloverlay">
 <div class="modal">
  <a class="close" href="#"><i class="fa fa-times-circle"></i></a>
  <table class="sponsor2"></table>
 </div>
</div>

<div id="sponsor3" class="modaloverlay">
 <div class="modal">
  <a class="close" href="#"><i class="fa fa-times-circle"></i></a>
  <table class="sponsor3"></table>
 </div>
</div>
              
            
!

CSS

              
                *, :after, :before {
	box-sizing: border-box;
}

a.button, .btn {
	text-decoration: none;
	text-align: center;
	text-shadow: 0 1px 0 #fff;
	color: steelblue;
	font-weight: 500;
	padding: 8px 15px 8px 15px;
	border: 1px solid rgba(26, 53, 71, 0.1);
	border-radius: 4px;
	-webkit-border-radius: 4px;
	-moz-border-radius: 4px;
	transition: .25s;
	background: linear-gradient(white, ghostwhite);
	cursor: pointer;
}
a.button:hover, .btn:hover {
	border: 1px solid rgba(26, 53, 71, 0.2);
	background: white;
}

.wrapper {
	width: 600px;
	height: 50vh;
	margin: 0 auto;
	text-align: center;
	display: -webkit-box;
	display: -moz-box;
	display: -ms-flexbox;
	display: -webkit-flex;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f5f5f5;
}

.modaloverlay {
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	background: rgba(0, 0, 0, 0.7);
	transition: opacity .25s;
	visibility: hidden;
	opacity: 0;
}
.modaloverlay:target {
	visibility: visible;
	opacity: 1;
}

.modal {
	width: 95%;
	max-width: 600px;
	position: relative;
	display: block;
	margin: auto;
	padding: .5em 1em;
	background: #fff;
	border-radius: 8px;
	transition: .25s;
	opacity: 1;
	transform: translate3d(0, 90%, 0) scale(.9);
}
.modal {
	margin-top: 0;
}

.modal table td a.link {
	font-size: .75em;
	padding: .35em .5em .25em;
	margin: 0;
	color: #fff;
	text-decoration: none;
	background: #666;
	line-height: 2;
	border-radius: 0 5px;
}

.modal table td a.link:hover {
	background: #888;
}

.modaloverlay:target > .modal {
	transform: translate3d(0, 50%, 0) scale(1);
	transition-timing-function: ease-out;
	opacity: 1;
}

.modal h4 {
	text-align: left;
	margin: 0 0 .25em 0;
	border-bottom: 1px solid #e1e1e1;
	font-size: 1.25em;
	line-height: 1.4;
}

.modal hr {
	border: solid #e1e1e1;
	border-width: 1px 0 0;
	clear: both;
	margin: .5em 0;
	height: 0;
}

.modal a.close {
	position: absolute;
	top: 5px;
	right: 7px;
	width: 24px;
	height: 24px;
	text-decoration: none;
	text-align: center;
	font-size: 24px;
	margin: 0;
	padding: 0;
	color: lightslategrey;
	background-color: #fff;
	border-radius: 50%;
	-webkit-border-radius: 50%;
	-moz-border-radius: 50%;
}

.modal a.close:hover {
	color: tomato;
}

              
            
!

JS

              
                $(function() {
	
//sheetrock
$.ajax({
	type: "GET",
	url: "https://s3-us-west-2.amazonaws.com/s.cdpn.io/768307/sheetrock.js",
	success: function() {
	//sponsorCallback
	var sponsorCallback = function(error, options, response) {
		if (!error) {		}

		setTimeout(function(){
			
			//Add H4 tag #text#
			$("table").children().each(function() {
				$(this).html($(this).html().replace(/#(.*?)#/gm,'<h4>$1</h4>')
				);
			});
			
			//Add html <br />
			$("td:contains('--')").html(function(_, html) {
				return html.replace(/(--)/g, "<hr />");
			});
			
		var $table1 = $("table td");
 		var hasLooped = false;
			
	function WEBlinks(){
    if(!hasLooped){
      // create hyperlinks
     $table1.each(function() {
        var plaintxt = $(this).html();
        var regex1 = /(https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/_\.\-]*(\?\S+)?)?)?)/gi;
        var txt2hyperlinks = plaintxt.replace(regex1,"<a href='$1' class='link'>$1</a>");
        $(this).html(txt2hyperlinks);
      });
			
    hasLooped = true;
    }
		
      $("table td").find('a').each(function() {
        var linkslice = $(this).html();
        var url2http = linkslice.slice(0, 4);
        var y = document.getElementsByClassName("link");
        var i;
        for (i = 0; i < y.length; i++) {
          y[i].innerHTML = url2http;
        }
      });

      $("table td").find('a').each(function() {
        var httptxt = $(this).html();
        var http2VIEW = httptxt.replace(/http/gi,'OUR WEBSITE <i class="fa fa-external-link"></i>');
        $(this).html(http2VIEW);
      });

	};
	setTimeout(WEBlinks,1111);
		
		}, 150); //timeout
	}; //sponsorCallback
	
	var GDsheet1 = "https://docs.google.com/spreadsheets/d/1LieALXsWkYoW7NyJuD22_gbddliz-sLrUZ8Msv_dVNw/edit#gid=0"

	$(".sponsor1").sheetrock({
		url: GDsheet1,
		query: "select A",
		headersOff: false,
		callback: sponsorCallback
	});
	
	$(".sponsor2").sheetrock({
		url: GDsheet1,
		query: "select B",
		headersOff: false,
		callback: sponsorCallback
	});
		
	$(".sponsor3").sheetrock({
		url: GDsheet1,
		query: "select C",
		headersOff: false,
		callback: sponsorCallback
	});
		
},//end ajax success function

	dataType: "script",
	cache: true
});
	
});

              
            
!
999px

Console