"Mr Branding" is a blog based on RSS for everything related to website branding and website design, it collects its posts from many sites in order to facilitate the updating to the latest technology.
To suggest any source, please contact me: Taha.baba@consultant.com
Saturday, March 31, 2018
Is Augmented Reality The Future Of Un-Tech? - #infographic
[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]
by Irfan Ahmad via Digital Information World
Meeting Models
Long-scrolling One Pager for Meeting Models – a new service substituting your team with more attractive people for that important new client meeting or VC pitch.
by Rob Hope @robhope via One Page Love
The Daily Growth of the Internet
[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]
by Irfan Ahmad via Digital Information World
Ta Ta Goo.gl — Google Says Goodbye To Its URL Shortening Service
[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]
by Web Desk via Digital Information World
Oberig Jewellery
by via Awwwards - Sites of the day
Facebook New Subscription Service for Creators and Pausing Messenger Chatbots
Welcome to this week’s edition of the Social Media Marketing Talk Show, a news show for marketers who want to stay on the leading edge of social media. On this week’s Social Media Marketing Talk Show, we explore Facebook’s New subscription service for creators and pausing Messenger chatbots with Luria Petrucci, Facebook privacy updates, and [...]
This post Facebook New Subscription Service for Creators and Pausing Messenger Chatbots first appeared on Social Media Examiner.
by Grace Duffy via
9 Ways to Focus a Wandering Mind #infographic
[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]
by Irfan Ahmad via Digital Information World
Friday, March 30, 2018
Security Concerns And The State Of Cryptocurrency Theft - #infographic
[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]
by Irfan Ahmad via Digital Information World
ES Modules: A Cartoon Deep-Dive
|
by via JavaScript Weekly
Creating an Image Editor Using CamanJS: Layers, Blend Modes, and Events
In the previous tutorial, you learned how to create an image editor using CamanJS which can apply basic filters like contrast, brightness, and noise to an image. CamanJS also has some other built-in filters like Nostalgia, Pinhole, Sunrise, etc., which we applied directly to the image.
In this tutorial, we will cover some more advanced features of the library like Layers, Blend Modes, and Events.
Layers in CamanJS
In the first tutorial, we only worked with a single layer which contained our image. All the filters that we applied only manipulated that main layer. CamanJS allows you to create multiple layers to enable you to edit your images in a more sophisticated manner. You can create nested layers, but they will always be applied on their parent layer like a stack.
Whenever you create a new layer and apply it on the parent layer, the default blend mode used will be normal
. You can create a new layer on the canvas using the newLayer()
method. When you create a new layer, you can also pass a callback function which will be useful if you intend to manipulate layer.
This function can be used for a lot of tasks like setting the blend mode for the new layer using the setBlendingMode()
method. Similarly, you can control the opacity of the new layer using the opacity()
method.
Any new layer that you create can be filled with a solid color using the fillColor()
method. You can also copy the contents of the parent layer to the new layer using the copyParent()
method. All the filters that we learned about in the previous tutorial can also be applied on the new layer that we are creating. For example, you can increase the brightness of the newly created layer by using this.filter.brightness(10)
.
Instead of copying the parent or filling the layer with a solid color, you also have the option to load any other image in the layer and overlay it on the parent. Just like the main image, you will be able to apply different filters to the overlaid image as well.
In the following code snippet, we have attached a click event handler to three buttons which will fill the new layer with a solid color, the parent layer, and an overlay image respectively.
$('#orange-btn').on('click', function (e) { Caman("#canvas", function () { this.newLayer(function () { this.opacity(50); this.fillColor('#ff9900'); }); this.render(); }); }); $('#parent-btn').on('click', function (e) { Caman("#canvas", function () { this.newLayer(function () { this.opacity(50); this.copyParent(); this.filter.brightness(20); }); this.render(); }); }); $('#overlay-btn').on('click', function (e) { var oImg = new Image(); oImg.src = "trees.png"; Caman("#canvas", function () { this.newLayer(function () { this.opacity(50); this.overlayImage(oImg); this.filter.brightness(20); }); this.render(); }); });
Blend Modes in CamanJS
In the previous section, we kept the opacity of any new layer that we added to the canvas below 100. This was done because the new layer would otherwise hide the old layer completely. When you place one layer over another, CamanJS allows you to specify a blend mode which determines the final outcome after the placement. The blend mode is set to normal
by default.
This means that any new layer that you add on the canvas will make the layer below it invisible. The library has ten blend modes in total. These are normal
, multiply
, screen
, overlay
, difference
, addition
, exclusion
, softLight
, exclusion
, and darken
.
As I mentioned earlier, the normal
blend mode sets the final color to be equal to the color of the new layer. The multiply
blend mode determines the final color of a pixel by multiplying the individual channels together and then dividing the result by 255. The difference
and addition
blend modes work in a similar manner, but they subtract and add the channels.
The darken
blend mode sets the final color of a pixel to be equal to the lowest value of individual color channels. The lighten
blend mode sets the final color of a pixel to be equal to the highest value of individual color channels. The exclusion
blend mode is somewhat similar to difference
, but it sets the contrast to a lower value. In the case of the screen
blend mode, the final color is obtained by inverting the colors of each layer, multiplying them, and then again inverting the result.
The overlay
blend mode acts like multiply
if the bottom color is darker, and it acts like screen
if the bottom color is lighter.
If you want the colors in different layers to interact in a different manner, CamanJS also lets you define your own blend modes. We will cover this in the next tutorial of the series.
Here is the JavaScript code to apply different blend modes on an image:
$('#multiply-btn').on('click', function (e) { hexColor = $("#hex-color").val(); Caman("#canvas", function () { this.revert(false); this.newLayer(function () { this.fillColor(hexColor); this.setBlendingMode('multiply'); }); this.render(); }); }); $('#screen-btn').on('click', function (e) { hexColor = $("#hex-color").val(); Caman("#canvas", function () { this.revert(false); this.newLayer(function () { this.fillColor(hexColor); this.setBlendingMode('screen'); }); this.render(); }); });
In the above code snippet, we get the Hex color value from an input field. This color is then applied on the new layer. You can write the code to apply other blend modes in a similar manner.
Try to specify a color of your choice in the input field, and then apply any of the blend modes by clicking on the respective button. I have applied the blend modes on a solid color in the example, but you can also apply them on an overlaid image from the previous section.
Events in CamanJS
If you uploaded any large image in either the demo of the first tutorial or the second tutorial, you might have noticed that the result of any applied filter or blend mode became evident after a long time.
Large images have a lot of pixels, and calculating the final value of different channels for each pixel after applying a specific blend mode can be very time-consuming. For example, when applying the multiply
blend mode on an image with dimensions 1920*1080, the device will have to perform multiplication and division over 6 million times.
In such cases, you can use events to give users some indication about the progress of a filter or blend mode. CamanJS has five different events which can be used to execute specific callback functions at different stages. These five events are processStart
, processComplete
, renderFinished
, blockStarted
, and blockFinished
.
The processStart
and processComplete
events are triggered after a single filter starts or finishes its rendering process. When all the filters that you specified have been applied on an image, the library fires the renderFinished
event.
CamanJS divides large images into blocks before starting to manipulate them. The blockStarted
and blockFinished
events are fired after individual blocks of the image have been processed by the library.
In our example, we will only be using the processStart
and renderFinished
events to inform users about the progress of our image editing operation.
Caman.Event.listen("processStart", function (process) { $(".process-message").text('Applying ' + process.name); }); Caman.Event.listen("renderFinished", function () { $(".process-message").text("Done!"); });
With the processStart
and processFinish
events, you get access to the name of the process currently operating on the image. The blockStarted
and blockFinished
events, on the other hand, give you access to information like the total number of blocks, the current block being processed, and the number of finished blocks.
Try clicking on any button in the demo below, and you will see the name of the process currently manipulating the image in the area below the canvas.
Final Thoughts
The first tutorial of the series showed you how to create a basic image editor with built-in filters from the CamanJS library. This tutorial showed you how to work with more than one layer and apply different filters and blend modes to each layer individually.
Since the image editing process can take a while for large images, we also learned how to indicate to users that the image editor is actually processing the image and not sitting idle.
In the next and final tutorial of the series, you will learn how to create your own blend modes and filters in CamanJS. If you have any questions related to this tutorial, feel free to let me know in the comments.
by Monty Shokeen via Envato Tuts+ Code
Facebook's Growing Stature in the Online Ad Market
[ This is a content summary only. Visit our website https://ift.tt/1b4YgHQ for full links, other content, and more! ]
by Web Desk via Digital Information World
LinkedIn Prospecting: How to Find and Connect With Future Customers
Do you want more clients? Wondering if LinkedIn can help you acquire more business? To explore how to use LinkedIn to find leads and turn them into customers, I interview John Nemo. More About This Show The Social Media Marketing podcast is an on-demand talk radio show from Social Media Examiner. It’s designed to help [...]
This post LinkedIn Prospecting: How to Find and Connect With Future Customers first appeared on Social Media Examiner.
by Michael Stelzner via
Find a Happy Medium
by via Awwwards - Sites of the day
Yo! #009 – Sketch for Windows, 2018 State of Email, 300 Free Icons
This week in Yo! I cover Lunacy – a Sketch editor for Windows, 2018 State of Email by Litmus, Local Overrides in Chrome 65 DevTools, Paste with Frames by FiftyThree, 300 free icons, beautiful websites, remote jobs, beats & more
by Rob Hope @robhope via One Page Love
Google JavaScript Style Guide
A tutorialabout Google’s coding standards for source code in the JavaScript programming language. The best stylistic practices for writing clean, understandable code.
by via jQuery-Plugins.net RSS Feed
Caramella
Neat load transitions in this colorful Landing Page for new blogging platform, Caramella. Quick shout-out to the smart use of the .la domain extension
by Rob Hope @robhope via One Page Love
Thursday, March 29, 2018
The Secret Sauce for Creating an Amazing Product
This article was originally published on Monday.com. Thank you for supporting the partners who make SitePoint possible.
9 out of 10 startups fail. This apocryphal statistic is generally accepted as fact because the simple truth is, building a successful business is hard.
There are many obvious factors that have contributed to monday.com’s success as a product and business—hard work, luck, determination—but much of where we’ve arrived today is thanks to the less obvious lessons that our founders learned the hard way.
When launching a new business and looking for a product/market fit, many people ask questions like:
- Do we solve a problem?
- Do people understand our solution?
- Are they able to implement our solution?
- Do we add value?
This is a good start, but it’s not close to enough. In this post, we’ll share some of our co-founders Roy Man and Eran Zinman’s hard-earned insights on how they built a strong business. They’ve both been developing and building products since they were kids and have a lot of successes and failures under their belt.
Beautiful design and excellent code don’t matter (at first)
Roy: “I built two startups that succeeded in some aspects but failed to turn into viable businesses. They were really good looking products with an excellent code base, but that didn’t help. It also didn’t help that people who saw these products were amazed and loved them—something didn’t work and I had no idea what.
So I went to my good friend and mentor Avishai Abrahami, the CEO of Wix, and told him that he had to show me how to get it right. So I joined Wix in 2010 when they were a startup of 80 people.”
Eran: “After I got my degree, I started my own company building a search engine for user reviews, where you could get an aggregated view of all reviews. I rented 15 computers that crawled the web 24/7 and put them on the second floor of my mom’s house. I got a call from our Internet provider who were like, ‘Uh, what are you doing?’
“I made every mistake you can make as an entrepreneur. I thought that you have to build an excellent product before you raise money. We kept improving it and perfecting it for a whole year while I burned through my life’s savings. Finally, my account was frozen, and I had to call it quits.
Working with your intuition is always wrong. You look at other companies and success stories and try to reverse-engineer them. It’s never like that. I thought, ‘I’m going to create the next Google. When I launch, it’s going to be perfect.’ I had no idea that I should have shared it with users and gotten feedback really early on.”
Roy: “When I joined Wix, I couldn’t believe how bad their codebase was. Their product design was pretty childlike, and the UI was horrible. Nothing acted like anything you’d expect. The Head of Product back then was proud of the fact that their ‘color picker’ was designed by a color-blind person.
Continue reading %The Secret Sauce for Creating an Amazing Product%
by SitePoint Team via SitePoint
Coldnoir
Nice use of canvas with this one page website for Coldnoir – a Chinese design/UX agency. Love the simplicity and feel of it as you scroll. Nicely built.
Coldnoir is a Web design / UX agency for designers inspire.
The post Coldnoir appeared first on One Page Mania.
by Michael via One Page Mania