From 77e10d9a8f73ae95dc798450b97736ba1330d01b Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Mon, 29 May 2017 16:32:03 +0200 Subject: [PATCH] Meetup (#127) * add meetup link to community page * all social data as array * add next meetup link to hero, grab data from Meetup API * community bar style tweaks --- _config.yml | 35 ++++++++++----- _src/_assets/images/meetup.svg | 3 ++ _src/_assets/javascripts/bigchain/meetup.js | 33 ++++++++++++++ _src/_assets/javascripts/page-front.js | 1 + _src/_assets/styles/_page-community.scss | 8 ++++ _src/_assets/styles/bigchain/_hero.scss | 12 ++++- _src/_includes/hero.html | 14 ++++-- _src/community.html | 49 +++++---------------- 8 files changed, 101 insertions(+), 54 deletions(-) create mode 100644 _src/_assets/images/meetup.svg create mode 100644 _src/_assets/javascripts/bigchain/meetup.js diff --git a/_config.yml b/_config.yml index 43e86b1..7990276 100644 --- a/_config.yml +++ b/_config.yml @@ -12,17 +12,30 @@ email: cla_cc: sylvain@bigchaindb.com enterprise: ikytz6br@robot.zapier.com -twitter: BigchainDB -facebook: BigchainDB -github: - org: bigchaindb - repo: bigchaindb -medium: the-bigchaindb-blog -googlegroup: bigchaindb -gitter: bigchaindb/bigchaindb -disqus: bigchain -linkedin: bigchaindb -youtube: UCh0Y3p3kJ9oyz9CRgZaO05w +social: + gitter: + title: Gitter + url: https://gitter.im/bigchaindb/bigchaindb + github: + title: GitHub + url: https://github.com/bigchaindb + org: bigchaindb + repo: bigchaindb + twitter: + title: Twitter + url: https://twitter.com/bigchaindb + medium: + title: Blog + url: https://blog.bigchaindb.com + meetup: + title: Meetup + url: https://www.meetup.com/BigchainDB-IPDB-Meetup + linkedin: + title: LinkedIn + url: https://www.linkedin.com/company/bigchaindb + youtube: + title: YouTube + url: https://www.youtube.com/channel/UCh0Y3p3kJ9oyz9CRgZaO05w address: company: BigchainDB GmbH diff --git a/_src/_assets/images/meetup.svg b/_src/_assets/images/meetup.svg new file mode 100644 index 0000000..c4fbfdd --- /dev/null +++ b/_src/_assets/images/meetup.svg @@ -0,0 +1,3 @@ + + + diff --git a/_src/_assets/javascripts/bigchain/meetup.js b/_src/_assets/javascripts/bigchain/meetup.js new file mode 100644 index 0000000..62075ce --- /dev/null +++ b/_src/_assets/javascripts/bigchain/meetup.js @@ -0,0 +1,33 @@ +//require whatwg-fetch/fetch.js + +document.addEventListener('DOMContentLoaded', function() { + + const url = 'https://bigchaindb-meetups.now.sh' + + function injectData(data) { + const events = data + + // just grab the first item of array + const nextEvent = events[0] + const name = nextEvent.name + const link = nextEvent.link + const date = new Date(nextEvent.time).toLocaleDateString('en-us', { month: 'short', day: 'numeric' }) + const element = document.getElementsByClassName('js-social-link--meetup')[0] + const elementTitle = document.getElementsByClassName('meetup-title')[0] + + elementTitle.innerHTML = '' + date + ' ' + '' + name + '' + elementTitle.style.opacity = 1 + element.href = link + } + + fetch(url) + .then(function(response) { + return response.json() + }) + .then(function(data) { + injectData(data) + }) + .catch(function(error) { + console.log(error) + }) +}) diff --git a/_src/_assets/javascripts/page-front.js b/_src/_assets/javascripts/page-front.js index 69862c9..6d6e134 100644 --- a/_src/_assets/javascripts/page-front.js +++ b/_src/_assets/javascripts/page-front.js @@ -2,6 +2,7 @@ //=include bigchain/testimonials.js //=include bigchain/smoothscroll.js //=include bigchain/github.js +//=include bigchain/meetup.js jQuery(function($) { diff --git a/_src/_assets/styles/_page-community.scss b/_src/_assets/styles/_page-community.scss index dc5ed71..7e69df3 100644 --- a/_src/_assets/styles/_page-community.scss +++ b/_src/_assets/styles/_page-community.scss @@ -34,6 +34,7 @@ @include transition; } + display: inline-block; box-shadow: none; padding: $btn-padding-y-sm $btn-padding-x-sm; @@ -72,6 +73,13 @@ } } } + + .social-link__title { + @include text-small; + color: $brand-primary; + display: block; + text-align: center; + } } .text-milestones { diff --git a/_src/_assets/styles/bigchain/_hero.scss b/_src/_assets/styles/bigchain/_hero.scss index c5f4e6c..c2fd23a 100644 --- a/_src/_assets/styles/bigchain/_hero.scss +++ b/_src/_assets/styles/bigchain/_hero.scss @@ -141,12 +141,17 @@ $menu-height-md: 66px; } .stars, - .release { + .release, + .meetup-title { display: inline-block; opacity: 0; transition: opacity .2s ease-out; } + strong { + font-weight: $font-weight-normal; + } + .stars { font-size: .6rem; background: rgba($brand-main-gray-lighter, .15); @@ -158,11 +163,14 @@ $menu-height-md: 66px; } .release { - @include text-bold; min-width: 44px; } } +.hero__community__label { + opacity: .5; +} + .hero__more { position: relative; diff --git a/_src/_includes/hero.html b/_src/_includes/hero.html index cb02195..e57c0d9 100644 --- a/_src/_includes/hero.html +++ b/_src/_includes/hero.html @@ -10,22 +10,28 @@ diff --git a/_src/community.html b/_src/community.html index ea1fe49..740b203 100644 --- a/_src/community.html +++ b/_src/community.html @@ -16,49 +16,24 @@ quotes: set3

There are many ways you can contribute to the BigchainDB project, some very easy and others more involved. We welcome all potential contributors, so we ask that everyone participating abide by some simple guidelines.

- Read The Guidelines + Read The Guidelines