Server Name Indication (SNI) and Ingress TLS in Kubernetes with Ambassador

The open-source Ambassador 0.50 API gateway adds support for Server Name Indication (SNI), a much-requested feature from the community that allows the configuration of multiple TLS certificates to be served from a single ingress IP address. In this tutorial, we explore how multiple secure domains (e.g., https://www.datawire.io and https://www.getambassador.io.) can be provided by a single or load balanced Ambassador running within a Kubernetes cluster.

SNI Use Cases

In a nutshell (and with thanks to Wikipedia), SNI is an extension to the TLS protocol, which allows a client to indicate which hostname it is attempting to connect to at the start of the TCP handshaking process. This allows the server to present multiple certificates on the same IP address and TCP port number, which in turn enables the serving of multiple secure websites or API services without requiring all those sites to use the same certificate.

13 Reasons Why Selenium WebDriver Should Be Your Choice for Automation Testing

Developed in 2004 by Thoughtworks for internal usage, Selenium is a widely used tool for automated testing of web applications. Initially, Selenium IDE (Integrated Development Environment) was being used by multiple organizations and testers worldwide and saved a lot of time and effort by the benefits of automation testing with Selenium. The major downside of automation testing with Selenium IDE was that it would only work with Firefox. To resolve the issue, Selenium RC(Remote Control) was used, which enabled Selenium to support automated cross-browser testing.

But currently, websites are becoming more robust with multiple features. Also, nowadays, with the majority of the organization making a mobile-friendly website, testers have to keep in mind that a website should work properly not only in desktop but also in Android as well as iOS. Selenium RC gradually lagged behind since it did not have the feature for testing browser compatibility of a website across multiple devices. To overcome all these issues, Selenium Webdriver stepped in.

Devs Will Just Dev! The Cloud Foundry Promise

“Every company is a technology company” said Peter Sondergaard, Gartner's former executive vice president of research, and evidence of this is all around us. But it was not so easy becoming a technology company, as the entry barriers were high. Besides developing their business propositions, companies had to develop, maintain and operate the platform on top of which their businesses (i.e. applications) run. 

The rise of DevOps culture, automated pipelines, container technologies, and microservices, all contributed to an improved situation. And all these are still evolving and getting increasingly popular. But still, businesses have to deal with things outside the development of their specific business propositions. There is still an operational load to carry, and the load seems to be moved now to the hands of developers. Cloud Foundry helps to eliminate this operational load and the need for building platforms and utility components that have no relation to your business propositions. Cloud Foundry makes it possible to develop only what contributes to your bottom line while it takes care of the rest. It allows developers to just develop! 

5 Tips for Maximizing Value in Multi-Speed It Environments

In the majority of phased enterprise Agile transformation programs, multi-speed IT is unavoidable. When I say multi-speed IT, I refer to a world where Agile and waterfall (legacy) initiatives co-exist and need to work hand in hand to deliver business outcomes.

In the last two decades, I had the opportunity to work with different enterprises in a variety of industries helping their transformation journey. Every organization is different even if they operate in the same industry. The business needs, enterprise portfolio, and IT landscape vary from one organization to another. The agenda of transformation also differs from one to another resulting in different approaches, initiatives, and timelines. No matter what the approach an organization adopts for transformation (change and growth), the journey from current state to future state requires innovative strategies to sustain business operations during the period of transformation.

DevOps Automation and IaC

In my previous blog, I talked about DevOps and compared it to the manufacturing of physical goods. I also mentioned the four key tenets of DevOps (CAMS) and stressed the importance of the automation component.

  • Culture
  • Automation
  • Measurement
  • Sharing

With DevOps, automation manifests itself in two forms, automation of the

Build Pipelines for GitHub Projects

If you have a project on GitHub, chances are you will want to continually build it to ensure it is still compiling, that it is still working — meaning, all tests are passing — and possibly create a release of the project so others, including yourself, can simply use the latest version without having to manually compile/package it. For all that, you will need a build pipeline.

GitHub now has a feature called GitHub Actions that can be used for many things, especially workflows that are triggered by events in your repository — like "issue created" or "push." And while developers can be very creative and extrapolate the boundaries of what GitHub Actions is aiming for, the reality is that for complex applications continuous integration and delivery, you are more likely better off with a platform that gives you control over build agents, software provisioned in them, custom webhooks, human control over workflows, and so on.

Google has banned all third party repair ads? Since Nov. 2018.

Start with https://www.google.com/search?q=google+banned+all+apple+repair+ads and there it is. It appears to be mostly about Apple products and when two juggernauts, dare I write collude even if openly, we all lose.

Apple's repair system is OK when your device is under AppleCare but beyond that we see the repair price climb to levels where they essentially tell you to buy a new on.

I've had no qualms about many third party repair companies but Apple seems to have declared war.

#208: Tagging

Cassidy and Marie talk about a tiny detail that improved how we handle our GitLab issues: tagging.

Time Jumps

  • 00:42:08 The history of CodePen tagging
  • 05:31:07 Can you have too many tags?
  • 14:23:12 Sponsor: Jetpack
  • 16:44:07 Giving descriptions to tags in Gitlab
  • 19:49:07 How does this compare to other places?
  • 23:03:20 Frequently occuring tag for customers
  • 26:11:12 Send us feedback on this episode

Sponsor: Jetpack 14:23

Jetpack brings a wealth of features to your self-hosted WordPress site as one of the best no-brainer plugins for WordPress there is. One feature I just recently used for the first time was the video hosting and video player. I had a video clip that I just wanted to drag and drop into a blog post like I would an image, but it was a little too big. Fortunately I just uploaded it through WordPress.com, it was magically available in the Media dialog on my self-hosted site, and it worked perfectly.

Show Links

CodePen Links

The post #208: Tagging appeared first on CodePen Blog.

How to Start an Online Store in 6 Simple Steps

Want to just get started? Click here to sign up for Hostinger and start your online store with WooCommerce today.

Starting an online store isn’t only about having a brilliant idea—you also need to market it well to maximize your reach.

Get it right and you’ll watch sales start to roll in. Get it wrong and you’ll just have a very time-consuming hobby on your hands. In this post, I’ll show you how to create an online store today and how to get your first customers to show up.

Top-Rated Ecommerce Website Builders to Create an Online Store

If you want to create an online store, you’ll need an ecommerce website builder. Here are the best options.

  • Hostinger — Best for WooCommerce sites
  • Shopify — Best all-around ecommerce website builder
  • Wix — Best for launching an online store in minutes
  • BigCommerce — Best site builder for multichannel selling

You can read our full reviews of all our recommended ecommerce website builders.

Start an Online Store in 6 Easy Steps

The sooner you start, the sooner you can pick up on the trends that really matter to your market.

  1. Pick your marketing strategy
  2. Find the right product niche
  3. Pick a name for your brand
  4. Create your online store
  5. Do a 60-day marketing burst
  6. Build your marketing flywheel
How to start an online store in 6 easy steps.

Step 1: Pick Your Marketing Strategy

Create a solid marketing strategy that helps you achieve your short-term and long-term business goals. While this may not look too hard, how well you choose your marketing strategy can make or break your online store. 

Generally, successful online stores use one of the following three tactics:

  1. SEO
  2. Paid marketing
  3. Platform marketing

Let’s discuss them in more detail.

SEO for Online Stores

This marketing strategy is pretty simple: find keywords for products that you want to offer, then get your site to rank in Google for those keywords.

Google search for bookcase with results example.

In this example, IKEA, Target, and Amazon rank very well organically (the ones underneath the carousel and the ads) for the search term “bookcase.” That means when hundreds of people search the term bookcase every day, they’ll be led directly to these websites where they can purchase bookcases.

If you get this strategy to work for your business, you can make a lot of money with your online store.

SEO has a few benefits that are ideal for a business:

  • The traffic streams are very dependable, which means dependable revenue for your business.
  • Search traffic usually has the highest volume of traffic of any traffic source.
  • Even at scale, search traffic can be enormously profitable.

Dependable, high volume, and profitable. It’s everything you want.

There is one major downside: SEO takes a lot of time and effort. Even if you’re pursuing a product category without any competitors, it can still take a good 3–6 months to see your site appear on the first or second page of search results for a keyword.

And traffic volume will be pretty small until you get your page into the top 1–3 rankings on a keyword. If your category is even modestly competitive, it can take years of effort to get to that point.

If you go with SEO as the marketing strategy for your online store, you’ll focus on three things:

  1. Optimizing your product pages for product keywords.
  2. Building useful and engaging content for non-product keywords that are also in your category. This helps your product pages rank.
  3. Making your content so good that people will link to it as a resource.

When playing the SEO game, there are only two things that matter: content and links. So that’s where you’ll spend the bulk of your time.

Paid Marketing for Online Stores

Some online stores do exceptionally well with paid marketing. This includes sponsored posts on Instagram and Facebook, and paid results in Google searches. Paid marketing involves ad placements you buy.

Instragram Paid Ecommerce Ad

But is paid marketing right for your business? My general rule of thumb: paid marketing is a great option if your product is the type of thing that could be featured in a mall.

Why?

The biggest paid marketing channels right now are Facebook and Instagram. Instagram in particular has gotten very popular for online stores in the last few years.

But think of the frame of mind someone has while scrolling through their Facebook or Instagram feed. They’re relaxing for a few minutes, laughing at a few photos, and leaving quick messages for a few friends. They’re enjoying themselves. It’s a lot like how people shop at a mall.

Sometimes, people are looking for a particular item, but a lot of people go to the mall to enjoy themselves. Malls have known this for a long time and stores have optimized around this browsing experience.

Products that sell effectively in a mall are also likely to do well with a paid ad on Facebook or Instagram. These products typically are:

  • Consumer products. Business products have a much harder time on these channels.
  • Highly visual and eye-catching. This is why apparel companies do so well in malls and why apparel companies have been really aggressive on Instagram in the last few years.
  • Simple to understand. The offer needs to be understood within 3 seconds. If you have a more complicated sales process that requires more explanation, people will have scrolled past your ad long before you have a chance to make the sale.
  • An impulse-friendly price point. If the price is too high that people need to carefully think through the decision, they’ll skip your ad and quickly forget it.

If your product meets all these criteria, you should seriously consider going the paid marketing route.

Screenshot of Google Ads landing page featuring search ads

Google Ads (formerly AdWords) is one exception to this. Since you’re bidding on keywords within Google, you put your ad in front of people who are already actively searching for that type of product. As long as the keyword has enough search volume and the ad bids aren’t too competitive, it’ll work very nicely.

The biggest downside to paid marketing is that you’ll have to invest a bunch of money upfront before you know whether or not you can turn a profit. Many of us don’t have those thousands of dollars to invest without a reliable chance of getting it back.

Most paid campaigns don’t turn a profit initially; they usually take a lot of iteration and work before they start making a profit. Most professional paid marketers need 3–6 months before their campaigns become profitable.

So be careful and make sure you don’t invest more than you can afford to lose here. If cash is tight, choose one of the other marketing options.

Platform Marketing for Online Stores

This is a completely different direction than the two methods above.

Instead of creating your own store and using a type of marketing to acquire traffic, you’ll leverage one of the main ecommerce platforms:

  • Amazon
  • Etsy
  • eBay
Amazon search results example.

It’s definitely possible to be successful at any of these three. I recommend most folks go after Amazon. Amazon’s audience is much larger which gives you more upside and just about every product niche already exists on Amazon.

The main exception is if you’re doing a craft business of some kind, like making your own bookends to sell to people. In that case, Etsy is a better fit since the audience expects more craft-oriented products.

eBay is still great if you’re doing a bunch of buying and reselling. But if you’re producing the same types of items consistently, the potential on Amazon is much greater.

You treat whichever platform you choose as your marketing channel. First, you’ll create your store on that platform and list all your products. Second, you’ll optimize your store to the best of your ability so the platform wants to feature your products.

Optimizing your store usually involves focusing on two areas:

  • Targeting your product pages to specific terms searched for within the platform
  • Getting as many 5-star reviews on your products as possible

As you improve your search terms and reviews, more people will see your products on that platform, which will produce more sales for you.

How to Choose the Best Type of Online Store for You

The type of online store you open will be directly tied to your marketing strategy. Those options include:

  • SEO — Focusing on content and links, which requires time and patience. 
  • Paid Marketing — You’re paying for exposure. This strategy requires money upfront, an easy-to-understand product, a friendly price point, and about three to six months of work to pay off. 
  • Existing platforms like Amazon, Etsy, and eBay — You’ll focus on winning the search terms within that marketplace and stacking up 5-star reviews. Success here requires a commitment to that platform.

I strongly recommend that you pick one of these and build your entire business around it. That’s right, just one.

Why can’t you do more than one?

I’ve made this exact mistake so many times myself. After a decade of working in online marketing alongside some of the most well-respected marketers out there, I’ve noticed one overwhelming trend—businesses that are good at one type of marketing are generally pretty bad at the others.

Here’s why it’s hard to be good at multiple types of marketing:

  • Every marketing channel is completely unique. While some marketing principles apply across all channels, you’ll have to learn all the tactics from the ground up. Constantly trying to learn new channels really slows you down.
  • Online marketing channels constantly change. What works today won’t work next year. Even though I’ve spent a decade doing SEO, I still feel like I’m relearning it every year. If you’re focused on a single marketing channel, you’ll have a much easier time keeping up.
  • Online marketing channels are power laws. This means the majority of the profits go to a few big players, and everyone else fights for scraps. If you’re not one of the winners, you won’t be making much.

If you stick with one marketing channel, you’ll get through the learning curve a lot faster. The faster you unlock your marketing channel, the sooner you’ll be making real money with your online store.

This step is crucial, so don’t rush through it. Landing on the right choice here will set up the foundation for your online store. 

Step 2: Find the Right Product Niche for Your Online Store

After choosing your marketing strategy, picking your product niche is the most important decision you’ll make.

One tip: Don’t just jump into product categories. Yes, being personally interested in the category really helps with building the business. But it’s also an easy trap.

You might pick a category that won’t support a thriving business. It doesn’t matter how much time and energy you put into it. If there’s no demand, the business won’t succeed.

Here are some of the things I look for in a good product category for an online store:

Avoid picking a category that’s too niche

A common best practice in marketing is to differentiate yourself. And this is powerful advice — it’s a huge advantage when you have it.

It’s also tricky to find a genuine way to differentiate yourself that the market is willing to pay for. There are countless ways to differentiate any given product, but only 1–2 actually matter.

Does the top-rated toothbrush holder on Amazon need to do something wacky and unique? Not at all. It needs to be simple, easy to use, reliable, affordable, and have a ton of reviews on Amazon. That’s it.

Instead of trying to differentiate yourself from every other product in your category, find a category with competitors that aren’t dominating their marketing channel.

Are the Amazon reviews low for all the top products? Are the SEO results of low quality? Are there no companies putting serious ad dollars behind a product? If the answer is yes, there’s an opportunity for you to out-compete them with your marketing.

A moderate price is key

Avoid any product category with too low of a price.

After all, if you only earn $1 in profit for each sale, you’ll have to sell 100,000 products every year to support yourself. After taxes and overhead, that’ll give you about $50–60K per year to live on.

Selling 100,000 of anything is a lot of work.

Is it terrible? Not necessarily. Could it be better? Definitely.

Now let’s assume that you’re selling something for $80 and making $40 in profit on each sale. To make $100,000 per year, you’ll only need to sell 2,500 items. That’s much more manageable.

However, you also want to avoid selling something at a price that’s too high. As pricing changes, so does buyer behavior. Prospects demand more proof. They may even demand a completely different buying process.

How many people buy cars without test driving them first? Not many. They want to see the car and talk to a real person before making a purchase that big. Cars require a lot of extra work and sales skills to sell effectively because of their higher price point.

We recommend finding a product that you can sell for between $50 and $100 dollars. It’s high enough that sales will add up quickly for you. Yet it’s also low enough that the buying process will be straightforward.

When trying to find the right price for the product you want to sell, it is important to accurately assess the costs involved. 

Setting the proper price for your items requires a lot of research. Determine what it will cost for you to obtain, store, and ship the products. Check out the competition for what kinds of price ranges you will be going against. 

If you estimate you will make a $40 profit, but you really only end up making a $20 profit, you will need to sell twice as many items to make that $100,000 per year we referenced. It is vital to accurately research your costs when you are looking for a product with a moderate price.

Make sure there’s demand.

You can tell if there’s demand by doing some easy research using the marketing channel of your choice.

For SEO, Google Ads has a Keyword Planner that tells you how many times something is searched in Google every month. If the keyword for your product gets less than 1,000 searches per month, it’s probably too small to build a business on.

Same with Amazon. If you have trouble finding products in your category with more than 100 reviews, it’s probably too small.

These days, I’d much rather pick a category that I have zero experience in but has genuine demand. That’s much better than realizing that a passion category of mine has zero demand later on.

Step 3: Pick a Name for Your Brand

Heads up: This is a TOUGH step.

That’s because a lot of the good names have been claimed. The websites are taken, the best names have been trademarked, and you’ll feel like you’re hitting dead-end after dead-end.

You might feel tempted to cut corners. You might even want to choose a less-than-ideal name just to get on with it.

Do not do this.

It’s 100% worth the effort to find a good one. It will pay off.

Here’s the naming checklist I use:

  • Easy to spell. I never want any friction when people are trying to find my site.
  • 3 words or fewer. I like to keep it as short as possible so it’s easier to remember. One or two words is ideal, three is still good…more than that is too many.
  • Pass the bar test. I should be able to say the name in a noisy bar without repeating it. That’s a great sign that it’s easy to understand. This is huge for word-of-mouth marketing later.
  • Can get the .com domain. Every online store needs a .com. It’s become too much of a standard. Some folks use weird domains like company.online or company.io. In my opinion, this causes problems later because whoever owns company.com will know how valuable it is once you try to buy it. I either buy the domain early or find one that’s instantly available.
  • Relevant to your category. Make sure the name relates to your product category in some way.
  • No trademark conflicts. Any corporate law firm can do a quick check for you on this. Since legal time is expensive, find 3–5 name options that check all the above items. Then have an attorney check for the trademarks all at the same time. It’s rare to not have at least one of them work.

We have an in-depth guide on how to pick and buy a domain name here.

Once you have your name picked, grab the domain using your domain registrar. Or if you’re buying the domain from someone, get it transferred into the domain registrar that you want to use for the long term.

Step 4: Open Your Online Store

If you’re pursuing an SEO or paid marketing strategy, this is a crucial step.

Why? Simple: The quality of your site has a huge impact on how much of your traffic will turn into buyers.

To make sure you make the highest-quality site, we recommend you use Hostinger.

  • 30-day free trial
  • Pre-built ecommerce templates
  • Integrated payment processing
  • Free marketing & SEO extensions
Try Hostinger for Free

Hostinger offers a great deal on WooCommerce (starting at $3.99 per month), and they make the setup of your online store as easy as humanly possible.

Even if you have never built a website before, let alone an online store, Hostinger offers a truly plug-and-play solution. You can be adding your first products in less than an hour of signing up, even if you’re an ecommerce rookie.

WooCommerce homepage

Here’s a step-by-step walkthrough of how to set up your WooCommerce store with Hostinger. There’s a much more detailed process there.

If you plan on carrying thousands of items, or have multiple inventory locations (brick & mortar stores, warehouses, etc.), you probably want something like Shopify or BigCommerce that is built to scale. Learn how to set up your Shopify store in our in-depth guide. WooCommerce is still a solid choice, but those two platforms handle bigger operations better.

But for most people starting their first store, running WooCommerce on Hostinger is all they need at a lot lower price.

Every ecommerce platform I’ve recommended comes with built-in marketing tools. You” also be able to connect your online store to social networks, like Instagram and Pinterest, as well as marketplaces, like eBay and Amazon.

Let’s talk about how to drive some digital foot traffic to your new shop.

Step 5: Do a 60-day Marketing Burst

There’s a good chance you’re starting small when your online store launches. 

So looking for quick wins to build momentum will really help you out in these early stages. You still need to get your first review, first page that ranks on Google, and first purchase from a paid ad.

Don’t worry about scalability, efficiency, and optimizing your systems in these first few days. Instead, find easy ways to build momentum—even if it takes lots of personal outreach and effort on your end. 

Examples include:

  • Tap into your personal network to see if anyone is willing to do an interview, and publish it on their own website. This will help you get your first few backlinks.
  • Ask personal friends and relatives to leave reviews on Amazon.
  • Spend some of your own cash on paid ads to test the offer.

These obviously aren’t sustainable strategies over the long term, but they’ll get you some quick wins. 

Do some research on your marketing channel and create a list of 50 ideas that you could do on your own. Then prioritize those ideas and create a 60-day Marketing Bust. The idea here is to ship as many ideas as you possibly can within those 60 days.

Be reasonable with your time and effort here. You don’t need to put in 90-hour weeks and burn yourself out. But expect to roll up your sleeves and put in some work.

By the end of this 60-day burst, you should have your first handful of sales. That sales stream should be enough to start building your marketing flywheel.

Step 6: Build Your Marketing Flywheel

Once you have some initial momentum, it’s time to start building the marketing flywheel that will grow your business around the clock without you having to personally accomplish every task.

What’s a flywheel? It’s a big wheel in an engine that helps create and preserve energy. We’re taking the same concept to your marketing plan to create big growth.

In the early days on Amazon, you’ll need to personally ask for a lot of your first product reviews. But that’s not sustainable.

Instead, look for marketing tactics that help create Amazon reviews for you without you asking for them.

Here’s an example:

A popular tactic on Amazon is to ask customers to leave a review. Some will even promise a discount code on the next purchase if a review is published.

You can automate that tactic. Have an assistant send the same templated email to every new customer, asking for a review and promising a discount code on their next order. All the platforms allow you to message customers personally through the platform.

So while you shouldn’t email blast all your customers at once, you can have an assistant send messages out one by one every week on your behalf. That’s a repeatable flywheel that doesn’t take up your time.

There is a ton you can do with email marketing that doesn’t cost a dollar.

A quick side note on this review tactic: Before you try something like this, make sure to check the guidelines and policies of the platform you’re on. There are always rules about these sorts of things and every platform is slightly different. Be careful to not push things too far, putting your store in danger of getting removed entirely.

Look for as many of these repeatable marketing flywheels as you can.

Instead of creating content yourself, can you pay someone for content?

If you did the keyword research, made a list of requirements that you want on each piece of content, and hired someone else to write the post itself, you could create a lot more content to help you win with an SEO marketing strategy. That’s a flywheel.

Instead of optimizing your paid ads yourself, can you delegate that? If your conversion rates are consistently improving and your cost to acquire a customer is going down, that lets you buy more customers with the same amount of capital. That accelerates your business without your personal effort. Another flywheel.

Focus on your core marketing channel and then build a marketing flywheel that will keep your online store growing without any effort from you. This is the key to opening an online store, generating sales quickly, and accelerating its growth.

Final Thoughts About Starting an Online Store

With the six tips above, you can start building an online store with Hostinger–or whichever ecommerce website builder matches your needs best. See all of our top picks on the list of our favorite ecommerce website builders. You can also check out our guide to the best web hosting companies to see what you need to go live with your online store. Happy selling!

Start your free trial with Hostinger today and start your online store in just minutes. Then follow the rest of my tips above to get an edge on the competition.

  • 30-day free trial
  • Pre-built ecommerce templates
  • Integrated payment processing
  • Free marketing & SEO extensions
Try Hostinger for Free

80+ Best WooCommerce Extensions & Addons

Best WooCommerce Extensions & Addons for WordPressWooCommerce is one of the most well know and used e-commerce WordPress plugins. Not only is it a completely free e-commerce solution for WordPress but it is also easy to use, includes support for many product formats, has options for currencies and taxes, offers the ability to integrate multiple shipping methods and has built-in support […]

The post 80+ Best WooCommerce Extensions & Addons appeared first on WPExplorer.

Slide an Image to Reveal Text with CSS Animations

I want to take a closer look at the CSS animation property and walk through an effect that I used on my own portfolio website: making text appear from behind a moving object. Here’s an isolated example if you’d like to see the final product.

Here’s what we're going to work with:

See the Pen
Revealing Text Animation Part 4 - Responsive
by Jesper Ekstrom (@jesper-ekstrom)
on CodePen.

Even if you’re not all that interested in the effect itself, this will be an excellent exercise to expand your CSS knowledge and begin creating unique animations of your own. In my case, digging deep into animation helped me grow more confident in my CSS abilities and increased my creativity, which got me more interested in front-end development as a whole.

Ready? Set. Let’s go!

Step 1: Markup the main elements

Before we start with the animations, let's create a parent container that covers the full viewport. Inside it, we're adding the text and the image, each in a separate div so it’s easier to customize them later on. The HMTL markup will look like this:

<!-- The parent container -->
<div class="container"> 
  <!-- The div containing the image -->
  <div class="image-container">
  <img src="https://jesperekstrom.com/wp-content/uploads/2018/11/Wordpress-folder-purple.png" alt="wordpress-folder-icon">
  </div>
  <!-- The div containing the text that's revealed -->
  <div class="text-container">
    <h1>Animation</h1>
  </div>
</div>

We are going to use this trusty transform trick to make the divs center both vertically and horizontally with a position: absolute; inside our parent container, and since we want the image to display in front of the text, we're adding a higher z-index value to it.

/* The parent container taking up the full viewport */
.container {
  width: 100%;
  height: 100vh;
  display: block;
  position: relative;
  overflow: hidden;
}

/* The div that contains the image  */
/* Centering trick: https://css-tricks.com/centering-percentage-widthheight-elements/ */
.image-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  z-index: 2; /* Makes sure this is on top */
}

