diff --git a/css/fullpage.css b/css/fullpage.css deleted file mode 100644 index 4f0f0bd..0000000 --- a/css/fullpage.css +++ /dev/null @@ -1,212 +0,0 @@ -/*! - * fullPage 2.7.5 - * https://github.com/alvarotrigo/fullPage.js - * MIT licensed - * - * Copyright (C) 2013 alvarotrigo.com - A project by Alvaro Trigo - */ -html.fp-enabled, -.fp-enabled body { - margin: 0; - padding: 0; - overflow:hidden; - - /*Avoid flicker on slides transitions for mobile phones #336 */ - -webkit-tap-highlight-color: rgba(0,0,0,0); -} -#superContainer { - height: 100%; - position: relative; - - /* Touch detection for Windows 8 */ - -ms-touch-action: none; - - /* IE 11 on Windows Phone 8.1*/ - touch-action: none; -} -.fp-section { - position: relative; - -webkit-box-sizing: border-box; /* Safari<=5 Android<=3 */ - -moz-box-sizing: border-box; /* <=28 */ - box-sizing: border-box; -} -.fp-slide { - float: left; -} -.fp-slide, .fp-slidesContainer { - height: 100%; - display: block; -} -.fp-slides { - z-index:1; - height: 100%; - overflow: hidden; - position: relative; - -webkit-transition: all 0.3s ease-out; /* Safari<=6 Android<=4.3 */ - transition: all 0.3s ease-out; -} -.fp-section.fp-table, .fp-slide.fp-table { - display: table; - table-layout:fixed; - width: 100%; -} -.fp-tableCell { - display: table-cell; - vertical-align: middle; - width: 100%; - height: 100%; -} -.fp-slidesContainer { - float: left; - position: relative; -} -.fp-controlArrow { - -webkit-user-select: none; /* webkit (safari, chrome) browsers */ - -moz-user-select: none; /* mozilla browsers */ - -khtml-user-select: none; /* webkit (konqueror) browsers */ - -ms-user-select: none; /* IE10+ */ - position: absolute; - z-index: 4; - top: 50%; - cursor: pointer; - width: 0; - height: 0; - border-style: solid; - margin-top: -38px; - -webkit-transform: translate3d(0,0,0); - -ms-transform: translate3d(0,0,0); - transform: translate3d(0,0,0); -} -.fp-controlArrow.fp-prev { - left: 15px; - width: 0; - border-width: 38.5px 34px 38.5px 0; - border-color: transparent #727272 transparent transparent; -} -.fp-controlArrow.fp-next { - right: 15px; - border-width: 38.5px 0 38.5px 34px; - border-color: transparent transparent transparent #727272; -} -.fp-scrollable { - overflow: scroll; -} -.fp-notransition { - -webkit-transition: none !important; - transition: none !important; -} -#fp-nav { - position: fixed; - z-index: 100; - margin-top: -32px; - top: 50%; - opacity: 1; - -webkit-transform: translate3d(0,0,0); -} -#fp-nav.right { - right: 17px; -} -#fp-nav.left { - left: 17px; -} -.fp-slidesNav{ - position: absolute; - z-index: 4; - left: 50%; - opacity: 1; -} -.fp-slidesNav.bottom { - bottom: 17px; -} -.fp-slidesNav.top { - top: 17px; -} -#fp-nav ul, -.fp-slidesNav ul { - margin: 0; - padding: 0; -} -#fp-nav ul li, -.fp-slidesNav ul li { - display: block; - width: 14px; - height: 13px; - margin: 7px; - position:relative; -} -.fp-slidesNav ul li { - display: inline-block; -} -#fp-nav ul li a, -.fp-slidesNav ul li a { - display: block; - position: relative; - z-index: 1; - width: 100%; - height: 100%; - cursor: pointer; - text-decoration: none; -} -#fp-nav ul li a.active span, -.fp-slidesNav ul li a.active span, -#fp-nav ul li:hover a.active span, -.fp-slidesNav ul li:hover a.active span{ - height: 12px; - width: 12px; - margin: -6px 0 0 -6px; - border-radius: 100%; - } -#fp-nav ul li a span, -.fp-slidesNav ul li a span { - border-radius: 50%; - position: absolute; - z-index: 1; - height: 4px; - width: 4px; - border: 0; - background: #333; - left: 50%; - top: 50%; - margin: -2px 0 0 -2px; - -webkit-transition: all 0.1s ease-in-out; - -moz-transition: all 0.1s ease-in-out; - -o-transition: all 0.1s ease-in-out; - transition: all 0.1s ease-in-out; -} -#fp-nav ul li:hover a span, -.fp-slidesNav ul li:hover a span{ - width: 10px; - height: 10px; - margin: -5px 0px 0px -5px; -} -#fp-nav ul li .fp-tooltip { - position: absolute; - top: -2px; - color: #727272; - font-size: 14px; - font-family: arial, helvetica, sans-serif; - white-space: nowrap; - max-width: 220px; - overflow: hidden; - display: block; - opacity: 0; - width: 0; -} -#fp-nav ul li:hover .fp-tooltip, -#fp-nav.fp-show-active a.active + .fp-tooltip { - -webkit-transition: opacity 0.2s ease-in; - transition: opacity 0.2s ease-in; - width: auto; - opacity: 1; -} -#fp-nav ul li .fp-tooltip.right { - right: 20px; -} -#fp-nav ul li .fp-tooltip.left { - left: 20px; -} -.fp-auto-height.fp-section, -.fp-auto-height .fp-slide, -.fp-auto-height .fp-tableCell{ - height: auto !important; -} \ No newline at end of file diff --git a/css/style.css b/css/style.css index 6111786..b66e204 100644 --- a/css/style.css +++ b/css/style.css @@ -1,216 +1,133 @@ /* -* GENERAL +* General */ body { - margin: 0 0; -} - -#page-gen { - position: relative; - height: 100vh; width: 100vw; - background-color: #fff; - - min-width: 1020px; - min-height: 640px; + margin: 0; } -#topmenu { +/* +* Fonts +*/ + +@font-face { + font-family: Ubuntu; + src: url("../fonts/Ubuntu-R.ttf"); +} + +.ubuntu { font-family: Ubuntu;} + +/* +* Spacing +*/ + +.pad10vw { padding-left: 10vw; padding-right: 10vw;} +.pad10vh { padding-top: 10vh !important; } + +.marb1r { margin-bottom: 1rem;} + + +/* +* Colours +*/ + +.accent { color: #03A9F4; } +.primary { color: #727272; } + +/* +* Header +*/ +header { position: fixed; top: 0; + left: 0; + width: 100vw; + + background-color: #fff; +} + +header > hr { + clear: both; +} + +header > nav { + float: left; +} + +header > ul { + float: right; + padding-right: 1rem; +} + +nav > ul { + list-style: none; + padding-left: 1rem; +} + +header > nav a { + padding: 1rem 1rem; + font-size: 1.7rem; + line-height: 1.7; +} + +header ul > li { + display: inline-block; +} + +header a { + text-decoration: none; + color :inherit; +} + +/* +* Panels (general) +*/ + +.panel { + height: 100vh; width: 100vw; } -.panel-gen { - height: 100vh; - padding-left: 2vw; - padding-top: 10vh; +.panel > section { + padding-top: 30vh; } - - -p { - line-height: 1.2; - margin: 0 0; +.panel > section > h1 { + font-size: 5rem; } -a { - color :#727272 !important; +.panel > section > h2 { + font-size: 3rem; } -a:hover { - color: #03A9F4 !important; -} - -a i { - color: inherit; +.panel p { + font-size: 1.5rem; + line-height: 1.4; } /* -* LANDING PANEL +* Typed.js cursor */ -/*Bigger things*/ - -#container-landing{ - padding-top: 25vh; +.typed-cursor{ + opacity: 1; + -webkit-animation: blink 0.7s infinite; + -moz-animation: blink 0.7s infinite; + animation: blink 0.7s infinite; } - -#greet { - margin-bottom: 0; - font-size: 7vw; +@keyframes blink{ + 0% { opacity:1; } + 50% { opacity:0; } + 100% { opacity:1; } } - -#landing-blurb { - overflow: hidden; - margin-left:0.4vw; +@-webkit-keyframes blink{ + 0% { opacity:1; } + 50% { opacity:0; } + 100% { opacity:1; } } - -/*Navigation*/ - -#container-landing ul { - list-style: none; - font-size: 4vw; - padding-left: 0; +@-moz-keyframes blink{ + 0% { opacity:1; } + 50% { opacity:0; } + 100% { opacity:1; } } - -#container-landing ul li { - display: inline; - margin-top: 0; - margin-bottom: 0; - margin-right: 1vw; - -} - -/* -* ABOUT ME PANEL -*/ - -/*Bigger things*/ - -#container-aboutme { - width: 95%; -} - -#container-aboutme p { - margin-top: 0; -} - -#img_bubble1 { - border-radius: 7em; - height:20vh; - display: inline; -} - - -/* -* INTOUCH PANEL -*/ - -#panel-intouch .fp-tableCell { - vertical-align: baseline; -} - -#container-intouch { - margin-left:2vw; - width: 95%; - margin-top:2vh -} - -form p textarea { - width: 90vw; - height: 20vh; - resize: none; -} - -/* -* MODIFIERS -*/ - -.accentsize { font-size: 3vw; } -.basesize { font-size: 2vw; } - -.bold { font-weight: bold; } - -.pos-abs { position: absolute; } - -.mt-z { margin-top: 0; } -.mt2 { margin-top: 0.5em;} -.mb-z { margin-bottom: 0; } - -.vcenter { - top: 40vh; - position: relative; - transform: translateY(-50%); -} - -.primarytext {color :#727272;} -.accent {color:#03A9F4;} - -.ta-center { text-align: center; } - -/* -* SOCIAL MEDIA BOXES -*/ - - -.social ul { - list-style: none; - margin-bottom: 0; -} - -.social ul li { - display: inline; -} - -.social ul li a i { - font-size: 7vh; -} - -/* -* CONTACT FORM POPUP -*/ - -#contact-popup { - position: fixed; - top: 20vh; - height: 50vh; - width: 50vw; - background-color: #03A9F4; - left: 25vw; - border-radius: 15vw; - text-align: center; - padding-top: 18vh; - display: none; -} - -#thanks { - color: #fff; - font-family: Oswald; - font-size: 4vw; -} - - -/* -* FONT DATA -*/ - -.opensans { font-family: OpenSans; } -.oswald { font-family: Oswald; } -.courgette { font-family: Courgette; } - -@font-face { - font-family: OpenSans; - src: url("../fonts/OpenSans-CondLight.ttf") format("truetype"); -} - -@font-face { - font-family: Oswald; - src: url("../fonts/Oswald-Light.ttf") format("truetype"); -} - -@font-face { - font-family: Courgette; - src: url("../fonts/Courgette-Regular.ttf") format("truetype"); -} \ No newline at end of file diff --git a/css/typed/main.css b/css/typed/main.css deleted file mode 100755 index e802d71..0000000 --- a/css/typed/main.css +++ /dev/null @@ -1,66 +0,0 @@ -/* -*{ - padding:0; - margin:0; -} - -body{ - font-family: "Ubuntu", sans-serif; - font-size: 100%; - background:#f8f8f8; -} - -a{ - text-decoration: none; - color:#666; -} - a:hover{ - color:#999; - } -p{ - line-height: 2em; - margin:0 0 20px; - text-align: center; -} -*/ - -.wrap{ - max-width: 600px; - margin:150px auto; -} - -.type-wrap{ - margin:10px auto; - padding:20px; - background:#f0f0f0; - border-radius:5px; - border:#CCC 1px solid; -} - -.links{ - margin:20px 0; - font-size: 0.75em; - text-align: center; -} - -.typed-cursor{ - opacity: 1; - -webkit-animation: blink 0.7s infinite; - -moz-animation: blink 0.7s infinite; - animation: blink 0.7s infinite; -} -@keyframes blink{ - 0% { opacity:1; } - 50% { opacity:0; } - 100% { opacity:1; } -} -@-webkit-keyframes blink{ - 0% { opacity:1; } - 50% { opacity:0; } - 100% { opacity:1; } -} -@-moz-keyframes blink{ - 0% { opacity:1; } - 50% { opacity:0; } - 100% { opacity:1; } -} \ No newline at end of file diff --git a/fonts/Courgette-Regular.ttf b/fonts/Courgette-Regular.ttf deleted file mode 100755 index 433766b..0000000 Binary files a/fonts/Courgette-Regular.ttf and /dev/null differ diff --git a/fonts/OpenSans-CondLight.ttf b/fonts/OpenSans-CondLight.ttf deleted file mode 100755 index 97c355b..0000000 Binary files a/fonts/OpenSans-CondLight.ttf and /dev/null differ diff --git a/fonts/Oswald-Heavy.ttf b/fonts/Oswald-Heavy.ttf deleted file mode 100755 index 0db6cf0..0000000 Binary files a/fonts/Oswald-Heavy.ttf and /dev/null differ diff --git a/fonts/Oswald-Light.ttf b/fonts/Oswald-Light.ttf deleted file mode 100755 index 18cac63..0000000 Binary files a/fonts/Oswald-Light.ttf and /dev/null differ diff --git a/fonts/Ubuntu-R.ttf b/fonts/Ubuntu-R.ttf new file mode 100644 index 0000000..45a038b Binary files /dev/null and b/fonts/Ubuntu-R.ttf differ diff --git a/images/IMG_1904.JPG b/images/IMG_1904.JPG deleted file mode 100755 index 2bcdb72..0000000 Binary files a/images/IMG_1904.JPG and /dev/null differ diff --git a/images/bathbomb1.jpg b/images/bathbomb1.jpg deleted file mode 100644 index 62a9723..0000000 Binary files a/images/bathbomb1.jpg and /dev/null differ diff --git a/images/bg-landing.jpg b/images/bg-landing.jpg deleted file mode 100644 index 5286777..0000000 Binary files a/images/bg-landing.jpg and /dev/null differ diff --git a/images/logo.png b/images/logo.png deleted file mode 100644 index 65bdcb4..0000000 Binary files a/images/logo.png and /dev/null differ diff --git a/images/robotdpm.png b/images/robotdpm.png deleted file mode 100644 index e2a4070..0000000 Binary files a/images/robotdpm.png and /dev/null differ diff --git a/images/web_couchpotato.jpg b/images/web_couchpotato.jpg deleted file mode 100644 index 2847422..0000000 Binary files a/images/web_couchpotato.jpg and /dev/null differ diff --git a/index.html b/index.html index 31ea9d2..725e9f9 100644 --- a/index.html +++ b/index.html @@ -2,120 +2,70 @@ - Hello! I'm Marc! + + + + + - - - + + + -
-
-
+ - - - - - - + + - - \ No newline at end of file diff --git a/js/animate.js b/js/animate.js index 2cafb69..1117981 100644 --- a/js/animate.js +++ b/js/animate.js @@ -1,42 +1,24 @@ -/* -* Typed.js animation for the landing panel. -*/ - -$(window).ready(function() { - var period = "."; - var typedStrings = ["code"+period, "learn new things"+period, "tinker"+period, "communicate"+period, "teach"+period, "solve problems"+period, "get things done"+period]; - - $("#typedWords").typed({ - strings: typedStrings, - typeSpeed:0, - backSpeed:0, - backDelay: 1500, - showCursor: true, - cursorChar: "_", - loop: true, - contentType: 'html' - }); +$(function(){ + $("#landing-subtyped").typed({ + strings: ["tinker.", + "share what I know.", + "learn new things.", + "code.", + "communicate."], + typeSpeed: 20, + loop: true, + backDelay: 2000, + backSpeed: 0, + cursorChar: "█" + }); }); -/* -* Scroll on menu link click -*/ -$(".menulink").click(function() { - var $panel = $(this).attr("id"); - - console.log($panel); - - $('html,body').animate({ - scrollTop: $($panel).offset().top}, - 'slow'); -}); - -/* -* Closing the contact form popup -*/ - -$(document).click(function() { - if($("#contact-popup").is(':visible')) { - $("#contact-popup").fadeOut("slow"); +$('a').on('click', function(event) { + var target = $($(this).attr('href')); + if( target.length ) { + event.preventDefault(); + $('html, body').animate({ + scrollTop: target.offset().top + }, 1000); } }); \ No newline at end of file diff --git a/js/form-handling.js b/js/form-handling.js deleted file mode 100644 index 0ddb344..0000000 --- a/js/form-handling.js +++ /dev/null @@ -1,30 +0,0 @@ -/* -* Contact form handling using AJAX, sends request to Formspree.io -*/ - -var $contactForm = $('#contactme'); - -$contactForm.submit(function(e) { - e.preventDefault(); - $.ajax({ - url: '//formspree.io/c.marcandre@gmail.com', - method: 'POST', - data: { - Sender: $("#sender").val(), - Position: $("#function").val(), - Email: $("#replyto").val(), - Details: $("#details").val() - }, - dataType: 'json', - beforeSend: function() { - console.log("Sending."); - }, - success: function(data) { - $('#contactme').trigger("reset"); - $("#contact-popup").fadeIn("slow"); - }, - error: function(err) { - console.log("Failed."); - } - }); -}); \ No newline at end of file diff --git a/js/jquery-visible/LICENSE.txt b/js/jquery-visible/LICENSE.txt deleted file mode 100644 index 812556b..0000000 --- a/js/jquery-visible/LICENSE.txt +++ /dev/null @@ -1,20 +0,0 @@ -Copyright (c) 2012 Digital Fusion, http://teamdf.com/ - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/js/jquery-visible/jquery.visible.min.js b/js/jquery-visible/jquery.visible.min.js deleted file mode 100644 index 417039c..0000000 --- a/js/jquery-visible/jquery.visible.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(t){var i=t(window);t.fn.visible=function(t,e,o){if(!(this.length<1)){var r=this.length>1?this.eq(0):this,n=r.get(0),f=i.width(),h=i.height(),o=o?o:"both",l=e===!0?n.offsetWidth*n.offsetHeight:!0;if("function"==typeof n.getBoundingClientRect){var g=n.getBoundingClientRect(),u=g.top>=0&&g.top0&&g.bottom<=h,c=g.left>=0&&g.left0&&g.right<=f,v=t?u||s:u&&s,b=t?c||a:c&&a;if("both"===o)return l&&v&&b;if("vertical"===o)return l&&v;if("horizontal"===o)return l&&b}else{var d=i.scrollTop(),p=d+h,w=i.scrollLeft(),m=w+f,y=r.offset(),z=y.top,B=z+r.height(),C=y.left,R=C+r.width(),j=t===!0?B:z,q=t===!0?z:B,H=t===!0?R:C,L=t===!0?C:R;if("both"===o)return!!l&&p>=q&&j>=d&&m>=L&&H>=w;if("vertical"===o)return!!l&&p>=q&&j>=d;if("horizontal"===o)return!!l&&m>=L&&H>=w}}}}(jQuery); diff --git a/js/typed/typed.js b/js/typed/typed.js deleted file mode 100755 index d45e1e5..0000000 --- a/js/typed/typed.js +++ /dev/null @@ -1,434 +0,0 @@ -// The MIT License (MIT) - -// Typed.js | Copyright (c) 2014 Matt Boldt | www.mattboldt.com - -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: - -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. - -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. - - - - -! function($) { - - "use strict"; - - var Typed = function(el, options) { - - // chosen element to manipulate text - this.el = $(el); - - // options - this.options = $.extend({}, $.fn.typed.defaults, options); - - // attribute to type into - this.isInput = this.el.is('input'); - this.attr = this.options.attr; - - // show cursor - this.showCursor = this.isInput ? false : this.options.showCursor; - - // text content of element - this.elContent = this.attr ? this.el.attr(this.attr) : this.el.text() - - // html or plain text - this.contentType = this.options.contentType; - - // typing speed - this.typeSpeed = this.options.typeSpeed; - - // add a delay before typing starts - this.startDelay = this.options.startDelay; - - // backspacing speed - this.backSpeed = this.options.backSpeed; - - // amount of time to wait before backspacing - this.backDelay = this.options.backDelay; - - // div containing strings - this.stringsElement = this.options.stringsElement; - - // input strings of text - this.strings = this.options.strings; - - // character number position of current string - this.strPos = 0; - - // current array position - this.arrayPos = 0; - - // number to stop backspacing on. - // default 0, can change depending on how many chars - // you want to remove at the time - this.stopNum = 0; - - // Looping logic - this.loop = this.options.loop; - this.loopCount = this.options.loopCount; - this.curLoop = 0; - - // for stopping - this.stop = false; - - // custom cursor - this.cursorChar = this.options.cursorChar; - - // shuffle the strings - this.shuffle = this.options.shuffle; - // the order of strings - this.sequence = []; - - // All systems go! - this.build(); - }; - - Typed.prototype = { - - constructor: Typed - - , - init: function() { - // begin the loop w/ first current string (global self.strings) - // current string will be passed as an argument each time after this - var self = this; - self.timeout = setTimeout(function() { - for (var i=0;i" + this.cursorChar + ""); - this.el.after(this.cursor); - } - if (this.stringsElement) { - self.strings = []; - this.stringsElement.hide(); - var strings = this.stringsElement.find('p'); - $.each(strings, function(key, value){ - self.strings.push($(value).html()); - }); - } - this.init(); - } - - // pass current string state to each function, types 1 char per call - , - typewrite: function(curString, curStrPos) { - // exit when stopped - if (this.stop === true) { - return; - } - - // varying values for setTimeout during typing - // can't be global since number changes each time loop is executed - var humanize = Math.round(Math.random() * (100 - 30)) + this.typeSpeed; - var self = this; - - // ------------- optional ------------- // - // backpaces a certain string faster - // ------------------------------------ // - // if (self.arrayPos == 1){ - // self.backDelay = 50; - // } - // else{ self.backDelay = 500; } - - // contain typing function in a timeout humanize'd delay - self.timeout = setTimeout(function() { - // check for an escape character before a pause value - // format: \^\d+ .. eg: ^1000 .. should be able to print the ^ too using ^^ - // single ^ are removed from string - var charPause = 0; - var substr = curString.substr(curStrPos); - if (substr.charAt(0) === '^') { - var skip = 1; // skip atleast 1 - if (/^\^\d+/.test(substr)) { - substr = /\d+/.exec(substr)[0]; - skip += substr.length; - charPause = parseInt(substr); - } - - // strip out the escape character and pause value so they're not printed - curString = curString.substring(0, curStrPos) + curString.substring(curStrPos + skip); - } - - if (self.contentType === 'html') { - // skip over html tags while typing - var curChar = curString.substr(curStrPos).charAt(0) - if (curChar === '<' || curChar === '&') { - var tag = ''; - var endTag = ''; - if (curChar === '<') { - endTag = '>' - } else { - endTag = ';' - } - while (curString.substr(curStrPos).charAt(0) !== endTag) { - tag += curString.substr(curStrPos).charAt(0); - curStrPos++; - } - curStrPos++; - tag += endTag; - } - } - - // timeout for any pause after a character - self.timeout = setTimeout(function() { - if (curStrPos === curString.length) { - // fires callback function - self.options.onStringTyped(self.arrayPos); - - // is this the final string - if (self.arrayPos === self.strings.length - 1) { - // animation that occurs on the last typed string - self.options.callback(); - - self.curLoop++; - - // quit if we wont loop back - if (self.loop === false || self.curLoop === self.loopCount) - return; - } - - self.timeout = setTimeout(function() { - self.backspace(curString, curStrPos); - }, self.backDelay); - } else { - - /* call before functions if applicable */ - if (curStrPos === 0) - self.options.preStringTyped(self.arrayPos); - - // start typing each new char into existing string - // curString: arg, self.el.html: original text inside element - var nextString = curString.substr(0, curStrPos + 1); - if (self.attr) { - self.el.attr(self.attr, nextString); - } else { - if (self.isInput) { - self.el.val(nextString); - } else if (self.contentType === 'html') { - self.el.html(nextString); - } else { - self.el.text(nextString); - } - } - - // add characters one by one - curStrPos++; - // loop the function - self.typewrite(curString, curStrPos); - } - // end of character pause - }, charPause); - - // humanized value for typing - }, humanize); - - } - - , - backspace: function(curString, curStrPos) { - // exit when stopped - if (this.stop === true) { - return; - } - - // varying values for setTimeout during typing - // can't be global since number changes each time loop is executed - var humanize = Math.round(Math.random() * (100 - 30)) + this.backSpeed; - var self = this; - - self.timeout = setTimeout(function() { - - // ----- this part is optional ----- // - // check string array position - // on the first string, only delete one word - // the stopNum actually represents the amount of chars to - // keep in the current string. In my case it's 14. - // if (self.arrayPos == 1){ - // self.stopNum = 14; - // } - //every other time, delete the whole typed string - // else{ - // self.stopNum = 0; - // } - - if (self.contentType === 'html') { - // skip over html tags while backspacing - if (curString.substr(curStrPos).charAt(0) === '>') { - var tag = ''; - while (curString.substr(curStrPos).charAt(0) !== '<') { - tag -= curString.substr(curStrPos).charAt(0); - curStrPos--; - } - curStrPos--; - tag += '<'; - } - } - - // ----- continue important stuff ----- // - // replace text with base text + typed characters - var nextString = curString.substr(0, curStrPos); - if (self.attr) { - self.el.attr(self.attr, nextString); - } else { - if (self.isInput) { - self.el.val(nextString); - } else if (self.contentType === 'html') { - self.el.html(nextString); - } else { - self.el.text(nextString); - } - } - - // if the number (id of character in current string) is - // less than the stop number, keep going - if (curStrPos > self.stopNum) { - // subtract characters one by one - curStrPos--; - // loop the function - self.backspace(curString, curStrPos); - } - // if the stop number has been reached, increase - // array position to next string - else if (curStrPos <= self.stopNum) { - self.arrayPos++; - - if (self.arrayPos === self.strings.length) { - self.arrayPos = 0; - - // Shuffle sequence again - if(self.shuffle) self.sequence = self.shuffleArray(self.sequence); - - self.init(); - } else - self.typewrite(self.strings[self.sequence[self.arrayPos]], curStrPos); - } - - // humanized value for typing - }, humanize); - - } - /** - * Shuffles the numbers in the given array. - * @param {Array} array - * @returns {Array} - */ - ,shuffleArray: function(array) { - var tmp, current, top = array.length; - if(top) while(--top) { - current = Math.floor(Math.random() * (top + 1)); - tmp = array[current]; - array[current] = array[top]; - array[top] = tmp; - } - return array; - } - - // Start & Stop currently not working - - // , stop: function() { - // var self = this; - - // self.stop = true; - // clearInterval(self.timeout); - // } - - // , start: function() { - // var self = this; - // if(self.stop === false) - // return; - - // this.stop = false; - // this.init(); - // } - - // Reset and rebuild the element - , - reset: function() { - var self = this; - clearInterval(self.timeout); - var id = this.el.attr('id'); - this.el.after('') - this.el.remove(); - if (typeof this.cursor !== 'undefined') { - this.cursor.remove(); - } - // Send the callback - self.options.resetCallback(); - } - - }; - - $.fn.typed = function(option) { - return this.each(function() { - var $this = $(this), - data = $this.data('typed'), - options = typeof option == 'object' && option; - if (!data) $this.data('typed', (data = new Typed(this, options))); - if (typeof option == 'string') data[option](); - }); - }; - - $.fn.typed.defaults = { - strings: ["These are the default values...", "You know what you should do?", "Use your own!", "Have a great day!"], - stringsElement: null, - // typing speed - typeSpeed: 0, - // time before typing starts - startDelay: 0, - // backspacing speed - backSpeed: 0, - // shuffle the strings - shuffle: false, - // time before backspacing - backDelay: 500, - // loop - loop: false, - // false = infinite - loopCount: false, - // show cursor - showCursor: true, - // character for cursor - cursorChar: "|", - // attribute to type (null == text) - attr: null, - // either html or text - contentType: 'html', - // call when done callback function - callback: function() {}, - // starting callback function before each string - preStringTyped: function() {}, - //callback for every typed string - onStringTyped: function() {}, - // callback for reset - resetCallback: function() {} - }; - - -}(window.jQuery); diff --git a/js/typed/typed.min.js b/js/typed/typed.min.js new file mode 100755 index 0000000..75a872c --- /dev/null +++ b/js/typed/typed.min.js @@ -0,0 +1 @@ +!function(t){"use strict";var s=function(s,e){this.el=t(s),this.options=t.extend({},t.fn.typed.defaults,e),this.isInput=this.el.is("input"),this.attr=this.options.attr,this.showCursor=this.isInput?!1:this.options.showCursor,this.elContent=this.attr?this.el.attr(this.attr):this.el.text(),this.contentType=this.options.contentType,this.typeSpeed=this.options.typeSpeed,this.startDelay=this.options.startDelay,this.backSpeed=this.options.backSpeed,this.backDelay=this.options.backDelay,this.stringsElement=this.options.stringsElement,this.strings=this.options.strings,this.strPos=0,this.arrayPos=0,this.stopNum=0,this.loop=this.options.loop,this.loopCount=this.options.loopCount,this.curLoop=0,this.stop=!1,this.cursorChar=this.options.cursorChar,this.shuffle=this.options.shuffle,this.sequence=[],this.build()};s.prototype={constructor:s,init:function(){var t=this;t.timeout=setTimeout(function(){for(var s=0;s'+this.cursorChar+""),this.el.after(this.cursor)),this.stringsElement){s.strings=[],this.stringsElement.hide();var e=this.stringsElement.find("p");t.each(e,function(e,i){s.strings.push(t(i).html())})}this.init()},typewrite:function(t,s){if(this.stop!==!0){var e=Math.round(70*Math.random())+this.typeSpeed,i=this;i.timeout=setTimeout(function(){var e=0,r=t.substr(s);if("^"===r.charAt(0)){var o=1;/^\^\d+/.test(r)&&(r=/\d+/.exec(r)[0],o+=r.length,e=parseInt(r)),t=t.substring(0,s)+t.substring(s+o)}if("html"===i.contentType){var n=t.substr(s).charAt(0);if("<"===n||"&"===n){var a="",h="";for(h="<"===n?">":";";t.substr(s).charAt(0)!==h;)a+=t.substr(s).charAt(0),s++;s++,a+=h}}i.timeout=setTimeout(function(){if(s===t.length){if(i.options.onStringTyped(i.arrayPos),i.arrayPos===i.strings.length-1&&(i.options.callback(),i.curLoop++,i.loop===!1||i.curLoop===i.loopCount))return;i.timeout=setTimeout(function(){i.backspace(t,s)},i.backDelay)}else{0===s&&i.options.preStringTyped(i.arrayPos);var e=t.substr(0,s+1);i.attr?i.el.attr(i.attr,e):i.isInput?i.el.val(e):"html"===i.contentType?i.el.html(e):i.el.text(e),s++,i.typewrite(t,s)}},e)},e)}},backspace:function(t,s){if(this.stop!==!0){var e=Math.round(70*Math.random())+this.backSpeed,i=this;i.timeout=setTimeout(function(){if("html"===i.contentType&&">"===t.substr(s).charAt(0)){for(var e="";"<"!==t.substr(s).charAt(0);)e-=t.substr(s).charAt(0),s--;s--,e+="<"}var r=t.substr(0,s);i.attr?i.el.attr(i.attr,r):i.isInput?i.el.val(r):"html"===i.contentType?i.el.html(r):i.el.text(r),s>i.stopNum?(s--,i.backspace(t,s)):s<=i.stopNum&&(i.arrayPos++,i.arrayPos===i.strings.length?(i.arrayPos=0,i.shuffle&&(i.sequence=i.shuffleArray(i.sequence)),i.init()):i.typewrite(i.strings[i.sequence[i.arrayPos]],s))},e)}},shuffleArray:function(t){var s,e,i=t.length;if(i)for(;--i;)e=Math.floor(Math.random()*(i+1)),s=t[e],t[e]=t[i],t[i]=s;return t},reset:function(){var t=this;clearInterval(t.timeout);var s=this.el.attr("id");this.el.after(''),this.el.remove(),"undefined"!=typeof this.cursor&&this.cursor.remove(),t.options.resetCallback()}},t.fn.typed=function(e){return this.each(function(){var i=t(this),r=i.data("typed"),o="object"==typeof e&&e;r||i.data("typed",r=new s(this,o)),"string"==typeof e&&r[e]()})},t.fn.typed.defaults={strings:["These are the default values...","You know what you should do?","Use your own!","Have a great day!"],stringsElement:null,typeSpeed:0,startDelay:0,backSpeed:0,shuffle:!1,backDelay:500,loop:!1,loopCount:!1,showCursor:!0,cursorChar:"|",attr:null,contentType:"html",callback:function(){},preStringTyped:function(){},onStringTyped:function(){},resetCallback:function(){}}}(window.jQuery); \ No newline at end of file diff --git a/projectsdev b/projectsdev deleted file mode 100644 index bc4b9c9..0000000 --- a/projectsdev +++ /dev/null @@ -1,30 +0,0 @@ -
-
-

Featured projects

-
-
-

November 2015
Queerness & Sexuality
special issue


The McGill Daily

-
-
-

December 2015
Lego-based autonomous robot

Design project management
Course project

-
-
-
-
-
-
-
-
-
-
Slide 2
-
Slide 3
-
Slide 4
- -
\ No newline at end of file