HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URL's 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 it's URL and the proper URL extention.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
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.
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.
Using packages here is powered by Skypack, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ES6 import
usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<body class="bg-light py-5">
<div class="container">
<div class="row">
<h4 class="text-muted">Desktop version</h4>
</div>
</div>
<div class="wrapper pb-5">
<div class="container">
<div class="row">
<!-- row one, item 1 -->
<div class="col-lg-4 item-wrapper">
<div>
<a class="ext-link" href="https://www.playrsmartcoach.com/" target="_blank" title="PLAYR Website">
<div>
<h2 class="title">PLAYR</h2>
<p class="subtitle">Football GPS Tracking System</p>
<div class="description">
<p>GPS player tracking technology combined with personalised sports science to help you take your performance to the next level.</p>
</div>
</div>
</a>
</div>
<div class="category-icon">Sports BioTech</div>
</div>
<!-- row one, item 2 -->
<div class="col-lg-4 item-wrapper">
<div>
<a class="ext-link" href="https://www.encased.com/" target="_blank" title="Encased Website">
<div>
<h2 class="title">Encased</h2>
<p class="subtitle">Quality smartphone accessories</p>
<div class="description">
<p>Secure and functional accessories for all major mobile phone brands including a wide range of cases, wireless charging solutions, as well as car and desk mounts.</p>
</div>
</div>
</a>
</div>
<div class="category-icon">Consumer Electronics</div>
</div>
<!-- row one, item 3 -->
<div class="col-lg-4 item-wrapper">
<div>
<a class="ext-link" href="https://www.orthomovement.com" target="_blank" title="OrthoMovement Website">
<div>
<h2 class="title">OrthoMovement</h2>
<p class="subtitle">Activity based insoles for all walks of life</p>
<div class="description">
<p>30 years of orthopedic research with new innovative tech materials providing insoles optimized for different activities and sports.
</p>
</div>
</div>
</a>
</div>
<div class="category-icon">Sports BioTech</div>
</div>
</div>
<div class="row">
<!-- row two, item 1 -->
<div class="col-lg-4 item-wrapper">
<div>
<a class="ext-link" href="https://www.spy-fy.com" target="_blank" title="Spy-Fy Website">
<div>
<h2 class="title">Spyslide by Spy-Fy</h2>
<p class="subtitle">Worlds most elegant webcam cover</p>
<div class="description">
<p>A thin and practical webcam cover that serves as the perfect alternative to that ugly sticker or post-it note on your laptop, tablet or desktop.</p>
</div>
</div>
</a>
</div>
<div class="category-icon">Consumer Electronics</div>
</div>
<!-- row two, item 2 -->
<div class="col-lg-4 item-wrapper">
<div>
<a class="ext-link" href="https://www.tape-design.com" target="_blank" title="TAPEDESIGN Website">
<div>
<h2 class="title">TAPEDESIGN</h2>
<p class="subtitle">High-Tech Grip Sock Technology</p>
<div class="description">
<p>Experience a noticeable change in your workouts with a better grip and leg sensitivity.</p>
</div>
</div>
</a>
</div>
<div class="category-icon">Sports BioTech</div>
</div>
<!-- row two, item 3 -->
<div class="col-lg-4 item-wrapper">
<div>
<a class="ext-link" href="https://www.bolleraven.com/" target="_blank" title="Bolle & Raven Website">
<div>
<h2 class="title">Bolle & Raven AirMod</h2>
<p class="subtitle">Custom-designed Bluetooth upgrade for Bose QC25 headphones</p>
<div class="description">
<p>Ultra-light and crafted to seamlessly fit the contours of the QC25 earcups, AirMod maintains the Bose esthetic while preserving 100% sound quality.</p>
</div>
</div>
</a>
</div>
<div class="category-icon">Consumer Electronics</div>
</div>
</div>
</div>
</div>
<!-- wrapper for mobile -->
<div class="container">
<div class="row">
<h4 class="text-muted">Mobile version</h4>
</div>
</div>
<div class="mobile-wrapper pb-5">
<div class="container">
<div class="row">
<!-- row one, item 1 -->
<div class="col-12 col-lg-4 item-wrapper">
<div>
<div>
<h2 class="title">PLAYR</h2>
<p class="subtitle">Football GPS Tracking System</p>
<div class="description">
<p>GPS player tracking technology combined with personalised sports science to help you take your performance to the next level.</p>
<a class="ext-link" href="https://www.playrsmartcoach.com/" target="_blank" title="PLAYR Website">PLAYR's Website</a>
</div>
</div>
</div>
<div class="category-icon">Sports BioTech</div>
</div>
<!-- row one, item 2 -->
<div class="col-12 col-lg-4 item-wrapper">
<div>
<div>
<h2 class="title">Encased</h2>
<p class="subtitle">Quality smartphone accessories</p>
<div class="description">
<p>Secure and functional accessories for all major mobile phone brands including a wide range of cases, wireless charging solutions, as well as car and desk mounts.</p>
<a class="ext-link" href="https://www.encased.com/" target="_blank" title="Encased Website">Encased's Website</a>
</div>
</div>
</div>
<div class="category-icon">Consumer Electronics</div>
</div>
<!-- row one, item 3 -->
<div class="col-12 col-lg-4 item-wrapper">
<div>
<div>
<h2 class="title">OrthoMovement</h2>
<p class="subtitle">Activity based insoles for all walks of life</p>
<div class="description">
<p>30 years of orthopedic research with new innovative tech materials providing insoles optimized for different activities and sports.
</p>
<a class="ext-link" href="https://www.orthomovement.com" target="_blank" title="OrthoMovement Website">OrthoMovement's Website</a>
</div>
</div>
</div>
<div class="category-icon">Sports BioTech</div>
</div>
</div>
<div class="row">
<!-- row two, item 1 -->
<div class="col-12 col-lg-4 item-wrapper">
<div>
<div>
<h2 class="title">Spyslide by Spy-Fy</h2>
<p class="subtitle">Worlds most elegant webcam cover</p>
<div class="description">
<p>A thin and practical webcam cover that serves as the perfect alternative to that ugly sticker or post-it note on your laptop, tablet or desktop.</p>
<a class="ext-link" href="https://www.spy-fy.com" target="_blank" title="Spy-Fy Website">Spyslide's Website</a>
</div>
</div>
</div>
<div class="category-icon">Consumer Electronics</div>
</div>
<!-- row two, item 2 -->
<div class="col-12 col-lg-4 item-wrapper">
<div>
<div>
<h2 class="title">TAPEDESIGN</h2>
<p class="subtitle">High-Tech Grip Sock Technology</p>
<div class="description">
<p>Experience a noticeable change in your workouts with a better grip and leg sensitivity.</p>
<a class="ext-link" href="https://www.tape-design.com" target="_blank" title="TAPEDESIGN Website">TAPEDESIGN's Website</a>
</div>
</div>
</div>
<div class="category-icon">Sports BioTech</div>
</div>
<!-- row two, item 3 -->
<div class="col-12 col-lg-4 item-wrapper">
<div>
<div>
<h2 class="title">Bolle & Raven AirMod</h2>
<p class="subtitle">Custom-designed Bluetooth upgrade for Bose QC25 headphones</p>
<div class="description">
<p>Ultra-light and crafted to seamlessly fit the contours of the QC25 earcups, AirMod maintains the Bose esthetic while preserving 100% sound quality.</p>
<a class="ext-link" href="https://www.bolleraven.com/" target="_blank" title="Bolle & Raven Website">Bolle & Raven's Website</a>
</div>
</div>
</div>
<div class="category-icon">Consumer Electronics</div>
</div>
</div>
</div>
</div>
</body>
@import "bourbon";
$font-size-base: 1rem;
$font-size-h2: 1.953rem;
$font-size-h3: 1.5rem;
$font-size-h4: 1.25rem;
//colors
$blue: #0DAFE0;
$orange: invert($blue);
$white: #fff !default;
$gray-100: #f8f9fa !default;
$gray-200: #e9ecef !default;
$gray-300: #dee2e6 !default;
$gray-400: #ced4da !default;
$gray-500: #adb5bd !default;
$gray-600: #6c757d !default;
$gray-700: #495057 !default;
$gray-800: #343a40 !default;
$gray-900: #212529 !default;
a.ext-link {
position: relative;
height: 100%;
text-decoration: none;
color: $gray-100;
cursor: pointer;
> div {
position: relative;
height: 100%;
padding: 1rem 0;
}
}
.title {
font-size: $font-size-h4;
text-transform: uppercase;
line-height: 1;
opacity: 1;
position: relative;
}
.subtitle {
color: $gray-400;
font-size: .9rem;
letter-spacing: .035rem;
line-height: 1.125;
margin: -.25rem 0 0;
opacity: 0;
}
.wrapper .row {
flex-wrap: nowrap;
justify-content: center;
overflow: hidden;
> div {
height: 240px;
overflow: hidden;
@include transition-property(all);
@include transition-duration(.7s);
@include transition-timing-function(ease-in-out);
// add image overlay for better contrast
&:before {
background: rgba($gray-900, 0.7);
content: "";
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
@include transition-property(all);
@include transition-duration(.2s);
}
}
// when the row is hovered
&:hover {
> div {
// overwrite widths of items when the row is hovered
flex-basis: calc(100% * 1/6);
flex-basis: 16.66%;
max-width: calc(100% * 1/6);
max-width: 16.66%;
}
}
.item-wrapper {
// set initial width of each item
flex-basis: calc(100% * 1/3);
flex-basis: 33.33%;
max-width: calc(100% * 1/3);
max-width: 33.33%;
> div {
height: 100%;
position: relative;
}
> a {
> div {
position: relative;
height: 100%;
padding: 1rem 0;
}
}
.description {
p {
width: calc(100% * 2/3);
margin-top: 0;
margin-bottom: 0;
padding: 1rem 0;
opacity: 0;
}
}
// didn't change for each category icon out of laziness
.category-icon {
content: '';
position: absolute;
bottom: 0;
right: 0;
height: auto;
font-size: 0.79rem;
color: $blue;
display: flex;
align-items: center;
padding: .35rem;
opacity: .7;
filter: grayscale(50%);
&:after {
content: '';
display: block;
margin-left: .5rem;
background-repeat: no-repeat;
-webkit-mask-image: url(//themjcl.com/wp-content/uploads/2019/02/sports_biotech_icon.svg);
mask-image: url(//themjcl.com/wp-content/uploads/2019/02/sports_biotech_icon.svg);
background-color: $blue;
height: 20px;
width: 21px;
}
}
// when an individual item is hovered
&:hover {
// increase width of the item
flex-basis: calc(100% * 2/3);
flex-basis: 66.66%;
max-width: calc(100% * 2/3);
max-width: 66.66%;
.title {
font-size: $font-size-h2;
color: $gray-900;
text-shadow: none;
@include transition-property(all);
@include transition-duration(.4s);
@include transition-timing-function(ease);
}
.subtitle {
opacity: 1;
color: $gray-700;
@include transition-property(opacity);
@include transition-duration(.2s);
@include transition-timing-function(ease);
@include transition-delay(.5s);
}
.category-icon {
opacity: 1;
filter: grayscale(0%);
}
.description {
p {
opacity: 1;
color: $gray-900;
@include transition-property(opacity);
@include transition-duration(.2s);
@include transition-timing-function(ease);
@include transition-delay(.5s);
}
}
// add white overlay
&:before {
background: rgba($gray-100, 0.8) !important;
content: "";
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
}
}
}
}
// Mobile styles
.mobile-wrapper {
height: initial;
max-width: 320px;
margin: 0 auto;
.row {
flex-direction: column;
> div {
position: relative;
height: auto;
max-width: none !important;
flex-basis: 100% !important;
// add image overlay for better contrast
&:before {
background: rgba($gray-900, 0.3);
content: "";
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
@include transition-property(all);
@include transition-duration(.2s);
}
&:first-child:hover {
margin-left: initial;
}
&:last-child:hover {
margin-right: initial;
}
> div {
opacity: .7;
position: relative;
padding: 2rem 0;
display: flex;
justify-content: space-evenly;
flex-direction: column;
align-content: center;
}
// didn't change for each category icon out of laziness
.category-icon {
flex-direction: row;
content: '';
position: absolute;
bottom: 0;
right: 0;
height: auto;
font-size: 0.79rem;
color: $blue;
display: flex;
align-items: center;
padding: .35rem;
opacity: .7;
filter: grayscale(50%);
&:after {
content: '';
display: block;
margin-left: .5rem;
background-repeat: no-repeat;
-webkit-mask-image: url(//themjcl.com/wp-content/uploads/2019/02/sports_biotech_icon.svg);
mask-image: url(//themjcl.com/wp-content/uploads/2019/02/sports_biotech_icon.svg);
background-color: $blue;
height: 20px;
width: 21px;
}
}
.title {
color: $gray-100;
}
.subtitle {
opacity: 1;
padding-bottom: 1rem;
color: rgba(tint($blue, 60%), .9);
}
.description {
padding-bottom: .5rem;
p {
width: 100%;
opacity: 1;
color: $gray-600;
}
a {
color: $gray-600;
}
}
// when an individual item is hovered
&:active {
> div {
opacity: 1;
@include transition-property(all);
@include transition-duration(.4s);
@include transition-timing-function(ease-out);
}
.title {
font-size: $font-size-h3;
color: $gray-100;
text-shadow: none;
@include transition-property(all);
@include transition-duration(.4s);
@include transition-timing-function(ease);
}
.subtitle {
opacity: 1;
color: tint($blue, 60%);
@include transition-property(opacity);
@include transition-duration(.3s);
@include transition-timing-function(ease);
}
.category-icon {
opacity: 1;
filter: grayscale(0%);
}
.description {
p {
opacity: 1;
color: $gray-100;
@include transition-property(opacity);
@include transition-duration(.3s);
@include transition-timing-function(ease);
}
a {
opacity: 1;
color: $gray-100;
letter-spacing: .06rem;
line-height: .9;
font-size: .9rem;
padding: .2rem .5rem .3rem;
background: rgba($gray-200, .1);
border: 1px solid rgba($gray-200, .2);
border-radius: 4px;
}
}
// add overlay
&:before {
background: rgba($gray-900, 0.9);
content: "";
height: 100%;
width: 100%;
position: absolute;
top: 0;
left: 0;
}
}
}
}
}
// Center screen version titles
.container .row h4:first-of-type {
text-align: center;
margin: 0 auto;
padding-bottom: 1rem;
}
// Add background images
.wrapper .row, .mobile-wrapper .row {
&:first-child {
> :nth-child(1) {
background-color: darken(desaturate(adjust-hue($blue, 44), 72.11), 8.24);
background-image: url("//themjcl.com/wp-content/uploads/2019/02/playr.jpg");
background-position: center center;
background-size: cover;
}
> :nth-child(2) {
background-color: darken(desaturate(adjust-hue($blue, -180), 51.45), 15.69);
background-image: url("//themjcl.com/wp-content/uploads/2019/02/encased.jpg");
background-position: center center;
background-size: cover;
}
> :nth-child(3) {
background-color: darken(desaturate(adjust-hue($blue, -136), 55.70), 31.76);
background-image: url("//themjcl.com/wp-content/uploads/2019/02/orthomovement.jpg");
background-position: center center;
background-size: cover;
}
}
&:last-child {
> :nth-child(1) {
background-color: lighten(desaturate(adjust-hue($blue, 17), 37.63), 11.57);
background-image: url("//themjcl.com/wp-content/uploads/2019/02/spyslide.jpg");
background-position: center center;
background-size: cover;
}
> :nth-child(2) {
background: $gray-200;
background-image: url("//themjcl.com/wp-content/uploads/2019/02/tapedesign.jpg");
background-position: center center;
background-size: cover;
}
> :nth-child(3) {
background-color: darken(desaturate(adjust-hue($blue, 10), 33.77), 31.57);
background-image: url("//themjcl.com/wp-content/uploads/2019/02/bolleraven.jpg");
background-position: center center;
background-size: cover;
}
}
}
Also see: Tab Triggers