/* The image inside the first div */
.image-container img {
  -webkit-filter: drop-shadow(-4px 5px 5px rgba(0,0,0,0.6));
  filter: drop-shadow(-4px 5px 5px rgba(0,0,0,0.6));
  height: 200px;
}

/* The div that holds the text that will be revealed */
/* Same centering trick */
.text-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  z-index: 1; /* Places this below the image container */
  margin-left: -100px;
}

We're leaving vendor prefixes out the code examples throughout this post, but they should definitely be considered if using this in production environment.

Here’s what that gives us so far, which is basically our two elements stacked one on top of the other.

See the Pen
Revealing Text Animation Part 1 - Mail Elements
by Jesper Ekstrom (@jesper-ekstrom)
on CodePen.

Step 2: Hide the text behind a block

To make our text start displaying from left to right, we need to add another div inside our .text-container:

<!-- ... -->

  <!-- The div containing the text that's revealed -->
  <div class="text-container">
    <h1>Animation</h1>
    <div class="fading-effect"></div>
  </div>
  
<!-- ... -->

...and add these CSS properties and values to it:

.fading-effect {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 0;
  width: 100%;
  background: white;
}

As you can see, the text is hiding behind this block now, which has a white background color to blend in with our parent container.

If we try changing the width of the block, the text starts to appear. Go ahead and try playing with it in the Pen:

