Monday, February 15, 2016

Typography Trends Designers Must Know in 2016 - #infographic

Typography Trend Predictions You Ought To Know

“Are you informed about what's in? Typography will only amplify this year. Designers will customize fonts, and use various creative techniques to enhance the overall beauty of their work. Many things of the past will return, such as retro, handwritten and serif fonts. Fonts will be modified and composed into anything. Possibilities are infinite and you must try them. Here's a list of typography trends you should catch on, to triumph the graphic and web design industry this year.”

by Irfan Ahmad via Digital Information World

dynamicColorPage – jQuery Plugin to Change Color of Your Page

dynamicColorPage is a jQuery plugin that lets user change the color style of your page dynamically.

The user got a small widget on the right handside, that can be used to change default color, and the appearance of the whole page will change.


by via jQuery-Plugins.net RSS Feed

Sending Emails with the Gmail JavaScript API

This article was peer reviewed by Simon Codrington. Thanks to all of SitePoint’s peer reviewers for making SitePoint content the best it can be!

In a previous article, I demonstrated how to build a basic Gmail inbox and message viewing app using the Gmail JavaScript API. Today I'm going to enhance that app with email sending capability using Gmail's powerful back-end. We'll end up with a customizable app which can display recent messages, allow the composition of new messages and allow us to reply to specific messages.

It's not necessary to have read the previous article to follow along with this one (although it will give you a deeper understanding of the subject matter). As ever, the complete source code for this article can be found on our GitHub repo (in the folder 02 - Sending mail).

Enabling the Gmail API on Your Google Account

[author_more]

The first step is to set up the Gmail API on your Google account. This will allow us to create applications which utilise Gmail functionality. Since we last looked at the Gmail API, Google have changed the user interface for the API management console — so here's a quick update on how to create the necessary Gmail API credentials.

Navigate to the Google Developer Console and create a project. Clicking Create will take us to the new project dashboard interface. From here we need to pop out the hamburger navigation menu and choose API Manager, then in the sidebar on the left we need to choose Credentials, before clicking on the New credentials button on the following page.

New credentials button

Now we need to create two sets of credentials: a browser API key and an OAuth client ID.

For the browser API key select API key then Browser key. On the following page we need only fill in the name field. However, for production I'd recommend adding a HTTP referrer (this will prevent abuse of our API key from non-authorized domains). Click Create and Google will generate an API key.

For the OAuth client ID, click once more on New credentials and select OAuth client ID. Select Web application as the application type and enter at least one authorized JavaScript origin. For a local development environment this will likely be http://localhost or similar. We do not need to enter an authorized redirect URI. Clicking Create will generate a client ID and client secret.

Once we've filled in the necessary fields we should be able to see our credentials back in the Credentials section. Keep this info open in a browser tab for the next step.

Initial Setup

Grab a Copy of the Code

Now that the API credentials are set up we should check out the source code of the existing demo application.

git clone git@github.com:sitepoint-editors/gmail-api-javascript-example.git

The folder 01 - Basic client contains the code from the previous article. This is what we're interested in.

Enter Our Credentials

And we should enter our credentials in index.html:

var clientId = 'xxxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com';
var apiKey = 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx';

Tweak the Authentication Scopes

Finally, we should tweak the authentication scopes. Previously we required read-only access to the users' Gmail account. However, sending an email requires further permissions. Modify the scopes variable definition in the index.html as follows (note that the scopes variable is a space-separated string):

var scopes =
  'http://ift.tt/1lIF7p7 '+
  'http://ift.tt/1Lqdzyj';

As mentioned in the previous article, it's always best practice to request the bare minimum permissions when working with someone else's data — especially something as sensitive as their email account. These two scopes are all we need for this application. Strangely there is a similarly named scope (compose) which allows much greater access than we require.

Test That It's Working

Navigate to http://localhost/gmail-api-javascript-example (or wherever you have placed your index.html file). If things have gone according to plan, the application should ask us for authorization. Once it's been authorized, we should see something like this:

Gmail demo app in action

Sending an Email

Now we've got the required permissions we can go ahead with the first step — tweaking the UI to add a compose button. This button will be positioned in the top right-hand corner of the interface (the pull-right Boostrap class helps with the positioning in this instance).

Compose button

<a href="#compose-modal"
   data-toggle="modal"
   id="compose-button"
   class="btn btn-primary pull-right hidden">Compose</a>

