From 01e38adb828102b7d2b82f72196ee8cfa93e5027 Mon Sep 17 00:00:00 2001 From: Luc Tribolet Date: Thu, 28 Apr 2016 23:15:55 +0200 Subject: [PATCH] Add bottom menu TODO : clear and rename CSS --- app/index.html | 27 ++- app/scripts/main.js | 82 ++++++++- app/styles/main.css | 403 +++++++++++++++++++++++++++++++++++++++++++- bower.json | 3 +- 4 files changed, 501 insertions(+), 14 deletions(-) diff --git a/app/index.html b/app/index.html index c4c982c..b0b9086 100755 --- a/app/index.html +++ b/app/index.html @@ -40,18 +40,33 @@ - - -
-
+
+ +
+
+
+
+ +
+ +
+

Hi! I am Luc Tribolet. Full Stack Developer. Based in Paris.

+ +
+
+
+
+
+
+
+ diff --git a/app/scripts/main.js b/app/scripts/main.js index 92487eb..36a890b 100755 --- a/app/scripts/main.js +++ b/app/scripts/main.js @@ -1,3 +1,81 @@ $(function() { - -}); \ No newline at end of file + function centerInit() { + var hero = $('.hero'), + heroContent = $('.hero-content'), + contentMargin = ($(window).height() - heroContent.height()) / 2; + + hero.css({ + "height": $(window).height() + "px" + }); + + heroContent.css({ + "margin-top": contentMargin + "px" + }); + + } + + centerInit(); + $(window).resize(centerInit); +}); + +var SidebarMenuEffects = (function() { + + function hasParentClass( e, classname ) { + if(e === document) return false; + if( classie.has( e, classname ) ) { + return true; + } + return e.parentNode && hasParentClass( e.parentNode, classname ); + } + + // http://coveroverflow.com/a/11381730/989439 + function mobilecheck() { + var check = false; + (function(a){if(/(android|ipad|playbook|silk|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4)))check = true})(navigator.userAgent||navigator.vendor||window.opera); + return check; + } + + function init() { + + var container = document.getElementById( 'st-container' ), + reset = document.getElementById( 'closeMenu' ), + buttons = Array.prototype.slice.call( document.querySelectorAll( '.scroll-to' ) ), + // event type (if mobile use touch events) + eventtype = mobilecheck() ? 'touchstart' : 'click', + resetMenu = function() { + classie.remove( container, 'st-menu-open' ); + }, + bodyClickFn = function(evt) { + if( !hasParentClass( evt.target, 'st-menu' ) ) { + resetMenu(); + document.removeEventListener( eventtype, bodyClickFn ); + } + }, + resetClickFn = function(evt) { + if (evt.target == reset) { + resetMenu(); + document.removeEventListener(eventtype, bodyClickFn); + } + }; + + buttons.forEach( function( el, i ) { + var effect = el.getAttribute( 'data-effect' ); + + el.addEventListener( eventtype, function( ev ) { + ev.stopPropagation(); + ev.preventDefault(); + container.className = 'st-container'; // clear + classie.add( container, effect ); + setTimeout( function() { + classie.add( container, 'st-menu-open' ); + }, 25 ); + document.addEventListener( eventtype, bodyClickFn ); + document.addEventListener( eventtype, resetClickFn ); + }); + } ); + + } + + init(); + +})(); \ No newline at end of file diff --git a/app/styles/main.css b/app/styles/main.css index bb74d16..fa4e659 100755 --- a/app/styles/main.css +++ b/app/styles/main.css @@ -1,6 +1,399 @@ -.browserupgrade { - margin: 0.2em 0; - background: #ccc; - color: #000; - padding: 0.2em 0; +/* =Common Styles +-------------------------------------------------------------- */ +body { + background: #111111; + color: #bfbfbf; + font: normal 16px "Source Sans Pro", arial, sans-serif; + font-weight: 400; + -webkit-font-smoothing: antialiased; + -webkit-text-size-adjust: 100%; } + +section { overflow: hidden; } + +::-moz-selection { background: #fff; color: #272727; } +::selection { background: #fff; color: #272727; } + +.padded { + padding-top: 60px; + padding-bottom: 60px; +} + +.padded-top { + padding-top: 60px; +} + +.padded-bottom { + padding-bottom: 60px; +} + +/* Medium Devices, Desktops */ +@media only screen and (min-width : 992px) { + .padded { + padding-top: 100px; + padding-bottom: 100px; + } + + .padded-top { + padding-top: 100px; + } + + .padded-bottom { + padding-bottom: 100px; + } +} + + +/* =Typography +-------------------------------------------------------------- */ +h1 { + font-family: 'Source Sans Pro', sans-serif; + font-weight: 300; + font-size: 30px; + line-height: 40px; + color: #fff; + padding-bottom: 30px; +} + +.hero h1 { + padding-bottom: 0px; +} + +h2 { + font-family: 'Lekton', sans-serif; + font-size: 12px; + line-height: 12px; + color: #bfbfbf; + letter-spacing: 0.20em; + padding-bottom: 20px; + -webkit-font-variant-ligatures: no-common-ligatures; +} + +h6 { + font-weight: 400; + font-size: 7px; + margin-top: 10px; + text-transform: uppercase; + letter-spacing: 0.3em; +} + +p { + font-size: 14px; + line-height: 30px; + padding-bottom: 20px; +} + +a { + color: #fff; +} + +a:hover { + text-decoration: underline; +} + +.strong { + color: #fff; +} + +/* Small Devices, Tablets */ +@media only screen and (min-width : 768px) { + h1 { + font-size: 50px; + line-height: 62px; + padding-bottom: 40px; + } + + h2 { + padding-bottom: 40px; + } + +} + +/* Medium Devices, Desktops */ +@media only screen and (min-width : 992px) { + h1 { + font-size: 55px; + line-height: 70px; + } + +} + +/* Large Devices, Wide Screens */ +@media only screen and (min-width : 1200px) { + h1 { + font-size: 60px; + line-height: 72px; + padding-bottom: 50px; + } + + h2 { + padding-bottom: 40px; + } + + p { + font-size: 16px; + line-height: 36px; + padding-bottom: 30px; + } +} + +/* =Hero +-------------------------------------------------------------- */ +.hero { + display: block; + width: 100%; + /*background: url(../images/hero.jpg) no-repeat top;*/ + background-size: cover; +} + +.logo { + margin-bottom: 30px; +} + +.scroll-to { + position: absolute; + bottom: -200px; + display: none; + width: 60px; + height: 60px; + background: url(../images/arrow@2x.png) no-repeat center; + background-size: 60px 60px; + opacity: .5; + + -webkit-transition: all 0.3s ease-in-out; + -moz-transition: all 0.3s ease-in-out; + -ms-transition: all 0.3s ease-in-out; + -o-transition: all 0.3s ease-in-out; + transition: all 0.3s ease-in-out; + + /* Animation */ + -webkit-animation-name: bounce; + animation-name: bounce; + -webkit-transform-origin: center bottom; + transform-origin: center bottom; + + -webkit-animation: bounce 1.5s infinite; + -moz-animation: bounce 1.5s infinite; + -ms-animation: bounce 1.5s infinite; + -o-animation: bounce 1.5s infinite; + animation: bounce 1.5s infinite; +} + +.scroll-to:hover { + opacity: 1; +} + +/* Landscape Phones */ +@media only screen and (min-width : 480px) { + .logo { + margin-bottom: 10px; + } + + .hero h2 { + padding: 0; + margin-bottom: 10px; + } + + .hero h1 { + margin: 0; + padding: 0; + } +} + +/* Small Devices, Tablets */ +@media only screen and (min-width : 768px) { + .logo { + margin-bottom: 30px; + } + .scroll-to { + display: block; + } + .hero h2 { + padding-bottom: 20px; + margin-bottom: 10px; + } + + .hero h1 { + margin: 0; + padding: 0; + } +} + +/* =Animations +-------------------------------------------------------------- */ +@keyframes bounce { + 0%,100% { + -webkit-transform: translate3d(0,-30px,0); + transform: translate3d(0,-30px,0); + } + 50% { + -webkit-transform: translate3d(0,-4px,0); + transform: translate3d(0,-4px,0); + } +} + + +@keyframes fadeIn { + from { + opacity: 0; + transform: translate3d(0, -100%, 0); + } + + to { + opacity: 1; + transform: none; + } +} + +@keyframes fadeOut { + from { + opacity: 1; + } + + to { + transform: translate3d(0, -100%, 0); + opacity: 0; + } +} + + +/* =Responsive Styles +-------------------------------------------------------------- */ +/* Landscape Phones */ +@media only screen and (min-width : 480px) { + +} + +/* Small Devices, Tablets */ +@media only screen and (min-width : 768px) { + +} + +/* Medium Devices, Desktops */ +@media only screen and (min-width : 992px) { + +} + +/* Large Devices, Wide Screens */ +@media only screen and (min-width : 1200px) { + +} + +.highlight { + color: #ed3200; +} +html, +body, +.st-container, +.st-pusher, +.st-content { + height: 100%; +} + +.st-content { + background: #111111; +} + +.st-content, +.st-content-inner { + position: relative; +} + +.st-container { + position: relative; + overflow: hidden; +} + +.st-pusher { + position: relative; + left: 0; + z-index: 99; + height: 100%; + perspective: 1000px; + -webkit-transition: -webkit-transform 0.5s; + transition: transform 0.5s; +} + +.st-pusher::after { + position: absolute; + top: 0; + right: 0; + width: 0; + height: 0; + background: rgba(0,0,0,0.2); + content: ''; + opacity: 0; + -webkit-transition: opacity 0.5s, width 0.1s 0.5s, height 0.1s 0.5s; + transition: opacity 0.5s, width 0.1s 0.5s, height 0.1s 0.5s; +} + +.st-menu-open .st-pusher::after { + width: 100%; + height: 100%; + opacity: 1; + -webkit-transition: opacity 0.5s; + transition: opacity 0.5s; +} + +.st-menu { + position: absolute; + bottom: 0; + left: 0; + z-index: 100; + visibility: hidden; + width: 100%; + height: 100px; + background: #a6a6a6; + -webkit-transition: all 0.5s; + transition: all 0.5s; +} + +.st-menu::after { + position: absolute; + bottom: 0; + right: 0; + width: 100%; + height: 100%; + background: rgba(0,0,0,0.2); + content: ''; + opacity: 1; + -webkit-transition: opacity 0.5s; + transition: opacity 0.5s; +} + +.st-menu-open .st-menu::after { + width: 0; + height: 0; + opacity: 0; + -webkit-transition: opacity 0.5s, width 0.1s 0.5s, height 0.1s 0.5s; + transition: opacity 0.5s, width 0.1s 0.5s, height 0.1s 0.5s; +} + +/* Individual effects */ +/* Effect 4: Slide along */ +.st-effect-4.st-menu-open .st-pusher { + -webkit-transform: translate3d(0, -100px, 0); + transform: translate3d(0, -100px, 0); +} + +.st-effect-4.st-menu { + z-index: 1; +} + +.st-effect-4.st-menu-open .st-effect-4.st-menu { + visibility: visible; + -webkit-transition: -webkit-transform 0.5s; + transition: transform 0.5s; + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); +} + +.st-effect-4.st-menu::after { + display: none; +} + +/* Fallback example for browsers that don't support 3D transforms (and no JS fallback) */ +.no-csstransforms3d .st-pusher, +.no-js .st-pusher { + padding-bottom: 100px; +} \ No newline at end of file diff --git a/bower.json b/bower.json index 43ecf83..0368555 100755 --- a/bower.json +++ b/bower.json @@ -3,7 +3,8 @@ "private": true, "dependencies": { "bootstrap": "~3.3.5", - "modernizr": "~2.8.1" + "modernizr": "~2.8.1", + "classie": "^1.0.1" }, "overrides": { "bootstrap": {