Tuesday, July 25, 2017

0 days off

"How do we live a full life?" Discover the story of Edward Stevenson's fight against chronic pain. This experience introduces his book about the keys to better living.
by via Awwwards - Sites of the day

Monday, July 24, 2017

Why do you need to analyse your website right away?

Owning a website is not easy as it is important to maintain its proliferation. This is why website owners find that it is necessary to do a website analysis. What is Web Analytics?But before digging into the tools, let's start with what exactly web analytics is. First, it measures the...

[ This is a content summary only. Visit our website http://ift.tt/1b4YgHQ for full links, other content, and more! ]

by DIW via Digital Information World

How to Bundle a Simple Static Site Using Webpack

Webpack is all the rage right now. It has over 30,000 stars on GitHub and has been embraced by some of the big guns in the JavaScript world, such as the React and Angular.

However, you don't need to be working on a large-scale project to take advantage of Webpack. Webpack is primarily a bundler, and as such you can also use it to bundle just about any resource or asset you care to think of.

In this article, I'm going to show you how to install and configure Webpack, then use it to create a minified bundle for a simple static site with a handful of assets.

But Why Would You Want to Do That?

Good question. Glad you asked!

One of the primary reasons for doing this is to minimize the number of HTTP requests you make to the server. As the average web page grows, you'll likely include jQuery, a couple of fonts, a few plugins, as well as various style sheets and some JavaScript of your own. If you're making a network request for each of these assets, things soon add up and your page can become sluggish. If you include all of the above in one bundle however, that problem disappears.

Webpack also makes it easy to minify your code, further reducing its size, and it lets you write your assets in whatever flavor you desire. For example, in this article I will demonstrate how to have Webpack transpile ES6 to ES5. This means you can write JavaScript using the latest, most up-to-date syntax (although this might not be fully supported yet), then serve the browsers ES5 that will run almost everywhere.

And finally, it's a fun learning exercise. Whether or not you employ any of these techniques in your own projects is up to you, but by following along you'll get a firm understanding of what Webpack does, how it does it and whether it's a good fit for you.

Getting up and Running

The first thing you'll need is to have Node and npm installed on your computer. If you haven't got Node yet, you can either download it from the Node website, or you can download and install it with the aid of a version manager. Personally, I much prefer this second method, as it allows you to switch between multiple versions of Node and it negates a bunch of permissions errors, which might otherwise see you installing Node packages with admin rights.

We'll also need a skeleton project to work with. Here's one I made earlier. To get it running on your machine, you should clone the project from GitHub and install the dependencies.

git clone http://ift.tt/2vTrmMD
cd webpack-static-site-example
npm i

This will install Slick Slider and Lightbox2 — two plugins we'll be using on the site — to a node_modules folder in the root of the project.

After that you can open index.html in your browser and navigate the site. You should see something like this:

Our static site

If you need any help getting with any of the steps above, why not head over to our forums and post a question.

Introducing Webpack to the Project

The next thing we'll need to do is to install Webpack. We can do this with the following command:

npm i webpack --save-dev

This will install Webpack and add it as a devDependency to your package.json file:

"devDependencies": {
  "webpack": "^3.2.0"
}

Next we'll make a dist folder which will contain our bundled JavaScript.

mkdir dist

Now we can try and run Webpack from the command line to see if it is set up correctly.

./node_modules/webpack/bin/webpack.js ./src/js/main.js ./dist/bundle.js

What I am doing here is telling Webpack to bundle the contents of src/js/main.js into dist/bundle.js. If everything is installed correctly, you should see something like this output to the command line:

Hash: 1856e2c19ecd9b2d9026
Version: webpack 3.2.0
Time: 50ms
    Asset     Size  Chunks             Chunk Names
bundle.js  2.67 kB       0  [emitted]  main
   [0] ./src/js/main.js 192 bytes {0} [built]

And Webpack will create a bundle.js file in the dist folder. If you have a look at that file in your text editor of choice, you'll see a bunch of boilerplate and the contents of main.js at the bottom.

Automating Our Setup

Now if we had to type all of the above into the terminal every time we wanted to run Webpack, that'd be quite annoying. So let's create an npm script we can run instead.

In package.json, alter the scripts property to look like this:

"scripts": {
  "test": "echo \"Error: no test specified\" && exit 1",
  "build": "webpack ./src/js/main.js ./dist/bundle.js"
},

Notice how we can leave out the full path to the Webpack module, as when run from a script, npm will automatically look for the module in the node_modules folder. Now when you run npm run build, the same thing should happen as before. Cool, eh?

Create a Webpack Configuration File

Notice how we're passing the path of the file to bundle and the path of the output file as arguments to Webpack? Well, we should probably change that and specify these in a configuration file instead. This will make our life easier when we come to use loaders later on.

Create a webpack.config.js file in the project root.

touch webpack.config.js

And add the following code.

module.exports = {
  entry: './src/js/main.js',
  output: {
    path: __dirname + '/dist',
    filename: 'bundle.js'
  }
}

And change the npm script to the following:

"scripts": {
  ...
  "build": "webpack"
},

In webpack.config.js we are specifying the entry point and output location of the bundle as properties of the configuration object, which we are then exporting . Run everything again and it should all work as before.

Continue reading %How to Bundle a Simple Static Site Using Webpack%


by James Hibbard via SitePoint

Wade – Blazing Fast, Javascript Search Library

Wade is a 1kb Javascript search library.

It allows you to create a function that can search an array of strings for a set of keywords, which is run through the processor. After this, it is searched for in each item of the data.


by via jQuery-Plugins.net RSS Feed

4 Photoshop Styles to Lift Your Photos above of the Crowd

In an earlier SitePoint article, we talked about the importance of evoking emotion with your imagery choices. I also showed you how to nail those photography styles in Photoshop to create engaging, heartfelt designs.

This time around, I’m going to share four more eye-catching effects that can be achieved in under 10 minutes using Photoshop.

Here are the photography styles I’ll be covering today:

  • Purist Effect
  • Muted Black & White Effect
  • DuoTone Effect
  • Targeted Blur Effect

The Purist Effect

As the name implies, “The Purist” effect is at its best when people don’t even notice it’s there – like ‘natural look makeup’ for your photos.

You probably won’t be aware of any special filters or gradients going on in this image. The goal is to achieve a look that is close to SOOC (Straight Out of the Camera), while still bringing out the natural beauty of your photo.

In most cases, you’ll be tweaking the colors on the RGB curve to subtly enhance your work.

Purist effects work well with food and fashion blogs, where the imagery needs to appear authentic. You’ll also see this style used on websites that cater to any form of news (sports, local, technology, current events, etc), where the core aim is to tell a true story, as opposed to a surreal or fantastic version of your story.

These Vagabond Shoes
http://ift.tt/2v0RzMG

Brickyard play avista
http://ift.tt/2v0Jury

Master Class: Doing it by hand

Question without notice: On an RGB screen, what happens when to your blue tones – skies and oceans – when you add more red and green to them?

Answer: They closer and closer they move to pure white. So, by the same logic, slightly reducing the red and green tones in our blue areas will make them appear cleaner and stronger. The same idea applies to the red and green areas. That’s what we’re doing here.

Step 1

First thing’s first, open up your desired image. For each of these looks, I will be using photos taken by Flickr users offering their photos under CC licensing. Photo credit: http://ift.tt/2vT1Erp

[caption id="attachment_157411" align="aligncenter" width="2048"]Pool and huts (A perfectly nice enough photo)[/caption]

Step 2

Add a new Adjustment Layer by either clicking at the bottom of your layer menu or on the side of the layer menu depending on your setup and select Curves.

Adjustment layer

Step 3

Adjust the RGB curve by setting the Output to 54 and the Input to 76. This will push the overall contrast.

Contrast

Step 4

Now select the Red curve (in the dropdown) and change your Output to 116 and Input to 133.

[caption id="attachment_157395" align="aligncenter" width="935"]Red channel Tweaking the red channel[/caption]

Step 5

Move to the Green curve and drop the top of your line so your Output is 242 and your Input remains at 255.

[caption id="attachment_157403" align="aligncenter" width="925"]The Green channel The Green channel[/caption]

Step 6

Finish up by adjusting your Blue curve so that your Output is 122 and your Input is 130.

[caption id="attachment_157409" align="aligncenter" width="934"]The Blue channel The Blue channel[/caption]

Before and After

Before and After

Not bad. Rich and lush not unrealistic.

The Muted Black & White Effect

While Black and White photos will always have a vintage feel, they also often project a sense of dignity and stripped back truth earned through their long history of use in photojournalism. Today we’re going to focus on what I’m calling “The Muted Black and White”. This is the faded black and white image that doesn’t have an abundance of contrast and features a lot of gray tones.

You typically see this look used on fashion based sites including those that fall into the category of art, culture, and education. The look is seldom used in news and food sites but it doesn’t mean it can’t be.

Unlike The Purist look, this one can’t be used for every photo especially given your subject without changing your workflow. For example models and subjects that feature darker hues and skin tones can get drowned out with the muted combination with a black and white application if the background is already dark. If that’s the case you may want to opt for either the muted look or a black and white look with a high contrast.

Micropolis
http://ift.tt/1TXOmDn

http://ift.tt/2v0vLB0
http://ift.tt/2v0vLB0

Master Class: Doing it by hand

Step 1

Open up your image. In this case I will be using an image courtesy of Sima Dimitric via Flickr CC licensing. Photo credit: http://ift.tt/2vSTPSO

Step 2

Create a new Adjustment Layer by either clicking the icon at the bottom of your layer menu or on the side depending on your setup. You will want to select the Black & White option.

Adjustment layer

Step 3

Depending on your particular image you will adjust the hues to your liking. In this scenario, we will adjust each hue accordingly so that the below image is your final output.

Selecting the Black & White option

Step 4

To achieve our muted look you will first want to make sure your paint colors are set to default black and white. If not first click (D) on your keyboard then (X) so that black is your foreground color. Next, create a new Adjustment Layer and select Gradient.

Select gradient.

Step 5

When the Gradient dialogue box pops up change the scale to 130% and click OK. That’s it, you’re finished. For a more muted look, you can always duplicate your gradient layer and adjust the opacity as desired.

Gradient overlay

Before and After

Before and After

Continue reading %4 Photoshop Styles to Lift Your Photos above of the Crowd%


by Alex Walker via SitePoint

Greenside

Greenside

'Greenside' is a One Page HTML template suited for a horticulturist, landscape designer or garden service. Features include intro hero image, about, service, lightbox image gallery (with category filter), testimonial slider and a contact form. The design is basic but does the job and great to see theme authors focusing on niches like these 👍🏻

by Rob Hope via One Page Love

Bucher

Bucher

Long-scrolling One Pager for a heating and plumbing installer called Bucher.

by Rob Hope via One Page Love