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. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

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.

Details

Privacy

Go PRO Window blinds lowered to protect code. Code Editor with window blinds (raised) and a light blub turned on.

Keep it secret; keep it safe.

Private Pens are hidden everywhere on CodePen, except to you. You can still share them and other people can see them, they just can't find them through searching or browsing.

Upgrade to PRO

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.

Template

Make Template?

Templates are Pens that can be used to start other Pens quickly from the create menu. The new Pen will copy all the code and settings from the template and make a new Pen (that is not a fork). You can view all of your templates, or learn more in the documentation.

Template URL

Any Pen can act as a template (even if you don't flip the toggle above) with a special URL you can use yourself or share with others. Here's this Pen's template URL:

Screenshot

Screenshot or Custom Thumbnail

Screenshots of Pens are shown in mobile browsers, RSS feeds, to users who chose images instead of iframes, and in social media sharing.

This Pen is using the default Screenshot, generated by CodePen. Upgrade to PRO to upload your own thumbnail that will be displayed on previews of this pen throughout the site and when sharing to social media.

Upgrade to PRO

HTML

              
                <div id="WIDGETLEFT" class="smallertext">
  Berlin&nbsp;<span id="widget_berlin_c">6</span>°C,&nbsp;Oslo&nbsp;<span id="widget_oslo_c">2</span>°C,&nbsp;1&nbsp;EUR&nbsp;=&nbsp;<span id="widget_nok">8,04</span>&nbsp;NOK
  <div style="display:none" id="THE_CLOCK_SMALL" onClick="clock_open()">
    <canvas id="THE_CLOCK_SMALL_C" width="16" height="16"></canvas>
  </div>
  <span id="WIDGETLEFT_BR"></span>
  <div style="display:none" id="mobile_feed_show"><a href="javascript:mobile_feed_open()">Mobile Feed</a></div>
</div>

<div id="MOBILE_FEED">
  <div id="MOBILE_FEED_INNER" class="smallertext">
    <div>
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tbody>
          <tr>
            <td align="left">Mobile Feed by Edo</td>
            <td align="right"><a href="javascript:mobile_feed_close()">close</a></td>
          </tr>
        </tbody>
      </table>
      <div id="MOBILE_FEED_INNER_IMG"><img src="//www.anony.ws/i/2016/04/22/somename.jpg"></div>
      <br>
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tbody>
          <tr>
            <td width="200" align="left">Some text</td>
            <td width="124" align="right"><a target="_blank" href="/">location</a>
              <a style="margin-left:3px" href="javascript:mobile_feed_next()">next</a></td>
          </tr>
        </tbody>
      </table>
    </div>
    <div>
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tbody>
          <tr>
            <td align="left">Mobile Feed by Edo</td>
            <td align="right"><a href="javascript:mobile_feed_close()">close</a></td>
          </tr>
        </tbody>
      </table>
      <div id="MOBILE_FEED_INNER_IMG"><img src="//www.anony.ws/i/2016/04/22/whatever.jpg"></div>
      <br>
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tbody>
          <tr>
            <td width="200" align="left">Some text</td>
            <td width="124" align="right"><a target="_blank" href="/">location</a>
              <a style="margin-left:3px" href="javascript:mobile_feed_next()">next</a></td>
          </tr>
        </tbody>
      </table>
    </div>
  </div>
</div>

<div id="MOBILE_FEED_SHADOW"></div>

<div id="CLOCK">
  <div id="CLOCK_INNER" class="smallertext">
    <table width="100%" cellpadding=0 cellspacing=0 border=0>
      <tr>
        <td align="left">Clock</td>
        <td align="right"><a href="javascript:clock_close()">close</a></td>
      </tr>
    </table>
    <div id="THE_CLOCK_OUTER">
      <canvas id="THE_CLOCK" width="168" height="168"></canvas>
    </div>
  </div>
</div>

<div id="CLOCK_SHADOW"></div>
              
            
!

CSS

              
                /*** RESET ***/
html, body, body div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, figure, footer, header, hgroup, menu, nav, section, time, mark, audio, video {
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	font-size: 100%;
	vertical-align: baseline;
	background: transparent;
}									

article, aside, figure, footer, header, hgroup, nav, section {display: block;}

/* force a vertical scrollbar to prevent a jumpy page */
html {overflow-y: scroll;}

ul {list-style: none;}

blockquote, q {quotes: none;}

blockquote:before, 
blockquote:after, 
q:before, 
q:after {content: ''; content: none;}

a {margin: 0; padding: 0; font-size: 100%; vertical-align: baseline; background: transparent;}

del {text-decoration: line-through;}

abbr[title], dfn[title] {border-bottom: 1px dotted #000; cursor: help;}

table {border-collapse: collapse; border-spacing: 0;}
th {font-weight: bold; vertical-align: bottom;}
td {font-weight: normal; vertical-align: top;}

hr {display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0;}

input, select {vertical-align: middle;}

pre {
	white-space: pre; /* CSS2 */
	white-space: pre-wrap; /* CSS 2.1 */
	white-space: pre-line; /* CSS 3 (and 2.1 as well, actually) */
	word-wrap: break-word; /* IE */
}

input[type="radio"] {vertical-align: text-bottom;}
input[type="checkbox"] {vertical-align: bottom; *vertical-align: baseline;}
.ie6 input {vertical-align: text-bottom;}

select, input, textarea {font: 99% sans-serif;}

table {font-size: inherit; font: 100%;}
 
a:hover, a:active { outline: none; }

small {font-size: 85%;}

strong, th {font-weight: bold;}

td, td img {vertical-align: top;} 

sub, sup {font-size: 75%; line-height: 0; position: relative;}
sup {top: -0.5em;}
sub {bottom: -0.25em;}

pre, code, kbd, samp {font-family: monospace, sans-serif;}

.clickable,
label, 
input[type=button], 
input[type=submit], 
button {cursor: pointer;}

button, input, select, textarea {margin: 0;}

button {width: auto; overflow: visible;}
 
.ie7 img {-ms-interpolation-mode: bicubic;} /* scale images in IE7 more attractively */
.ie6 html {filter: expression(document.execCommand("BackgroundImageCache", false, true));} /* prevent BG image flicker upon hover */

.clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; overflow: hidden; }  
.clearfix:after { clear: both; }  
.clearfix { zoom: 1; }  


.hiddentext {
	display:none;
}


/*** PAGE ***/

* {
	font-weight:normal !important;
}

body {
	-webkit-text-size-adjust:none;
	color:#000;
	font-family:Helvetica,sans-serif;
	font-size:15px;
	line-height:19px;
	
	font-weight:normal;
	font-style:normal;
	margin:0px;
	padding:0px;
}

:focus {outline: 0;}

i {
	 font-size-adjust:0.508;
	 font-weight:normal;
	 font-style:italic;
}

input { 
	outline:0; 
	color:#000;
	font-family:Helvetica,sans-serif;
	font-size:15px;
}

.weathertext {
	font-size:70px;
	line-height:60px;
	font-family:"Times New Roman", Times, serif;
	padding:40px;
}

html {
    -webkit-text-size-adjust: none; /* Prevent font scaling in landscape */
	 overflow-x: hidden;
	 -webkit-font-smoothing: subpixel-antialiased; /* or antialiased */
}

.fixtextbugsafari {
	-webkit-font-smoothing: antialiased !important;
}

textarea {
	resize: none;
}


a 		{color: #000;}
a:hover {color: #000;}

::-moz-selection	{background: #dddddd; color: #000; text-shadow: none;}
::selection 		{background: #dddddd; color: #000; text-shadow: none;} 
a:link 				{-webkit-tap-highlight-color: #dddddd;}

.nomargin { margin:0px !important;}

.smallertext {
	font-size:12px !important;
	line-height:auto !important;
}

#MENU_ARCHIVE {
	position:fixed;
	top:50px;
	left:200px;
	width:1000px;
	text-align:center;
	z-index:9999;
	display:none;
}

#MENU_ARCHIVE a {
	text-decoration:none;
	border-bottom:2px solid transparent;
	display:inline-block;
	margin-right:14px;
}

#MENU_ARCHIVE a:hover {
	border-bottom:2px solid #000;
}

.submenu_active, .search_active {
	border-bottom:2px solid #000 !important;
}

#search_box {
	display:none;
	text-align:left;
	cursor:pointer;
	border:0px;
	border-bottom:2px solid #000;
	padding:0;
	margin:0;
	margin-top:-9px;
	margin-right:14px;
	margin-left:0px;
	padding-left:-3px;
	height:25px;
	overflow:hidden;
}


#WIDGETLEFT {
	position:fixed;
	top:0px;
	left:0px;
	background-color:#ddd;
	padding:2px 8px 2px 7px;
	color:#000;
	z-index:20;
}

#CONTENT.workbench {
	overflow:hidden;
	padding-bottom:100px;
	visibility:hidden;
}

