<!doctype html>
<html>
<head>
	<title>Counterpush</title>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width" />
    <link href='http://fonts.googleapis.com/css?family=Lato:400,300,300italic,400italic,700,700italic' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="css/mediaelementplayer.css" />
    <link rel="stylesheet" type="text/css" href="css/main.css" />
	<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>

	<!--[if IE 6]>
	<link rel="stylesheet" type="text/css" href="css/ie-legacy.css" />
	<![endif]-->

</head>
<body class="push-holder">

<header>
	<h1><a href="#home" class="active">Counterpush</a></h1>
    <nav class="push-menu" id="primary">
    	<ul>
	        <li><a href="#music">Music</a></li>
            <li><a href="#photos">Photos</a></li>
            <li><a href="#about">About</a></li>
            <li><a href="#contact">Contact</a></li>
        </ul>
    </nav>
    <a href="#" id="pull"><span>Show/Hide Menu</span></a>
</header>

<div id="container">

	<div class="parallax" id="home">
		<div class="blurb">
        	<div class="inner">
				<p>In the early '00s, Counterpush was cover band playing small bars for beer, pizza, and the occasional courtesy clap.  In 2004, they released the EP <cite>De Anima</cite> and continued to gig in the LA/OC area with huge aspirations.</p>
                <p>As is the case with many creative endeavors, Counterpush lost it's drive and fizzled.  Have we heard the last of Counterpush?  Or does this band&#8212;or any of its former members&#8212;have anything left for a second wind?</p>
                <p>Stay tuned... In the meantime, feel free to browse the archives below.</p>
                <div class="btn-next"><a href="#" data-target="#music">Next</a></div>
            </div>
		</div>
	</div>

	<div class="parallax" id="music">
		<div class="blurb">
        	<h2>Music</h2>
            <div class="inner">
				<p>These tunes were written a while back, but are always looking to fall on new ears.  Some new siblings wouldn't hurt either.</p>
    	        <audio id="mejs" src="http://www.counterpush.com/media/Counterpush_ByTheWay.mp3" type="audio/mp3" controls="controls"></audio>
        	    <ul class="cp-tracks">
            	    <li id="track-1" data-src="/media/Counterpush_ByTheWay.mp3" class="current"><a href="#">By the Way</a></li>
                	<li id="track-2" data-src="/media/Counterpush_JuliesSong.mp3"><a href="#">Julie's Song</a></li>
	                <li id="track-3" data-src="/media/Counterpush_AnythingYouWant.mp3"><a href="#">Anything You Want</a></li>
    	            <li id="track-4" data-src="/media/Counterpush_WrappingUpTheDay.mp3"><a href="#">Wrapping Up the Day</a></li>
        	        <li id="track-5" data-src="/media/Counterpush_Siren.mp3"><a href="#">Siren</a></li>
            	    <li id="track-6" data-src="/media/Counterpush_ProvincialPride.mp3"><a href="#">Provincial Pride</a></li>
	            </ul>
			</div>
		</div>
	</div>

	<div class="parallax" id="photos">
		<object width="650" height="488" id="photo-gallery">
        	<param name="flashvars" value="offsite=true&lang=en-us&page_show_url=%2Fphotos%2Fvelardo%2Fsets%2F303460%2Fshow%2F&page_show_back_url=%2Fphotos%2Fvelardo%2Fsets%2F303460%2F&set_id=303460&jump_to="></param>
            <param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=140556"></param>
            <param name="allowFullScreen" value="true"></param>
            <embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/slideshow/show.swf?v=140556" allowFullScreen="true" flashvars="offsite=true&lang=en-us&page_show_url=%2Fphotos%2Fvelardo%2Fsets%2F303460%2Fshow%2F&page_show_back_url=%2Fphotos%2Fvelardo%2Fsets%2F303460%2F&set_id=303460&jump_to=" width="650" height="488"></embed>
		</object>
		<div class="blurb">
        	<h2>Photos</h2>
            <div class="inner">
				<p>I haven't had a chance to build an actual photo gallery for this website yet, so in the meantime, feel free to browse the <a href="http://www.flickr.com/photos/velardo/sets/303460/show/" target="_blank">Counterpush photo archive on flickr</a>.</p>
			</div>
		</div>
	</div>

	<div class="parallax" id="about">
		<div class="blurb">
        	<h2>About</h2>
            <div class="inner">
				<p>Counterpush was formed in 2002 when founding members Velardo Dala, Henry Chavarria, Mingo, and Gabriel Brooks were simply a SoCal cover band playing in bars from Downtown Pasadena to Newport Beach.</p>
                <p>In 2004, Velardo enlisted the help of producer Dave Carlock to record the EP <cite>De Anima</cite>, which would provide the impetus for the band to shed its set list of 90s alternative cover songs and focus on their original material.</p>
			</div>
    	</div>
	</div>

	<div class="parallax" id="contact">
		<div class="blurb">
        	<h2>Contact</h2>
            <div class="inner">
				<p>Please send any correspondence to <a href='mailto&#58;in&#102;%6F&#64;c&#111;unte%72push&#46;c%6&#70;%&#54;&#68;'>inf&#111;&#64;cou&#110;ter&#112;u&#115;h&#46;com</a> or visit the band's <a href="http://www.facebook.com/counterpush">Facebook page</a>.</p>
    	        <p><a href="http://www.facebook.com/counterpush"><img src="images/icon-find-fb.png" alt="Find us on Facebook" /></a></p>
			</div>
		</div>
	</div>

