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 URLs 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 its URL and the proper URL extension.
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 esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM 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.
<h1>A <em>Coder's</em> Advent Calendar</h1>
<section id="modal">
<div class="wrapper">
<div class="content">
<div class="close"></div>
<div class="box"></div>
</div>
</div>
</section>
<section id="calendar" class="collectonme">
<div id="day-labels">
<div class="label">Sun</div>
<div class="label">Mon</div>
<div class="label">Tue</div>
<div class="label">Wed</div>
<div class="label">Thu</div>
<div class="label">Fri</div>
<div class="label">Sat</div>
</div>
<div id="one" class="week">
<div class="day noDate"></div>
<div class="day noDate"></div>
<div class="day">
<span class="date">1</span>
<div class="surprise">
<h2>A Hilarious Design Classic</h2>
<p>For your first day, I present for your reading pleasure a wonderful classic comic by the incomparable Matthew Inman (aka The Oatmeal).</p>
<a class="button" href="http://theoatmeal.com/comics/design_hell" target="_blank">Read On</a>
</div>
</div>
<div class="day">
<span class="date">2</span>
<div class="surprise">
<h2>For Your Second Day, Some Humor</h2>
<p>A user interface is like a joke. If you have to explain it, chances are it's not that good.</p>
</div>
</div>
<div class="day">
<span class="date">3</span>
<div class="surprise">
<h2>And Now, to Waste Your Time</h2>
<p>This site has some great illustrations, some funny random stuff, and overall is just a champion time-waster, for those of you tired of Buzzfeed hell.</p>
<a href="http://www.booksofadam.com" target="_blank" class="button">Visit Books of Adam</a>
</div>
</div>
<div class="day">
<span class="date">4</span>
<div class="surprise">
<h2>And Now - A History of Web Design</h2>
<p>Web design has been around for a while now, and it has a storied history. Webs.com and AmeriCommerce have put together a fun infographic to walk you down memory lane.</p>
<a class="button" href="http://www.webs.com/blog/2015/02/04/history-web-design-infographic/" target="_blank">View the Infographic</a>
</div>
</div>
<div class="day">
<span class="date">5</span>
<div class="surprise">
<h2>Oh Look - Another Pen of Mine!</h2>
<p>A few fun modal animations for your enjoyment.</p>
<a class="button" href="https://codepen.io/designcouch/full/obvKxm" target="_blank">View the Pen</a>
</div>
</div>
</div>
<div id="two" class="week">
<div class="day">
<span class="date">6</span>
<div class="surprise">
<h2>A Stellar Podcast</h2>
<p>If you're not familiar with Chris Coyier, shame on you. The dude is one of the founders of Codepen, for crying out loud. Anywho, he has a podcast called the Shoptalk Show that is audio gold.</p>
<a class="button" href="http://shoptalkshow.com" target="_blank">Listen Now</a>
</div>
</div>
<div class="day">
<span class="date">7</span>
<div class="surprise">
<h2>An Up and Coming Designer</h2>
<p>Dan Eden is a prodigious young brit working for Dropbox who has already contributed a large amount to the web design world. He's got a blog that's admittedly not updated often - but what's there is worth your time.
</p>
<a href="https://daneden.me/blog/" class="button" target="_blank">Visit DanEden.me</a>
</div>
</div>
<div class="day">
<span class="date">8</span>
<div class="surprise">
<h2>Swift for the Masses</h2>
<p>For those of you familiar with Swift, Apple's new programming language, it's been an exciting few weeks. Apple, as promised open-sourced Swift, and in response, IBM introduced a cool Swift toy.</p>
<a class="button" href="https://developer.ibm.com/swift/2015/12/03/introducing-the-ibm-swift-sandbox/">Visit the Swift Sandbox</a>
</div>
</div>
<div class="day">
<span class="date">9</span>
<div class="surprise">
<h2>Beautiful Progressive Loading Images</h2>
<p>So it seems that we're all after a great solution for smoothly and progressively loaded, large images. There hasn't been a perfect solution presented yet, but this one at CSS Tricks comes close!</p>
<a href="https://css-tricks.com/the-blur-up-technique-for-loading-background-images/" class="button">Visit CSS Tricks</a>
</div>
</div>
<div class="day">
<span class="date">10</span>
<div class="surprise">
<h2>A Wonderful Web Comic</h2>
<p>Jerry King is great - and he does an awesome web comic for WebDesignerDepot every week.</p>
<a href="http://www.webdesignerdepot.com/author/Jerry-King/" target="_blank" class="button">Visit WebDesignerDepot</a>
</div>
</div>
<div class="day">
<span class="date">11</span>
<div class="surprise">
<h2>CSS Animation Nirvana</h2>
<p>While perusing another advent calendar (24ways) I stumbled across an in-progress website that is pretty epic. The guys at Rally Interactive are seriously impressive.</p>
<a class="button" href="http://beta.rallyinteractive.com" target="_blank">Visit Their Beta Site</a>
</div>
</div>
<div class="day">
<span class="date">12</span>
<div class="surprise">
<h2>Freelancers, Rejoice</h2>
<p>One of the most integral pieces of a freelance business is your billing. I've been using Hiveage since it was called Curdbee, and love it. It's not as ubiquitous as it should be, but you should definitely check it out.</p>
<a class="button" href="https://www.hiveage.com" target="_blank">Visit Hiveage</a>
</div>
</div>
</div>
<div id="three" class="week">
<div class="day">
<span class="date">13</span>
<div class="surprise">
<h2>A Designer's CMS</h2>
<p>While there are a slew of full-featured, easy-to-use CMS options out there, my personal preference is a lesser known one called MODX. If you take the time to get into it, you can do almost anything you want with relative ease.</p>
<a class="button" href="http://www.modx.com" target="_blank">Visit MODX.com</a>
</div>
</div>
<div class="day">
<span class="date">14</span>
<div class="surprise">
<h2>A MODX Helping Hand</h2>
<p>To aid in my CMS suggestion from yesterday, one of the best MODX resources is MODX.today. You should give it a look!</p>
<a class="button" href="http://www.modx.com" target="_blank">Visit MODX.today</a>
</div>
</div>
<div class="day">
<span class="date">15</span>
<div class="surprise">
<h2>Begin at the Beginning: Part 1</h2>
<p>Jon Duckett has a <strong>fantastic</strong> series of books on the basic technology involved in front-end web design. Here's the first.</p>
<a class="button" href="http://www.amazon.com/gp/product/1118531647?keywords=jon%20duckett&qid=1450450861&ref_=sr_1_3&s=books&sr=1-3" target="_blank">Buy Javascript & Jquery: Interactive Front-End <br>Web Development</a>
</div>
</div>
<div class="day">
<span class="date">16</span>
<div class="surprise">
<h2>Begin at the Beginning: Part 2</h2>
<p>Jon Duckett has a <strong>fantastic</strong> series of books on the basic technology involved in front-end web design. Here's the second.</p>
<a class="button" href="http://www.amazon.com/gp/product/1118008189?keywords=jon%20duckett&qid=1450450861&ref_=sr_1_4&s=books&sr=1-4" target="_blank">Buy HTML and CSS: Design and Build Websites</a>
</div>
</div>
<div class="day">
<span class="date">17</span>
<div class="surprise">
<h2>Looking To Break Into UI Design?</h2>
<p>UI-Patterns.com is a fantastic resource for learning and practicing UI design. You should really check it out, even if you don't consider yourself a dyed-in-the-wool UI designer.</p>
<a href="http://ui-patterns.com" target="_blank" class="button">Visit UI-Designs.com</a>
</div>
</div>
<div class="day">
<span class="date">18</span>
<div class="surprise">
<h2>Get to Learning!</h2>
<p>If you're just beginning in web design, I've shared a few resources already that should help you build up your fundamentals—but no resource is more effective than Treehouse. They do a fantastic job at making complex concepts easy to understand, and their wealth of material covers much more than just web design.</p>
<a href="https://teamtreehouse.com" target="_blank" class="button">Visit Team Treehouse</a>
</div>
</div>
<div class="day">
<span class="date">19</span>
<div class="surprise">
<h2>And Now For Something Completely Random</h2>
<p>Most of the things I'm sharing on here are related to web design, but haven't you always wondered what happened to Kevin Mccallister of Home Alone fame? Well, now we know—and it ain't good.</p>
<a href="https://www.youtube.com/watch?v=yh7-wAy_8ss" target="_blank" class="button">Watch on YouTube</a>
</div>
</div>
</div>
<div id="four" class="week">
<div class="day">
<span class="date">20</span>
<div class="surprise">
<h2>Tonight, on 60 Minutes...</h2>
<p>You should check out the 60 Minutes segment with Charlie Rose tonight. He's peeking inside of Jony Ive's secret design studio.</p>
<a href="https://twitter.com/60Minutes/status/677632512827506688?ref_src=twsrc%5Etfw" target="_blank" class="button">Read the Tweet</a>
</div>
</div>
<div class="day">
<span class="date">21</span>
</div>
<div class="day">
<span class="date">22</span>
</div>
<div class="day">
<span class="date">23</span>
</div>
<div class="day">
<span class="date">24</span>
</div>
<div class="day" id="christmas-day">
<span class="date">25</span>
<svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="48.905px" height="48.904px" viewBox="0 0 48.905 48.904" style="enable-background:new 0 0 48.905 48.904;" xml:space="preserve">
<g>
<g>
<g>
<polygon points="22.092,7.262 24.452,6.022 26.811,7.262 26.362,4.635 28.268,2.775 25.633,2.39 24.452,0 23.272,2.39
20.635,2.775 22.544,4.635 " />
</g>
<g>
<g>
<polygon points="34.237,18.481 35.088,18.481 24.452,7.846 17.67,14.627 " />
</g>
<g>
<path d="M33.958,26.638l-1.979,0.349c0.323,0.192,0.554,0.533,0.554,0.938c0,0.61-0.496,1.104-1.106,1.104
c-0.611,0-1.104-0.496-1.104-1.104c0-0.267,0.105-0.498,0.26-0.688l-3.443,0.611c0.85,0.074,1.523,0.762,1.523,1.631
c0,0.916-0.742,1.656-1.655,1.656c-0.919,0-1.658-0.74-1.658-1.656c0-0.654,0.388-1.209,0.938-1.479l-4.349,0.771
c0.299,0.151,0.51,0.457,0.51,0.813c0,0.51-0.411,0.922-0.921,0.922c-0.509,0-0.918-0.412-0.918-0.922
c0-0.242,0.096-0.456,0.248-0.62L10.849,30.74l-2.513,2.514l27.466,2.003l-1.468-1.468h6.777L33.958,26.638z" />
</g>
<g>
<path d="M16.146,25.439l-3.181,3.182l24.242-4.304l-4.406-4.404l-6.46-1.504c0.37,0.354,0.604,0.853,0.604,1.407
c0,1.077-0.873,1.95-1.95,1.95c-1.076,0-1.946-0.873-1.946-1.95c0-0.877,0.58-1.607,1.375-1.852l-3.319-0.773
c0.12,0.203,0.205,0.426,0.205,0.676c0,0.756-0.614,1.37-1.37,1.37c-0.754,0-1.367-0.614-1.367-1.37
c0-0.476,0.258-0.876,0.628-1.121l-2.963-0.689l-2.425,2.425h3.715l-6.957,6.958H16.146L16.146,25.439z" />
</g>
<g>
<path d="M42.468,41.925l-4.812-4.813l-4.768-0.347c0.258,0.265,0.42,0.623,0.42,1.019c0,0.81-0.654,1.465-1.462,1.465
s-1.46-0.655-1.46-1.465c0-0.481,0.251-0.889,0.613-1.153l-8.132-0.595c0.205,0.207,0.332,0.488,0.332,0.802
c0,0.634-0.512,1.147-1.146,1.147c-0.632,0-1.144-0.512-1.144-1.147c0-0.381,0.197-0.701,0.484-0.909l-3.998-0.294
c0.54,0.32,0.907,0.899,0.907,1.571c0,1.011-0.82,1.828-1.832,1.828c-1.008,0-1.827-0.817-1.827-1.828
c0-0.762,0.466-1.414,1.128-1.689l-2.73-0.199l-6.606,6.608h15.829l-1.257,6.979h6.889l-1.259-6.979L42.468,41.925
L42.468,41.925z" />
</g>
</g>
</g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
<g>
</g>
</svg>
</div>
<div class="day noDate"></div>
</div>
</section>
<div id="bottom" class="collectonme"></div>
$borderColor:#c6c6c6;
$borderThickness:1px;
$weekendColor:#ebebeb;
$hoverBackgroundColor:#305dd4;
$hoverTextColor:#cfdef4;
* {
box-sizing:border-box;
}
html,body {
font-family:helvetica neue,helvetica,arial,sans-serif;
font-weight:200;
height:100%;
min-height:100%;
}
body {
background-color:darken($hoverBackgroundColor,15%);
}
h1 {
font-size:35px;
margin: 0;
padding:50px 0;
text-align:center;
color:white;
text-shadow:2px 2px 0px rgba(0,0,0,.3);
em {
font-weight:500;
}
}
#modal {
position:fixed;
z-index:1;
top:-100%;
left:0;
height:100%;
width:100%;
background:rgba($hoverBackgroundColor,.9);
.wrapper {
height:100%;
width:100%;
display:table;
.content {
display:table-cell;
vertical-align:middle;
position:relative;
height:100%;
width:100%;
.close {
position:absolute;
height:50px;
width:50px;
top:15px;
right:15px;
transform:rotate(45deg);
&:before {
content:'';
display:block;
position:absolute;
left:50%;
margin-left:-1px;
height:0%;
width:2px;
background:rgba(255,255,255,.7);
}
&:after {
content:'';
display:block;
position:absolute;
top:50%;
margin-top:-1px;
width:0%;
height:2px;
background:rgba(255,255,255,.7);
}
}
.box {
padding:50px;
width:500px;
max-width:100%;
background:white;
border-radius:5px;
margin:0 auto;
transform:scale(0);
h2 {
font-size:25px;
line-height:35px;
font-weight:300;
margin-bottom:25px;
}
p {
font-size:16px;
line-height:22px;
margin-bottom:25px;
&:last-of-type {
margin-bottom:0;
}
}
a {
&.button {
display:inline-block;
padding:15px;
color:white;
text-decoration:none;
background-color:$hoverBackgroundColor;
border-radius:5px;
margin-top:25px;
box-shadow:inset 0 0 0 darken($hoverBackgroundColor,20%);
transition:.25s ease-in-out;
&:hover {
box-shadow:inset 500px 0 0 darken($hoverBackgroundColor,20%);
}
}
}
}
}
}
&.active {
top:0%;
animation: fadeIn .25s ease-in-out;
&.moveOut {
animation: fadeOut .25s ease-in-out;
}
.wrapper {
.content {
.box {
-webkit-animation: scaleUp 750ms .25s linear both;
animation: scaleUp 750ms .25s linear both;
}
.close {
&:before {
height:100%;
transition:.25s .5s ease-in-out;
}
&:after {
width:100%;
transition:.25s .25s ease-in-out;
}
&:hover {
cursor:pointer;
&:before,&:after {
transition:.25s 0s ease-in-out;
background:rgba(255,255,255,1);
}
}
}
}
}
}
}
#calendar {
width:800px;
max-width:100%;
margin:0 auto;
border-top:$borderThickness solid $borderColor;
border-left:$borderThickness solid $borderColor;
position:relative;
z-index:0;
#day-labels {
width:100%;
border-bottom:$borderThickness solid $borderColor;
border-right:$borderThickness solid $borderColor;
overflow:auto;
.label {
width:14.285714286%;
float:left;
text-align:right;
padding:10px;
font-size:18px;
letter-spacing:1px;
color:darken($borderColor,30%);
background:rgba(255,255,255,.95);
}
}
.week {
width:100%;
overflow:hidden;
.day {
width:14.285714286%;
padding-bottom:14.285714286%;
border-right:$borderThickness solid $borderColor;
border-bottom:$borderThickness solid $borderColor;
height:0px;
float:left;
position:relative;
background:rgba(255,255,255,.95);
.date {
display:block;
position:absolute;
top:5px;
right:5px;
border-radius:100%;
height:25px;
width:25px;
text-align:center;
line-height:25px;
font-size:14px;
color:darken($borderColor,30%);
&.today {
color:white;
background:#cd1b1b;
}
}
.surprise {
display:none;
}
&#christmas-day {
text-align:center;
svg {
height:100%;
fill:#348834;
}
&:hover {
svg {
fill:$hoverTextColor;
}
}
}
&.future {
}
&.past {
background-image:url(http://www.designcouch.com/assets/images/christmaspresent11.svg);
background-size:30%;
background-repeat:no-repeat;
background-position:center center;
&#christmas-day {
background-image:none;
}
}
&:first-of-type,&:last-of-type {
background-color:rgba($weekendColor,.95);
&.noDate {
&:hover {
background-color:rgba($weekendColor,.95);
cursor:default;
}
}
}
&:hover {
background-color:$hoverBackgroundColor;
cursor:pointer;
&.noDate {
background:rgba(255,255,255,.95);
cursor:default;
}
.date {
color:$hoverTextColor;
&.today {
background:$hoverTextColor;
color:$hoverBackgroundColor;
}
}
}
}
}
}
#bottom {
position:fixed !important;
height:0;
width:100%;
bottom:0;
left:0;
}
@keyframes fadeIn {
0% {
top:0%;
opacity:0;
}
100% {
opacity:1;
}
}
@keyframes fadeOut {
0% {
opacity:1;
}
100% {
opacity:0;
}
}
@-webkit-keyframes scaleUp {
0% { -webkit-transform: matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
3.2% { -webkit-transform: matrix3d(0.345, 0.098, 0, 0, 0.065, 0.345, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.345, 0.098, 0, 0, 0.065, 0.345, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
4.5% { -webkit-transform: matrix3d(0.485, 0.163, 0, 0, 0.107, 0.485, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.485, 0.163, 0, 0, 0.107, 0.485, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
6.41% { -webkit-transform: matrix3d(0.673, 0.242, 0, 0, 0.158, 0.673, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.673, 0.242, 0, 0, 0.158, 0.673, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
9.01% { -webkit-transform: matrix3d(0.88, 0.288, 0, 0, 0.188, 0.88, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.88, 0.288, 0, 0, 0.188, 0.88, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
12.71% { -webkit-transform: matrix3d(1.064, 0.241, 0, 0, 0.159, 1.064, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.064, 0.241, 0, 0, 0.159, 1.064, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
13.51% { -webkit-transform: matrix3d(1.087, 0.221, 0, 0, 0.146, 1.087, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.087, 0.221, 0, 0, 0.146, 1.087, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
17.92% { -webkit-transform: matrix3d(1.139, 0.105, 0, 0, 0.07, 1.139, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.139, 0.105, 0, 0, 0.07, 1.139, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
18.92% { -webkit-transform: matrix3d(1.137, 0.082, 0, 0, 0.055, 1.137, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.137, 0.082, 0, 0, 0.055, 1.137, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
25.23% { -webkit-transform: matrix3d(1.075, -0.001, 0, 0, -0.001, 1.075, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.075, -0.001, 0, 0, -0.001, 1.075, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
29.03% { -webkit-transform: matrix3d(1.032, -0.015, 0, 0, -0.01, 1.032, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.032, -0.015, 0, 0, -0.01, 1.032, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
31.43% { -webkit-transform: matrix3d(1.012, -0.017, 0, 0, -0.011, 1.012, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.012, -0.017, 0, 0, -0.011, 1.012, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
34.63% { -webkit-transform: matrix3d(0.994, -0.014, 0, 0, -0.01, 0.994, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.994, -0.014, 0, 0, -0.01, 0.994, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
40.14% { -webkit-transform: matrix3d(0.985, -0.007, 0, 0, -0.005, 0.985, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.985, -0.007, 0, 0, -0.005, 0.985, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
56.46% { -webkit-transform: matrix3d(1, 0.001, 0, 0, 0.001, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0.001, 0, 0, 0.001, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
62.36% { -webkit-transform: matrix3d(1.002, 0.001, 0, 0, 0, 1.002, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.002, 0.001, 0, 0, 0, 1.002, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
81.48% { -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
84.68% { -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
100% { -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
}
@keyframes scaleUp {
0% { -webkit-transform: matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
3.2% { -webkit-transform: matrix3d(0.345, 0.098, 0, 0, 0.065, 0.345, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.345, 0.098, 0, 0, 0.065, 0.345, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
4.5% { -webkit-transform: matrix3d(0.485, 0.163, 0, 0, 0.107, 0.485, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.485, 0.163, 0, 0, 0.107, 0.485, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
6.41% { -webkit-transform: matrix3d(0.673, 0.242, 0, 0, 0.158, 0.673, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.673, 0.242, 0, 0, 0.158, 0.673, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
9.01% { -webkit-transform: matrix3d(0.88, 0.288, 0, 0, 0.188, 0.88, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.88, 0.288, 0, 0, 0.188, 0.88, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
12.71% { -webkit-transform: matrix3d(1.064, 0.241, 0, 0, 0.159, 1.064, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.064, 0.241, 0, 0, 0.159, 1.064, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
13.51% { -webkit-transform: matrix3d(1.087, 0.221, 0, 0, 0.146, 1.087, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.087, 0.221, 0, 0, 0.146, 1.087, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
17.92% { -webkit-transform: matrix3d(1.139, 0.105, 0, 0, 0.07, 1.139, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.139, 0.105, 0, 0, 0.07, 1.139, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
18.92% { -webkit-transform: matrix3d(1.137, 0.082, 0, 0, 0.055, 1.137, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.137, 0.082, 0, 0, 0.055, 1.137, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
25.23% { -webkit-transform: matrix3d(1.075, -0.001, 0, 0, -0.001, 1.075, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.075, -0.001, 0, 0, -0.001, 1.075, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
29.03% { -webkit-transform: matrix3d(1.032, -0.015, 0, 0, -0.01, 1.032, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.032, -0.015, 0, 0, -0.01, 1.032, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
31.43% { -webkit-transform: matrix3d(1.012, -0.017, 0, 0, -0.011, 1.012, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.012, -0.017, 0, 0, -0.011, 1.012, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
34.63% { -webkit-transform: matrix3d(0.994, -0.014, 0, 0, -0.01, 0.994, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.994, -0.014, 0, 0, -0.01, 0.994, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
40.14% { -webkit-transform: matrix3d(0.985, -0.007, 0, 0, -0.005, 0.985, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(0.985, -0.007, 0, 0, -0.005, 0.985, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
56.46% { -webkit-transform: matrix3d(1, 0.001, 0, 0, 0.001, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0.001, 0, 0, 0.001, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
62.36% { -webkit-transform: matrix3d(1.002, 0.001, 0, 0, 0, 1.002, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1.002, 0.001, 0, 0, 0, 1.002, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
81.48% { -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
84.68% { -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
100% { -webkit-transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); }
}
// target current day, disable future days and days without dates
var d = new Date();
var todaysDate = d.getDate();
var target = $('#calendar .week .day .date');
target.each(function(){
var day = $(this).html();
if (todaysDate == day) {
$(this).addClass('today');
}
if (todaysDate < day){
$(this).parent().addClass('future');
}
if (todaysDate >= day){
$(this).parent().addClass('past')
}
});
// handle clicks on days
$('.day').click(function(){
if ($(this).hasClass('future')){
$('#modal').addClass('active');
$('#modal .wrapper .content .box').html("<h2>Naughty, naughty.</h2> <p>You can't look early! Check back on that day to see what I've left for you.</p>");
}
if ($(this).hasClass('past')){
var content = $(this).children('.surprise').html();
$('#modal').addClass('active');
$('#modal .wrapper .content .box').html('');
$('#modal .wrapper .content .box').html(content);
}
})
// close modal
$('.close').click(function(){
var ultimateParent = $(this).parent().parent().parent();
ultimateParent.addClass('moveOut');
setTimeout(function(){
ultimateParent.removeClass('moveOut').removeClass('active');
},250);
})
// snow effect customizations
$(document).snowfall({flakeCount : 100,collection : '.collectonme', maxSpeed : 10});
Also see: Tab Triggers