#CONTENT.archive {
	top:95px;
	padding-bottom:100px;
}

#CONTENT.about {
	top:95px;
	padding-bottom:100px;
}


/*** WORKBENCH ***/

#CLOCK {
	position:absolute;
	top:60px;
	left:200px;
	width:172px;
	height:172px;
	z-index:998;
	border:1px solid #666;
	background-color:#fff;
	display:none;
	cursor:move;
}

#CLOCK_INNER {
	position:absolute;
	top:7px;
	left:9px;
	width:154px;
	height:154px;
	overflow:hidden;
}

#CLOCK_SHADOW {
	position:absolute;
	top:73px;
	left:212px;
	width:172px;
	height:172px;
	z-index:997;
	background-color:#666;
	-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
	filter: alpha(opacity=50);
	-khtml-opacity: 0.5;
	-moz-opacity: 0.5;
	opacity: 0.5;
	display:none;
}

#THE_CLOCK_OUTER {
	padding-left:12px;
	padding-top:3px;
}

#THE_CLOCK_SMALL {
	display:inline-block;
	position:relative;
	width:16px;
	height:1px;
	display:none;
	cursor:pointer;
	margin-left:2px;
}


#WIDGETLEFT_BR {
	width:1px;
	overflow:hidden;
}


#THE_CLOCK_SMALL canvas {
	top:-11px;
	left:4px;
	position:absolute;
}

#MOBILE_FEED {
	position:absolute;
	top:60px;
	left:200px;
	width:278px;
	height:410px;
	z-index:1000;
	border:1px solid #666;
	background-color:#fff;
	display:none;
	cursor:move;
}


#MOBILE_FEED_SHADOW {
	position:absolute;
	top:73px;
	left:212px;
	width:278px;
	height:410px;
	z-index:999;
	background-color:#666;
	-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)";
	filter: alpha(opacity=50);
	-khtml-opacity: 0.5;
	-moz-opacity: 0.5;
	opacity: 0.5;
	display:none;
}


#MOBILE_FEED_INNER {
	position:absolute;
	top:7px;
	left:9px;
	width:260px;
	overflow:hidden;
}


#MOBILE_FEED_INNER_IMG {
	width:260px;
	overflow:hidden;
	margin-bottom:-17px;
}

#MOBILE_FEED_INNER_IMG img {
	width:260px;
}

