Skip to content

Instantly share code, notes, and snippets.

@samarkandiy
Created August 6, 2012 08:08
Show Gist options
  • Save samarkandiy/3272204 to your computer and use it in GitHub Desktop.
Save samarkandiy/3272204 to your computer and use it in GitHub Desktop.
A web page created at CodePen.io.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- IF PEN IS PRIVATE -->
<!-- <meta name="robots" content="noindex"> -->
<!-- END -->
<title>Recent codepens &middot; CodePen</title>
<!--
Copyright (c) 2012 Azik Samarkandiy, http://codepen.io/html5web
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-->
<style>
* {
box-sizing: border-box;
transition: all .9s ease-out;
}
body {
background:url(http://codepen.io/images/classy_fabric.png);
}
h1 {
font:3em "HelveticaNeue-CondensedBold", "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
color: #fff;
text-align: center;
}
.CodePen-Slid0r .wrapper {
position:relative;
width:100%;
visibility:hidden;
opacity:0;
overflow:hidden;
padding:0;
float:left;
}
.CodePen-Slid0r .wrapper.show {
visibility:visible;
opacity:1;
height:850px;
padding-bottom:5px;
}
.CodePen-Slid0r iframe {
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
visibility:hidden;
opacity:0;
overflow:hidden;
background:#fff;
}
.CodePen-Slid0r .wrapper.show iframe {
visibility:visible;
opacity:1;
height:550px;
width:100%;
}
.meta {
background:#111;
position:fixed;
border:10px solid #222;
height:70px;
width:140%;
padding:5px;
margin-top: 70%;
overflow: hidden;
}
.meta h1,
.meta h2 {
float:left;
font:2em "HelveticaNeue-CondensedBold", "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
color:#fff;
margin:5px;
}
.meta h2 {
color:#76DAFF;
font-size:1.5em;
line-height:2em;
overflow-y:hidden;
height:80px;
}
.meta img {
float:left;
margin-right:10px;
height:40px;
width:40px;
border-radius: 50%;
}
.meta .social {
position:absolute;
z-index:1338;
right:30%;
top:-40%;
color:#fff;
font:1.25em "HelveticaNeue-CondensedBold", "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
line-height:3em;
background:rgba(40, 40, 40, .9);
height:100%;
padding:5px 10px 0 10px;
border-radius:5px;
}
.meta .social span {
font-size:1.2em;
margin-right:5px;
}
</style>
<style>
#codepen-footer, #codepen-footer * {
-webkit-box-sizing: border-box !important;
-moz-box-sizing: border-box !important;
box-sizing: border-box !important;
}
#codepen-footer {
display: block !important;
position: fixed !important;
bottom: 0 !important;
left: 0 !important;
width: 100% !important;
padding: 0 10px !important;
margin: 0 !important;
height: 30px !important;
line-height: 30px !important;
font-size: 12px !important;
color: #eeeeee !important;
background-color: #505050 !important;
text-align: left !important;
background: -webkit-linear-gradient(top, #505050, #383838) !important;
background: -moz-linear-gradient(top, #505050, #383838) !important;
background: -ms-linear-gradient(top, #505050, #383838) !important;
background: -o-linear-gradient(top, #505050, #383838) !important;
border-top: 1px solid black !important;
border-bottom: 1px solid black !important;
border-radius: 0 !important;
border-image: none !important;
box-shadow: inset 0 1px 0 #6e6e6e, 0 2px 2px rgba(0, 0, 0, 0.4) !important;
z-index: 300 !important;
font-family: "Lucida Grande", "Lucida Sans Unicode", Tahoma, sans-serif !important;
letter-spacing: 0 !important;
word-spacing: normal !important;
word-spacing: 0 !important;
-webkit-transform: none !important;
-moz-transform: none !important;
-ms-transform: none !important;
-o-transform: none !important;
transform: none !important;
}
#codepen-footer a {
color: #a7a7a7 !important;
text-decoration: none !important;
text-shadow: none !important;
border: 0 !important;
}
#codepen-footer a:hover {
color: white !important;
}
</style>
<script>
// Kill alerts, confirmations and prompts
// window.alert = function(){}; we're going to allow alerts for now
window.confirm = function(){};
window.prompt = function(){};
window.open = function(){};
window.print = function(){};
</script>
</head>
<body>
<!--
CodePen Slid0r Widget.
A CodePen Slid0r Widget using the unoffical CodePen API.
Unoffical CodePen API:
http://github.com/TimPietrusky/codepen-awesomepi
2012 by Tim Pietrusky
timpietrusky.com
-->
<div class="CodePen-Slid0r">
<h1>Recent pens</h1>
</div>​
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
(function() {
/*
* Using the unoffical CodePen API to get the Editor's Picks.
* http://github.com/TimPietrusky/codepen-awesomepi
*/
$.ajax({
dataType: 'jsonp',
jsonp: 'jsonp',
url: 'http://codepen-awesomepi.timpietrusky.com/recent',
success: function(data) {
if (data.content != null) {
start(data.content.pens);
}
}
});
/*
* Create and show the iframes holding the pens
*/
function start(pens) {
// Clear
$('.CodePen-Slid0r').html('');
// Create iframes
$.each(pens, function(i, v) {
var wrapper = $('<div class="wrapper"></div>');
var link = $('<a href="" target="_blank"></a>');
link.attr('href', this.url.pen);
var iframe = $('<iframe></iframe>');
iframe.attr('frameborder', 0);
iframe.attr('scrolling', 'no');
iframe.attr('allowtransparency', 0);
iframe.attr('class', 'iframe' + i);
iframe.attr('src', this.url.fullgrid);
// Show first in the line
if (i == 0) {
wrapper.attr('class', 'wrapper show');
}
// meta
var meta = $('<div class="meta"></div>');
var meta_author = $('<img src="'+this.user.gravatar+'">'
+ '<h1>' + this.user.realname + '</h1>');
var meta_title = $('<h2></h2>');
if (this.title != null) {
meta_title.html(this.title);
}
var meta_social = $('<div class="social"></div>');
meta_social.append(this.views + ' <span class="views">&#9786;</span>');
meta_social.append('&nbsp;&nbsp;');
meta_social.append(this.hearts + ' <span class="hearts">&#9829;</span>');
meta_author.appendTo(meta);
meta_title.appendTo(meta);
meta_social.appendTo(meta);
iframe.appendTo(link);
meta.appendTo(link);
wrapper.append(link);
wrapper.appendTo('.CodePen-Slid0r');
});
setTimeout(function() {
rotate();
}, 0);
}
function rotate() {
var iframes = $('.CodePen-Slid0r .wrapper');
setInterval(function() {
$.each(iframes, function(i, v) {
iframes[i] = $(iframes[i]);
if (iframes[i].hasClass('show')) {
iframes[i].removeClass('show');
if (iframes[i+1] != undefined) {
$(iframes[i+1]).addClass('show');
} else {
iframes[0].addClass('show');
}
return false;
}
});
}, 5000);
}
})();
</script>
<div id="codepen-footer">
<a style="color: #f73535 !important;" href="https://codepen.wufoo.com/forms/m7x3r3/def/field14=" target="_blank">Report Abuse</a>
&nbsp;
<a href="/html5web/pen/phAtC" target="_blank">Edit this Pen</a>
</div>
<script>
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-30102653-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</body>
</html>
/*
* Using the unoffical CodePen API to get the Editor's Picks.
* http://github.com/TimPietrusky/codepen-awesomepi
*/
$.ajax({
dataType: 'jsonp',
jsonp: 'jsonp',
url: 'http://codepen-awesomepi.timpietrusky.com/recent',
success: function(data) {
if (data.content != null) {
start(data.content.pens);
}
}
});
/*
* Create and show the iframes holding the pens
*/
function start(pens) {
// Clear
$('.CodePen-Slid0r').html('');
// Create iframes
$.each(pens, function(i, v) {
var wrapper = $('<div class="wrapper"></div>');
var link = $('<a href="" target="_blank"></a>');
link.attr('href', this.url.pen);
var iframe = $('<iframe></iframe>');
iframe.attr('frameborder', 0);
iframe.attr('scrolling', 'no');
iframe.attr('allowtransparency', 0);
iframe.attr('class', 'iframe' + i);
iframe.attr('src', this.url.fullgrid);
// Show first in the line
if (i == 0) {
wrapper.attr('class', 'wrapper show');
}
// meta
var meta = $('<div class="meta"></div>');
var meta_author = $('<img src="'+this.user.gravatar+'">'
+ '<h1>' + this.user.realname + '</h1>');
var meta_title = $('<h2></h2>');
if (this.title != null) {
meta_title.html(this.title);
}
var meta_social = $('<div class="social"></div>');
meta_social.append(this.views + ' <span class="views">&#9786;</span>');
meta_social.append('&nbsp;&nbsp;');
meta_social.append(this.hearts + ' <span class="hearts">&#9829;</span>');
meta_author.appendTo(meta);
meta_title.appendTo(meta);
meta_social.appendTo(meta);
iframe.appendTo(link);
meta.appendTo(link);
wrapper.append(link);
wrapper.appendTo('.CodePen-Slid0r');
});
setTimeout(function() {
rotate();
}, 0);
}
function rotate() {
var iframes = $('.CodePen-Slid0r .wrapper');
setInterval(function() {
$.each(iframes, function(i, v) {
iframes[i] = $(iframes[i]);
if (iframes[i].hasClass('show')) {
iframes[i].removeClass('show');
if (iframes[i+1] != undefined) {
$(iframes[i+1]).addClass('show');
} else {
iframes[0].addClass('show');
}
return false;
}
});
}, 5000);
}
<!--
CodePen Slid0r Widget.
A CodePen Slid0r Widget using the unoffical CodePen API.
Unoffical CodePen API:
http://github.com/TimPietrusky/codepen-awesomepi
2012 by Tim Pietrusky
timpietrusky.com
-->
<div class="CodePen-Slid0r">
<h1>Recent pens</h1>
</div>​
* {
box-sizing: border-box;
transition: all .9s ease-out;
}
body {
background:url(http://codepen.io/images/classy_fabric.png);
}
h1 {
font:3em "HelveticaNeue-CondensedBold", "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
color: #fff;
text-align: center;
}
.CodePen-Slid0r .wrapper {
position:relative;
width:100%;
visibility:hidden;
opacity:0;
overflow:hidden;
padding:0;
float:left;
}
.CodePen-Slid0r .wrapper.show {
visibility:visible;
opacity:1;
height:850px;
padding-bottom:5px;
}
.CodePen-Slid0r iframe {
position:absolute;
top:0;
left:0;
width:100%;
height:100%;
visibility:hidden;
opacity:0;
overflow:hidden;
background:#fff;
}
.CodePen-Slid0r .wrapper.show iframe {
visibility:visible;
opacity:1;
height:550px;
width:100%;
}
.meta {
background:#111;
position:fixed;
border:10px solid #222;
height:70px;
width:140%;
padding:5px;
margin-top: 70%;
overflow: hidden;
}
.meta h1,
.meta h2 {
float:left;
font:2em "HelveticaNeue-CondensedBold", "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
color:#fff;
margin:5px;
}
.meta h2 {
color:#76DAFF;
font-size:1.5em;
line-height:2em;
overflow-y:hidden;
height:80px;
}
.meta img {
float:left;
margin-right:10px;
height:40px;
width:40px;
border-radius: 50%;
}
.meta .social {
position:absolute;
z-index:1338;
right:30%;
top:-40%;
color:#fff;
font:1.25em "HelveticaNeue-CondensedBold", "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
line-height:3em;
background:rgba(40, 40, 40, .9);
height:100%;
padding:5px 10px 0 10px;
border-radius:5px;
}
.meta .social span {
font-size:1.2em;
margin-right:5px;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment