Posts

Showing posts from May, 2019

Implementing Private Variables In JavaScript

JavaScript (or ECMAScript) is the programming language that powers the web. Created in May 1995 by Brendan Eich, it’s found its place as a widely-used and versatile technology. Despite its success, it’s been met with its fair share of criticism, especially for idiosyncrasies. Things like objects being casted to string form when used as indices, 1 == "1" returning true, or the notoriously confusing this keyword. A particularly interesting quirk though, is the existence of various techniques for variable privacy. In its current state, there is no "direct” way to create a private variable in JavaScript. In other languages, you can use the private keyword or double-underscores and everything works, but variable privacy in JavaScript carries characteristics that make it seem more akin to an emergent trait of the language rather than an intended functionality. Let’s introduce some background to our problem. The "var” keyword Before 2015, there was essentially one w

Create a JavaScript Contact Form With the Smart Forms Framework

Best Date Format: Year Month Day

Image
Arguably the most common way to express a date is to include the day of the month, the month, and the year. And there are many ways to order that information. For example, day, month, year, like 20/11/2020. Or perhaps a more common example is month, day, year, like 12/30/2024. Any programmer will tell you that there are endless variations and possibilities. With the scripting language PHP for example, there are many ways to format a date . So it begs the question, is there an optimal way to write dates? Why yes in fact, there is.. YEAR/MONTH/DAY format maintains perfect calendrical order and scales infinitely. Numerical Order is the Key For one-off dates, like when filling out a form or something, you can use whatever date format makes sense. But when working with multiple dates, like with archived files, it’s always best to write numerical dates in descending order . Doing so preserves calendrical order and is infinitely scalable. To understand this, consider some examples. P

What Is Code?

Sometimes, it feels like people who can code seem like they have superpowers. But what is code, anyway? Code is all around us. Code is used in things like computers, phones, self-driving cars, and all other... The post What Is Code? appeared first on Treehouse Blog . from Treehouse Blog http://bit.ly/2HP0Flc

Weekly Platform News: Favicon Guidelines, Accessibility Testing, Web Almanac

Reducing motion with the picture element

Here’s a bonafide CSS/HTML trick from Brad Frost and Dave Rupert where they use the <picture> element to switch out a GIF file with an image if the user has reduced motion enabled . This is how Brad goes about implementing that: <picture> <!-- This image will be loaded if the media query is true --> <source srcset="no-motion.jpg" media="(prefers-reduced-motion: reduce)"></source> <!-- Otherwise, load this gif --> <img srcset="animated.gif alt="brick wall"/> </picture> How nifty is this? It makes me wonder if there are other ways this image-switching technique can be used besides accessibility and responsive images... Also it’s worth noting that Eric Bailey wrote about the reduced motion media query a while back where he digs into its history and various approaches to use it. Direct Link to Article — Permalink The post Reducing motion with the picture element appeared first on CSS-T

Reading List 232

Link O’ The Week: Privacy Preserving Ad Click Attribution For the Web – a very interesting proposal by Apple WebKit engineer @johnwilander, already an experimental feature in Safari Technology Preview 82+. Cake or death: AMP and the worrying power dynamics of the web by Andrew Betts. Excellent read. W3C and WHATWG to work together to advance the open Web platform – Winners will be web developers who don’t have competing specs claiming to be The Truth. And if WHATWG will take some of the accessibility & authoring advice from W3C specs, we all win. *If*. reducing motion with the picture element – do this if you use animated GIFs CSS Grid Generator by Sarah Drasner. ( Explainer ) Meet the Flexbox Inspector – avoid the “Flexbox Pit of Despair” with the new Firefox devtools A Model for WordPress Accessibility by hunky Uncle @aardrian Learn Docker in 12 Minutes – nice YouTube video introducing Docker Compiling C to WebAssembly without Emscripten by Das Surma First Amer

20+ Best Artistic Business Card Designs (For Creatives & Artists in 2019)

20 Basic Resume Templates (Top Examples to Download Today)

20+ Simple Invoice Design Templates: Made For Microsoft Word

5 Top Presets for Fast Picture Styles in After Effects (LUTs)

20 Best Small Business WordPress Website Themes for 2019

How to Make an Infographic Template

How to Make a Book in InDesign

Why You Should Learn Python

Thinking about learning Python? That’s a great idea. What is Python? Python is a general purpose programming language that is used for a variety of different web applications. It was designed to be very easy to... The post Why You Should Learn Python appeared first on Treehouse Blog . from Treehouse Blog http://bit.ly/2W5xbmF