#MOBILE_FEED_INNER a, #mobile_feed_show a, #CLOCK_INNER a {
	text-decoration:underline;
}

#MOBILE_FEED_INNER a:hover, #mobile_feed_show a:hover, #CLOCK_INNER a:hover {
	text-decoration:none;
}

#mobile_feed_show {
	display:none;
	position:relative;
	margin-left:5px;
}

.workbench_item {
	float:left;
	margin-bottom:45px;
}

.workbench_item .smallertext:hover{
	text-decoration:none !important;
}

.workbench_item img {
	width:300px
}

.workbench_item a {
	text-decoration:underline;
}

.workbench_item a:hover {
	text-decoration:none;
}

.workbench_item em {
	letter-spacing:-4px;
	font-style:normal !important;
}

.vimeo_play {
	width:65px;
	height:40px;
	overflow:hidden;
	position:absolute;
	left:10px;
	bottom:10px;
	background:url(../_GFX/vimeo_play.png);
	background-position:0px 0px;
	background-repeat:no-repeat;
	cursor:pointer;	
}

.vimeo_play:hover {
	background-position:0px -40px;	
}

.vimeo_preview_image {
	position:relative;
	width:400px;
	height:225px;
	overflow:hidden;
	margin-bottom:4px;
	
}

.vimeo_preview_image img {
	width:100%;
}


/*** PROJECT ***/

#PROJECT_VIEW_TEXT {
	position:fixed;
	top:120px;
	left:30px;
	width:285px;
}


#PROJECT_VIEW_TEXT a {
	text-decoration:underline;
}

#PROJECT_VIEW_TEXT a:hover {
	text-decoration:none;
}

#PROJECT_VIEW_IMAGES {
	position:absolute;
	top:30px;
	left:364px;
	width:650px;
	display:none;
}

#PROJECT_VIEW_IMAGES .vimeovideo {
	margin-bottom:-3px;
}

#PROJECT_VIEW_IMAGES img {
	width:100%;
	margin-bottom:16px;
}

#PROJECT_VIEW_NAVI {
	position:fixed;
	top:120px;
	left:1060px;
	width:200px;
	display:none;
}

#PROJECT_VIEW_NAVI a {
	text-decoration:none;
}

#PROJECT_VIEW_NAVI a:hover {
	text-decoration:underline;
}


.project_video {
	width:100%;
	position:relative;
	overflow:hidden;
	margin-bottom:16px;
}

.project_video img {
	margin-bottom:0 !important;
}

.project_item {
	display:block;
	cursor:pointer
}

#MOBILE_FEED_INNER div:not(:first-of-type) {
display: none;
}
              
            
!

JS

              
                    URL_ROOT = 'index.html'
    PAGE_SECTION = 'workbench'
    iOS = '0'
    COUNTRY = 'NETHERLANDS'

    var u = self.location.href
    if (u.indexOf("www.???.com") != -1) {
        window.location.replace(u.replace("www.google.com", "google.com"))
    }
    if (u.indexOf("www.???.com") != -1) {
        window.location.replace(u.replace("www.google.com", "google.com"))
    }

    $(window).bind("load", function() {
        lets_go()
    });

/* 	--------------------------------------------------------------------
	VARS
	------------------------------------------------------------------- */

WORKBENCH_MASONRY_INITIALIZED = 0;
WINDOW_LAST_Y = 0;
WORKBENCH_SHADOW_XOFF = 10;
WORKBENCH_SHADOW_YOFF = 10;
WORKBENCH_MF_Y = 0;
WORKBENCH_CLOCK_Y = 0;
WORKBENCH_IMG_RIGHTMAR = 20;
WORKBENCH_USE_ZOOMS = 1; // also change in php!
WORKBENCH_VIDEO_RATIO = 400 / 225;
WORKBENCH_TEXT_RATIO = 1.2;
FOUR_THREE_RATIO = 4 / 3;
SHOWCASE_TEXT_IS_SHOWN = 0;
WORKBENCH_LOADITEMS = 15; // also change in incl.section_workbench.php -> WORKBENCH_SHOW_AMOUNT
WORKBENCH_NEXT = 0 + WORKBENCH_LOADITEMS;
WORKBENCH_CHECK_LOAD = null;
WORKBENCH_LOADING = 0;

ABOUT_IS_LINKS = 0;
LINK_MASONRY_INITIALIZED = 0;

SEARCH_IGNORE_CHARS = new Array(13, 16, 17, 18, 37, 38, 39, 40, 91, 93, 224); // function & cursor keys
SEARCH_TIMER = null;
SEARCH_DELAY = 350; // ms till a keystroke toggles a search
SEARCH_REQUEST = null;
$SEARCH_UNDERLINED_BEFORE = null;
SEARCH_DONE = 0;
isSafari = (navigator.userAgent.toLowerCase().indexOf('safari') != -1 && navigator.userAgent.toLowerCase().indexOf('chrome') == -1) ? 1 : 0;

street_map = null
do_scroll_to_project = -1

zCounter = 1001

isIE = (navigator.userAgent.match(/msie/i));
isIE7 = (navigator.userAgent.match(/msie 7/i));
isIE6 = (navigator.userAgent.match(/msie 6/i));
isIE8 = (navigator.userAgent.match(/msie 8/i));




/* 	--------------------------------------------------------------------
	INITIALIZE
	------------------------------------------------------------------- */

function make_workbench_visible() {
    // timeout for masonry
    $('#CONTENT').css('visibility', 'visible')
}

