Basics Behind Color Theory for Web Designer

Original Source: https://www.hongkiat.com/blog/basics-behind-color-theory-for-web-designer/

As a collective digital artist, it is important to understand the fundamental science behind color theory. It’s a popular topic with a vast spread of information to retain and digest. Not only…

Visit hongkiat.com for full content.

iPad Pro 2020: All the latest rumours and leaks

Original Source: http://feedproxy.google.com/~r/CreativeBloq/~3/VTRQgILlG6M/ipad-pro-2020

There has been much speculation about the arrival of the new iPad Pro 2020. The iPad Pro was pretty much neglected in 2019, so fans are keen to see if 2020 marks the year the powerful tablet gets some attention. While Apple's spring event was slated for March, it now looks as if it is going to be cancelled due to coronavirus fears. However, that doesn't mean that new products won't be announced, so we are still expecting news about the iPad Pro 2020 to be just around the corner. 

Delays and viruses aside, what do we know about the iPad Pro 2020? One thing's for sure, whatever the update looks like, there will be some great iPad Pro apps for designers, artists and illustrators to work with. Here we take a look at all the latest iPad Pro 2020 leaks and rumours. And spoiler alert: it looks like the iPad Pro really may become a MacBook killer this time round.

iPad Pro 2020: Design rumours

The most recent rumours are based around the iPad Pro's strides into laptop territory. One recent leak suggests that the iPad Pro could come with an optional keyboard that includes a proper trackpad, so it really could become a machine that creatives can use instead of their MacBook. 

Code seen by 9to5Mac for iOS 14 (expected to be with us in autumn) also suggests that both the iPad and the iPhone could soon work much better with a mouse. This could mean that you can connect your mouse via bluetooth to your device and it will work much in the same way as it does on a computer, with two-finger taps acting like right-clicks, for example. Note that iOS 13 does have mouse support for the iPad, but it's buried within the settings and overall seems pretty unintuitive. 

On top of these rumours, there's a lot of speculation floating around about the iPad Pro 2020's design in general. In the middle of 2019, Apple registered another two tablet models with the Eurasian Economic Commission (EEC) regulator. And both of these new models didn't match any models that aren't in the current line-up, which has (naturally) led to speculation. 

A previous rumour, posted on Twitter last month, offers an unconfirmed look at the front and back of the new iPad Pro 2020. The most significant feature is addition of two rear cameras. Being that the current iPad Pro only has one, it hints that Apple has put the devices' photo-taking abilities in (ahem) focus.

iPad Pro 2020: Release date and price

Late last year, Bloomberg's Mark Gurman suggested the release date would be early 2020, which is interesting when you consider Apple usually unveils new tech at its annual October event. Does this mean that Apple skipped a 2019 iPad Pro launch with the intent of releasing two new iPad Pros in 2020? Only time will tell.

There's no current news on the price of the new device, however with over a year between updates, we expect this iPad Pro refresh to be significant, in terms of both cost and capability. 

Below is what we've heard about the latest event being cancelled, with no news yet on how this will affect the iPad Pro. 

iPad Pro 2020: What we'd like to see 

While we wait for official confirmation from Apple, we can only speculate what the new iPad Pro 2020 will actually offer. However there's no doubt that the new iPad Pro will be a top-end, power-packed tablet. The current 12.9-inch model boasts a very powerful A12X Bionic processor, so expect even more processing power for demanding creative tasks like photo or video editing. 

Our biggest wish for the iPad Pro 2020 would be a bigger screen. Seeing as there is no longer a 15-inch MacBook Pro anymore, how about a 15-inch iPad Pro to fill the gap? The extra space would be perfect for designers, illustrators and artists to express themselves with an Apple Pencil. 

We'll update this post as and when more news drops on the new iPad Pro 2020. But if you can't wait that long to get your hands on one of these powerful devices, you can currently get some great deals on the 2018 iPad Pro models. Here are the best prices in your area: 

iPad Pro 12.9 reviewMacBook Pro 2020: Latest rumour roundup20 best drawing apps for iPad

The Latest Research for Web Designers, March 2020

Original Source: https://www.webdesignerdepot.com/2020/03/the-latest-research-for-web-designers-march-2020/

While it’s important to know about the latest research and surveys impacting web design, I think it’s just as important to stay informed about news that may affect your work as a designer.

As such, this roundup of the latest research for web designers includes a mix of reports along with some news and facts about something that people are talking about all around the world: the coronavirus.

A Better Lemonade Stand Analyzes the Best Remote Working Locations

