<% var content = site.posts %>

<div id="cover" class="background-haze">
    <div id="stars"></div>
    <div id="stars-2"></div>
    <div id="stars-3"></div>
    <div class="center-div" id="app">
        <div class="container bottom-spacer">
            <div class="row justify-content-md-center">
                <div class="col12">
                    <h1><img class="text-logo" alt="James Peret" src="images/jamesperet-logo-white.png"></h1>
                </div>
            </div>
            <div class="row justify-content-md-center bottom-spacer-md">
                <div class="col4">
                    <ul class="nav">
                        <li class="nav-item"><a class="nav-link" href="/projects">Projects</a></li>
                        <li class="nav-item"><a class="nav-link" href="/blog">Blog</a></li>
                        <li class="nav-item"><a class="nav-link" href="/about">About</a></li>
                    </ul>
                </div>
            </div>
            <div class="row bottom-spacer-md">
                <div class="col-3">
                    <img class="img-fluid" src="images/james-peret-drawing.png">
                </div>
                <div class="col-9">
                    <div class="about-text">
                        <p class="lead">Hello, I'm James Peret, a designer, programmer and filmmaker from Sao Paulo, Brazil.</p>
                        <p class="hide-if-sm">My skills include developing games with unity and C#, coding web apps with node and javascript, designing user interfaces and 3d modeling for games and industrial design.</p>
                        <p class="hide-if-sm">I'm available for work in the areas of programming, design and filmmaking assistance.</p>
                    </div>
                </div>
            </div>
            <div class="row bottom-spacer">
                <div class="social-media-list">
                    <a href="http://twitter.com/jamesperet" class="social-media-icon"><img src="images/icon-twitter.png" v-on:click="send_event('twitter')"></a>
                    <a href="https://github.com/jamesperet" class="social-media-icon"><img src="images/icon-github.png" v-on:click="send_event('github')"></a>
                    <a href="http://www.linkedin.com/in/jamesperet" class="social-media-icon"><img src="images/icon-linkedin.png" v-on:click="send_event('linkedin')"></a>
                    <a href="https://vimeo.com/jamesperet" class="social-media-icon"><img src="images/icon-vimeo.png" v-on:click="send_event('vimeo')"></a>
                    <a href="https://youtube.com/jamesperet" class="social-media-icon"><img src="images/icon-youtube.png" v-on:click="send_event('youtube')"></a>
                </div>
            </div>
        </div>
    </div>
</div>
<div class="container">
    <div class="row" style="margin-bottom: 15px;">
        <div class="col-12">
            <h2 class="display-4">Latest Projects</h2>
        </div>
    </div>
    <div class="row blog-posts">
        <% limit(featured_projects(content), 3).forEach(function(post){ %>
            <% content = remove_from_list(content, post) %>
            <% var data = {post: post, size: 4, image: post.thumbnail_image} %>
            <%- partial('_partial/content-card', data) %>
        <% }) %>
    </div>
    <div class="row justify-content-end" style="text-align: right;">
        <div class="col-2">
            <a role="button" href="/projects" class="btn btn-sm btn-outline-secondary"><i class="fas fa-plus"></i> Projects</a>
        </div>
    </div>
    <% var games = limit(tagged(content, 'games'), 4) %>
    <% if(games.length > 0) { %>
        <div class="row" style="margin-bottom: 15px;">
            <div class="col-12">
                <h2 class="display-4">Games</h2>
            </div>
        </div>
        <div class="row">
            <% games.forEach(function(post){ %>
                <% if(games.length == 1) { %> 
                    <%- partial('_partial/content-thumbnail', {post: post, show_title: false, size: 12}) %>
                <% } else if(games.length == 2) { %>
                    <%- partial('_partial/content-thumbnail', {post: post, show_title: false, size: 6}) %>
                <% } else if(games.length == 3) { %>
                    <%- partial('_partial/content-thumbnail', {post: post, show_title: false, size: 4}) %>
                <% } else { %>
                    <%- partial('_partial/content-thumbnail', {post: post, show_title: false, size: 3}) %>
                <% } %>
                <% content = remove_from_list(content, post) %>
            <% }) %>
        </div>
    <% } %>
    <div class="row justify-content-end" style="text-align: right;">
        <div class="col-2">
            <a role="button" href="/projects" class="btn btn-sm btn-outline-secondary"><i class="fas fa-plus"></i> Projects</a>
        </div>
    </div>
    <div class="row up-spacer" style="margin-bottom: 15px;">
        <div class="col-12">
            <h2 class="display-4">Latest Posts</h2>
        </div>
    </div>
    <div class="row blog-posts">
        <% limit(order_posts(content), 3).forEach(function(post){ %>
            <% content = remove_from_list(content, post) %>
            <% var data = {post: post, size: 4, image: `/${post.slug}/cover.jpg`} %>
            <%- partial('_partial/content-card', data) %>
        <% }) %>
    </div>
    <div class="row justify-content-end bottom-spacer" style="text-align: right;">
        <div class="col-2">
            <a role="button" href="/blog" class="btn btn-sm btn-outline-secondary"><i class="fas fa-plus"></i> Posts</a>
        </div>
    </div>
</div>
<%- partial('_partial/social-links') %>
<%- partial('_partial/contact-form') %>