function lets_go() {
    // initialize everything

    resize_elements();
    openExternal();
    setTimeout('resize_elements()', 300);
    setTimeout('resize_elements()', 500);

    if (PAGE_SECTION == 'workbench') {

        mobile_feed_ini();
        clock_ini();

        widget_data_refresh();

        var $container = $('#CONTENT');

        $container.imagesLoaded(function() {
            $container.masonry({
                itemSelector: '.workbench_item',
                columnWidth: 10
            });
            WORKBENCH_MASONRY_INITIALIZED = 1;
            setTimeout('make_workbench_visible()', 500);
            resize_elements()
        });

        $(window).scroll(function() {
            mobile_feed_windowscroll()
        });

        WORKBENCH_CHECK_LOAD = setInterval('checkScrollPos()', 400)


    } else if (PAGE_SECTION == 'archive') {

        $('#search_box').keyup(function(event) {

            if (event.keyCode == 27) {
                // ESC pressed -> bye
                $('#search_box').val('');
                leave_search();
                return
            }

            if (array_pos(parseInt(event.keyCode), SEARCH_IGNORE_CHARS) == -1) {
                search_ini()
            }

        });

        if (do_scroll_to_project != -1) {
            smooth_scroll('#project_item' + do_scroll_to_project, 124, 1500)
        }


        // click to next image
        $("#PROJECT_VIEW_IMAGES").find('.project_item').bind('click', function(event) {

            $target = $(event.target)

            var theClass = ""
            if ($target.length > 0) {
                theClass = $target[0].className
            }

            if (theClass == 'vimeo_play') {
                return // is vimeo play button
            }


            var n = $(this).next('.project_item')
            if (n.length) {
                smooth_scroll(n, 124, 800)
            } else {
                smooth_scroll('#project_item0', 124, 1000)
            }
        })




    } else if (PAGE_SECTION == 'contact') {

        if (COUNTRY == 'GERMANY') {
            switchMap('berlin')

        } else if (COUNTRY == 'NORWAY') {
            switchMap('oslo')

        } else {

            if (Math.round(Math.random() * 10000) % 2 == 0) {
                switchMap('berlin')
            } else {
                switchMap('oslo')
            }
        }

        $('#CONTACT1').drag("start", function(event, dd) {
            zCounter++
            $(this).css('z-index', zCounter)

        }).drag(function(event, dd) {
            $(this).css({
                top: dd.offsetY,
                left: dd.offsetX
            });
        })

        $('#CONTACT2').drag("start", function(event, dd) {
            zCounter++
            $(this).css('z-index', zCounter)
        }).drag(function(event, dd) {
            $(this).css({
                top: dd.offsetY,
                left: dd.offsetX
            });
        })

        $('#CONTACT3').drag("start", function(event, dd) {
            zCounter++
            $(this).css('z-index', zCounter)
        }).drag(function(event, dd) {
            $(this).css({
                top: dd.offsetY,
                left: dd.offsetX
            });
        })




    } else if (PAGE_SECTION == 'about') {

        var c = $('#DEFAULT_COLLAGE').val()
        if (c != "" && c != "is_links") {
            showCollage(c)

        } else if (c == "is_links") {

            ABOUT_IS_LINKS = 1;

            var $container = $('#CONTENT');

            $container.imagesLoaded(function() {
                $container.masonry({
                    itemSelector: '.link_block'
                });
                LINK_MASONRY_INITIALIZED = 1;
                resize_elements()
            });

        }

    }
}


$(window).resize(function() {
    resize_elements();
});




/* 	--------------------------------------------------------------------
	WORKBENCH
	------------------------------------------------------------------- */

function play_vimeo_video(t) {

    var $p = $(t).parent()
    var vimeo_id = $p.attr('data-vimeo-id')
    var zm = $p.attr('zm')
    var w = parseInt($p.css('width'))
    var h = parseInt($p.css('height'))

    var h = '<div class="vimeovideo" style="display:block"><iframe zm="' + zm + '" src="https://player.vimeo.com/video/' + vimeo_id + '?title=0&amp;byline=0&amp;portrait=0&amp;color=ffffff&amp;autoplay=1" width="' + w + '" height="' + h + '" frameborder="0"></iframe></div>'

    $p.html(h)

    // reduce safari text render bug bullshit in combination with flash
    if (isSafari) {
        if (!$('#CONTENT').hasClass('fixtextbugsafari')) {
            $('#CONTENT').addClass('fixtextbugsafari');
        }
    }
}


function widget_data_refresh() {

    $.getJSON(URL_ROOT + '_INCL/getData.php', function(data) {
        $.each(data, function(key, val) {
            $('#' + key).html(val)
        });
    });

    setTimeout('widget_data_refresh()', 1000 * 60) // 1 min
}


/* 	--------------------------------------------------------------------
	MOBILE FEED
	------------------------------------------------------------------- */

function mobile_feed_windowscroll() {

    var y = $(window).scrollTop();
    var d = WINDOW_LAST_Y - y;
    WINDOW_LAST_Y = y;

    // parallax scrolling
    WORKBENCH_MF_Y -= d / 2.2;
    WORKBENCH_CLOCK_Y -= d / 3.8

    if (iOS == '1') {

        $('#MOBILE_FEED').stop().animate({
            'top': WORKBENCH_MF_Y
        }, 700, 'easeOutQuad');
        $('#MOBILE_FEED_SHADOW').stop().animate({
            'top': WORKBENCH_MF_Y + WORKBENCH_SHADOW_YOFF
        }, 700, 'easeOutQuad');

        $('#CLOCK').stop().animate({
            'top': WORKBENCH_CLOCK_Y
        }, 700, 'easeOutQuad');
        $('#CLOCK_SHADOW').stop().animate({
            'top': WORKBENCH_CLOCK_Y + WORKBENCH_SHADOW_YOFF
        }, 700, 'easeOutQuad');

    } else {
        $('#MOBILE_FEED').css('top', WORKBENCH_MF_Y);
        $('#MOBILE_FEED_SHADOW').css('top', WORKBENCH_MF_Y + WORKBENCH_SHADOW_YOFF);

        $('#CLOCK').css('top', WORKBENCH_CLOCK_Y);
        $('#CLOCK_SHADOW').css('top', WORKBENCH_CLOCK_Y + WORKBENCH_SHADOW_YOFF);
    }
}