With the help of Nomad List, A Better Lemonade Stand has aggregated a list of the 20 best places to work remotely.

While finding a place to live can be a very subjective matter (for instance, some people prefer colder locales or warm ones), this list takes into account factors that can have a serious impact on the work of a freelancer. For example, this is why Auckland, New Zealand ended up taking the #1 spot for remote work:

The other cities to round out the top 10 are:

Bengaluru, India
Budapest, Hungary
Buenos Aires, Argentina
Chiang Mai, Thailand
Dubrovnik, Croatia
Hanoi, Vietnam
Ho Chi Minh, Vietnam
Krakow, Poland
Lisbon, Portugal

I’d argue that it’s high scores on factors like the following that make them the best spots to work remotely from:

Cost
Internet speed
Free wifi in the city
Places to work from
Walkability
Happiness score
Quality of life

If you’ve been considering a move and you want it to not only be a place you love but that’s good for your business, one of these nomad-friendly spots might fit the bill.

Hubspot Gives Us a Comprehensive Look at the State of Marketing

As always, there’s almost too much information to digest in Hubspot’s annual State of Marketing report. But that’s not going to stop me from highlighting the points you can use to bring more money into your business:

Website Upgrades Needed

According to the survey, 63% of respondents are looking to upgrade their websites in 2020. If you have experience in and enjoy doing website redesigns, hop on this opportunity as soon as you can.

Maintenance Pros Wanted

Sometimes it’s not the design that needs to be tweaked. Rather your clients would benefit from a technical tune-up along with ongoing maintenance.

When asked which tactics have been the most beneficial for improving a website’s performance and search ranking, here’s what respondents had to say:

You could easily create a recurring revenue stream around these maintenance tasks.

Visual-Heavy Content Marketing is a Must

Marketers use a wide variety of content in their marketing strategies:

If you’re in the business of building websites, you should also be helping your clients create graphics for the media above. For instance, you could provide ongoing design services for:

Blog (and promotional social media) graphics
Videos or just video cover images
Infographics
Templates for case studies, ebooks, and white papers

Just because your job is primarily to build high-converting websites for clients doesn’t mean you shouldn’t be looking for other ways to serve them.

The Coronavirus’s Impact on Freelancers

With so much news about the coronavirus out there, it’s hard to know what to focus your attention. If you’re a freelancer, then these are the statistics and research you should focus on:

Conferences Around the World Are Being Cancelled

Business Insider and the LA Times rounded up lists of conferences that have been cancelled, rescheduled, or restructured because of the coronavirus:

Adobe Summit (it’ll be online instead)
Facebook’s F8
Facebook’s Global Marketing Summit
EmTech Asia
Shopify Developer Conference
Google I/O
Google Cloud Next ‘20 (rescheduled as an online event)

And for those of you who work with WordPress, WordCamp Asia was cancelled.

Considering how expensive and time-consuming professional design conferences can be to attend, these cancellations might not be as big of a disappointment to the freelance community. In fact, it might bring a change to the professional conference landscape, with more of them hosted virtually so that it becomes cheaper, more practical, and now safer to attend.

Some Freelance Gigs Are Drying Up

In particular, it’s Singapore’s population of freelancers that are feeling the effects of the coronavirus, according to a report from Vice.

It makes sense. As businesses close down their offices or their operations altogether, the contract workforce who works behind the scenes for them is going to be impacted as well. This is especially problematic for those who build ecommerce and retail websites. With many products manufactured in China (31.3% of all apparel and 37.6% of textiles are manufactured there, for instance), inventories are waning and many retailers are having to wait out the virus to resume operations. 

The Singapore government recently announced plans for its 2020 budget, which included contributing SG$800 million towards curbing the effects of the virus on the country. Additional support is to be given to industries the most severely affected by it as well.

While the country’s budget doesn’t account for freelancers (as I’m sure will be the case in other countries), the freelance community itself is stepping up.

Nicholas Chee, who runs a video production company in Singapore, started a Facebook group for freelancers who’ve been dealing with lost gigs as a result of the coronavirus. It’s called SG COVID-19 Creative/Cultural Professionals & Freelancers Support Group and is giving the freelance community a way to support each other through this crisis.

Web Designers May Be Able To Help Stop The Spread of Coronavirus

It’s not just Facebook groups that are going to help freelancers get through the coronavirus crisis in one piece. According to Dr. Stephanie Evergreen, web designers might actually be able to help slow down or stop the spread of the virus itself.

