diff --git a/demo/css/demo.css b/demo/css/demo.css index fbdbe75..d213887 100644 --- a/demo/css/demo.css +++ b/demo/css/demo.css @@ -19,7 +19,6 @@ body, p, h1, h2, h3 { } p, h1, h2 { - line-height: 1.3; text-shadow: 0 0 5px rgba(0, 0, 0, .6); width: 100%; } @@ -28,11 +27,12 @@ h1, h2 { font-size: 40px; font-size: 2.5rem; font-weight: 700; - margin-top: -5px; + line-height: 1; } h1 { - margin-bottom: 5px; + margin-bottom: 10px; + margin-top: -2px; } h2 { @@ -42,6 +42,9 @@ h2 { p { font-size: 20px; font-size: 1.25rem; + letter-spacing: 0; + letter-spacing: .02rem; + line-height: 1.3; margin-bottom: 20px; } p:last-child { @@ -51,6 +54,10 @@ p.p--credits { font-size: 14px; font-size: .9rem; } +p strong { + display: inline-block; + margin-bottom: 2px; +} a { color: #fff; @@ -132,6 +139,52 @@ a.a--no-weight { display: none; } +.arrow { + -webkit-animation: bounce 3s infinite; + animation: bounce 3s infinite; + bottom: -64px; + bottom: -4rem; + left: calc(50% - 19px); + position: absolute; + -webkit-transform: translateX(-50%); + -ms-transform: translateX(-50%); + transform: translateX(-50%); + transition: opacity 250ms ease-in-out; + width: 38px; +} +.arrow--hide { + opacity: 0; +} + +@-webkit-keyframes bounce { + 0%, 20%, 50%, 80%, 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + } + 40% { + -webkit-transform: translateY(-15px); + transform: translateY(-15px); + } + 60% { + -webkit-transform: translateY(-5px); + transform: translateY(-5px); + } +} + +@keyframes bounce { + 0%, 20%, 50%, 80%, 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + } + 40% { + -webkit-transform: translateY(-15px); + transform: translateY(-15px); + } + 60% { + -webkit-transform: translateY(-5px); + transform: translateY(-5px); + } +} @media screen and (max-width: 480px) { .hide-on-mobile { display: none; diff --git a/demo/css/demo.min.css b/demo/css/demo.min.css index 574f999..1b5e782 100644 --- a/demo/css/demo.min.css +++ b/demo/css/demo.min.css @@ -1 +1 @@ -*,:after,:before{box-sizing:border-box}body,html{height:100%;width:100%}body{font-family:'Source Sans Pro',helvetica,arial;font-size:18px;font-weight:300}body,h1,h2,h3,p{margin:0;padding:0}h1,h2,p{line-height:1.3;text-shadow:0 0 5px rgba(0,0,0,.6);width:100%}h1,h2{font-size:40px;font-size:2.5rem;font-weight:700;margin-top:-5px}h1{margin-bottom:5px}h2{margin-bottom:20px}p{font-size:20px;font-size:1.25rem;margin-bottom:20px}p:last-child{margin-bottom:0}p.p--credits{font-size:14px;font-size:.9rem}a{color:#fff;font-weight:700;text-decoration:none}a.a--no-weight{font-style:italic;font-weight:300}.container{-webkit-align-items:center;align-items:center;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0;padding:15px;position:relative;width:100%}.container--big{height:175vh}.container--full{height:100vh}.container--small{height:40vh}.container .content{background:rgba(0,0,0,.75);border-radius:8px;color:#fff;margin:0 auto;padding:30px 35px;text-align:center}.parallax__container{clip:rect(0,auto,auto,0);height:100%;left:0;overflow:hidden;position:absolute;top:0;width:100%;z-index:-100}.parallax__container .parallax{background-position:center;background-repeat:no-repeat;background-size:cover;position:fixed;top:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transform-style:preserve-3d;transform-style:preserve-3d;width:100%}.bg1{background-image:url(../img/bg1.jpg)}#bg3{background-image:url(../img/bg3.jpg)}.show-on-mobile--inline{display:none}@media screen and (max-width:480px){.hide-on-mobile{display:none}.show-on-mobile--inline{display:inline}} \ No newline at end of file +*,:after,:before{box-sizing:border-box}body,html{height:100%;width:100%}body{font-family:'Source Sans Pro',helvetica,arial;font-size:18px;font-weight:300}body,h1,h2,h3,p{margin:0;padding:0}h1,h2,p{text-shadow:0 0 5px rgba(0,0,0,.6);width:100%}h1,h2{font-size:40px;font-size:2.5rem;font-weight:700;line-height:1}h1{margin-bottom:10px;margin-top:-2px}h2{margin-bottom:20px}p{font-size:20px;font-size:1.25rem;letter-spacing:0;letter-spacing:.02rem;line-height:1.3;margin-bottom:20px}p:last-child{margin-bottom:0}p.p--credits{font-size:14px;font-size:.9rem}p strong{display:inline-block;margin-bottom:2px}a{color:#fff;font-weight:700;text-decoration:none}a.a--no-weight{font-style:italic;font-weight:300}.container{-webkit-align-items:center;align-items:center;display:-webkit-flex;display:-ms-flexbox;display:flex;-ms-flex-align:center;-webkit-flex-wrap:wrap;-ms-flex-wrap:wrap;flex-wrap:wrap;margin:0;padding:15px;position:relative;width:100%}.container--big{height:175vh}.container--full{height:100vh}.container--small{height:40vh}.container .content{background:rgba(0,0,0,.75);border-radius:8px;color:#fff;margin:0 auto;padding:30px 35px;text-align:center}.parallax__container{clip:rect(0,auto,auto,0);height:100%;left:0;overflow:hidden;position:absolute;top:0;width:100%;z-index:-100}.parallax__container .parallax{background-position:center;background-repeat:no-repeat;background-size:cover;position:fixed;top:0;-webkit-transform:translate3d(0,0,0);transform:translate3d(0,0,0);-webkit-transform-style:preserve-3d;transform-style:preserve-3d;width:100%}.bg1{background-image:url(../img/bg1.jpg)}#bg3{background-image:url(../img/bg3.jpg)}.show-on-mobile--inline{display:none}.arrow{-webkit-animation:bounce 3s infinite;animation:bounce 3s infinite;bottom:-64px;bottom:-4rem;left:calc(50% - 19px);position:absolute;-webkit-transform:translateX(-50%);-ms-transform:translateX(-50%);transform:translateX(-50%);transition:opacity 250ms ease-in-out;width:38px}.arrow--hide{opacity:0}@-webkit-keyframes bounce{0%,100%,20%,50%,80%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-15px);transform:translateY(-15px)}60%{-webkit-transform:translateY(-5px);transform:translateY(-5px)}}@keyframes bounce{0%,100%,20%,50%,80%{-webkit-transform:translateY(0);transform:translateY(0)}40%{-webkit-transform:translateY(-15px);transform:translateY(-15px)}60%{-webkit-transform:translateY(-5px);transform:translateY(-5px)}}@media screen and (max-width:480px){.hide-on-mobile{display:none}.show-on-mobile--inline{display:inline}} \ No newline at end of file diff --git a/demo/img/arrow-down.png b/demo/img/arrow-down.png new file mode 100644 index 0000000..93c085b Binary files /dev/null and b/demo/img/arrow-down.png differ diff --git a/demo/index.html b/demo/index.html index fda1293..492a310 100644 --- a/demo/index.html +++ b/demo/index.html @@ -13,7 +13,8 @@
-
+
+

Universal Parallax

A vanilla javascript plugin

@@ -21,14 +22,22 @@

Universal Parallax

-

Adapts to height

+
+

+ Adapts to height +
+ Displays 100% of BG regardless +

+

- Container bigger than the screen height? No sweat + Container going off screen? +
+ No sweat

@@ -38,18 +47,19 @@

Universal Parallax

Universal Parallax

- Scales to whatever height your container might be. + Automatically scales to the height of your container
- Check out npm or github for docs and download. + Check out npm or github for docs and download

- Photo credits in order of appearance from unsplash.com: + Photo credits in order of appearance from unsplash + :
Denys Nevozhai, Rohit Tandon,
James Donaldson, - James Connolly. + James Connolly

Find me on git @marrio-h

@@ -58,6 +68,7 @@

Universal Parallax

+