From 713d332f0334f80c9668b0ffefaf06f2b6e19c07 Mon Sep 17 00:00:00 2001 From: Chuck Dries Date: Thu, 13 Apr 2017 10:08:00 -0700 Subject: [PATCH] CSS Animations --- css/style.css | 122 +++++++++++++++++++++++++++++++++++++++++++ index.html | 19 +++---- sass/animations.scss | 66 +++++++++++++++++++++++ sass/responsive.scss | 2 +- sass/style.scss | 6 +++ 5 files changed, 205 insertions(+), 10 deletions(-) create mode 100644 sass/animations.scss diff --git a/css/style.css b/css/style.css index cd3fca3..0b25ad8 100644 --- a/css/style.css +++ b/css/style.css @@ -1,3 +1,119 @@ +@-webkit-keyframes fadeIn { + 0% { + -moz-opacity: 0; + -webkit-opacity: 0; + -o-opacity: 0; + opacity: 0; + -moz-transform: translate(0, 10vh); + -webkit-transform: translate(0, 10vh); + -o-transform: translate(0, 10vh); + transform: translate(0, 10vh); } + 20% { + -moz-opacity: 0; + -webkit-opacity: 0; + -o-opacity: 0; + opacity: 0; + -moz-transform: translate(0, 10vh); + -webkit-transform: translate(0, 10vh); + -o-transform: translate(0, 10vh); + transform: translate(0, 10vh); } + 100% { + -moz-opacity: 1; + -webkit-opacity: 1; + -o-opacity: 1; + opacity: 1; + -moz-transform: none; + -webkit-transform: none; + -o-transform: none; + transform: none; } } + +@-moz-keyframes fadeIn { + 0% { + -moz-opacity: 0; + -webkit-opacity: 0; + -o-opacity: 0; + opacity: 0; + -moz-transform: translate(0, 10vh); + -webkit-transform: translate(0, 10vh); + -o-transform: translate(0, 10vh); + transform: translate(0, 10vh); } + 20% { + -moz-opacity: 0; + -webkit-opacity: 0; + -o-opacity: 0; + opacity: 0; + -moz-transform: translate(0, 10vh); + -webkit-transform: translate(0, 10vh); + -o-transform: translate(0, 10vh); + transform: translate(0, 10vh); } + 100% { + -moz-opacity: 1; + -webkit-opacity: 1; + -o-opacity: 1; + opacity: 1; + -moz-transform: none; + -webkit-transform: none; + -o-transform: none; + transform: none; } } + +@-o-keyframes fadeIn { + 0% { + -moz-opacity: 0; + -webkit-opacity: 0; + -o-opacity: 0; + opacity: 0; + -moz-transform: translate(0, 10vh); + -webkit-transform: translate(0, 10vh); + -o-transform: translate(0, 10vh); + transform: translate(0, 10vh); } + 20% { + -moz-opacity: 0; + -webkit-opacity: 0; + -o-opacity: 0; + opacity: 0; + -moz-transform: translate(0, 10vh); + -webkit-transform: translate(0, 10vh); + -o-transform: translate(0, 10vh); + transform: translate(0, 10vh); } + 100% { + -moz-opacity: 1; + -webkit-opacity: 1; + -o-opacity: 1; + opacity: 1; + -moz-transform: none; + -webkit-transform: none; + -o-transform: none; + transform: none; } } + +@keyframes fadeIn { + 0% { + -moz-opacity: 0; + -webkit-opacity: 0; + -o-opacity: 0; + opacity: 0; + -moz-transform: translate(0, 10vh); + -webkit-transform: translate(0, 10vh); + -o-transform: translate(0, 10vh); + transform: translate(0, 10vh); } + 20% { + -moz-opacity: 0; + -webkit-opacity: 0; + -o-opacity: 0; + opacity: 0; + -moz-transform: translate(0, 10vh); + -webkit-transform: translate(0, 10vh); + -o-transform: translate(0, 10vh); + transform: translate(0, 10vh); } + 100% { + -moz-opacity: 1; + -webkit-opacity: 1; + -o-opacity: 1; + opacity: 1; + -moz-transform: none; + -webkit-transform: none; + -o-transform: none; + transform: none; } } + .reset, body, .slide, .slide div .project .details h2, .slide div .project .details p, .slide div .project .details .award div p { padding: 0; margin: 0; @@ -195,6 +311,12 @@ body { font-style: italic; font-weight: normal; } +#scrollprompt { + -moz-animation: 2s ease fadeIn; + -webkit-animation: 2s ease fadeIn; + -o-animation: 2s ease fadeIn; + animation: 2s ease fadeIn; } + @media (max-width: 800px) { #mast { padding-left: 1em; } } diff --git a/index.html b/index.html index a893c8c..ec988b4 100644 --- a/index.html +++ b/index.html @@ -43,7 +43,7 @@ Resume [pdf] / Blog

-

Scroll down!

+

Scroll down!

@@ -52,7 +52,7 @@
-

About Me (Why I rock)

+

About Me Why I rock

A brief history of Chuck & tech

When I was a child I was obsessed with trains and vacuum cleaners. In elementary school my grandma tried to teach me Photoshop. In seventh grade I started teaching myself HTML. Freshman year I started learning the basics of networking and BASH so I could run a Minecraft server on my sparkly new iMac. In the first half of high school I volunteered at Phoenix Children's Hospital and in the second half I taught robotics at The Waybright Academy. On top of that, I was active throughout @@ -127,7 +127,7 @@

-

Projects & Experience

+

Projects & Experience Things I've made: filter by clicking the bar above.

@@ -184,9 +184,10 @@ diff --git a/sass/animations.scss b/sass/animations.scss new file mode 100644 index 0000000..de1f465 --- /dev/null +++ b/sass/animations.scss @@ -0,0 +1,66 @@ +$prefixes: ("-moz-", "-webkit-", "-o-", ""); +@mixin prefix($property, $value) { + @each $prefix in $prefixes { + #{$prefix + $property}: $value; + } +} + +// @mixin keyframePrefix($name) { +// @each $prefix in $prefixes { +// \@#{$prefix}keyframes #{$name} { +// @content; +// } +// } +// } +@mixin keyframePrefix($name) { + @-webkit-keyframes #{$name} { + @content; + } + @-moz-keyframes #{$name} { + @content; + } + @-o-keyframes #{$name} { + @content; + } + @keyframes #{$name} { + @content; + } +} + +@include keyframePrefix(fadeIn) { + 0% { + @include prefix(opacity, 0); + @include prefix(transform, translate(0, 10vh)); + } + 20% { + @include prefix(opacity, 0); + @include prefix(transform, translate(0, 10vh)); + } + 100% { + @include prefix(opacity, 1); + @include prefix(transform, none); + } +} + +// @include keyframePrefix("prompt") { +// from, +// 20%, +// 53%, +// 80%, +// to { +// @include prefix(animation-timing-function, cubic-bezier(0.215, 0.610, 0.355, 1.000)); +// @include prefix(transform, translate(0, 0)); +// } +// 40%, +// 43% { +// @include prefix(animation-timing-function, cubic-bezier(0.755, 0.050, 0.855, 0.060)); +// @include prefix(transform, translate(0, -20px)); +// } +// 70% { +// @include prefix(animation-timing-function, cubic-bezier(0.755, 0.050, 0.855, 0.060)); +// @include prefix(transform, translate(0, -10px)); +// } +// 90% { +// @include prefix(transform, translate(0, -2px)); +// } +// } \ No newline at end of file diff --git a/sass/responsive.scss b/sass/responsive.scss index da5175a..c3bcfbe 100644 --- a/sass/responsive.scss +++ b/sass/responsive.scss @@ -1,5 +1,5 @@ @mixin respond-to($breakpoint) { - @media (max-width: $width) { + @media (max-width: $breakpoint) { @content; } } diff --git a/sass/style.scss b/sass/style.scss index 8378b69..c52f330 100644 --- a/sass/style.scss +++ b/sass/style.scss @@ -1,5 +1,6 @@ //setup @import 'responsive'; +@import 'animations'; $width: 800px; $grey: #ccc; $pink: #ed1a76; @@ -259,6 +260,11 @@ body { font-weight: normal; } +#scrollprompt { + // @include prefix(animation, 1s 1.1s 1 prompt) + @include prefix(animation, 2s ease fadeIn) +} + @include respond-to($width) { #mast { padding-left: 1em;