{% extends "base.html" %}

{% block pageid %}home{% endblock %}

{% block extrahead %}
    <link rel="stylesheet" type="text/css" href="{{MEDIA_URL}}css/demos.css"/>
    <meta name="google-site-verification" content="Phj8dHc2oKwic3FGPsKIhdOBk_1wnCTnKwjcjiLgJPc" />
    <meta name="google-site-verification" content="TH9rA27HbfjO_XqYWTIPrW1E7E7Dtgsh7ULzHi3UTVA" />
{% endblock %}
{% if not scripts %}
  {% set scripts = ('mdn_home',) %}
{% endif %}

{% block content %}

<header id="welcome-bar">
<div class="wrap">

  <h1>{% trans %}It's the Web. <b>You drive.</b>{% endtrans %}</h1>
  <h2>{{_("Welcome to the Mozilla Developer Network.")}}</h2>
  <p>{% trans %}We are an open community of developers building resources for a better web, 
  regardless of brand, browser or platform. Anyone can contribute and each person 
  who does makes us stronger. Together we can continue to drive innovation on the 
  Web to serve the greater good. It starts here, with you.{% endtrans %}</p>
  
  <button type="button" id="welcome-close">{{_("Close")}}</button>

</div>
</header>

<section id="content">
<div class="wrap">

  <section id="content-main" role="main" class="full">
    
    <section id="top-docs">
    <h1>{% trans %}Browse Thousands of Docs for <b>Web Developers</b>{% endtrans %}</h1>
      <ul>
        <li>
          <ul>
            <li><a href="{{ devmo_url(_('/en/HTML')) }}">HTML</a></li>
            <li><a href="{{ devmo_url(_('/en/HTML/HTML5')) }}">HTML5</a></li>
            <li><a href="{{ devmo_url(_('/en/CSS')) }}">CSS</a></li>
            <li><a href="{{ devmo_url(_('/en/JavaScript')) }}">JavaScript</a></li>
            <li><a href="{{ devmo_url(_('/en/DOM')) }}">DOM</a></li>
          </ul>
        </li>
        <li>
          <ul> 
            <li><a href="{{ devmo_url(_('/en/HTML/Canvas')) }}">Canvas</a></li>
            <li><a href="{{ devmo_url(_('/en/SVG')) }}">SVG</a></li>
            <li><a href="{{ devmo_url(_('/en/WebGL')) }}">WebGL</a></li>
            <li><a href="{{ devmo_url(_('/en/Using_audio_and_video_in_Firefox')) }}">Video</a></li>
            <li><a href="{{ devmo_url(_('/en/Using_audio_and_video_in_Firefox')) }}">Audio</a></li>
          </ul>
        </li>
        <li>
          <ul>
            <li><a href="{{ devmo_url(_('/en/Using_gradients')) }}">Gradients</a></li>
            <li><a href="{{ devmo_url(_('/en/CSS/Using_CSS_transforms')) }}">Transforms</a></li>
            <li><a href="{{ devmo_url(_('/en/CSS/CSS_transitions')) }}">Transitions</a></li>
            <li><a href="{{ devmo_url(_('/en/CSS/CSS_animations')) }}">Animations</a></li>
            <li><a href="{{ devmo_url(_('/en/CSS/Media_queries')) }}">Media Queries</a></li>
          </ul>
        </li>
        <li>
          <ul>
            <li><a href="{{ devmo_url(_('/en/Ajax')) }}">AJAX</a></li>
            <li><a href="{{ devmo_url(_('/en/WebSockets')) }}">WebSockets</a></li>
            <li><a href="{{ devmo_url(_('/en/Offline_resources_in_Firefox')) }}">Offline Cache</a></li>
            <li><a href="{{ devmo_url(_('/en/DOM/Storage')) }}">Local Storage</a></li>
            <li><a href="{{ devmo_url(_('/en/IndexedDB')) }}">IndexedDB</a></li>
          </ul>
        </li>
        <li>
          <ul>
            <li><a href="{{ devmo_url(_('/en/Using_geolocation')) }}">Geolocation</a></li>
            <li><a href="{{ devmo_url(_('/en/DragDrop/Drag_and_Drop')) }}">Drag &amp; Drop</a></li>
            <li><a href="{{ devmo_url(_('/en/Using_files_from_web_applications')) }}">File API</a></li>
            <li><a href="{{ devmo_url(_('/en/Using_web_workers')) }}">Web Workers</a></li>
            <li><a href="{{ url('docs') }}" class="more">{{_("and more")}}&hellip;</a></li>
          </ul>
        </li>
      </ul>
      <p class="more">
        {% trans mobile_url=url('mobile'), addons_url=url('addons'), mozilla_url=url('mozilla') %}
            And even more resources for: 
            <a href="{{ mobile_url }}">Mobile Web Apps</a> &middot; 
            <a href="{{ addons_url }}">Firefox Add-ons</a> &middot; 
            <a href="{{ mozilla_url }}">Mozilla Applications</a>
        {% endtrans %}
      </p>
    </section><!-- /#top-docs -->
    
    <section id="home-promos" class="home-promos">
    
      <div class="promo" id="promo-learn">
          <a href="{{ url('learn') }}">
          <h2>{{_("Learn")}}</h2>
          <p>{{_("Our collection of resources shows you how to use the technologies that power the Web.")}}</p>
        </a>
        <div></div>
      </div>
      
      <div class="promo" id="promo-demos">
          <a href="{{ url('demos') }}">
          <h2>{{_("Demos")}}</h2>
          <p>{{_("Check out what developers are doing with the latest Web standards and open technologies.")}}</p>
        </a>
        <div></div>
      </div>
      
      <div class="promo" id="promo-foxdev">
        <a href="{{ devmo_url(_('/en/Firefox_for_developers')) }}">
          <h2>{{_("Firefox for Devs")}}</h2>
          <p>{{_("See what's new for Web developers in the latest version of Firefox.")}}</p>
        </a>
        <div></div>
      </div>

    {% if waffle.switch('home_mwc_promo') %}
      <div class="promo" id="promo-apps">
        <a href="{{ url('apps') }}">
          <h2>{{_("Apps at MWC 2012")}}</h2>
          {% trans %}
          <p>27 February &ndash; 1 March<br> Barcelona</p>
          <p class="more">Learn more about<br> the Mozilla Marketplace</p>
          {% endtrans %}
        </a>
        <div></div>
      </div>
    {% else %}
      <div class="promo" id="promo-aurora">
        <a href="{{_("http://www.mozilla.com/en-US/firefox/channel/")}}">
          <h2>{{_("Firefox Aurora")}}</h2>
          <p>{{_("Experience the latest desktop and mobile features in Aurora and help shape the future of Firefox.")}}</p>
        </a>
        <div></div>
      </div>
    {% endif %}
    
    </section><!-- /#home-promos -->

    <div class="home-extra">
      <div class="col-1">
        {% if waffle.switch('apps_promo') %}
        <figure id="apps-promo" class="promo banner">
          <a href="{{ url('apps') }}">
            <img src="{{MEDIA_URL}}img/labsapps-promo-456x150.png" width="456" height="150" alt="{{ _("Be part of the Mozilla Labs Apps project. Learn More.") }}">
          </a>
        </figure>
        {% else %}
        <figure id="webfwd-promo" class="promo banner">
          <a href="http://webfwd.org" rel="external">
            <img src="{{MEDIA_URL}}img/webfwd-promo-banner.png" width="456" height="161" alt="Web Fwd: Mozilla's accelerator for open Web projects. Learn more.">
          </a>
        </figure>
        {% endif %}
      
        <section id="home-news">
          <h1>{{_("Latest News & Updates")}}</h1>
          {{ newsfeed(updates, section_headers=True) }}
        </section><!-- /#home-news -->
      </div>
        
      <div class="col-2">
        <section id="home-demos">
          <h1>{{_("Awesome Demos")}}</h1>
          <p class="more"><a href="{{ url('demos') }}">{% trans %}More Demos&hellip;{% endtrans %}</a></p>
          
          <ul class="gallery">
            {% set extra_class = cycler(' row-first', '')%}
            {% for submission in demos %}
                {{ submission_thumb(submission, extra_class, thumb_width="180", thumb_height="133") }}
            {% endfor %}
            <li class="demo-submit">          
            <p><a href="{{ url('demos_submit') }}">{% trans %}Have an awesome demo of your own? <strong>Submit It</strong>{% endtrans %}</a></p>
            </li>
          </ul>
        </section><!-- /#home-demos -->
      </div>
    </div>
    
  </section>

