From 5e57c9caae15c0e34e10d1c5854cc41d0d51c65c Mon Sep 17 00:00:00 2001 From: Tom Raithel Date: Thu, 23 Feb 2017 22:12:43 +0100 Subject: [PATCH] Nice animation for logo link --- assets/icons/back.svg | 11 +----- js/components/Footer.js | 2 +- js/components/Header.js | 9 +++-- js/components/LogoLink.js | 17 +++++++++ styles/components/branding.css | 4 +-- styles/components/logo-link.css | 63 +++++++++++++++++++++++++++++++++ tasks/watch.js | 1 + 7 files changed, 91 insertions(+), 16 deletions(-) create mode 100644 js/components/LogoLink.js create mode 100644 styles/components/logo-link.css diff --git a/assets/icons/back.svg b/assets/icons/back.svg index b3aabe3..26623d3 100644 --- a/assets/icons/back.svg +++ b/assets/icons/back.svg @@ -1,10 +1 @@ - - - - Combined Shape - Created with Sketch. - - - - - \ No newline at end of file + \ No newline at end of file diff --git a/js/components/Footer.js b/js/components/Footer.js index 1eb1ccb..e30f57a 100644 --- a/js/components/Footer.js +++ b/js/components/Footer.js @@ -9,7 +9,7 @@ export default function Footer({ items, pageName }) { return ( } + logoContent={} > AOE is a leading provider of Enterprise Open Source web solutions. diff --git a/js/components/Header.js b/js/components/Header.js index 0626ca3..cf23918 100644 --- a/js/components/Header.js +++ b/js/components/Header.js @@ -1,11 +1,16 @@ import React from 'react'; import Branding from './Branding'; import Link from './Link'; +import LogoLink from './LogoLink'; +import { getItemPageNames } from '../../common/config'; + +export default function Header({ pageName }) { + + const smallLogo = pageName !== 'index'; -export default function Header() { return ( } + logoContent={} >
diff --git a/js/components/LogoLink.js b/js/components/LogoLink.js new file mode 100644 index 0000000..2e28b60 --- /dev/null +++ b/js/components/LogoLink.js @@ -0,0 +1,17 @@ +import React from 'react'; +import classNames from 'classnames'; +import Link from './Link'; + +export default function LogoLink({ small=false }) { + return ( + + + + + + Technology Radar + + + + ); +} diff --git a/styles/components/branding.css b/styles/components/branding.css index 880a58b..ebee26d 100644 --- a/styles/components/branding.css +++ b/styles/components/branding.css @@ -12,9 +12,7 @@ &__logo { flex: 0 0 200px; & img { - display: block; - width: 150px; - height: 60px; + display: inline-block; } } diff --git a/styles/components/logo-link.css b/styles/components/logo-link.css new file mode 100644 index 0000000..9133a44 --- /dev/null +++ b/styles/components/logo-link.css @@ -0,0 +1,63 @@ +.logo-link { + display: inline-block; + transition: 200ms all ease-out; + width: 400px; + color: var(--color-white); + text-decoration: none; + position: relative; + + &__slide { + transition: 400ms all cubic-bezier(0.54, 0, 0.28, 1); + display: block; + position: relative; + } + + &__icon { + transition: 400ms opacity ease-out; + position: absolute; + top: 50%; + transform: translateY(-50%); + opacity: 0; + } + + &__img { + transition: 400ms all cubic-bezier(0.54, 0, 0.28, 1); + } + + &__text { + transition: 400ms all cubic-bezier(0.54, 0, 0.28, 1); + position: absolute; + top: 50%; + left: 130px; + white-space: nowrap; + font-size: 18px; + line-height: 1; + margin-top: -1px; + transform: translateY(-50%); + opacity: 0; + } + + &--small { + .logo-link__img { + transform: scale(0.55); + } + + .logo-link__text { + opacity: 0.8; + } + + .logo-link__slide { + transform: translateX(-32px); + } + + &:hover { + .logo-link__icon { + opacity: 1; + } + + .logo-link__slide { + transform: translateX(0); + } + } + } +} diff --git a/tasks/watch.js b/tasks/watch.js index e53de63..2aa5a61 100644 --- a/tasks/watch.js +++ b/tasks/watch.js @@ -33,6 +33,7 @@ runBuild('all'); watch(stylesPath(), options, watchBuild('css')); watch(jsPath(), options, watchBuild('js')); +watch(jsPath(), options, watchBuild('pages')); watch(assetsPath(), options, watchBuild('assets')); watch(radarPath(), options, watchBuild('pages'));