See the Pen
Revealing Text Animation Part 2 - Hiding Block
by Jesper Ekstrom (@jesper-ekstrom)
on CodePen.

There is another way of making this effect without adding an extra block with a background over it. I will cover that method later in the article. 🙂

Step 3: Define the animation keyframes

We are now ready for the fun stuff! To start animating our objects, we're going to make use of the animation property and its @keyframes function. Let’s start by creating two different @keyframes, one for the image and one for the text, which will end up looking like this:

/* Slides the image from left (-250px) to right (150px) */
@keyframes image-slide {
  0% { transform: translateX(-250px) scale(0); }
  60% { transform: translateX(-250px) scale(1); }
  90% { transform: translateX(150px) scale(1); }
  100% { transform: translateX(150px) scale(1); }  
}

/* Slides the text by shrinking the width of the object from full (100%) to nada (0%) */
@keyframes text-slide {
  0% { width: 100%; }
  60% { width: 100%; }
  75%{ width: 0; }
  100% { width: 0; }
}

I prefer to add all @keyframes on the top of my CSS file for a better file structure, but it’s just a preference.

The reason why the @keyframes only use a small portion of their percent value (mostly from 60-100%) is that I have chosen to animate both objects over the same duration instead of adding an animation-delay to the class it’s applied to. That’s just my preference. If you choose to do the same, keep in mind to always have a value set for 0% and 100%; otherwise the animation can start looping backward or other weird interactions will pop up.