15 Top Instagram Ad Templates on Placeit Video Maker for 2019

A Practical Use Case for Vue Render Functions: Building a Design System Typography Grid

Customer Satisfaction Surveys with Wufoo

How to use Vertical Video (for Social Media)

Tips for Utilizing Infographics on Your Website

How to Write a Summary of Accomplishments on Your Resume (Not Just List Duties)

25 Best Pitch Deck Templates: For Business Plan PowerPoint Presentations

How to Create a Mosaic Photo Effect Action in Photoshop

46 Best Photoshop Actions With Creative Photo Effects

How to Color Grade Video Quickly (With Presets) in Premiere Pro

How to Create a Mega Menu With a Free WordPress Plugin

10 Best Restaurant WordPress Plugins

10 Top Intro Themes for Engaging Podcasts and Videos

A Quick Look at the First Public Working Draft for Color Adjust Module 1

The difference between keyboard and screen reader navigation

There are a few differences between keyboards and screen readers and Léonie Watson highlights of them: When using the tab key, keyboard focus and screen reader focus are synchronised with each other. The rest of the time, screen reader users have an enormous range of commands at their disposal for reading and navigating content independently of keyboard focus. The commands vary between screen readers, but they all have one thing in common: they’re tied to different HTML elements. This is also a good reminder that screen readers behave differently from one another. It’s worth doing some research to see how our sites work in all these environments. One thing is clear from this post though: writing semantic and concise HTML is the best way to improve accessibility for both users with keyboards and screen readers. For example, Scott O'Hara has this recent post on best practices using the tabindex attribute to ensure accessible navigation using the keyboard. Direct Link to Art

Creating Interactive Maps in WordPress with MapSVG

Glitching Scratch 3.0 on an Embedded Web Game Console

Image
Today, we are excited to announce our partnership with JoyLabz, which began in 2017 and has centered around the development of a new game console called GameBender. JoyLabz, developers of Makey Makey and Drawdio, and founded by former Lifelong Kindergarten researcher Jay Silver, has been an incredible partner. We are excited to finally share the […] from Bocoup http://bit.ly/2I2KYpg

How and Why to Create a Trailer for Your Film

Hiring Writers With Graphic Design & Copywriting Skills at Tuts+ Business (Apply Now!)

How to Create Google Slides Presentations Using Cool (Customizable) Themes

Top 3 Film Emulation LUTs (Look Presets) to Instantly Change Picture Styles

How to Give a Good Presentation-Without Anxiety or Being Nervous

How to Make a Filter Icon

How to Create a Simple Magazine Template in Adobe InDesign

Color contrast accessibility tools

What I’m Learning: How to Create Balanced and Diverse Teams

Hey everybody! 👋 Ryan here again. I have some exciting news. I’m assuming you’re here for two reasons. First: You want to learn more about how to create balanced and diverse teams at your company. Second:... The post What I’m Learning: How to Create Balanced and Diverse Teams appeared first on Treehouse Blog . from Treehouse Blog http://bit.ly/2EH6hMd

Reducing motion with the picture element

Image
I was just talking with Dave about the accessibility of moving images on the web, and he said: hm… I wonder if you could use picture + prefers-reduced-motion ? He then sends the following code: <picture> <source srcset="no-motion.jpg" media="(prefers-reduced-motion: reduce)"></source> <img srcset="animated.gif alt="brick wall"/> </picture> I copied the code, dropped it into a post of mine , created a static image of an animated GIF, and turned on the “reduce motion” preference (System Preferences > Accessibility > Display). And then BOOM. Just worked. In real time! I think this is so freaking cool. I always associated prefers-reduced-motion with CSS, but of course the picture element accepts media queries! Where else could this be useful? This technique would definitely be helpful for posts with embedded animated GIFs in it. Authors would have to grab a static frame of a GIF as a fallback, so the

Top 4 Ionic App Builders and Universal Ionic Templates

Cloning a live WordPress site to work on locally

