CivicIdeas Homepage

with Featured Video

by Pete Fecteau

HTML

<script src="https://buttonpresser.com/CivicIdeas_BS/js/bootstrap.min.js"></script>
<script src="https://buttonpresser.com/CivicIdeas_BS/js/goog_trans.js"></script>
<script src="https://buttonpresser.com/CivicIdeas_BS/js/bootstrap-dropdown.js"></script>
<script src="https://buttonpresser.com/CivicIdeas_BS/js/bootstrap-collapse.js"></script>
<script src="https://buttonpresser.com/CivicIdeas_BS/js/bootstrap-carousel.js"></script>
<div class="standard-nav navbar navbar-fixed-top">
    <div class="navbar-inner">
        <div class="container">
            <div class="nav-collapse" id="main-menu">
                <ul class="nav" id="main-menu-left">
                    <li class="nav-home active"><a href="#">Home</a></li>
                    <li class="nav-ideas"><a href="#">Ideas</a></li>
                    <li class="nav-projects"><a href="#">Projects</a></li>
                    <li class="nav-discussions"><a href="#">Discussions</a></li>
                    <li class="nav-forums"><a href="#">Forums</a></li>
                    <li class="nav-meetings"><a href="#">Meetings</a></li>
                    <li class="nav-surveys"><a href="#">Surveys</a></li>
                </ul>
                <ul class="nav pull-right" id="main-menu-right">
                    <li>
                        <form class="navbar-search pull-left">
                            <input type="text" class="search-query" placeholder="Search" />
                        </form>
                    </li>
                    <li class="dropdown">
                      <a class="dropdown-toggle" data-toggle="dropdown" href="#">Ron Swanson <span class="caret"></span></a>
                      <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
                        <li><a href="../default">Log Out</a></li>
                        <li class="divider"></li>
                        <li><a href="#" class="open-my-profile">Edit Profile</a></li>
                        <li><a href="#">My...

SCSS

@import url('https://buttonpresser.com/CivicIdeas_BS/css/bootstrap.css');
@import url('https://buttonpresser.com/CivicIdeas_BS/css/bootstrap-custom.css');
@import url('https://buttonpresser.com/CivicIdeas_BS/css/global-nav.css');
@import url('https://buttonpresser.com/CivicIdeas_BS/css/global-headers.css');
@import url('https://buttonpresser.com/CivicIdeas_BS/css/global-sidebar.css');
@import url('https://buttonpresser.com/CivicIdeas_BS/css/global-footer.css');
@import url('https://buttonpresser.com/CivicIdeas_BS/css/header-idea.css');
@import url('https://buttonpresser.com/CivicIdeas_BS/css/header-discussion.css');
@import url('https://buttonpresser.com/CivicIdeas_BS/css/header-project.css');
@import url('https://buttonpresser.com/CivicIdeas_BS/css/header-forum.css');
@import url('https://buttonpresser.com/CivicIdeas_BS/css/header-meeting.css');
@import url('https://buttonpresser.com/CivicIdeas_BS/css/header-survey.css');
@import url('https://buttonpresser.com/CivicIdeas_BS/css/widget-open-ideation.css');
@import url('https://buttonpresser.com/CivicIdeas_BS/css/widget-attach-media.css');
.standard-nav {top:0;}
section {border-bottom: 1px solid #DEDFE0;}
section:last-child {border-bottom:0;}
section.media {border-bottom:0px;}
section.media ul li h4.slideshow:before,
section.media ul li h4.video:before,
section.media ul li h4.document:before,
.header[class^="small-"],
.header[class*=" small-"] {
	background-position-x:-50px;
}

.featured {
    .featured-header {
        margin-top:-50px;
        display:block;
        margin-bottom:20px;
        width:720px;
        line-height:50px;
        border-bottom: 1px solid #DEDFE0;
    }
    .featured-video {
        padding:0 0 20px;
        border-bottom:0;
    }
}

JavaScript

$('.dropdown-toggle').dropdown();
$('.collapse').collapse();

$('.well.closer').each(function() {
  $(this).prepend('<div class="close-box">&times;</div>');
});
$(function(){
    $('.close-box').click(function() {
        $(this).parent().fadeOut(1000);
    });
}); 

$(function(){
    $(".new-idea").live("click", function() {
        var desc = $(this).parent().find('div.home-idea-desc');
        desc.animate({
            height: 300
          }, 800, function() {
      });
        return false;
	});
    $(".idea-clear").live("click", function() {
        var desc = $(this).parent().parent().parent().find('div.home-idea-desc')
        desc.animate({
            height: 0,
          }, 800, function() {
      });
	});
});

// IDEAS & VOTING SCRIPT
$(".idea-header.vote").live("click", function() {
    myBtn = $(this).parent().find('.btn.vote');
    thatBtn = $(this).parent().find('.btn.follow');
    voteCount = parseInt($(this).find('span').text(), 10);
    console.log(voteCount);
    newVoteCount = voteCount + 1;	
    $(this).css('backgroundPosition','0 0');
    $(this).find('span').html(newVoteCount);
    $(this).addClass('voted');
    $(this).removeClass('vote');
    myBtn.addClass('voted');
    myBtn.removeClass('vote');
    myBtn.html('Voted');
    thatBtn.addClass('followed');
    thatBtn.removeClass('follow');
    thatBtn.html('Followed');
});
$(".idea-header.voted").live("click", function() {
    myBtn = $(this).parent().find('.btn.voted');
    thatBtn = $(this).parent().find('.btn.followed');
    voteCount = parseInt($(this).find('span').text(), 10);
    console.log(voteCount);
    newVoteCount = voteCount - 1;
    $(this).css('backgroundPosition','-152px 0');
    $(this).find('span').html(newVoteCount);
    $(this).addClass('vote');
    $(this).removeClass('voted');
    myBtn.addClass('vote');
    myBtn.removeClass('voted');
    myBtn.html('Vote');
    thatBtn.addClass('follow');
    thatBtn.removeClass('followed');
   ...