In an article she wrote for Fast Company, Dr. Evergreen, a data visualization specialist, demonstrates how more eye-catching graphics can better educate the public on what’s going on and what they can do.

For instance, she shares this graphic from the World Health Organization:

While it more effectively lays out this data than a wall of text would, it’s not going to do much to capture anyone’s attention.

It’s more important than ever for public health agencies to use data visualization to communicate with the masses, as the public is bombarded with more information each day and in need of a way for the most pressing issues to cut through the noise.

Quantifiable data, instead, should be presented like this graphic from the Florida Department of Health. 

It does both a good job of capturing attention and informing the public of what’s going on.

Bottom line: if your website is tasked with communicating critical data to the public, see if there’s a way you can lend your design skills to it. While a writer can clearly communicate what’s going on, graphics are more likely to grab and hold their attention.

Wrap-Up

While annual “State of” reports always tend to wind down around February/March, we still have a wealth of data coming in that not only affects your design strategy but your business strategy too.

Keep your eyes peeled for the next edition of the latest research for web designers as we’re sure to see the first quarterly reports come out for design, marketing, SEO, and more.

Source

p img {display:inline-block; margin-right:10px;}
.alignleft {float:left;}
p.showcase {clear:both;}
body#browserfriendly p, body#podcast p, div#emailbody p{margin:0;}

Slick new Apple homepage celebrates world-changing women

Original Source: http://feedproxy.google.com/~r/CreativeBloq/~3/_pcG7RHtjtY/apple-homepage-iwd

As part of its International Women's Day celebrations this weekend, Apple has changed its homepage into an interactive, scrollable catalogue of images and biographies celebrating "the women who are changing everything". These include campaigner Malala Yousafzai, Little Women director Greta Gerwig and 12-year-old Ghanaian musician DJ Switch.

At the centre of the new website layout is a link to Apple's latest Behind the Mac ad. The video features a montage of the same images of the female creators (and, of course, their Macs), soundtracked by Beyoncé's Flawless – which samples a TED talk by Chimamanda Ngozi Adichie called We should all be feminists. Previous Behind the Mac ads have featured similarly candid, black and white photos of musicians from Paul McCartney to FKA Twigs using Macs as part of their creative process.

The homepage also links to Apple's She Creates series. For the entire month of March, the brand's in-store Today at Apple sessions will be led by inspiring female creators, helping customers make creative use of various Apple products.

With its simple photography and monochrome palette, the classy new homepage carries an inspiring message and looks good doing it. We like it, and we hope it inspires other women in creative careers – whether they're an art director or just starting out.

Apple has form when it comes to tweaking its homepage. We were big fans of last month's playful Apple Arcade takeover, which saw animated video game characters turn its products into a virtual assault course. 

Check out the Apple homepage here.

Generate Javascript

Join us this April at GenerateJS

Join us at GenerateJS this April to learn all you need to know about JavaScript. Book your tickets now.

Related articles:

MacBook Pro 2020: Latest rumour roundupApple MacBook Pro 16-inch reviewDesign's gender problem, and what you can do about it

The 12 best drawing books

Original Source: http://feedproxy.google.com/~r/CreativeBloq/~3/szn9qGo9GbA/the-10-best-drawing-books

The best drawing books dispel the myth that artists are born, not made. We believe that nearly anyone can learn a skill, if they know what resources to use to help them learn.

That's where we come in. Whether you're just starting out or you're a seasoned artist, this list of the best drawing books will help you improve your knowledge, and provide you with some great reference material, too. While this isn't an exhaustive list, this is our pick of the best drawing books we recommend for artists, or aspiring artists, of all skill levels.

For more inspiration and advice in video or online tutorial format, take a look at our roundup of how to draw tutorials.

Sketching from the imagination

Sketching from the imagination: Creatures & Monsters is a fascinating book, organised by artist, which displays fantasy creature designs. A varied subject selection provides drawings of everything from dragons and fairies to mechanical structures and aliens, in all stages of development. The majority of the artwork is in black and white; however, a number of full colour illustrations pop up randomly, making for a welcome change of pace in among the monochrome. A slight downside to this softcover is that there’s no easy way (unless you’re familiar with every artist) to quickly find a specific subject matter or style of interest. 

On the whole there’s very little not to like about this book. The art is accessible and fascinating in its variety, and the artistic insight is a nice added extra. Creature artists are sure to enjoy all the eye candy on view, and it’s a bargain to boot.

Best drawing books: Drawing the head and hands