I’m doing some changes to this WordPress site and wanted to get out of the loop of FTPing a new version of my CSS to the live server and refreshing the browser. Rather than clone the site and setup a dev server, I wanted to host it on my local machine so the cycle of changing and testing would be faster and I could work online. Nice people on Twitter recommended Local By Flywheel which was easy to install and get going (no dependancy rabbit hole) and which allows you to locally host multiple sites. It also has a really intuitive UI. To clone my live site, I installed the BackUpWordPress plugin , told it to backup the MySQL database and the files (eg, the theme, plugins etc) and let it run. It exports a file that Local by Flywheel can easily injest – simply drag and drop it onto Local’s start screen. (There’s a handy video that shows how to do it.) For some reason, although I use the excellent Make Paths Relative plugin , the link to my main stylesheet uses the absolute path, so I

Using the Grid Shepherd Technique to Order Data with CSS

How to Make Your Resume in PowerPoint (With Creative PPT Templates)

15+ Best Business Presentation Tips: Quotes From the Experts (For Great Results in 2019)

How to Create a Photo to Watercolor Photoshop Action

25+ Best Free PSD Mockups (Photoshop Templates for 2019)

How to Make Your WordPress Theme or Plugin Multilingual-Ready

10 Best WordPress Gallery Plugins of 2019

Prioritizing

Night Mode with Mix Blend Mode: Difference

25 Simple Google Slides Themes (Free + Premium) to Design Minimalist Presentations

How to Build a Filterable Thumbnail Layout with CSS Grid, Flexbox and JavaScript

A Brief History of Type

How to Create a Living Galaxy Photo Effect in Adobe Photoshop

How (and Why) to Add Particle Animation Effects to Your Videos

How to Quickly Customize a Google Slides Calendar Template

50 Awesome Icon Tutorials

How to Fade Your Adobe Lightroom Presets

20+ Best Real Estate Business Card Designs (Unique Ideas for 2019)

Envato Tuts+ Community Challenge: Created by You, May 2019 Edition

How to Make Maps in Google Slides With Templates

Next Level: Top 3 Space-Themed Stock Video Clips

How to Create a Typography Dispersion Action in Adobe Photoshop

Top 3 Looping Video Backgrounds (Stock Footage) for Live Steaming

Code as Documentation: New Strategies with CSS Grid

Weekly Platform News: Mozilla WebThings, Internet Explorer mode, GraphQL

Reading List 231

A report from the AMP Advisory Committee Meeting – Uncle Tezza (@edent) joined the AMP Advisory Committee so Google aren’t surrounded by yes-men, and so you don’t have to. Buy him a pint next time you see him and give him a big snog to say thanks. Sheetson – “Instantly turn any Google Sheet into RESTful API.” Animation Handbook – looks pretty good (but I know nothing about animation) SVG Properties and CSS – “the SVG elements that are available to us as well as the CSS properties for them.” If you use AMP, are your sites accessible? (from the official AMP Advisory Committee minutes) Hands-on with Portals: seamless navigations on the Web as Malte Ubi writes “with Portals you can make something that feels like a single SPA even though page A is built with LegacyAngularWeNoLongerTouchThis and page B is built with ReactInternProjectWeDidntKnowHowReduxWorksYet.” Switching From WordPress To Hugo – convert an existing WP site to static site generator Everything You Ever Wanted

20+ Best Photography Business Card Designs (2019 Creative Ideas & Examples)

How to Deal With Difficult Coworkers and Employees: Steps You Can Take Today

New Course on Using HTML Tables the Right Way in 2019

How to Make a (Good Looking) Poster

Tech Jobs: An Explainer

Did you know? 1.3 million new developer jobs will be created in the next 10 years. No matter your background or previous experience, there’s never been a better time to start your journey toward one of... The post Tech Jobs: An Explainer appeared first on Treehouse Blog . from Treehouse Blog http://bit.ly/2QgPlAT

The Power of Serverless v2.0! (Now an Open-Source Gatsby Site Hosted on Netlify)

Create a Home Page With the Elements Plugin for WordPress

Create a Google Login Page in PHP

How to Create a WordPress Child Theme

