JavaScript preprocessors can help make authoring JavaScript easier and more convenient. For instance, CoffeeScript can help prevent easy-to-make mistakes and offer a cleaner syntax and Babel can bring ECMAScript 6 features to browsers that only support ECMAScript 5.
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.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
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.
<link href="https://fonts.googleapis.com/css?family=EB+Garamond" rel="stylesheet">
<body>
<div class="gridcontainer">
<div class="griditem1"><h2 id="responsive_headline">THE FONMON</h2><hr><h3 class="subtitle">A five column layout using columns of different widths</h3></div>
<p class="griditem2 aside">Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each. The gutters are thirty pixels. The centre three columns can be combined to one master column – like the one you’re now reading.</p>
<div class="griditem3 aside"> <p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each.</p></div>
<div class="griditem4">
<p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each. The gutters are thirty pixels. The centre three columns can be combined to one master column – like the one you’re now reading. This can comfortably contain a three hundred pixel wide advertising unit.
Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each.</p>
<p>Asymmetric grids can give rise to interesting layouts due to combining and offsetting columns.</p>
<hr>
</div>
<div class="griditem5"><p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each. The gutters are thirty pixels. The centre three columns can be combined to one master column – like the one you’re now reading.</p></div>
<div class="griditem6">
<p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each. The gutters are thirty pixels. The centre three columns can be combined to one master column – like the one you’re now reading. This can comfortably contain a three hundred pixel wide advertising unit.
</p>
<p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each.
</p>
</div>
<div class="griditem7 aside"><p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide.</p>
</div>
<div class="griditem8"><p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each.
Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each. The gutters are thirty pixels. The centre three columns can be combined to one master column – like the one you’re now reading. This can comfortably contain a three hundred pixel wide advertising unit.
</p> <p>Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each.
Inspired by a trip to the library of Fonmon castle, this layout is inspired by the large collection of 18th century volumes there. Designed around an asymmetric five column grid, the first and last columns are two hundred pixels wide. The centre three are ninety six pixels wide each. The gutters are thirty pixels. The centre three columns can be combined to one master column – like the one you’re now reading. This can comfortably contain a three hundred pixel wide advertising unit.
</p> </div>
<div class="griditem9 aside">
<p>This specimen sheet is designed around an asymmetric five column grid. The first and last columns are two hundred pixels wide.
</p>
</div>
</div>
</body>
body {
margin: 0;
padding: 0;
font-family: 'lato', helvetica, arial;
line-height: 1.5;
background-color: #faf8f6;
font-family: 'EB Garamond', serif;
}
.gridcontainer {
display: grid;
margin: auto;
max-width: 990px;
margin: 0 auto;
padding-left: 4%;
padding-right: 4%;
justify-content: center;
grid-template-rows: auto;
grid-template-columns: 25% repeat(3, 1fr 12.5925%) 1fr 25%;
}
[class^="griditem"] {}
.griditem1 {
grid-column: 2 / 9;
margin: 0 auto;
padding: 0;
width: 100%;
text-align: right;
}
h2 {
margin: 0 auto;
padding: 0;
font-family: helvetica;
}
hr {
margin: 0;
padding: 0;
}
.subtitle {
font-size: 1.3rem;
margin-top: 20px;
margin-bottom: 20px;
font-style: italic;
font-weight: 400;
text-align: center;
}
.griditem2 {
grid-column: 1 / 2;
}
.griditem3 {
grid-column: 9;
}
.griditem2 p, .griditem3 p {
text-align: justify;
}
.griditem4 {
grid-column: 3 / 8;
grid-row: 2;
}
.griditem5 {
grid-column: 1 / -1;
background-color: black;
color: white;
margin-top: 20px;
margin-bottom: 20px;
}
p {
max-width: 70ch;
}
.griditem5 p {
margin: auto;
padding-top: 3%;
padding-bottom: 5%;
}
.griditem6 {
grid-column: 1 / 8;
}
.griditem7 {
grid-column: 9;
}
.griditem7 p {
background-color: rgb(225, 224, 222);
padding: 5px 15px 10px 15px;
}
.aside, .aside p {
color: #CD2F27;
font-size: 1rem;
text-align: justify;
}
.griditem8 {
grid-column: 3 / -1;
}
.griditem8 p {
margin: 0;
}
.griditem9 {
grid-column: 1;
text-align: right;
grid-row: 5;
}
.griditem9 p {
border-right: 1px solid gray;
padding-right: 10px;
text-align: right;
}
p + p {
margin-top: 0;
text-indent: 2em;
}
p {
font-size: 1.2rem;
}
/*global jQuery */
/*!
* FitText.js 1.2
*
* Copyright 2011, Dave Rupert http://daverupert.com
* Released under the WTFPL license
* http://sam.zoy.org/wtfpl/
*
* Date: Thu May 05 14:23:00 2011 -0600
*/
(function( $ ){
$.fn.fitText = function( kompressor, options ) {
// Setup options
var compressor = kompressor || 1,
settings = $.extend({
'minFontSize' : Number.NEGATIVE_INFINITY,
'maxFontSize' : Number.POSITIVE_INFINITY
}, options);
return this.each(function(){
// Store the object
var $this = $(this);
// Resizer() resizes items based on the object width divided by the compressor * 10
var resizer = function () {
$this.css('font-size', Math.max(Math.min($this.width() / (compressor*10), parseFloat(settings.maxFontSize)), parseFloat(settings.minFontSize)));
};
// Call once to set.
resizer();
// Call on resize. Opera debounces their resize by default.
$(window).on('resize.fittext orientationchange.fittext', resizer);
});
};
})( jQuery );
jQuery("#responsive_headline").fitText(.67);
Also see: Tab Triggers