Andrew Loomis' Drawing the Head and Hands is a classic, and is excellent if you're looking for a solid foundation on drawing hands and heads. There's a ton of info inside, so you'll want to take it slow, especially if you struggle with drawing hands. Loomis' explanations are detailed and engaging, and it's hands-down (pun intended) the best anatomy reference book despite its age. Loomis' systematic approach will help you understand the principles behind drawing realistic portraits. Aside from the benefits of learning how to draw, Drawing the Head and Hands makes an excellent coffee table book too.

Pocket Art: Portrait Drawing

This Pocket Art: Portrait Drawing art guide is perfect for those artists looking to improve their portraiture skills. Artist Miss Led (real name Joanna Henly) breaks down the stages of portrait drawing into manageable, easy-to-understand sections, covering how to best approach creating beautiful portraits in a range of styles.  

Aimed at beginners and experienced artists alike, this 112-page book acts as a solid introduction to portrait drawing techniques, but also looks at how professional artists can create fine art and commercial-style illustrations. The handy-sized book is full of expert advice and tips, backed up by plenty of exercises for readers to put into practice. Copy is minimal but covers everything it needs to, leaving more space for Miss Led’s beautiful art.  

This manual is well designed, clearly written, and you’ll be hard pushed to find a bag it doesn’t fit in. Like all good tutorial-style books, it works because it’s accessible to artists of every skill level. Packed with inspirational art and very affordable, Pocket Art: Portrait Drawing comes highly recommended.  

Best drawing books: Drawn to Life

Volume 1 of Walt Stanchfield's Drawn to Life: 20 Golden Years of Disney Master Classes is a super-dense drawing book that you'll need to read slowly. Stanchfield takes a different approach to learning how to draw by focusing more on the emotions, life and action than proportions and technical accuracy. With a heavy focus on gesture drawing, don't expect a book filled with finished drawings. Drawn to Life is about capturing the moment. If you're interested in creating drawings with character and flow, this is a must-have reference. 

Best drawing books: The Sketch Encyclopedia

If you're looking for some warmup sketch ideas, The Sketch Encyclopedia: Over 900 Drawing Projects  is a great place to start. This drawing book breaks down each project, of which there are over 1,000, into four key steps (sketch, line drawing, and two that build up and complete the form) – making it easy to follow along. With lessons on creatures, people, buildings, famous landmarks, vehicles and nature, you're sure to find something to get you started. The Sketch Encyclopedia also includes an extensive introduction covering tools, line making, light theory, perspective and texture.

Best drawing books: Drawing on the right side of the brain

This revised 'definitive' edition of Drawing on the Right Side of the Brain by Betty Edwards is excellent for professional illustrators or drawing hobbyists. Edwards delivers a lot of interesting concepts as she encourages you to explore the importance of creative thinking. She approaches learning how to draw by teaching you how to see differently and explains everything from technique to materials. If you're an art educator, don't skip this one!

Best drawing books: How to draw comics the Marvel way

No drawing books list is complete without a word from Stan Lee and John Buscema. If you're looking for a crash course in figure drawing, or if you're an aspiring comic-book artist, animator, or illustrator, do yourself a favour and grab a copy of How to Draw Comics the Marvel Way. In addition to figure drawing, you'll learn about composition, shot selection, perspective, character dynamics, and more. Are there newer, more in-depth books out there? Sure, but if you're a comic book junkie, then you need this book.

Best drawing books: The Silver Way

Part of learning how to draw is learning how to have confidence in your own work. The Silver Way: Techniques, Tips, and Tutorials for Effective Character Design is written by Stephen Silver, the man behind the character design for Kim Possible, Danny Phantom, and The Fairly OddParents (to name a few). It offers guidance, encouragement, and inspiration in addition to easy-to-follow tutorials and drawing techniques.

Best drawing books:  Art Fundamentals

