Skip to content
This repository has been archived by the owner on Dec 21, 2022. It is now read-only.

Commit

Permalink
fixs
Browse files Browse the repository at this point in the history
  • Loading branch information
vinilzen committed Feb 20, 2016
1 parent 4dd1484 commit 9d2bc04
Show file tree
Hide file tree
Showing 12 changed files with 943 additions and 8,620 deletions.
8,455 changes: 2 additions & 8,453 deletions css/newcult.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion css/newcult.css.map

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ gulp.task('browser-sync', ['sass'], function() {
baseDir: "./"
},
open: false,
notify: false,
ghostMode: false,
});

Expand Down
187 changes: 138 additions & 49 deletions index.html

Large diffs are not rendered by default.

226 changes: 174 additions & 52 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,80 @@
var gs, gf;
$(document).ready(function() {

/*
$("#first").vegas({
slides: [
{ src: "img/back1-start.png" },
{ src: "img/back2-components.png" },
{ src: "img/back3-projects.png" },
{ src: "img/back4-encyclopedia.png" },
{ src: "img/back5-company.png" },
{ src: "img/back6.png" }
]
});
*/

var colors = new Array(
[62,35,255],
[60,255,60],
[255,35,98],
[45,175,230],
[255,0,255],
[255,128,0]);

var step = 0;
//color table indices for:
// current color left
// next color left
// current color right
// next color right
var colorIndices = [0,1,2,3];

//transition speed
var gradientSpeed = 0.001;

function updateGradient() {

if ( $===undefined ) return;

var c0_0 = colors[colorIndices[0]],
c0_1 = colors[colorIndices[1]],
c1_0 = colors[colorIndices[2]],
c1_1 = colors[colorIndices[3]];

var istep = 1 - step;

var r1 = Math.round(istep * c0_0[0] + step * c0_1[0]),
g1 = Math.round(istep * c0_0[1] + step * c0_1[1]),
b1 = Math.round(istep * c0_0[2] + step * c0_1[2]),
color1 = "rgb("+r1+","+g1+","+b1+")";

var r2 = Math.round(istep * c1_0[0] + step * c1_1[0]),
g2 = Math.round(istep * c1_0[1] + step * c1_1[1]),
b2 = Math.round(istep * c1_0[2] + step * c1_1[2]),
color2 = "rgb("+r2+","+g2+","+b2+")";

$('#first').css({
background: "-webkit-gradient(linear, left top, right top, from("+color1+"), to("+color2+"))"}).css({
background: "-moz-linear-gradient(left, "+color1+" 0%, "+color2+" 100%)"
});

step += gradientSpeed;

if ( step >= 1 ) {
step %= 1;
colorIndices[0] = colorIndices[1];
colorIndices[2] = colorIndices[3];

//pick two new target color indices
//do not pick the same as the current one
colorIndices[1] = ( colorIndices[1] + Math.floor( 1 + Math.random() * (colors.length - 1))) % colors.length;
colorIndices[3] = ( colorIndices[3] + Math.floor( 1 + Math.random() * (colors.length - 1))) % colors.length;
}
}

setInterval(updateGradient,10);


var sw = $('.site-wrapper'),
swi = $('.site-wrapper-inner'),
Expand All @@ -8,34 +83,55 @@ $(document).ready(function() {
activeSlide = 'first',
timer, timer2;


setTimeout( function(){
$('.cover-container')
.removeClass('showTitle')
.addClass('showed');
}, 2300 );

$( ".cover-dark" ).scroll(function() {
if ( $(window).width() > 767 ){

var id = $('.cover-active').attr('data-title'),
title_id = '#title-' + id;
$('body').on('mousewheel DOMMouseScroll', function(e) {

if ( $('.cover-active').offset().top < -130 ){
$('.title-slide').not(title_id).removeClass('fade');
$(title_id).addClass('fade');
} else {
$('.title-slide').removeClass('fade');
}
var e0 = window.event || e,
delta = Math.max(-1, Math.min(1, (e0.wheelDelta || -e0.detail)));

if ($(this).offset().top == 0) {
checkCurrentSubtitle();
}
if (!start_custom_scroll && delta === -1) {
goToSecondSlide();
}

if ($('#service').offset().top == 25) {
// console.log("$('#service').offset().top == 25");
goToFirstSlide();
}
});
if (!start_custom_scroll && $('#service').offset().top == 25 && delta === 1) {
goToFirstSlide();
}
});

$('.icon-arrow-down').click(function(){
goToSecondSlide();
return false;
});

$( ".cover-dark" ).scroll(function() {

var id = $('.cover-active').attr('data-title'),
title_id = '#title-' + id;

if ( $('.cover-active').offset().top < -130 ){
$('.title-slide').not(title_id).removeClass('fade');
$(title_id).addClass('fade');
} else {
$('.title-slide').removeClass('fade');
}

if ($(this).offset().top == 0) {
checkCurrentSubtitle();
}

if ($('#service').offset().top == 25) {
// console.log("$('#service').offset().top == 25");
goToFirstSlide();
}
});
}

$('.item-project').hover(function(){
if ( $(window).width() > 1023 ) {
Expand All @@ -46,11 +142,14 @@ $(document).ready(function() {
if (img){

$('body').addClass('fadeout');

$('.title-slide.active').fadeTo(200, 0.01);

timer2 = setTimeout(function(){
$('body').attr('class','');
$('body').addClass('body-project-'+img);
$('.cover-dark').css({'background': 'none'})
}, 400);
}, 200);
}
}
}, function(){
Expand All @@ -59,63 +158,86 @@ $(document).ready(function() {

$('body').addClass('fadeout');
timer = setTimeout(function(){
$('.title-slide.active').attr('style','');
$('body').attr('class','');
$('.cover-dark').css({'background-color': '#191919'});
}, 400);
}, 200);
}
});

$('.icon-arrow-down').click(function(){
// if (!start_custom_scroll)
goToSecondSlide();
return false;
$('.arrow_link_abc').click(function(){
$("html, body").animate({
scrollTop: $('#first').outerHeight()
}, 800);
});

$('#home').click(function(){
// $('html,body').animate({ scrollTop: 0 }, 'slow');
goToFirstSlide();
$('#home-link').click(function(){
if ($(window).width() > 767) {
goToFirstSlide();
} else {
if ( $('body').hasClass('modal-open') ){
$('#navbar').collapse('toggle');
}
$("html, body").animate({ scrollTop: 0 });
}
return false;
});

$('#navbar').on('show.bs.collapse', function () {
$('body').addClass('modal-open');
}).on('hide.bs.collapse', function () {
$('body').removeClass('modal-open');
});

$('#home-link, .navbar-toggle').affix({
offset: {
top: $('#first').outerHeight(),
}
});

$('.masthead-nav a[href^="#"]').click(function(e) {

var $el = $(this),
target = $el.attr('href');

$('.masthead-nav li').removeClass('active');
$el.closest('li').addClass('active');

if (target.length) {
e.preventDefault();
if ($(window).width() > 767) {

if (!start_custom_scroll && activeSlide == 'first') {
goToSecondSlide();
}
if (target.length) {
e.preventDefault();

$('.cover-dark').animate({
scrollTop: $(target).position().top
}, 1000, function() {
checkCurrentSubtitle();
});
}
return false;
});

$('body').on('mousewheel DOMMouseScroll', function(e) {

// console.log('mousewheel');
if (!start_custom_scroll && activeSlide == 'first') {
goToSecondSlide();
}

var e0 = window.event || e,
delta = Math.max(-1, Math.min(1, (e0.wheelDelta || -e0.detail)));
$('.cover-dark').animate({
scrollTop: $(target).position().top
}, 1000, function() {
checkCurrentSubtitle();
});
}
return false;

if (!start_custom_scroll && delta === -1) {
goToSecondSlide();
}
} else {

$('#navbar').collapse('toggle');

if (!start_custom_scroll && $('#service').offset().top == 25 && delta === 1) {
goToFirstSlide();
$('body').animate({
scrollTop: $(target).position().top+$(window).height()
}, 1000, function(){
// $('#navbar').collapse('toggle');
});
}
});

$('#myModal').on('show.bs.modal', function (e) {
$('.navbar-toggle.collapsed.affix').fadeOut();
}).on('hide.bs.modal', function (e) {
$('.navbar-toggle.collapsed.affix').fadeIn();
})

function goToSecondSlide() {
// console.log('goToSecondSlide');
start_custom_scroll = true;
Expand All @@ -132,7 +254,7 @@ $(document).ready(function() {
}

function goToFirstSlide() {
// console.log('goToFirstSlide');

$('.cover-dark').addClass('goToFirstSlide');
start_custom_scroll = true;
head.removeClass('text-white');
Expand Down
33 changes: 19 additions & 14 deletions scss/contact.scss
Original file line number Diff line number Diff line change
Expand Up @@ -38,33 +38,38 @@
font-size: 36px;
font-size: 2.3rem;
}

.btn {
margin-top: 35px;
margin-top: 2.2rem;
transition: all .3s ease;
&.btn-primary {
&:hover {
background-color: #fff;
color: #000;
}
}
}

.btn {
transition: all .3s ease;
&.btn-primary {
&:hover {
background-color: #fff;
color: #000;
}
&.btn-default {
&:hover {
border: 1px solid #fff;
background-color: transparent;
color: #fff;
}
}
&.btn-default {

border: 1px solid transparent;
&:hover {
border: 1px solid #fff;
background-color: transparent;
color: #fff;
}
}
}

@media screen and (max-aspect-ratio: 17/10) and (min-width: 1651px) {
.cover-contact {
padding-bottom: 120px;
}
}

@media screen and (max-aspect-ratio: 14/10) and (min-width: $screen-md-min) { //and (min-width: 1651px)
@media screen and (max-aspect-ratio: 14/10) and (min-width: 1025px) { //and (min-width: 1651px)
.cover-contact {
padding-bottom: 180px;
}
Expand Down
Loading

0 comments on commit 9d2bc04

Please sign in to comment.