The compose button is not displayed on the interface by default. This is so that it only appears once the user has authenticated. To enable this functionality we need to remove the hidden class from the element at the same time as we remove the hidden class from the table which displays the inbox. This means that we should amend our handleAuthResult() function to add the following just after the loadGmailApi() call:

Continue reading %Sending Emails with the Gmail JavaScript API%


by Jamie Shields via SitePoint

Web Design Weekly #222

Headlines

Automatically art-directed responsive images

Eric Portis explains how you can automatically art direct responsive images by simply passing a few parameters to the Cloudinary API. I personally haven’t had a chance to have a play with the API but it does look mighty fine. Whilst we are on the topic of responsive images, Vitaly Friedman over on Smashing Magazine explored the landscape a little with a solid post which is also worth a read. (cloudinary.com)

Frontend database performance – Case study

Nolan Lawson built a webapp with a rich, interactive experience that’s every bit as compelling as a native app and explained his process. Great reading. (pocketjavascript.com)

Sponsor Web Design Weekly and reach 24,945 designers and developers

Articles

How to be Productive in React in a Week

If you have never dived into React but are keen to investigate this post by Sarah Drasner is a must read. (css-tricks.com)

Deep Dive into Grid Layout Placement

Manuel Casasnovas has gone all out and written a comprehensive review of the different methods provided by the CSS Grid Layout spec for positioning items. A word of warning, he gets into the nitty gritty. (igalia.com)

The `background-clip` Property