</div>
<!-- #container -->


<script src="js/mediaelement-and-player.min.js"></script>
<script src="js/jquery.simple.parallax.js"></script>
<script src="js/waypoints.min.js"></script>

<script>
    function mejsPlayNext(currentPlayer) {
        if (jQuery('.cp-tracks li.current').length > 0){ // get the .current song
            var current_item = jQuery('.cp-tracks li.current:first'); // :first is added if we have few .current classes
			var audio_src = jQuery(current_item).next().data('src');
			console.log(audio_src);
            jQuery(current_item).next().addClass('current').siblings().removeClass('current');
        }else{ // if there is no .current class
            var current_item = jQuery('.cp-tracks li:first'); // get :first if we don't have .current class
			var audio_src = jQuery(current_item).next().data('src');
            jQuery(current_item).next().addClass('current').siblings().removeClass('current');
        }

        if( jQuery(current_item).is(':last-child') ) { // if it is last - stop playing
            jQuery(current_item).removeClass('current');
        }else{
            currentPlayer.setSrc(audio_src);
            currentPlayer.play();
        }
    }
</script>

<script>
	// initialize parallax
    jQuery('.parallax').parallax({ speed : 0.15 });

	jQuery(function() {

		// home link
		jQuery('h1 a').on('click', function(e){
			e.preventDefault();
			var jthis = jQuery(this);
			var target = jthis.attr('href');
			jQuery('html, body').animate({ scrollTop: jQuery(target).offset().top }, 750);
			jQuery(this).addClass('active');
		});

		// nav scroll
		jQuery('nav a').on('click', function(e) {
			e.preventDefault();
			var target = jQuery(this).attr('href');
			jQuery('html, body').animate({ scrollTop: jQuery(target).offset().top }, 750);
			jQuery('h1 a').removeClass('active');
			jQuery('nav a').removeClass('active');
			jQuery(this).addClass('active');
		});

		// waypoints
		var sections = [];

		jQuery('.parallax').each(function() {
			sections.push(jQuery(this).attr('id'));
		});

		jQuery.each(sections, function(index) {
			var sectionDiv = jQuery('#' + sections[index]);
			sectionDiv.waypoint(function(down) {
				activateSection(sections[index]);
			}, {offset: 36});
			sectionDiv.waypoint(function(up) {
				activateSection(sections[index]);
			}, {offset: -36});
		});

		function activateSection(sectionName) {
			jQuery('nav a').removeClass('active');
			var selected = '#' + sectionName;
			jQuery('nav a').each(function(index, element) {
                if(jQuery(this).attr('href') == selected){
					jQuery(this).addClass('active');
				} else {
					jQuery(this).removeClass('active');
				}
            });
		}

		// h2
		jQuery('.blurb').each(function(index, element) {
            //var blurbHeight = jQuery(this).children('p').height();
			var blurbHeight = jQuery(this).children('.inner').height();
			blurbHeight = blurbHeight + 20; // offset
			jQuery(this).children('h2').css('line-height', blurbHeight + 'px');
        });

		// next
		jQuery('.btn-next a').on('click', function(e){
			e.preventDefault();
			var target = jQuery(this).data('target');
			jQuery('html, body').animate({ scrollTop: jQuery(target).offset().top }, 750);
			jQuery('h1 a').removeClass('active');
			jQuery('nav a').removeClass('active');
		});

		// music tracks
        jQuery('audio').mediaelementplayer({
			audioWidth: 300,
            success: function (mediaElement, domObject) {
                mediaElement.addEventListener('ended', function (e) {
                    mejsPlayNext(e.target);
                }, false);
            },
            keyActions: []
        });

        jQuery('.cp-tracks li a').click(function(e) {
			e.preventDefault();
			var targetListItem = jQuery(this).parent('li');
			targetListItem.addClass('current').siblings().removeClass('current');
			var audio_src = targetListItem.data('src');
            jQuery('audio#mejs:first').each(function(){
                this.player.pause();
                this.player.setSrc(audio_src);
                this.player.play();
            });
        });

	});
</script>

<script>
	// push menu
	var menu = jQuery('#primary'),
		pull = jQuery('#pull'),
		body = jQuery('body');

	pull.on('click', function(e){
		e.preventDefault();
		jQuery(this).toggleClass('active');
		body.toggleClass('push-left');
		menu.toggleClass('open');
	});

</script>


<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-1372393-1', 'counterpush.com');
  ga('send', 'pageview');
</script>

<script>
jQuery(function(){
	jQuery('#track-1 button').click(function(){ _gaq.push(['_trackEvent', 'Song Downloads', 'Click', 'By the Way']); });
	jQuery('#track-2 button').click(function(){ _gaq.push(['_trackEvent', 'Song Downloads', 'Click', 'Julie\'s Song']); });
	jQuery('#track-3 button').click(function(){ _gaq.push(['_trackEvent', 'Song Downloads', 'Click', 'Anything You Want']); });
	jQuery('#track-4 button').click(function(){ _gaq.push(['_trackEvent', 'Song Downloads', 'Click', 'Wrapping Up the Day']); });
	jQuery('#track-5 button').click(function(){ _gaq.push(['_trackEvent', 'Song Downloads', 'Click', 'Siren']); });
	jQuery('#track-6 button').click(function(){ _gaq.push(['_trackEvent', 'Song Downloads', 'Click', 'Provincial Pride']); });
});
</script>


</body>
</html>