Image
If you're using a theme you downloaded from the free WordPress theme repository, or maybe one you've bought from ThemeForest , you may want to make some tweaks to it. Maybe you want to register a new font. Or add a new template file. Maybe you want to add some code from one of the tutorials or courses here on Envato Tuts+ . Or perhaps you want to use the theme as the basis for a theme of your own design. You might be tempted to just go and edit the source code for a third-party theme (ie. a theme you didn't write yourself), but don't! The next time you update that theme, new files will be downloaded and you'll lose all the changes you made. Frustrating, to say the least. But what can you do, if you do need to edit the theme? Luckily there is a way to edit the code in a theme, and still have the ability to download the latest updates: that's by creating a child theme using the original theme as a parent theme. This means that you'll activate the child t

How to Create Engaging Crowdfunding Videos (and Boost Your Campaign)

Front-End Documentation, Style Guides and the Rise of MDX

How to Design Your Business Card Quickly (With a Pro Online Maker App)

Best Software for Icon Design: Photoshop vs. Illustrator

How to Make a Persuasive PowerPoint Presentation (With Powerful Tips)

The Best Preset Pack for Instant Video Styles (Look Preset LUTs) in Final Cut Pro

10 Amazing Backgrounds Every Graphic Designer Should Own

How to Make a Video Slideshow (With a Template) in Final Cut Pro

18+ Best Fitness WordPress Themes for 2019 Gym & Exercise Sites

10 Top Intro Video Templates for Final Cut Pro

7 Principles of Good Website Design for Newspaper WordPress Themes

How to Get Your Video Files Into Premiere Pro (Best Import Methods)

The Browser Can Remember Edited Content

Getting Started with React Testing Library

I can guess what you are thinking: another React testing library? So many have already been covered here on CSS-Tricks (heck, I’ve already posted one covering Jest and Enzyme ) so aren’t there already enough options to go around? But react-testing-library is not just another testing library. It’s a testing library, yes, but one that’s built with one fundamental principle that separates it from the rest. The more your tests resemble the way your software is used, the more confidence they can give you. It tries to address tests for how a user will use your application. In fact, it’s done in such a way that tests won’t break even when you refactor components. And I know that’s something we’ve all run into at some point in our React journey. We’re going to spend some time writing tests together using react-testing-library for a light to-do application I built. You can clone the repo locally: git clone https://github.com/kinsomicrote/todoapp-test.git And, if you do that, insta

25 Simple (CV) Resume Templates (Easy to Customize & Edit Quickly)

New Course: Create a Rainy Window Effect Animation in Adobe After Effects

Cartoon Fundamentals: How to Draw the Female Form

How to Make a Halftone Pattern in Photoshop

10 of My Best Tips on How to Start a Tech Apprenticeship Program

If you haven’t yet read the IWSI America report on Modern Apprentices, then I suggest you do. It talks about how to get started with apprenticeship and gives a list of key tasks to tackle. Here’s... The post 10 of My Best Tips on How to Start a Tech Apprenticeship Program appeared first on Treehouse Blog . from Treehouse Blog http://bit.ly/2Hwpy4P

How to Create a Dusty Texture From Scratch

25+ Best Free Photoshop (PSD) T-Shirt Mockup Templates

How to Create a Retro Vintage Badge in Adobe Photoshop

3 Top Transparent Background Templates for Premiere Pro

Destructing Elements in 3ds Max With RayFire: Part 2

Create a PHP Login Form

What Does it Mean to Be “Full Stack”?

How I Use CleanMyMac X

How to Create the Perfect Pitch Deck Presentation Design

Structured data and Google

Domain-specific markup for fun and profit It doesn’t come as a surprise to Dull Old Web Farts (DOWFs) like me to learn last month that Google gives a search boost to sites that use structured data (as well as rewarding sites for being performant and mobile-friendly). Google has brilliant heuristics for analysing the content of sites, but developers being explicit and marking up their content using subject-specific vocabularies means more robust results. For the first time (to my knowledge), Google has published some numbers on how structured data affects business . The headlines: Jobrapido’s overall organic traffic grew by 115%, and they have seen a 270% increase in new user registrations from organic traffic After the launch of job posting structured data, Google organic traffic to ZipRecruiter job pages converted at a rate three times higher than organic traffic from other search engines. The Google organic conversion rate on job pages was also more than 4.5 times higher than it

30+ Best PowerPoint Slide Templates (Free + Premium PPT Designs)

25+ Simple WordPress Themes to Quickly Make Sites (2019)

Create Beautiful Forms With PHP Form Builder

React Native App Templates and UI Kits to Save You Time

The “Inside” Problem

So, you're working on a design. You need a full-width container element because the design has a background-color that goes from edge-to-edge horizontally. But the content inside doesn’t necessarily need to be edge-to-edge. You want to: Limit the width (for large screens) Pad the edges Center the content It's "the inside problem" in web layout. It's not hard, it's just that there are lots of considerations. The "inside" issue. Centered, max-width/padding containers inside full-width color bands. What's your favorite pattern? (Just a fun every day thing with many possible solutions to consider!) pic.twitter.com/pNYf5YsQMp — Chris Coyier (@chriscoyier) March 14, 2019 The classic solution is an outer and inner container. The parent element is naturally as wide as it's own parent, and let's assume that's the <body> element, or the entire width of the browser window. That takes the background-color and pads the lef

Top 3 Video LUTs (Apply Look Presets and Picture Styles Fast)

Creating a Diversity Scholarship Program for Your Conference

The HTML Treasure Hunt

Here are my slides for The HTML Treasure Hunt , my keynote at the International JavaScript Conference last week. They probably don’t make much sense on their own, unfortunately, as I use slides as pointers for me to ramble about the subject, but a video is coming soon, and I’ll post it here. Given that one of my themes was “write less JS and more HTML”, feedback was great! Attendees gave me 4.8 out of 5 for “Quality of the presentation” (against a conference average of 4.0) and 4.9 for “Speaker’s knowledge of the subject” (against an average of 4.5). Comments included: great talk talk! reminding of the basics we often forget. amazing way to start the second day of this conference. inspiring to say the least. great job Bruce very entertaining and great message. excellent speaker Thanks, that was a talk a lot of us needed. Remarkable presentation. Thought provoking, backed with statistics. Well presented. Very experienced and inspiring speaker. I would really like to i

20+ Professional Business Card Designs (2019 Best Ideas & Examples)

18+ Best PowerPoint SlideShare Presentation Examples (For 2019)

What Your Web Typography Says About You

How to Create a Dramatic Angel Photo Manipulation in Photoshop

What Not to Put on a Good Resume: 20+ Things to Avoid in 2019

What Is Microsoft PowerPoint? +How to Start Using It For Presentations (Now)

22 Best Magazine Mockups Using an Online Generator (Cover, Layout, Flat, and More)

25 PPT Templates: To Make Simple Modern PowerPoint Presentations in 2019

25 Best PowerPoint Slide Design Templates (PPTs for 2019)

International Artist Feature: Belarus

Footnotes That Work in RSS Readers

Everything You Ever Wanted to Know About inputmode

Weekly news: PWA Issue on iOS, Performance Culture, Anti-Tracking in Browsers

Best Instagram Feed Plugins for WordPress in 2019

An Easy Way to Code a Mega Menu in WordPress

20+ Fun PowerPoint Templates With Colorful PPT Slide Designs (For 2019)

How to Make a Simple Flyer in Adobe InDesign

How to Create an Awesome Dispersion Action in Adobe Photoshop

20+ Best Flat Design, Modern WordPress Themes for 2019

Bluehost, Sitelock, SSL, and .htaccess

Image
Apparently, Bluehost partnered with a company called SiteLock sometime last year. Supposedly Sitelock is a “website scanner that proactively checks for malicious threats and vulnerabilities”. I guess the service operates on Bluehost servers, and today they sent a scary email letting me know that “malware was detected” on my Bluehost site. Here’s the thing though. I host only one site at Bluehost, and it is a simple one-page site with only a few simple files. So I was surprised by this “malware detected” alert from Sitelock. I mean, the site is so simple as to be practically identical to the default Bluehost setup. For example, if you sign up for a new account at Bluehost (or any web host), and then don’t do anything at all with it, just leave it entirely as-is in its default state, right. Then say the server gets hacked. It MUST follow that the default hosting setup is insecure. And this is why I found the malware alert so puzzling, because the site is only a few files away from the

10 Best WordPress Menu Plugins for 2019

Create JavaScript and HTML5 Forms for Free

Iterating a React Design with Styled Components

Evergreen Googlebot

I've heard people say that the #1 most exciting and important thing that came out of Google I/O this year was the evergreen Googlebot : Today, we are happy to announce that Googlebot now runs the latest Chromium rendering engine (74 at the time of this post) when rendering pages for Search. Moving forward, Googlebot will regularly update its rendering engine to ensure support for latest web platform features. Before this, I guess I never even thought about it. I guess part of it is that some people did already know that the old version didn't support some newfangled JavaScript stuff, and thus literally packaged their app with old JavaScript to be more SEO -friendly. A bunch of people were apparently shipping older code simply for the sake of Googlebot, and now they don't have to. Sure, I'll call that a win. Don't read this news as "don't worry about your JavaScript-rendered pages and SEO" though, because Google Webmasters is still telling us t