If you need to know anything about the `back-ground-clip’ property Ana Tudor has you covered. As always, Ana explores all aspects in great detail with a large selection of examples. (css-tricks.com)

The Status of the WordPress REST API

The WordPress REST API has been an extremely hot topic this week in the WordPress world and as always Brian Krogsgard has written an extensive post on the topic. (poststatus.com)

Tools / Resources

An Introduction to PostCSS

PostCSS has been around for quite a few years now but seems to have gained a lot of traction during the last couple. With a large selection of plugins now (over 200) it’s a great time to experiment and this post is a great starting point. (sitepoint.com)

React Router Tutorial

A collection of small lessons for getting up-to-speed with the React Router by Ryan Florence. (github.com)

Bulma

A modern CSS framework based on Flexbox. (bulma.io)

CSS Best Practices – Slide Deck (inkedblade.net)

CSS Gradient Animator (gradient-animator.com)

Useful Sketch Tips (medium.com)

Inspiration

The State of Information Visualization, 2016 (eagereyes.org)

A UX Designer’s Review of iPad Pro (medium.com)

Why I work remotely (signalvnoise.com)

Jobs

Senior Front End Developer at Shopify

At Shopify we have one of the largest front end architectures in the world, and our front end development team works on making our client side scalable, approachable, and an exceptional experience for over 150,000 shop owners across the world. If this sounds interesting you should get in contact. (shopify.com)

Frontend Developer at KISSmetrics

Do you love building interactive interfaces? Love making reusable UI components
that are well unit tested and can be reused across an app? Do you know the ins
and outs of JavaScript? (kissmetrics.com)

Have a web related job you need to fill?

Last but not least…

Ethical Web Development

As web developers, we are responsible for shaping the experiences of user’s online lives. By making choices that are ethical and user-centered, we create a better web for everyone. These open source principles aim to guide those decisions. (ethicalweb.org)

Git Blame Someone Else (github.com)

The post Web Design Weekly #222 appeared first on Web Design Weekly.


by Jake Bresnehan via Web Design Weekly

Sourcehunt Design: February – Make Your Mark

Sourcehunt

After launching Sourcehunt Design last month, we are excited to bring you 5 new open source projects which could use a helping design hand. Right on time for Valentine's Day, share some love by donating some time to the following projects.

There are some big name source projects this month, so having any of them on your resume will no doubt look impressive. We've selected some more established open source projects, so directions might be a bit more concrete now than in the last Sourcehunt edition.

This month we've selected some long-established open source projects, so expect mature systems and experienced project management.

As always, check out the GitHub guides in case you are stuck with GitHub issues (although it should be pretty straightforward).

Etherpad

Ethernet

Etherpad allows you to edit documents collaboratively in real-time, much like a live multi-player editor that runs in your browser. Write articles, press releases, to-do lists, etc. together with others, all working on the same document at the same time.

All instances provide access to your data through a well-documented API and supports import/export to many major data exchange formats. And if the built-in feature set isn't enough for you, there's tons of plugins that allow you to customize your instance to suit your needs.

While Etherpad has no pressing need for critical design decisions, there are some important issues related to UI and UX on GitHub. While Etherpad is a thoroughly useful tool, there's arguably room to make it more aesthetically satisfying. If you agree, feel free to file issues or contact the developers.

Osmand

Open Source Mobile Mapping

OsmAnd (OSM Automated Navigation Directions) is a map and navigation application with access to the free, worldwide, and high-quality OpenStreetMap (OSM) data. Equipped with a voice and optical navigator, the ability to view POIs (points of interest), manage GPX tracks and much more.

It is currently the world's most popular open source map app for mobile, so contributing to it has pay off in valuable street cred. OsmAnd has recently updated their UI for Android going for a more Material Design-style, however it offers a lot of room for improvement. A perfect first task to work on if you want to get involved. Here is an example where you can contribute with some icons for the UI.

I2P

I2P

I2P is an anonymous overlay network - a network within a network. It is intended to protect communication from dragnet surveillance and monitoring by third parties such as ISPs. I2P is used by many people who care about their privacy: activists, oppressed people, journalists and whistleblowers, as well as the average person.

No network can be "perfectly anonymous". The continued goal of I2P is to make attacks more and more difficult to mount. Its anonymity will get stronger as the size of the network increases and with ongoing academic review. As of now, I2P is available on desktops, embedded systems (like the Raspberry Pi) and Android phones.

On first sight, the entry level barrier to contribute with design in I2P might look pretty difficult, however once mingled in with the community, their design needs surface pretty quickly. I2P is looking to give its website a refresh, so if you are interested to give it a try, feel free to reach out to the team.

VLC

3-002

VLC is a free and open source cross-platform multimedia player and framework that plays most common multimedia formats from DVDs to Audio CDs to VCDs and various streaming protocols.

As one of the most used multimedia players (if not the most used), VLC prides itself as one of the most successful open source/free software projects in this age of capitalism. I personally cite it as one of my favorite examples when arguing the merits of open source software.

VLC is also open for design contributions. You can contribute with VLC skins to the actual software, which can be a great learning curve. You can also contribute with Icons and Promotional Design, check out the Design page. Design improvements to the VLC website are also very valuable, so reach out to the VLC folks on the forum to get involved.

VLC is not actively present on GitHub, but you can check their bug tracker to file or follow issues.

Continue reading %Sourcehunt Design: February – Make Your Mark%


by Elio Qoshi via SitePoint

How to Connect Your Api.ai Assistant to the IoT

The potential of a personal assistant gets exciting when it has access to personal data and the real world via the Internet of Things. New possibilities arise — from requesting your assistant turn on your lights to asking it how well you slept. We will be connecting our Api.ai assistant to the Jawbone Up API as an example of this.

What You'll Need

This article builds upon a variety of concepts we've already covered in previous articles here at SitePoint. In order to follow along with this tutorial comfortably, you'll need the following.

  • An Api.ai agent connected to a simple HTML web app - See this article if you'd like to understand this process, otherwise, you can download the code from this guide and use it too.
  • An agent that has been taught the entity of "sleep" - We created this in Empowering Your Api.ai Assistant with Entities. It should understand concepts like "how much sleep did I have last night?" and "how much REM sleep did I get?". If you're looking to adapt this to your own IoT device, you'll need to have created your own custom entity that understands your IoT functionality.
  • A general knowledge of Node.js and running a Node server - Without it, you won't be able to get the server running!
  • Knowledge of how to use the Jawbone UP API (or another API you intend to use) - We've covered the Jawbone Up API previously in Connecting to the Jawbone Up API with Node.js and will be referring to sections from that article throughout.
  • An SSL certificate to run your site on HTTPS - You'll need this if working with the Jawbone Up API. We cover how to set up a self signed certificate on the Jawbone Up API article.

The Code

All code for this demo is available for you to download and use however you please! You can find it all on GitHub.

How This Works

Our Api.ai assistant is already connected to a simple web app that accepts statements via the HTML5 Speech Recognition API. From here, we need to add a new bit of functionality that listens for a specific action from our Api.ai agent. In our case, this is the action of "sleepHours".

Whenever our JavaScript detects this action, it triggers a separate call to our Node.js app to ask the Jawbone API for that data. Once the web app receives this data, our web app turns it into a nice sentence and reads it out — giving our assistant a whole new range of intelligence!

Our Project Structure

I've adjusted the app from the initial HTML-only structure to one which uses EJS views so that we can switch pages in our web app when logging into the Jawbone Up API via OAuth. In reality, we only really have one page but this method allows us to add more in future if needed for other IoT devices. This single view is at /views/index.ejs. We then have our Node server in the root folder as server.js and certificate files in root too. To keep things relatively simple and contained, all front-end JavaScript and CSS is inline. Feel free to move these into CSS and JS files as you prefer, minify them and make them pretty.

Our file structure

Responding to Api.ai Actions in JavaScript

As you might remember from our previous article, when Api.ai returns a response, it provides a JSON object that looks like so:

[code language="js"]
{
"id": "6b42eb42-0ad2-4bab-b7ea-853773b90219",
"timestamp": "2016-02-12T01:25:09.173Z",
"result": {
"source": "agent",
"resolvedQuery": "how did I sleep last night",
"speech": "I'll retrieve your sleep stats for you now, one moment!",
"action": "sleepHours",
"parameters": {
"sleep": "sleep"
},
"metadata": {
"intentId": "25d04dfc-c90c-4f55-a7bd-6681e83b45ec",
"inputContexts": [],
"outputContexts": [],
"contexts": [],
"intentName": "How many hours of @sleep:sleep did I get last night?"
}
},
"status": {
"code": 200,
"errorType": "success"
}
}
[/code]

Within that JSON object there are two bits of data we need to use — action and parameters.sleep:

[code language="js"]
"action": "sleepHours",
"parameters": {
"sleep": "sleep"
},
[/code]

action is the name we gave to the Api.ai action which the user has triggered. In the case of our sleep example, we named it "sleepHours". parameters contain the variables in our sentence that can change a few details. In the case of sleep, our parameter tells us what type of sleep – "sleep", "deep sleep", "light sleep" or "REM sleep" (or just "REM").

Initially, in our early article on Api.ai, our prepareResponse() function took the JSON response from Api.ai, put the whole thing into our debug text field on the bottom right and took out Api.ai's verbal response to display in the web app. We completely relied on what our Api.ai agent said, without adding any of our own functionality:

[code language="js"]
function prepareResponse(val) {
var debugJSON = JSON.stringify(val, undefined, 2),
spokenResponse = val.result.speech;

respond(spokenResponse);
debugRespond(debugJSON);
}
[/code]

This time around, we keep an eye out for the action field and run our own function called requestSleepData() if it the action contains "sleepHours". Within this function, we pass in the sleep parameter so we know what type of sleep is being requested:

[code language="js"]
function prepareResponse(val) {
var debugJSON = JSON.stringify(val, undefined, 2),
spokenResponse = val.result.speech;

if (val.result.action == "sleepHours") {
requestSleepData(val.result.parameters.sleep);
} else {
respond(spokenResponse);
}

debugRespond(debugJSON);
}
[/code]

Within requestSleepData(), we request all sleep data from our Node.js server and then filter it by looking at the very first value in the returned array of data (data.items[0].details) — this would be last night's sleep. Within these details, we have data.items[0].details.rem with our REM sleep, data.items[0].details.sound with our deep sleep, data.items[0].details.light with our light sleep and data.items[0].details.duration with the combined amount of sleep recorded:

[code language="js"]
function requestSleepData(type) {
$.ajax({
type: "GET",
url: "/sleep_data/",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data) {
console.log("Sleep data!", data);

if (data.error) {
respond(data.error);
window.location.replace("/login/jawbone");
}

switch (type) {
case "REM sleep":
respond("You had " + toHours(data.items[0].details.rem) + " of REM sleep.");
break;
case "deep sleep":
respond("You had " + toHours(data.items[0].details.sound) + " of deep sleep.");
break;
case "light sleep":
respond("You had " + toHours(data.items[0].details.light) + " of light sleep.");
break;
case "sleep":
respond("You had " + toHours(data.items[0].details.duration) + " of sleep last night. That includes " + toHours(data.items[0].details.rem) + " of REM sleep, " + toHours(data.items[0].details.sound) + " of deep sleep and " + toHours(data.items[0].details.light) + " of light sleep.");
break;
}
},
error: function() {
respond(messageInternalError);
}
});
}
[/code]

Continue reading %How to Connect Your Api.ai Assistant to the IoT%


by Patrick Catanzariti via SitePoint

Plastics Unlimited

Plastics Unlimited

One Pager for 'Plastics Unlimited' built on WordPress that utilises the SEO friendly pushState method. Not the most "designy" site but the build is quite solid when you dive deeper. That team slider with email info plus their phone extensions is a quite a neat feature for a bigger company. Good to see more Single Page websites in the industrial and manufacturing sector.

by Rob Hope via One Page Love