function mobile_feed_close() {
    $('#MOBILE_FEED').animate({
        'opacity': 0.0
    }, 100, function() {
        $('#MOBILE_FEED').css('display', 'none')
    });
    $('#MOBILE_FEED_SHADOW').animate({
        'opacity': 0.0
    }, {
        complete: function() {
            $('#MOBILE_FEED_SHADOW').css('display', 'none')
        }
    }, 2000);
    $('#mobile_feed_show').css('display', 'inline-block');
    flash_widgetleft()

    var date = new Date();
    date.setTime(date.getTime() + (24 * 60 * 60 * 1000)); // 24h
    $.cookie('NODE_mobile_feed', 0, {
        path: '/',
        expires: date
    });

}

function mobile_feed_open() {
    $('#mobile_feed_show').css('display', 'none');

    $('#MOBILE_FEED_SHADOW').css('display', 'block').animate({
        'opacity': 0.5
    }, {
        complete: function() {
            $('#MOBILE_FEED_SHADOW').animate({
                'background-color': '#666'
            }, 500)
        }
    }, 500);

    $('#MOBILE_FEED').css('display', 'block').animate({
        'opacity': 1.0
    }, 300);

    var date = new Date();
    date.setTime(date.getTime() + (24 * 60 * 60 * 1000)); // 24h
    $.cookie('NODE_mobile_feed', 1, {
        path: '/',
        expires: date
    });
}

var count = 0;

function mobile_feed_next() {

	$('#MOBILE_FEED_INNER > div').eq(count).hide();

	count++;
	count = count%2;

	$('#MOBILE_FEED_INNER > div').eq(count).show();
}

function mobile_feed_ini() {

    var w = $(window).width();
    var h = $(window).height();

    var y = h - 100;
    var x = 30 + 200 + Math.round((w - 60 - 342 - 200 - WORKBENCH_SHADOW_XOFF) * Math.random());
    WORKBENCH_MF_Y = y;

    var show = $('#MOBILE_FEED').attr('data-show');
    if (show != 0) {
        $('#MOBILE_FEED').css({
            'display': 'block'
        });
        $('#MOBILE_FEED_SHADOW').css({
            'display': 'block'
        });
    }

    $('#MOBILE_FEED').css({
        'left': x,
        'top': y
    });
    $('#MOBILE_FEED_SHADOW').css({
        'left': (x + WORKBENCH_SHADOW_XOFF),
        'top': (y + WORKBENCH_SHADOW_YOFF)
    });

    if (iOS == '1') {

        $('#MOBILE_FEED').bind('drag', function(event) {
            $(this).css({
                left: (event.pageX - 139),
                top: (event.pageY - 205)
            });

            WORKBENCH_MF_Y = parseInt(event.pageY - 205);

            var x = parseInt($('#MOBILE_FEED_SHADOW').css('left'))
            var y = parseInt($('#MOBILE_FEED_SHADOW').css('top'))

            $('#MOBILE_FEED_SHADOW').css({
                top: ((event.pageY - 205) + WORKBENCH_SHADOW_YOFF),
                left: ((event.pageX - 139) + WORKBENCH_SHADOW_XOFF)
            });
        })

        $('#MOBILE_FEED').drag("end", function(event) {

            var x = parseInt($('#MOBILE_FEED').css('left'))
            var y = parseInt($('#MOBILE_FEED').css('top'))

            $('#MOBILE_FEED_SHADOW').css({
                'top': y + WORKBENCH_SHADOW_YOFF,
                'left': x + WORKBENCH_SHADOW_XOFF
            }).stop().animate({
                'background-color': '#666'
            }, 1000)

        })

        $('#MOBILE_FEED').drag("start", function(event) {
            zCounter += 2
            $('#MOBILE_FEED').css('z-index', zCounter)
            $('#MOBILE_FEED_SHADOW').stop().css({
                'background-color': '#dddddd',
                'z-index': zCounter - 1
            })
        })


    } else {


        $('#MOBILE_FEED').bind('mousedown', function() {
            zCounter += 2
            $('#MOBILE_FEED').css('z-index', zCounter)
            $('#MOBILE_FEED_SHADOW').stop().css({
                'background-color': '#dddddd',
                'z-index': zCounter - 1
            })
        })

        $('#MOBILE_FEED').drag("start", function(ev, dd) {

            zCounter += 2
            $('#MOBILE_FEED').css('z-index', zCounter)
            $('#MOBILE_FEED_SHADOW').stop().css({
                'background-color': '#dddddd',
                'z-index': zCounter - 1
            })


        }).drag(function(ev, dd) {
            $(this).css({
                top: dd.offsetY,
                left: dd.offsetX
            });

            WORKBENCH_MF_Y = parseInt(dd.offsetY);

            var x = parseInt($('#MOBILE_FEED_SHADOW').css('left'))
            var y = parseInt($('#MOBILE_FEED_SHADOW').css('top'))

            $('#MOBILE_FEED_SHADOW').css({
                top: (dd.offsetY + WORKBENCH_SHADOW_YOFF),
                left: (dd.offsetX + WORKBENCH_SHADOW_XOFF)
            });


        }).drag("end", function(ev, dd) {

            $('#MOBILE_FEED_SHADOW')
                .css({
                    'top': dd.offsetY + WORKBENCH_SHADOW_YOFF,
                    'left': dd.offsetX + WORKBENCH_SHADOW_XOFF
                })
                .stop()
                .animate({
                    'background-color': '#666'
                }, 1000)

        });
    }
}