</div>
</section><!-- /#content -->
{% endblock %}

{% block js %}
{{ super() }}
    
<script type="text/javascript">
// <![CDATA[
	$("#welcome-bar").ready(function(){
		$("#welcome-close").click(function(){
		  $("#welcome-bar").slideUp("fast").after('<div class="wrap"><button type="button" id="welcome-open">About MDN</button></div>');
		  $("#welcome-open").click(function(){ 
		    $("#welcome-bar").slideDown();
		    $(this).parents("div.wrap").fadeOut("fast").remove(); 
		  });
		});
	});
// ]]>
</script>
  
<script type="text/javascript" src="{{MEDIA_URL}}js/mdn/jquery.hoverIntent.minified.js"></script>
<script type="text/javascript">
// <![CDATA[
	$(".gallery").ready(function(){
		$(".gallery").addClass("js");

    $(".gallery .demo").hoverIntent({
      interval: 250,
      over: function() {
        var content = $(this).html(),
            demo = $(this), 
            offs = $(this).offset();
        $("#content").prepend('<div class="demo demohover"><div class="in">'+content+'<\/div><\/div>');
        $("div.demohover").css({ left: offs.left, top: offs.top }).fadeIn(200).mouseleave(function() {
          $(this).fadeOut(200, function(){ 
            $(this).remove(); 
          });
        });
      }, 
      out: function() { /* do nothing */ }
    });

	});
// ]]>
</script>

{% endblock %}