To enable the @keyframes to our classes, we’ll call the animation name on the CSS property animation. So, for example, adding the image-slide animation to the image element, we’d do this:

.image-container img {
  /* [animation name] [animation duration] [animation transition function] */
  animation: image-slide 4s cubic-bezier(.5,.5,0,1);
}

The name of the @keyframes works the same as creating a class. In other words the name doesn’t really matter as long as it’s called the same on the element where it’s applied.

If that cubic-bezier part causes head scratching, then check out this post by Michelle Barker. She covers the topic in depth. For the purposes of this demo, though, it’s suffice to say that it is a way to create a custom animation curve for how the object moves from start to finish. The site cubic-bezier.com is a great place to generate those values without all the guesswork.

We talked a bit about wanting to avoid a looping animation. We can force the object to stay put once the animation reaches 100% with the animation-fill-mode sub-property:

.image-container img {
  animation: image-slide 4s cubic-bezier(.5,.5,0,1);
  animation-fill-mode: forwards;
}

So far, so good!

See the Pen
Revealing Text Animation Part 3 - @keyframes
by Jesper Ekstrom (@jesper-ekstrom)
on CodePen.

Step 4: Code for responsiveness

Since the animations are based on fixed (pixels) sizing, playing the viewport width will cause the elements to shift out of place, which is a bad thing when we’re trying to hide and reveal elements based on their location. We could create multiple animations on different media queries to handle it (that’s what I did at first), but it’s no fun managing several animations at once. Instead, we can use the same animation and change its properties at specific breakpoints.

