Skip to content
This repository was archived by the owner on May 5, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
3 changes: 0 additions & 3 deletions source/img/assets/index/carousel/slot2-web-development.svg

This file was deleted.

Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file added source/img/assets/index/eitan-grinspun.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/img/assets/index/gordon-fraser.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/img/assets/index/grading-costs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/img/assets/index/icon1-piggybank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/img/assets/index/icon2-hourglass.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/img/assets/index/instructor-time.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/img/assets/index/mateen-rizki.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/img/assets/index/quote-left.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/img/assets/index/quote-right.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/img/assets/index/student-engagement.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added source/img/assets/index/student-engagement.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
388 changes: 301 additions & 87 deletions source/index.html.erb

Large diffs are not rendered by default.

46 changes: 22 additions & 24 deletions source/javascripts/partials/_header.es6
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
/* globals $ */


$(() => {

const $header = $('header');
const $toggle = $('.menu-toggle');
const $nav = $('.mobile-nav');
const $dropdownMenu = $('.header-dropdown-menu');

var setTransparent = () => {
$header.removeClass('opaque-background');
$header.addClass('transparent-background');
$dropdownMenu.removeClass('opaque-background');
$dropdownMenu.addClass('transparent-background');
}

var setOpaque = () => {
$header.removeClass('transparent-background');
$header.addClass('opaque-background');
$dropdownMenu.removeClass('transparent-background');
$dropdownMenu.addClass('opaque-background');
const $headerLogo = $header.find('img');

var setDark = () => {
$header.removeClass('header-dark');
$header.addClass('header-light');
$dropdownMenu.removeClass('header-dark');
$dropdownMenu.addClass('header-light');
$headerLogo.attr({'src':'/img/logo-dark.svg', 'alt':'Logo'});
}

var setHeaderStyle = () => {
setOpaque();
var setLight = () => {
$header.removeClass('header-light');
$header.addClass('header-dark');
$dropdownMenu.removeClass('header-light');
$dropdownMenu.addClass('header-dark');
$headerLogo.attr({'src':'/img/logo-light.svg', 'alt':'Logo'});
}

if ($('body').innerWidth() <= 783) {
setOpaque();
} else {
setHeaderStyle();
setDark();
}

$(window).resize(() => {
if ($('body').innerWidth() > 783) {
setHeaderStyle();
} else {
setOpaque();
if ($('body').innerWidth() < 783) {
setDark();
}
});

$(window).on("scroll", () => {
if ($(window).scrollTop() > 0) setDark();
else setLight();
});

// Responsive Menu

$toggle.click(function (event) {
Expand Down
5 changes: 2 additions & 3 deletions source/javascripts/partials/_index.es6
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@ $(() => {
const headerHeight = $('header').height()
const eventType = ((document.ontouchstart !== null) ? 'click' : 'touchstart')

$('.scrollto').on(eventType, function (event) {
$('.scrollto').on(eventType, 'a', function (event) {
event.preventDefault()

const id = $(this).attr('href')
const offset = 2 * headerHeight
const target = $(id).offset().top - offset
const target = $(id).offset().top - headerHeight

$('html, body').animate({
scrollTop: target
Expand Down
10 changes: 5 additions & 5 deletions source/partials/_header.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<div class="mobile-nav">
<%= partial "nav" %>
</div>
<header class="fixed transparent-background <% if current_resource.data.transparent %>should-be-transparent<% end %>">
<header class="fixed header-dark">
<div class="container animated fadeInDown">
<div class="logo">
<a href="/" class="logo-link"><%= image_tag 'logo-dark.svg', alt: 'Codio', class: 'img-logo' %></a>
</div>
<div class="logo">
<a href="/" class="logo-link"><%= image_tag 'logo-light.svg', alt: 'Codio', class: 'img-logo' %></a>
</div>
<nav>
<%= partial "nav", locals: {pricing: pricingType, surl: signupUrl} %>
<%= partial "nav", locals: {pricing: pricingType, surl: signupUrl} %>
</nav>
</div>
</header>
2 changes: 1 addition & 1 deletion source/partials/_nav.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<%= link_to 'Log in', '/p/login' %>
</li>
<li class='highspot'>
<%= link_to 'Free trial', (defined?(surl) && !surl.nil? ? surl : '/start-edu-trial'), class: 'button button-rounded-small' %>
<%= link_to 'Free trial', (defined?(surl) && !surl.nil? ? surl : '/start-edu-trial'), class: 'button button-small' %>
</li>
<li>
<%= link_to 'Join Class', '/p/join-class' %>
Expand Down
Loading