123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348 |
- new WOW().init();
- jQuery(document).ready(function($) {
-
- $(window).bind('load', function() {
- $('#loader').fadeOut(700);
- });
- /*============================================
- Welcome Cookies
- ==============================================*/
- $(function dw_set_cookie() {
- var COOKIE = 'windhamdavid-cookie';
- var dwcookie = $.cookie(COOKIE);
- if (dwcookie == null) {
- $.cookie(COOKIE, 'yum-cookies', { expires: 7, path: '/'});
- $('.welcome').typed({
- strings: ['Hey,', 'Hello,\n^10Welcome to ^10my domain ^10...^10', 'Hello, \nWelcome to my little corner of the internet. \n^10It is nice to ', 'Hello, \nWelcome to my little corner of the internet. \nIt is very nice to have you here!^10\n'],
- typeSpeed: -40,
- backSpeed: -70,
- startDelay: 0,
- backDelay: 0,
- loop: false,
- loopCount: false,
- attr: null,
- callback: function(){
- dw_shift();
- }
- });
- }
- else {
- $('.intro').collapse('hide');
- $('.terminal').modal('show');
- $('.welcome-back-text').typed({
- strings: ['Hello...', 'Welcome back'],
- typeSpeed: 10,
- backSpeed: 70,
- startDelay: 0,
- backDelay: 0,
- loop: false,
- loopCount: false,
- attr: null,
- callback: function(){
- dw_terminal();
- dw_collapse();
- }
- });
- }
- });
-
- function dw_shift() {
- var collapseh = $('.intro').height();
- $('.leader').ScrollTo({
- offset: -(collapseh),
- duration: 1500,
- easing: 'linear',
- callback: function(){
- dw_collapse();
- }
- });
- $('.intro').slideToggle({
- duration: 1000,
- easing: 'linear'
- });
- }
- function dw_collapse() {
- $('.welcome-back-text').addClass('.welcome-back-text:after');
- //$('.intro').collapse('hide');
- //$('.terminal').modal('hide');
- }
- /*============================================
- Terminal
- ==============================================*/
- (function ($){
- $.fn.cli = function(handler, prompt, effect){
- if (!prompt) prompt = '<span class="u">you</span><span class="at">@</span><span class="mee">david</span> > ';
- if (!effect) effect = $.fn.text;
- return this.each(function(){
- var self = $(this);
- function newline(){
- self.
- append('<p class=input><span class=prompt>'+prompt+'</span><span style=outline:none contenteditable></span></p>');
- try {
- $('[contenteditable]', self)[0].focus();
- }catch(e){
- }
- }
- newline();
- self.on('keydown', '[contenteditable]', function(evt){
- if (evt.keyCode == 13){
- $(this).removeAttr('contenteditable'); // IE needs special handling which jQuery provides
- effect.call($('<p class=response>').appendTo(self),handler(this.textContent || this.innerText));
- newline();
- return false;
- }
- });
- });
- };
- })(jQuery);
- function dw_terminal(){
- function type(text){
- var span = $('<span>').appendTo(this).after('<span id="blinker" style="background: green"> </span>');
- var style = $('<style>p.input {visibility: hidden} p.input.old {visibility: visible}</style>').appendTo('head');
- $('p.input').addClass('old');
- var progress = 0;
- var timer = setInterval (function(){
- span.text(text.substr(0, progress++));
- if (progress > text.length){
- $('#blinker').remove();
- style.remove();
- $('[contenteditable]')[0].focus();
- clearInterval(timer);
- }
- },100);
- }
- $('.thermo').cli(function(text){
- if (/good/i.test(text)) {
- return "Very" +text;
- $('.terminal').modal('hide');
- };
- if (/exit/i.test(text)) {
- $('.terminal').modal('hide');
- };
- if (/help/i.test(text)) return "I need somebody. Type 'exit' to close";
- if (/hello/i.test(text)) return "Hello to you!";
- if (/what/i.test(text)) return "This is a website silly human";
- if (/and/i.test(text)) return "and what?";
- if (/who/i.test(text)) return "David A. Windham";
- if (/how/i.test(text)) return "JavaScript is a dynamic computer programming language";
- if (/why/i.test(text)) return "For fun";
- if (/you/i.test(text)) return "your mama";
- if (/cd ../i.test(text)) return "Oh, I see";
- if (/thermonuclear/i.test(text)) return "Wouldn't you prefer a nice game of chess?";
- if (text.length < 3) return "type 'exit' to close";
- return 'command not found: '+text;
- }, null, type);
- $('p.input').on('touchstart click', function(e) {
- e.preventDefault();
- $('[contenteditable]')[0].focus();
- });
- }
- /*============================================
- Navigation
- ==============================================*/
- $('.nav-toggle').on('touchstart click', function(e) {
- e.preventDefault();
- $( this ).toggleClass( 'active' );
- });
- $('#nav').affix({
- offset: {top: $('.intro').height()-$('.navbar').height()}
- });
- $(function dw_hidenav() {
- var headerHeight = $('.navbar').height();
- $(window).on('scroll', { previousTop: 0 },
- function() {
- var currentTop = $(window).scrollTop();
- if (currentTop < this.previousTop) {
- if (currentTop > 0 && $('.navbar').hasClass('fixed')) {
- $('.navbar').addClass('visible');
- } else {
- $('.navbar').removeClass('visible fixed');
- }
- }
- else {
- $('.navbar').removeClass('visible');
- if (currentTop > headerHeight && !$('.navbar').hasClass('fixed')) $('.navbar').addClass('fixed');
- }
- this.previousTop = currentTop;
- }
- );
- });
- /*============================================
- Carousel
- ==============================================*/
- $('.carousel').carousel({
- interval: 4200,
- interval: false
- });
- $('.carousel').on('slide.bs.carousel', function() {
- $('.carousel-caption').fadeIn(600);
- //$('#tv').removeClass('invert');
- });
- $('.carousel').on('slid.bs.carousel', function() {
- $('.carousel-caption').fadeOut(600);
- //$('#tv').addClass('invert');
- });
- $('.caro').carousel({
- interval: 9000
- });
- /*============================================
- SVG Animate
- ==============================================*/
- $('#caro').on('slid.bs.carousel', function() {
- $('.active .animac').removeClass('hide-svg fade-svg');
- var animac = new DrawFillSVG({elementId: 'svg-mac'});
- var animac1 = new DrawFillSVG({elementId: 'svg-imac'});
- var animac2 = new DrawFillSVG({elementId: 'svg'});
- animac.replay();
- animac1.replay();
- animac2.replay();
- });
- $('#caro').on('slide.bs.carousel', function() {
- $('.active .animac').addClass('fade-svg').delay(1000).queue(function(hideit){
- $(this).addClass('hide-svg');
- hideit();
- });
- });
- /*============================================
- Comments
- ==============================================*/
- $('#comments').hide();
- $('.toggle-comments').on('touchstart click', function(e) {
- e.preventDefault();
- $('#comments').toggle('slow', function() {
- var anchor = $('.toggle-comments');
- var anchorText = anchor.text() === 'Hide Comments' ? 'Show Comments' : 'Hide Comments';
- $(anchor).text(anchorText);
- });
- });
- $('#commentform').validate({
- rules: {
- author: {
- required: true,
- minlength: 2
- },
- email: {
- required: true,
- email: true
- },
- comment: {
- required: true,
- minlength: 20
- }
- },
- messages: {
- author: 'Please enter in your name.',
- email: 'Please enter a valid email address.',
- comment: 'Nothing to Say?'
- },
- errorElement: 'div',
- errorPlacement: function(error, element) {
- element.before(error);
- }
- });
- /*============================================
- SmoothState
- ==============================================*/
-
- /*============================================
- Calendar
- ==============================================*/
- $('.calendar').fullCalendar ({
- firstDay : 1,
- height: 345,
- events: [
- {
- title: 'Project',
- start: '2014-09-27',
- end: '2014-10-02'
- },
- {
- title: 'Conf',
- start: '2014-10-11',
- end: '2014-10-13',
- borderColor: 'red'
- },
- {
- title: 'off',
- start: '2014-10-13',
- end: '2014-10-16'
- },
- {
- title: 'Contract',
- start: '2014-10-16',
- end: '2014-10-31'
- },
- {
- title: 'Contract',
- start: '2014-11-03',
- end: '2014-11-22'
- },
- {
- title: 'Project',
- start: '2014-12-01',
- end: '2014-12-06'
- },
- {
- title: 'Project',
- start: '2014-12-08',
- end: '2014-12-13'
- },
- {
- title: 'Holiday',
- start: '2014-12-22',
- end: '2015-01-05',
- borderColor: 'red'
- },
- {
- title: 'Project',
- start: '2015-01-06',
- end: '2015-01-25'
- },
- {
- title: 'Project',
- start: '2015-02-02',
- end: '2015-02-14'
- },
- {
- title: 'Holiday',
- start: '2015-02-14',
- end: '2015-02-19',
- borderColor: 'red'
- }
- ]
- });
-
- });
|