Art Fundamentals: Color, Light, Composition, Anatomy, Perspective, and Depth by Gilles Beloeil (Assassin's Creed series), Andrei Riabovitchev (Prometheus and X-Men: First Class), and Roberto F. Castro (Dead Island and Mortal Kombat) is one of the most comprehensive drawing books on the market today. In this book, you'll discover all sorts of goodies, including the rule of thirds, rule of odds, Golden Triangle, and Divine Proportions. But it goes well beyond composition. You'll also learn about colour and light, perspective and depth, anatomy, and portraying emotions.

Best drawing books: Drawing the head and figure

Drawing the Head and Figure: A How-To Handbook That Makes Drawing Easy by Jack Hamm is packed with helpful advice. You could say that this book is in direct competition with Loomis' drawing books (number 01), and you'd be correct. However, Hamm's approach to drawing the figure is more simplistic than Loomis'. His step-by-step approach will have even the most inexperienced artists drawing better and more confidently. Although some of the drawings are a bit dated, specifically the hairstyles and clothing, it's still an excellent primer for learning how to draw and can be easily applied to what you're making today.

Best drawing books: Modern cartooning

Cartooning is fun, and in Modern Cartooning: Essential Techniques for Drawing Today's Popular Cartoons, Christopher Hart shows you the essential techniques you need to know to unleash your full potential. Aimed at beginners, Modern Cartooning takes you step-by-step through the process of creating cartoons. You'll learn how to draw faces, bodies, backdrops, and more. As an added bonus, Hart's YouTube channel regularly shares easy-to-follow, step-by-step videos on how to draw cartoons, manga, animals and everything else.

Best drawing books: The Illusion of Life

Why is an animation book included on a 'best drawing books' list? Because it's amazing! Written by Ollie Johnston and Frank Thomas, two long-term Disney animators, The Illusion of Life takes its readers back to the beginning. Although it's not a tutorial book by any stretch of the word, it does offer a lot of advice and guidance regarding styles, effects, colour selection, and more. It also formed the basis for the 12 principles of animation still used today. This drawing book will inspire you to create through its many uses of photos, paintings, sketches and storyboards – all of which can be used to help you become a better artist.

Parts of this article were originally published in ImagineFX magazine. Subscribe here.

Read more:

Books every graphic designer should readThe best online art classes right nowThe best pencils for colouring, drawing and sketching


Hasselblad Heroines continues to feature talented female photographers

Original Source: http://feedproxy.google.com/~r/abduzeedo/~3/SiniteABQg4/hasselblad-heroines-continues-feature-talented-female-photographers

Hasselblad Heroines continues to feature talented female photographers
Hasselblad Heroines continues to feature talented female photographers

AoiroStudioMar 05, 2020

It’s always honorable seeing brands like Hasselblad create initiatives to celebrate women at making their mark into the photography industry and that is pretty male-dominated. They are back with Hasselblad Heroines that will be kicking off the second-year installment on 8 March 2020, International Women’s Day. For 2020, they will be featuring seven (7) photographers and we have taken the liberty to feature them here. By putting a spotlight on these talented creatives, Hasselblad Heroines hopes to encourage the next generation of female photographers to go against the grain and bring their creative visions to life.

In their words

Hasselblad proudly continues its second year of Hasselblad Heroines, which highlights various female photographers making their mark in the photographic industry. Kicking off the second-year instalment on 8 March 2020, International Women’s Day, is the first Hasselblad Heroine Swee Oh. Through weekly spotlights over a total of seven weeks, each Heroine will share their experiences in their career, challenges in a typically male-dominated industry, and inspiration in their art through short video interviews.

By Swee Oh

Julia Fullerton-Batten

By Bara Prasilova

By Natalia Evelyn Bencicova

By Clarissa Bonet

By Chiara Zonca

By Celia D. Luna

Last year we received a resoundingly positive response to the Hasselblad Heroines series, and we want to continue celebrating artists who represent true creative ingenuity. Since its inception nearly eighty years ago, Hasselblad carries a vested interest in the growth and development of the photographic arts and the nourishment of diverse and innovative creators

Marketing Manager Bronius Rudnickas

About Hasselblad

Founded in 1941, Hasselblad is one of the leading manufacturers of digital medium format cameras and lenses. True to its Scandinavian heritage, Hasselblad cameras are renowned for their iconic ergonomic design, uncompromising image quality and extremely high performance. For over half a century, Hasselblad cameras have captured some of the world’s most iconic images – including the first landing on the Moon – and helped shape the way we look at the world through genuine photographic artistry. Trusted by NASA and used by some of the greatest photographers in the world, Hasselblad continues to develop products that enable all types of creatives to capture their artistic vision.

More on Hasselblad


Inspirational Websites Roundup #13

Original Source: http://feedproxy.google.com/~r/tympanus/~3/0TO3-heD4ww/

Today we have a special collection of really interesting and creative website designs for you! Some outstanding works have been released over the past few weeks and we’re very excited to share these masterpieces with you. So many cool new trends are mixed and combined including beautiful 3D graphics, outlined text, unusual layouts and neat hover trails.

We hope you enjoy this selection and get a good dose of fresh inspiration!

Bruno Ortolland

Socialclub

Voir plus loin

Kevin van der Wijst

Pest Stop Boys

Luigi De Rosa

Davide Baratta

DDNA

Illuminating Radioactivity

Vallourec

Tula microphones

Alessandra Zanghi Studio

Connect Homes

Six N. Five

LEQB

Bite Toothpaste Bits

Yelloworld

Loer Architecten

Violet Office

Krause Studio

Sandy Dauneau

80s Fever

Elias Akentour

Josh W Comeau

PenzGidroMash

WØRKS

56k

Viens-là

The Markup

PANAMÆRA

Érika Moreira

kern inc.

DEADWATER

unspun

Playground Paris

Zenly

This is Spotify

Inspirational Websites Roundup #13 was written by Mary Lou and published on Codrops.

Subtle K-Y rebrand is a stroke of genius

Original Source: http://feedproxy.google.com/~r/CreativeBloq/~3/EWK1pGrwxjk/k-y-rebrand

With International Women's Day approaching on Sunday, lubricant brand K-Y Jelly has revealed a rebrand focused on female sexual empowerment.

Design Bridge New York's new logo design emphasises the ruby in its centre, turning it into a much prouder celebration of the vulva than before, and a "strong symbol of female sexual power". The ruby was always part of the logo, but diagonalising the 'Y's descender to meet the 'K' creates a new outer diamond, making the effect far more obvious. 

K-Y old and new logo

The old logo (left) compared to the new one (right)

"We've loaded it with meaning," says Claire Parker from Design Bridge, "and brought a sensuality and confidence to the brand that was lacking before."

If you ask us, the vulvarisation (sorry) of the logo is a stroke of genius. The old logo looks positively prudish, clinical even, compared with this playfully confident rebrand. And if anyone needs help spotting the visual reference, Design Bridge's accompanying video (below) for the rebrand ensures that the new ruby looks, well, nice and inviting. 

K-Y Jelly was one of the first lubricants aimed specifically at women. Launched in 1904, it entered a marketplace aimed predominantly at men. This new identity is a brilliantly strong statement of the brand's mission to, as K-Y puts it, to "empower women to have the best sex, always".

KY packaging

Are you ready for this jelly?

As well as the new logo, the rebrand includes bespoke typography and iconography for the product's packaging, as well as a refined colour palette with consistent use of the brand's "deep, ruby red – a colour that universally represents love and passion". We love it. 

Related articles

Durex hits the spot with sexy new rebrandThe problem with period product brandingDesigners react to bizarre Gucci rebrand

Introducing Alpine.js: A Tiny JavaScript Framework

Original Source: https://www.smashingmagazine.com/2020/03/introduction-alpinejs-javascript-framework/

Introducing Alpine.js: A Tiny JavaScript Framework

Introducing Alpine.js: A Tiny JavaScript Framework

Phil Smith

2020-03-05T11:30:00+00:00
2020-03-05T21:09:09+00:00

Like most developers, I have a bad tendency to over-complicate my workflow, especially if there’s some new hotness on the horizon. Why use CSS when you can use CSS-in-JS? Why use Grunt when you can use Gulp? Why use Gulp when you can use Webpack? Why use a traditional CMS when you can go headless? Every so often though, the new-hotness makes life simpler.

Recently, the rise of utility based tools like Tailwind CSS have done this for CSS, and now Alpine.js promises something similar for JavaScript.

In this article, we’re going to take a closer look at Alpine.js and how it can replace JQuery or larger JavaScript libraries to build interactive websites. If you regularly build sites that require a sprinkling on Javascript to alter the UI based on some user interaction, then this article is for you.

Throughout the article, I refer to Vue.js, but don’t worry if you have no experience of Vue — that is not required. In fact, part of what makes Alpine.js great is that you barely need to know any JavaScript at all.

Now, let’s get started.

What Is Alpine.js?

According to project author Caleb Porzio:

“Alpine.js offers you the reactive and declarative nature of big frameworks like Vue or React at a much lower cost. You get to keep your DOM, and sprinkle in behavior as you see fit.”

Let’s unpack that a bit.

Let’s consider a basic UI pattern like Tabs. Our ultimate goal is that when a user clicks on a tab, the tab contents displays. If we come from a PHP background, we could easily achieve this server side. But the page refresh on every tab click isn’t very ‘reactive’.

To create a better experience over the years, developers have reached for jQuery and/or Bootstrap. In that situation, we create an event listener on the tab, and when a user clicks, the event fires and we tell the browser what to do.

See the Pen Showing / hiding with jQuery by Phil on CodePen.

See the Pen Showing / hiding with jQuery by Phil on CodePen.

That works. But this style of coding where we tell the browser exactly what to do (imperative coding) quickly gets us in a mess. Imagine if we wanted to disable the button after it has been clicked, or wanted to change the background color of the page. We’d quickly get into some serious spaghetti code.

Developers have solved this issue by reaching for frameworks like Vue, Angular and React. These frameworks allow us to write cleaner code by utilizing the virtual DOM: a kind of mirror of the UI stored in the browser memory. The result is that when you ‘hide’ a DOM element (like a tab) in one of these frameworks; it doesn’t add a display:none; style attribute, but instead it literally disappears from the ‘real’ DOM.

This allows us to write more declarative code that is cleaner and easier to read. But this is at a cost. Typically, the bundle size of these frameworks is large and for those coming from a jQuery background, the learning curve feels incredibly steep. Especially when all you want to do is toggle tabs! And that is where Alpine.js steps in.

Like Vue and React, Alpine.js allows us to write declarative code but it uses the “real” DOM; amending the contents and attributes of the same nodes that you and I might edit when we crack open a text editor or dev-tools. As a result, you can lose the filesize, wizardry and cognitive-load of larger framework but retain the declarative programming methodology. And you get this with no bundler, no build process and no script tag. Just load 6kb of Alpine.js and you’re away!

Alpine.js

JQuery

Vue.js

React + React DOM

Coding style

Declarative

Imperative

Declarative

Declarative

Requires bundler

No

No

No

Yes

Filesize (GZipped, minified)

6.4kb

30kb

32kb

5kb + 36kb

Dev-Tools

No

No

Yes

Yes

When Should I Reach For Alpine?

For me, Alpine’s strength is in the ease of DOM manipulation. Think of those things you used out of the box with Bootstrap, Alpine.js is great for them. Examples would be:

Showing and hiding DOM nodes under certain conditions,
Binding user input,
Listening for events and altering the UI accordingly,
Appending classes.

You can also use Alpine.js for templating if your data is available in JSON, but let’s save that for another day.

When Should I Look Elsewhere?

If you’re fetching data, or need to carry out additional functions like validation or storing data, you should probably look elsewhere. Larger frameworks also come with dev-tools which can be invaluable when building larger UIs.

From jQuery To Vue To Alpine

Two years ago, Sarah Drasner posted an article on Smashing Magazine, “Replacing jQuery With Vue.js: No Build Step Necessary,” about how Vue could replace jQuery for many projects. That article started me on a journey which led me to use Vue almost every time I build a user interface. Today, we are going to recreate some of her examples with Alpine, which should illustrate its advantages over both jQuery and Vue in certain use cases.

Alpine’s syntax is almost entirely lifted from Vue.js. In total, there are 13 directives. We’ll cover most of them in the following examples.

Getting Started

Like Vue and jQuery, no build process is required. Unlike Vue, Alpine it initializes itself, so there’s no need to create a new instance. Just load Alpine and you’re good to go.

<script src=”https://cdn.jsdelivr.net/gh/alpinejs/alpine@v1.9.4/dist/alpine.js” defer></script>

The scope of any given component is declared using the x-data directive. This kicks things off and sets some default values if required:

<div x-data=”{ foo: ‘bar’ }”>…</div>

Capturing User Inputs

See section in Sarah Drasner’s article →

x-model allow us to keep any input element in sync with the values set using x-data. In the following example, we set the name value to an empty string (within the form tag). Using x-model, we bind this value to the input field. By using x-text, we inject the value into the innerText of the paragraph element.

See the Pen Capturing user input with Alpine.js by Phil on CodePen.

See the Pen Capturing user input with Alpine.js by Phil on CodePen.

This highlights the key differences with Alpine.js and both jQuery and Vue.js.

Updating the paragraph tag in jQuery would require us to listen for specific events (keyup?), explicitly identify the node we wish to update and the changes we wish to make. Alpine’s syntax on the other hand, just specifies what should happen. This is what is meant by declarative programming.

Updating the paragraph in Vue while simple, would require a new script tag:

new Vue({ el: ‘#app’, data: { name: ” } });

While this might not seem like the end of the world, it highlights the first major gain with Alpine. There is no context-switching. Everything is done right there in the HTML — no need for any additional JavaScript.

Click Events, Boolean Attributes And Toggling Classes

See section in Sarah Drasner’s article →

Like with Vue, : serves as a shorthand for x-bind (which binds attributes) and @ is shorthand for x-on (which indicates that Alpine should listen for events).

In the following example, we instantiate a new component using x-data, and set the default value of show to be false. When the button is clicked, we toggle the value of show. When this value is true, we instruct Alpine to append the aria-expanded attribute.

x-bind works differently for classes: we pass in object where the key is the class-name (active in our case) and the value is a boolean expression (show).

See the Pen Click Events, Boolean Attributes and Toggling Classes with Alpine.js by Phil on CodePen.

See the Pen Click Events, Boolean Attributes and Toggling Classes with Alpine.js by Phil on CodePen.

Hiding And Showing

See section in Sarah Drasner’s article →

The syntax showing and hiding is almost identical to Vue.

See the Pen Showing / hiding with Alpine.js by Phil on CodePen.

See the Pen Showing / hiding with Alpine.js by Phil on CodePen.

This will set a given DOM node to display:none. If you need to remove a DOM element completely, x-if can be used. However, because Alpine.js doesn’t use the Virtual DOM, x-if can only be used on a <template></template> (tag that wraps the element you wish to hide).

Magic Properties

In addition to the above directives, three Magic Properties provide some additional functionality. All of these will be familiar to anyone working in Vue.js.

$el fetches the root component (the thing with the x-data attribute);
$refs allows you to grab a DOM element;
$nextTick ensures expressions are only executed once Alpine has done its thing;
$event can be used to capture a nature browser event.

See the Pen Magic Properties by Phil on CodePen.

See the Pen Magic Properties by Phil on CodePen.

Let’s Build Something Useful

It’s time to build something for the real world. In the interests of brevity I’m going to use Bootstrap for styles, but use Alpine.js for all the JavaScript. The page we’re building is a simple landing page with a contact form displayed inside a modal that submits to some form handler and displays a nice success message. Just the sort of thing a client might ask for and expect pronto!

Initial view of the demo app

Initial view (Large preview)

View of the demo app with modal open

Modal open (Large preview)

View of the demo app with success message displaying

Success message (Large preview)

Note: You can view the original markup here.

To make this work, we could add jQuery and Bootstrap.js, but that is quite a bit of overhead for not a lot of functionality. We could probably write it in Vanilla JS, but who wants to do that? Let’s make it work with Alpine.js instead.

First, let’s set a scope and some initial values:

<body class=”text-center text-white bg-dark h-100 d-flex flex-column” x-data=”{ showModal: false, name: ”, email: ”, success: false }”>

Now, let’s make our button set the showModal value to true:

<button class=”btn btn-lg btn-secondary” @click=”showModal = true” >Get in touch</button>

When showModal is true, we need to display the modal and add some classes:

<div class=”modal fade text-dark” :class=”{ ‘show d-block’: showModal }” x-show=”showModal” role=”dialog”>

Let’s bind the input values to Alpine:

<input type=”text” class=”form-control” name=”name” x-model=”name” >
<input type=”email” class=”form-control” name=”email” x-model=”email” >

And disable the ‘Submit’ button, until those values are set:

<button type=”button” class=”btn btn-primary” :disabled=”!name || !email”>Submit</button>

Finally, let’s send data to some kind of asynchronous function, and hide the modal when we’re done:

<button type=”button” class=”btn btn-primary” :disabled=”!name || !email” @click=”submitForm({name: name, email: email}).then(() => {showModal = false; success= true;})”>Submit</button>

And that’s about it!

See the Pen Something useful built with Alpine.js by Phil on CodePen.

See the Pen Something useful built with Alpine.js by Phil on CodePen.

Just Enough JavaScript

When building websites, I’m increasingly trying to ask myself what would be “just enough JavaScript”? When building a sophisticated web application, that might well be React. But when building a marketing site, or something similar, Alpine.js feels like enough. (And even if it’s not, given the similar syntax, switching to Vue.js takes no time at all).

It’s incredibly easy to use (especially if you’ve never used VueJS). It’s tiny (< 6kb gzipped). And it means no more context switching between HTML and JavaScript files.

There are more advanced features that aren’t included in this article and Caleb is constantly adding new features. If you want to find out more, take a look at the official docs on Github.

Smashing Editorial
(ra, il)

How to Optimize Your YouTube SEO

Original Source: http://feedproxy.google.com/~r/Designrfix/~3/jhl9bdls2zU/how-to-optimize-your-youtube-seo

Video marketing has absolutely exploded in the last few years and for good reason. Most people prefer to consume information via video rather than read a lengthy blog post. YouTube has over 1 Billion users and has become the third-largest search engine so if it’s the best place for you to publish your videos. In […]

The post How to Optimize Your YouTube SEO appeared first on designrfix.com.