Skip to content

Commit

Permalink
Me blurring!
Browse files Browse the repository at this point in the history
  • Loading branch information
parkerbossier committed May 22, 2017
1 parent 870eb1b commit 2a50082
Show file tree
Hide file tree
Showing 8 changed files with 333 additions and 101 deletions.
81 changes: 17 additions & 64 deletions app/App.less
Expand Up @@ -16,74 +16,27 @@ body {
background: url('/img/mars.jpg');
background-size: cover;
background-repeat: no-repeat;
}

.Nav {
position: fixed;
top: 50px;
left: 50px;
background: fade(black, 50%);
padding: 30px;
color: @colorWhite;
}

li {
&:before {
content: '> ';
}
}
li + li {
margin-top: @gutterSmall;
}
label {
cursor: pointer;
}
input {
display: none;
}
input:checked + span {
font-weight: bold;
}

&:before,
&:after {
content: '';
position: absolute;
height: 10px;
left: -2px;
right: -2px;
border: 2px solid white;
}
&:before {
top: -2px;
border-bottom: none;
}
&:after {
bottom: -2px;
border-top: none;
}
strong {
font-weight: bold;
}

.ComingSoon {
position: relative;
background: fade(black, 50%);
padding: 30px;
color: @colorWhite;

&:before,
&:after {
content: '';
.App {
&-pages {
position: absolute;
height: 10px;
left: -2px;
right: -2px;
border: 2px solid white;
}
&:before {
top: -2px;
border-bottom: none;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
&:after {
bottom: -2px;
border-top: none;

&-photoCredit {
position: fixed;
bottom: 0;
right: 0;
font-size: 10px;
margin: @gutterSmall;
}
}
}
10 changes: 7 additions & 3 deletions app/App.ts
@@ -1,7 +1,11 @@
import './reset.less';

import { Nav } from './Nav';

import { Flightplan } from './Flightplan';
import './App.less';

new Nav($('.Nav'));
// reset the hash on load if applicable
if (window.location.hash === '#flightplan')
window.history.replaceState(null, document.title, '/');

const nav = new Nav($('.Nav'));
const filghtplan = new Flightplan($('.Flightplan'));
187 changes: 187 additions & 0 deletions app/Flightplan.less
@@ -0,0 +1,187 @@
@import (reference) './definitions.less';

@circleWidth: 450px;
@crossLength: 20px;
@crossThickness: 2px;
@ringBallMargin: 2px;
@ringBallSize: 16px;
@ringThickness: 6px;

.Flightplan {
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;

/* mars circle */
&-mars {
position: relative;
z-index: 1;
width: @circleWidth;
height: @circleWidth;
border-radius: 1000px;
overflow: hidden;
background: url('/img/orange-mars.jpg');
background-position: 14% 30%;
background-size: 1884px 1776px;
background-repeat: no-repeat;
display: flex;
flex-direction: column;
align-items: center;
}
&-marsReadout {
margin: 30px;
font-size: 12px;
opacity: .8;

&:first-child {
margin-bottom: 0;
}
&:last-child {
margin-top: 0;
}
td:nth-child(2n + 1) {
text-align: right;
}
td:nth-child(2) {
padding-right: 1.5em;
}
}
&-marsCrosses {
display: flex;
width: 60%;
justify-content: space-between;
opacity: .5;
margin: @gutter 0;
}
&-marsCross {
position: relative;
width: @crossLength;
height: @crossLength;

&:before,
&:after {
content: '';
position: absolute;
top: 50%;
left: 50%;
margin-top: -@crossThickness/2;
margin-left: -@crossLength/2;
width: 100%;
height: 2px;
background: white;
}
&:after {
transform: rotate(90deg);
}
}
&-marsBio {
margin: auto 0;
font-size: 20px;
line-height: 1.4;
}

/* me circle */
&-me {
position: relative;
width: @circleWidth;
height: @circleWidth;
border-radius: 1000px;
border: @ringThickness solid fade(@colorWhite, 50%);
display: flex;
align-items: center;
justify-content: center;
margin-left: -45px;
}
&-meImageWrapper {
position: relative;
width: 70%;
height: 70%;
border-radius: 1000px;
background-color: fade(@colorWhite, 50%);
}
&-meImage {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-image: url('/img/me.png');
background-size: 110%;
background-position: -50% bottom;
background-repeat: no-repeat;
pointer-events: none;
border-radius: 1000px;
}
&-meRing {
position: absolute;
top: 0%;
left: 0%;
width: 100%;
height: 100%;
transform: rotate(35deg);

&:after {
content: '';
position: absolute;
top: 0;
left: 50%;
margin-left: -@ringBallSize/2;
width: @ringBallSize;
height: @ringBallSize;
background: @colorWhite;
border-radius: 100px;
overflow: hidden;
}
}
&-meRingInner {
&:after {
margin-top: @ringBallMargin;
}
}
&-meRingOuter {
&:after {
margin-top: -@ringBallSize - @ringThickness - @ringBallMargin;
}
}

&-me--animateFocus &-meImage {
animation: 4s linear 5s meRingBlur;
}
&-me--animateFocus &-meRingOuter {
animation: 4s linear 5s meRingRotation;
}
}

@keyframes meRingBlur {
start {
filter: blur(0);
}
30% {
filter: blur(5px);
}
45% {
filter: blur(0);
}
60% {
filter: blur(3px);
}
end {
filter: blur(0);
}
}
@keyframes meRingRotation {
start {
transform: rotate(35deg);
}
30% {
transform: rotate(60deg);
}
60% {
transform: rotate(25deg);
}
end {
transform: rotate(35deg);
}
}
18 changes: 18 additions & 0 deletions app/Flightplan.ts
@@ -0,0 +1,18 @@
import './Flightplan.less';

export class Flightplan {
constructor(private element: JQuery) {
const animateClass = 'Flightplan-me--animateFocus';
const me = element.find('.Flightplan-me');
const outerRing = element.find('.Flightplan-meRingOuter');

outerRing.on('animationend', () => {
console.log('reset!');

me.removeClass(animateClass);
setTimeout(() => {
me.addClass(animateClass);
}, 0);
})
}
}
7 changes: 2 additions & 5 deletions app/Nav.less
Expand Up @@ -6,7 +6,6 @@
left: 50px;
background: fade(black, 50%);
padding: 14px 30px;
color: @colorWhite;

ul {
transition: opacity .2s ease, max-height .2s ease;
Expand All @@ -26,9 +25,6 @@
}
input[type=radio] {
display: none;
}
&-text {

}
input:checked + &-text {
font-weight: bold;
Expand Down Expand Up @@ -62,6 +58,8 @@

/* open/close */
&-toggle {
display: none !important;

position: absolute;
top: 5px;
right: 5px;
Expand All @@ -72,7 +70,6 @@
justify-content: center;
border: 1px solid @colorWhite;
background: none;
color: @colorWhite;
font-size: 16px;
cursor: pointer;
}
Expand Down
Binary file added img/me.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/orange-mars.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 2a50082

Please sign in to comment.