For example:

@keyframes image-slide {
  0% { transform: translatex(-250px) scale(0); }
  60% { transform: translatex(-250px) scale(1); }
  90% { transform: translatex(150px) scale(1); }
  100% { transform: translatex(150px) scale(1); }
}

/* Changes animation values for viewports up to 1000px wide */
@media screen and (max-width: 1000px) {
  @keyframes image-slide {
    0% { transform: translatex(-150px) scale(0); }
    60% { transform: translatex(-150px) scale(1); }
    90% { transform: translatex(120px) scale(1); }
    100% { transform: translatex(120px) scale(1); }
  }
}

Here we are, all responsive!

See the Pen
Revealing Text Animation Part 4 - Responsive
by Jesper Ekstrom (@jesper-ekstrom)
on CodePen.

Alternative method: Text animation without colored background

I promised earlier that I’d show a different method for the fade effect, so let’s touch on that.

Instead of using creating a whole new div — <div class="fading-effect"> — we can use a little color trickery to clip the text and blend it into the background:

.text-container {
  background: black;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

This makes the text transparent which allows the background color behind it to bleed in and effectively hide it. And, since this is a background, we can change the background width and see how the text gets cut by the width it’s given. This also makes it possible to add linear gradient colors to the text or even a background image display inside it.

The reason I didn't go this route in the demo is because it isn't compatible with Internet Explorer (note those -webkit vendor prefixes). The method we covered in the actual demo makes it possible to switch out the text for another image or any other object.


Pretty neat little animation, right? It’s relatively subtle and acts as a nice enhancement to UI elements. For example, I could see it used to reveal explanatory text or even photo captions. Or, a little JavaScript could be used to fire the animation on click or scroll position to make things a little more interactive.

Have questions about how any of it works? See something that could make it better? Let me know in the comments!

The post Slide an Image to Reveal Text with CSS Animations appeared first on CSS-Tricks.

Designing for the web ought to mean making HTML and CSS

David Heinemeier Hansson has written an interesting post about the current state of web design and how designers ought to be able to still work on the code side of things:

We build using server-side rendering, Turbolinks, and Stimulus. All tools that are approachable and realistic for designers to adopt, since the major focus is just on HTML and CSS, with a few sprinkles of JavaScript for interactivity.

And it’s not like it’s some well kept secret! In fact, every single framework we’ve created at Basecamp that allows designers to work this way has been open sourced. The calamity of complexity that the current industry direction on JavaScript is unleashing upon designers is of human choice and design. It’s possible to make different choices and arrive at different designs.

I like this sentiment a whole lot — not every company needs to build their websites the same way. However, I don’t think that the approach that Basecamp has taken would scale to the size of a much larger organization. David continues:

Also not interested in retreating into the idea that you need a whole team of narrow specialists to make anything work. That “full-stack” is somehow a point of derision rather than self-sufficiency. That designers are so overburdened with conceptual demands on their creativity that they shouldn’t be bordered or encouraged to learn how to express those in the native materials of the web. Nope. No thanks!

Designing for the modern web in a way that pleases users with great, fast designs needn’t be this maze of impenetrable complexity. We’re making it that! It’s possible not to.

Again, I totally agree with David’s sentiment as I don’t think there’s anyone in the field who really wants to make the tools we use to build websites overly complicated; but in this instance, I tend to agree with what Nicolas recently had to say on this matter:

The interesting thing to note here is that the act of front-end development changes based on the size and scale of the organization. As with all arguments in front-end development, there is no “right” way! Our work has to adapt to the problems that we’re trying to solve. Is a large, complex React front-end useful for Basecamp? Maybe not. But for some organizations, like mine at Gusto, we have to specialize in certain areas because the product that we’re working on is so complicated.

I guess what I also might be rambling about is that I don’t think it’s engineers that are making front-end development complicated — perhaps it’s the expectations of our users.

Direct Link to ArticlePermalink

The post Designing for the web ought to mean making HTML and CSS appeared first on CSS-Tricks.

Hustle Adds Hot New Marketing Opt-ins and reCAPTCHA for WordPress Blocks

Your favorite WordPress marketing plugin got another upgrade! Hustle’s new Gutenberg and reCAPTCHA integrations make it easier and less spammy to grab new users with pop-ups. Want to make a special offer, get more social followers, or grow your mailing list? Hustle handles all the technical-backend-code-jiberish so you can publish stunning campaigns quickly. Hustle adds […]