/* 	--------------------------------------------------------------------
	CLOCK
	------------------------------------------------------------------- */

function flash_widgetleft() {
    $('#WIDGETLEFT').css({
        'background-color': '#333333'
    }).stop().animate({
        'background-color': '#dddddd'
    }, 600, 'easeOutQuad')
}


function clock_close() {
    $('#CLOCK').animate({
        'opacity': 0.0
    }, 100, function() {
        $('#CLOCK').css('display', 'none')
    });
    $('#CLOCK_SHADOW').animate({
        'opacity': 0.0
    }, {
        complete: function() {
            $('#CLOCK_SHADOW').css('display', 'none')
        }
    }, 2000);

    $('#THE_CLOCK_SMALL').css('display', 'inline-block');
    flash_widgetleft()

    var date = new Date();
    date.setTime(date.getTime() + (24 * 60 * 60 * 1000)); // 24h
    $.cookie('NODE_clock', 0, {
        path: '/',
        expires: date
    });
}


function clock_open() {

    $('#THE_CLOCK_SMALL').css('display', 'none');

    $('#CLOCK_SHADOW').css('display', 'block').animate({
        'opacity': 0.5
    }, {
        complete: function() {
            $('#CLOCK_SHADOW').animate({
                'background-color': '#666'
            }, 500)
        }
    }, 500);

    $('#CLOCK').css('display', 'block').animate({
        'opacity': 1.0
    }, 300);

    var date = new Date();
    date.setTime(date.getTime() + (24 * 60 * 60 * 1000)); // 24h
    $.cookie('NODE_clock', 1, {
        path: '/',
        expires: date
    });
}

function clock_loop() {
    drawClock('THE_CLOCK', 128)
    drawClock('THE_CLOCK_SMALL_C', 16)
}


function IE_hidebigclock() {
    $('#CLOCK').css({
        'display': 'none',
        'visibility': 'visible'
    })
}

function IE_hidesmallclock() {
    $('#THE_CLOCK_SMALL').css({
        'display': 'none',
        'visibility': 'visible'
    })
}

function clock_ini() {

    var w = $(window).width();
    var h = $(window).height();
    var y = h - 150 - Math.random() * 200;
    for (var i = 0; i < 10; i++) {
        var x = 30 + 100 + Math.round((w - 60 - 210 - 100 - WORKBENCH_SHADOW_XOFF) * Math.random());
    }
    WORKBENCH_CLOCK_Y = y;

    var show = $('#CLOCK').attr('data-show');
    if (show != 0) {
        $('#CLOCK').css({
            'display': 'block'
        });
        $('#CLOCK_SHADOW').css({
            'display': 'block'
        });
    }

    $('#CLOCK').css({
        'left': x,
        'top': y
    });
    $('#CLOCK_SHADOW').css({
        'left': (x + WORKBENCH_SHADOW_XOFF),
        'top': (y + WORKBENCH_SHADOW_YOFF)
    });


    if (isIE7 != null || isIE8 != null) {
        // make visible, then hide

        if ($('#THE_CLOCK_SMALL').is(':hidden')) {
            $('#THE_CLOCK_SMALL').css({
                'display': 'block',
                'visibility': 'hidden'
            })
            drawClock('THE_CLOCK_SMALL_C', 128)
            setTimeout('IE_hidesmallclock()', 2000)
        }

        if ($('#CLOCK').is(':hidden')) {
            $('#CLOCK').css({
                'display': 'block',
                'visibility': 'hidden'
            })
            drawClock('THE_CLOCK', 128)
            setTimeout('IE_hidebigclock()', 2000)
        }
    }



    clock_loop();
    setInterval(clock_loop, 1000);


    if (iOS == '1') {

        $('#CLOCK').bind('drag', function(event) {
            $(this).css({
                left: (event.pageX - 86),
                top: (event.pageY - 86)
            });

            WORKBENCH_CLOCK_Y = parseInt(event.pageY - 86);

            var x = parseInt($('#CLOCK_SHADOW').css('left'))
            var y = parseInt($('#CLOCK_SHADOW').css('top'))

            $('#CLOCK_SHADOW').css({
                top: ((event.pageY - 86) + WORKBENCH_SHADOW_YOFF),
                left: ((event.pageX - 86) + WORKBENCH_SHADOW_XOFF)
            });
        })

        $('#CLOCK').drag("end", function(event) {

            var x = parseInt($('#CLOCK').css('left'))
            var y = parseInt($('#CLOCK').css('top'))

            $('#CLOCK_SHADOW').css({
                'top': y + WORKBENCH_SHADOW_YOFF,
                'left': x + WORKBENCH_SHADOW_XOFF
            }).stop().animate({
                'background-color': '#666'
            }, 1000)

        })

        $('#CLOCK').drag("start", function(event) {
            zCounter += 2
            $('#CLOCK').css('z-index', zCounter)
            $('#CLOCK_SHADOW').stop().css({
                'background-color': '#dddddd',
                'z-index': zCounter - 1
            })
        })

    } else {

        $('#CLOCK').bind('mousedown', function() {
            zCounter += 2
            $('#CLOCK').css('z-index', zCounter)
            $('#CLOCK_SHADOW').stop().css({
                'background-color': '#dddddd',
                'z-index': zCounter - 1
            })
        })

        $('#CLOCK').drag("start", function(ev, dd) {
            zCounter += 2
            $('#CLOCK').css('z-index', zCounter)
            $('#CLOCK_SHADOW').stop().css({
                'background-color': '#dddddd',
                'z-index': zCounter - 1
            })


        }).drag(function(ev, dd) {
            $(this).css({
                top: dd.offsetY,
                left: dd.offsetX
            });

            WORKBENCH_CLOCK_Y = parseInt(dd.offsetY);

            var x = parseInt($('#CLOCK_SHADOW').css('left'))
            var y = parseInt($('#CLOCK_SHADOW').css('top'))

            $('#CLOCK_SHADOW').css({
                top: (dd.offsetY + WORKBENCH_SHADOW_YOFF),
                left: (dd.offsetX + WORKBENCH_SHADOW_XOFF)
            });


        }).drag("end", function(ev, dd) {

            $('#CLOCK_SHADOW')
                .css({
                    'top': dd.offsetY + WORKBENCH_SHADOW_YOFF,
                    'left': dd.offsetX + WORKBENCH_SHADOW_XOFF
                })
                .stop()
                .animate({
                    'background-color': '#666'
                }, 1000)
        });
    }

}

/* 	-------------------------------------------------------------------
	WORKBENCH
	------------------------------------------------------------------- */


function checkScrollPos() {

    if (WORKBENCH_LOADING == 1) {
        return
    }

    var s = $(window).scrollTop() + $(window).height();
    var c = $('#CONTENT').height();
    var d = c - s;

    if (d < 200) {
        WORKBENCH_LOADING = 1

        $.ajax({
            url: URL_ROOT + '_INCL/loadWorkbenchItems.php?offset=' + WORKBENCH_NEXT + '&r=' + Math.random(),
            cache: false,
            success: function(result) {

                if (result == "WORKBENCH END") {
                    clearTimeout(WORKBENCH_CHECK_LOAD)

                } else {
                    $(result).imagesLoaded(function() {

                        $('#CONTENT').append($(result)).masonry('appended', $(result), false);
                        $('#CONTENT').find('.workbench_newloaded').fadeOut(0)

                        setTimeout('resize_elements()', 100)
                        setTimeout('resize_elements()', 400)
                        setTimeout('workbench_make_visible()', 400)
                    });

                    WORKBENCH_NEXT = WORKBENCH_NEXT + WORKBENCH_LOADITEMS;

                }
            }
        });

    }

}

function workbench_make_visible() {
    $('#CONTENT').find('.workbench_newloaded').fadeIn(500, function() {
        $('#CONTENT').find('.workbench_newloaded').removeClass('workbench_newloaded')
        WORKBENCH_LOADING = 0
    })
}


/* 	--------------------------------------------------------------------
	RESIZE ELEMENTS
	------------------------------------------------------------------- */

function resize_elements() {

    var w = $(window).width();
    var h = $(window).height();

    $('#CONTENT').css('width', w);
    $('#MENU').css({
        'display': 'block',
        'left': (w - 1000) / 2
    });
    $('#MENU_ARCHIVE').css({
        'display': 'block',
        'left': (w - 1000) / 2
    });


    /* resize workbench --------------------------------------------- */

    if (PAGE_SECTION == 'workbench') {

        if (WORKBENCH_USE_ZOOMS == 0) {
            // all images same width

            // 3 cols
            var new_w = (w - 4 * 10) / 3;

            if (new_w > 470) {
                // 4 cols
                new_w = (w - 5 * 10) / 4;
            } else if (new_w < 280) {
                // 2 cols
                new_w = (w - 3 * 10) / 2;
            }

            var new_h = (new_w - WORKBENCH_IMG_RIGHTMAR) / WORKBENCH_VIDEO_RATIO;

            $('.workbench_item').css('width', new_w);
            $('.workbench_item img').css('width', new_w - WORKBENCH_IMG_RIGHTMAR);
            $('.workbench_item .vimeo_preview_image').css({
                'width': new_w - WORKBENCH_IMG_RIGHTMAR,
                'height': new_h
            });
            $('.workbench_item iframe').css({
                'width': new_w - WORKBENCH_IMG_RIGHTMAR,
                'height': new_h
            });

            // text less broad
            $('.workbench_item_text').css('width', (new_w - WORKBENCH_IMG_RIGHTMAR) / WORKBENCH_TEXT_RATIO);

        } else {
            // different widths

            // 4 cols
            var new_w = (w - 5 * 10) / 4;

            if (new_w > 420) {
                // 5 cols
                new_w = (w - 6 * 10) / 5;
            } else if (new_w < 280) {
                // 3 cols
                new_w = (w - 4 * 10) / 3;
            }

            var wb = $('.workbench_item')

            for (var i = 0; i < wb.length; i++) {

                var $item = $(wb[i]);
                var mode = 'img';

                if ($item.hasClass('vimeo')) {
                    $target = $item.find('.vimeo_preview_image');
                    $target2 = $item.find('iframe');
                    mode = 'vimeo';
                } else {
                    $target = $item.find('img');
                }

                var zoom = $target.attr('zm');
                zoom = zoom / 55

                var tempw = Math.max(100, new_w + new_w * zoom);
                var temph = (tempw - WORKBENCH_IMG_RIGHTMAR) / WORKBENCH_VIDEO_RATIO;

                $item.css('width', tempw);

                if (mode == 'img') {
                    $target.css('width', tempw - WORKBENCH_IMG_RIGHTMAR);
                } else {
                    $target.css({
                        'width': tempw - WORKBENCH_IMG_RIGHTMAR,
                        'height': temph
                    });
                    $target2.css({
                        'width': tempw - WORKBENCH_IMG_RIGHTMAR,
                        'height': temph
                    });
                }

                // text less broad
                $item.find('.workbench_item_text').css('width', (tempw - WORKBENCH_IMG_RIGHTMAR) / WORKBENCH_TEXT_RATIO);

            }
        }


        if (WORKBENCH_MASONRY_INITIALIZED == 1) {
            $('#CONTENT').masonry('reload');
        }


        // left widget
        if (w < 1360) {
            // small screens -> 2 lines
            $('#WIDGETLEFT_BR').html('<div style="clear:both;"></div>').css("display", 'block')
            $('#mobile_feed_show').css('margin-left', 0)

        } else {

            $('#WIDGETLEFT_BR').html('').css("display", 'none')
            $('#mobile_feed_show').css('margin-left', 10)
        }



        /* project view --------------------------------------------- */

        var p_image_w = (w - 20) / 1.915
        var p_nav_x = 30 + 364 + p_image_w + 16
        var p_nav_w = Math.max(100, (w - 20 - 30 - p_nav_x))

        var txtheight = parseInt($('#PROJECT_VIEW_TEXT').height())
        if (txtheight > 0) {
            if (txtheight + 120 > h) {
                $('#PROJECT_VIEW_TEXT').css({
                    'position': 'absolute',
                    'left': 0,
                    'top': 25
                })
            } else {
                $('#PROJECT_VIEW_TEXT').css({
                    'position': 'fixed',
                    'left': 30,
                    'top': 120
                })
            }
        }

        // xxx
        if (do_scroll_to_project != -1) {
            // adjust hight of images to scroll to right place

            var all_el = $('.project_item')

            for (var i = 0; i < all_el.length; i++) {

                var iw = $(all_el[i]).data('iw')
                var ih = $(all_el[i]).data('ih')

                var r = iw / ih
                var newh = p_image_w / r
                $(all_el[i]).css('height', newh)
            }

        }


        $('#PROJECT_VIEW_IMAGES').css({
            'display': 'block',
            'width': p_image_w
        })
        $('#PROJECT_VIEW_NAVI').css({
            'display': 'block',
            'width': p_nav_w,
            'left': p_nav_x
        })



        /* resize contact ------------------------------------------- */

    } else if (PAGE_SECTION == 'contact') {

        $('#STEET_VIEW').css({
            'height': h,
            'width': w
        });
        $('#STEET_VIEW_CONTAINER').css({
            'height': h,
            'width': w
        });



        /* resize about --------------------------------------------- */

    } else if (PAGE_SECTION == 'about') {

        if (ABOUT_IS_LINKS == 0) {
            var collage_w = (w - 476 - 30 - 30);
            var collage_h = (h - 100);
            $('#ABOUT_COLLAGE').css({
                'display': 'block',
                'width': collage_w,
                'height': collage_h
            });

            var scale = getCollageScale();

            $('.collage_img').each(function() {

                var ox = $(this).attr('data-ox');
                var oy = $(this).attr('data-oy');
                var ow = $(this).attr('data-ow');
                var oh = $(this).attr('data-oh');

                $(this).css({
                    'width': ow * scale,
                    'height': oh * scale,
                    'top': oy * scale,
                    'left': ox * scale,
                });
            });

        } else {
            // link section

            // 3 cols
            var new_w = (w - 4 * 10) / 3;

            if (new_w > 470) {
                // 4 cols
                new_w = (w - 5 * 10) / 4;
            } else if (new_w < 280) {
                // 2 cols
                new_w = (w - 3 * 10) / 2;
            }

            new_w -= 10
            $('.link_block').css('width', new_w);

            if (LINK_MASONRY_INITIALIZED == 1) {
                $('#CONTENT').masonry('option', {
                    columnWidth: new_w + 10
                })
                $('#CONTENT').masonry('reload');
            }

        }

    }

}


/* 	--------------------------------------------------------------------
	UTILITIES
	------------------------------------------------------------------- */


function openExternal() {

    // open external links in new window. also updates for future ajax loaded links.
    $("a[href^='http:']:not([href*='" + window.location.host + "'][target='_blank'])").live('click', function() {
        var h = ($(this).attr('href'))

        if (h.indexOf('nodeberlin.com') == -1 && h.indexOf('nodeoslo.com') == -1 && h.indexOf('localhost') == -1) {
            $(this).attr('target', '_blank')
        }
    });

    $("a[href^='tel:']").live('mouseover', function() {
        var h = ($(this).attr('href'))
        if (iOS != 1) {
            // remove tel: links for all other browsers
            var tempid = "sp" + Math.round(Math.random() * 10000000)
            $(this).wrap('<span id="' + tempid + '">')
            var h = $(this).html()
            $(this).remove()
            $('#' + tempid).html(h)
            $(this).unbind()
            return false
        }
    });
}


function cleanArray(a) {

    var newArray = new Array()

    for (var i = 0; i < a.length; i++) {
        if (a[i] != "" && a[i] != null && a[i] != undefined) {
            newArray.push(a[i])
        }
    }
    return newArray

}

function in_array(id, arr) {
    var found = 0
    for (var i = 0; i < arr.length; i++) {
        if (arr[i] == id) {
            found = 1
            break;
        }
    }
    return found
}


function array_pos(id, arr) {
    var pos = -1

    for (var i = 0; i < arr.length; i++) {
        if (arr[i] == id) {
            pos = i
            break;
        }
    }
    return pos
}
              
            
!
999px
What do you call a two-legged ghost cow? Boolean Beef.

Console