Next-Gen Threat Hunting Techniques With SIEM-SOAR Integration

In the constantly shifting realm of cybersecurity, remaining ahead of emerging threats is no longer merely an aspiration but an imperative. With cyber adversaries continuously enhancing their skills and tenacity, businesses are progressively embracing cutting-edge technologies and inventive tactics to actively identify and counteract cyber threats. In this array of strategies, the fusion of Security Information and Event Management (SIEM) and Security Orchestration, Automation, and Response (SOAR) tools has risen as a transformative force. 

NLP (Natural Language Processing) plays a crucial role in today's cybersecurity due to several key reasons. SIEM (Security Information and Event Management) and SOAR (Security Orchestration, Automation, and Response) are indispensable instruments for overseeing, identifying, and addressing security threats. Nevertheless, they frequently encounter difficulties when dealing with unstructured text data, including logs, reports, and threat intelligence streams. This is precisely where NLP becomes indispensable:

Microservices With Apache Camel and Quarkus (Part 5)

In part three of this series, we have seen how to deploy our Quarkus/Camel-based microservices in Minikube, which is one of the most commonly used Kubernetes local implementations. While such a local Kubernetes implementation is very practical for testing purposes, its single-node feature doesn't satisfy real production environment requirements. Hence, in order to check our microservices behavior in a production-like environment, we need a multi-node Kubernetes implementation. And one of the most common is OpenShift.

What Is OpenShift?

OpenShift is an open-source, enterprise-grade platform for container application development, deployment, and management based on Kubernetes. Developed by Red Hat as a component layer on top of a Kubernetes cluster, it comes both as a commercial product and a free platform or both as on-premise and cloud infrastructure. The figure below depicts this architecture.

Securing Your Applications With Spring Security

In today's increasingly digital world, securing your applications has become paramount. As developers, we must ensure that our applications are protected from unauthorized access and malicious attacks. One popular solution for securing Java applications is Spring Security, a comprehensive and customizable framework that provides authentication, authorization, and protection against various security threats.

In this article, we will explore the basics of Spring Security and walk through a real-world example to demonstrate how it can be implemented in your application. By the end of this article, you should have a better understanding of the benefits of using Spring Security and how to utilize its features effectively.

Safeguarding Your Organization: Insights for IT Pros During National Insider Threat Awareness Month

September marks National Insider Threat Awareness Month (NITAM), an annual campaign dedicated to shedding light on the risks posed by trusted insiders. Whether employees, contractors, partners, or collaborators, these authorized individuals have the potential to intentionally or accidentally cause significant damage through data theft, system sabotage, fraud, and more. As technology leaders on the front line of your organization's cyber defenses, it's critical to understand your role in insider threat mitigation. Use this month as an opportunity to re-evaluate controls and strengthen vulnerabilities.

Access lies at the heart of insider risk  — broad privileges provide openings for abuse. Scrutinize the access rights of users across your systems and data. Are permissions overly permissive based on actual needs? Tighten controls by implementing the least privilege and separation of duties policies. Leverage tools like access management platforms to streamline provisioning and revocation. For highly sensitive resources, enforce multi-factor authentication and monitor for suspicious activity.

Selecting the Right Automated Tests

This is an article from DZone's 2023 Automated Testing Trend Report.

For more:


Read the Report

Modern software applications are complex and full of many dynamic components that generate, collect, and fetch data from other components simultaneously. If any of these components acts unexpectedly or, worse, fails, there can be a cascading effect on all other dependent components. 

Snowflake vs. Data Bricks: Compete To Create the Best Cloud Data Platform

In the world of business, a comparison of Snowflake and Data Bricks is important because it improves data analysis and business management. Organizations, companies, and businesses need a strategy to gather all the data in one place that is to be analyzed.

Cloud-based data systems Snowflake and Data Bricks are industry leaders. However, it is important to understand which data platform is the best for your company.

Messaging Channels in Enterprise Integration Patterns: Enabling Efficient Communication

Businesses rely on seamless communication between their various systems and applications in today's interconnected world to facilitate effective data exchange and streamline operational procedures. The Enterprise Integration Patterns (EIPs) offer a collection of tried-and-true answers to the problems posed by integrating various systems. Messaging channels, which act as crucial conduits for dependable and adaptable communication, are among the fundamental parts of EIPs. 

Organizations increasingly rely on technology in today's quickly changing business environment to improve customer satisfaction, drive efficiency, and streamline operations. However, as businesses expand, they frequently gather a variety of systems and applications, which leads to data silos, ineffective procedures, and decreased agility. Enterprise Integration Patterns (EIPs) enable seamless communication and data exchange between various systems, offering a tried-and-true solution to these problems. Messaging channels, the foundation of enterprise integration communication, are one of the main elements of EIPs. Messaging channels offer a dependable, adaptable, and flexible data exchange mechanism that promotes seamless system interoperability. 

What Is Privacy by Design?

Privacy by Design (PbD) is an approach to systems engineering that aims to embed privacy into every stage of the development process and across the entire organization from day one.

Privacy is too often overlooked or solely an afterthought. Policies get developed following harmful incidents such as data breaches or privacy invasions, at which point it is too late. Privacy by design aims to correct this through instilling conscious and proactive privacy management, with the impact on the data subject remaining the center of attention.

How to Add Stripe QR Code Payment in WordPress

Are you looking for a way to add a QR code for Stripe payments on your WordPress website?

QR codes, or Quick Response Codes, are a type of barcode that users can scan using their mobile phones. You can show a Stripe payment form using QR codes and help customers easily purchase a product or service.

In this article, we will show you how to add Stripe QR code payment in WordPress.

How to add Stripe payment QR code payment in WordPress

Why Add Stripe QR Code Payment in WordPress?

Stripe is a popular payment gateway that lets you accept online payments on your WordPress site or eCommerce store. It makes it very easy for customers to pay using their credit cards.

The best part is that customers don’t have to go through a lengthy signup process. They can simply enter their credit card on the website to make a purchase.

Adding Stripe QR code payments to your site gives customers the flexibility to complete a purchase quickly. Customers can simply scan the code to open the payment link.

This makes the checkout process very simple and fast. It helps people to easily buy a product and service on your online store. As a result, you’ll see a boost in conversions and reduced cart abandonments.

That said, let’s look at how you can add a Stripe QR code payment to your WordPress website.

Create a Stripe Payment Form in WordPress

First, you’ll need to add a Stripe payment form on your website to accept online payments from customers.

The best way to do that is using WPForms. It is the best contact form plugin for WordPress that’s super easy to use and easily integrates with Stripe. There are many form templates to choose from, and you can customize them using the drag-and-drop builder.

For this tutorial, you’ll need the WPForms Pro license because it includes the Stripe addon. There’s also a WPForms Lite version that you can use for free. It allows you to accept Stripe payments, but there’s a 3% transaction fee for payments made through your forms.

To start, you’ll need to download and install the WPForms plugin. If you need help, then please see our guide on how to install a WordPress plugin.

Upon activation, you can go to WPForms » Settings from your WordPress dashboard and enter the license key. You can find the key in your account area on the WPForms website.

Adding a license key to the WPForms form builder plugin

Simply enter the key and click the ‘Verify Key’ button.

Once that’s done, you’ll need to go to the WPForms » Addons page and install the Stripe addon.

Installing the Stripe addon

Go ahead and click the ‘Install Addon’ button, and WPForms will automatically install and activate it.

From here, you can head to WPForms » Settings from the WordPress admin panel and go to the ‘ Payments’ tab.

Next, simply click the ‘Connect with Stripe’ button and follow the onscreen instructions to connect your account with WPForms.

Click the connect with Stripe button

Once Stripe is connected, you can go to WPForms » Add New to create a new form.

WPForms offers lots of form templates to choose from. You can select a simple contact form, an order form, or a Stripe payment form and customize it.

Stripe payment form

For this tutorial, we will use the ‘Stripe Payment Form’ template.

Next, you can customize your form using the drag-and-drop form builder. By default, you’ll see different form fields in the template.

However, WPForms lets you add more form fields to the template, like a dropdown, checkboxes, email, phone, address, website, and more.

Customize Stripe payment form

You can also click any form field on the template to customize it further.

For instance, we changed the text for each item on your demo form and enabled the option to show prices after the item label.

Customize form field in stripe payment form

Once you’re done editing the form, simply switch to the ‘Payments’ tab and select ‘Stripe’ from the menu on the left.

From here, ensure the ‘Enable Stripe payments’ option is enabled.

Enable Stripe payments

Next, you can switch to the Settings tab. Here, you’ll see options to change the notification and confirmation settings.

For instance, you can select what action should take place once a user submits a form. WPForms lets you show a message or a page or even redirect users to a URL.

Confirmation settings form

You’re now ready to display your Stripe payment form on your website.

Simply click the ‘Save’ button to store your changes and then click the ‘Embed’ button at the top.

Save and embed your form

Next, WPForms will show a popup where you can choose an existing page or create a new one to embed your form.

We will choose the ‘Select Existing Page’ option for this tutorial.

Embed a form in page

Next, you’ll need to enter a name for your new page.

Once that’s done, simply click the ‘Let’s Go’ button.

Enter name for your new page

After that, you’ll see a preview of your Stripe payment form in the WordPress content editor.

You can go ahead and publish the page and visit the website to see it in action.

Stripe payment form preview

Now go ahead and copy the link of your payment form page, as you’ll need it to create a QR code.

Alternative Method: You can also create a Stripe payment form using WP Simple Pay. It is the best Stripe payment plugin for WordPress and helps you collect online payments without setting up a shopping cart.

WP Simple Pay is a more straightforward option compared to WPForms. It is perfect if you’re just looking to create a basic form to accept credit card payments.

However, if you’re looking for more customization options and form templates, then we recommend using WPForms.

For more details, you can see our detailed guide on how to accept payments with Stripe in WordPress.

Add QR Code for Stripe Payments in WordPress

Now that your Stripe payment form is ready, you can create a QR code for it and display it anywhere on your site.

There are 2 ways you can add a QR code to your site. You can use the Google Chrome browser’s feature or use a WordPress plugin.

1. Create QR Codes using Google Chrome

If you’re using the Google Chrome browser, then you can use it to share a webpage via a QR code.

First, you’ll need to open the Stripe payment form page in a new tab or window.

Next, you can click the share icon in the top right corner of the site address bar. From here, simply select the ‘Create QR Code’ option.

Click the share icon in chrome

After that, Google Chrome will generate a QR code for your Stripe payment form page.

You can go ahead and download the QR code as an image.

Download the QR code

Next, simply place the image anywhere on your site.

For example, you can show the QR code on product pages, so customers can quickly scan them and open the form to make a purchase.

Add QR code to product page

2. Create a Stripe Payment QR Code using a WordPress Plugin

You can also add QR codes to your site using a WordPress plugin like Shortcodes Ultimate. It is a free plugin that lets you create over 50 different types of shortcodes, including QR codes.

First, you’ll need to install and activate the Shortcodes Ultimate plugin. If you need help, then please see our guide on how to install a WordPress plugin.

Upon activation, you will see the Shortcode Ultimate welcome screen.

Shortcode ultimate welcome screen

Next, you’ll need to edit a page or post to add your QR code.

Once you’re in the content editor, simply add a shortcode block.

How to add a shortcode block to WordPress

After that, you should see an ‘Insert shortcode’ option.

You can simply click the double brackets icon to add your QR code.

Click the select shortcode icon

Next, the plugin will display different shortcode options for your site.

Go ahead and select the ‘QR Code’ option.

Select QR code shortcode

After that, you’ll see options to enter details for your QR code.

In the Data field, you can enter the URL of your Stripe payment form that you created earlier.

Besides that, there is an option to enter a title for the code, which acts as an alt-text. You can also adjust the size of your QR code.

Enter QR code details

If you scroll down, then you’ll see more options to customize your QR code. For instance, you can change the primary color, background color, and more.

Once you’re done, simply click the ‘Insert shortcode’ button.

Click insert shortcode

The plugin also lets you see a live preview of the code on your blog post or landing page.

Go ahead and publish your page to see the Stripe payment form QR code in action.

QR code live preview

We hope this article helped you learn how to add Stripe QR code payment in WordPress. You may also want to see our guide on WooCommerce made simple and how to accept recurring payments in WordPress.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Add Stripe QR Code Payment in WordPress first appeared on WPBeginner.

Mastering Persistence: Why the Persistence Layer Is Crucial for Modern Java Applications

Building robust and efficient applications requires a deep understanding of various architectural components in today's rapidly evolving technology landscape. While choices like microservices, monolithic architectures, event-driven approaches, and containerization garner significant attention, one fundamental aspect often overlooked is the persistence layer. This article explores the benefits of the book "Persistence Best Practices for Java Applications" and why the persistence layer is vital for modern applications.

The Significance of the Persistence Layer

The persistence layer is the part of an application responsible for storing and retrieving data. In Java applications, it plays a role similar to data stores in cloud-native solutions. Here are some key reasons why the persistence layer is crucial in today's application development landscape:

A Better WEB3 Experience: Account Abstraction From Flow (Part 1)

Despite the advancement of dApps’ capabilities over the past year, adoption has been slowed by terrible user experience. Users are required to complete a complicated and onerous series of steps—download a wallet, learn about gas costs, obtain tokens to pay gas, save seed phrases, and more. This poses a significant hurdle for users new to the blockchain, or those who are just uncomfortable with holding crypto. Often they just give up.

To solve this problem, walletless dApps on Flow have emerged. With this approach, users can easily sign up for dApps using credentials they are already comfortable with (social logins, email accounts). This allows them to get started quickly, without needing to understand the complexities of wallets or blockchain.

Revealing Images With CSS Mask Animations

In a previous article, we explored fancy hover effects for images that involve shines, rotations, and 3D perspectives. We are going to continue playing with images, but this time, we are making animations that reveal images on hover. Specifically, we will learn about CSS masks and how they can be used to cover portions of an image that are revealed when the cursor hovers over the image.

Here is the HTML we will use for our work:

<img src="" alt="">

Yes, that’s right, only one image tag. The challenge I like to take on with each new CSS project is: Let CSS do all of the work without extra markup.

As we go, you may notice minor differences between the code I share in the article and what is used inside the demos. The code throughout the article reflects the CSS specification. But since browser support is inconsistent with some of the features we’re using, I include prefixed properties for broader support.

Example 1: Circle Reveal

In this first one, an image sits in a square container that is wiped away on hover to reveal the image.

So, we have two images, each with a gradient background that is revealed with a touch of padding. We could have added a <div> — or perhaps even a <figure> — to the markup to create a true container, but that goes against the challenge of letting CSS do all of the work.

While we were able to work around the need for extra markup, we now have to ask ourselves: How do we hide the image without affecting the gradient background? What we need is to hide the image but continue to show the padded area around it. Enter CSS masks.

It’s not terribly complicated to apply a mask to an element, but it’s a little trickier in this context. The “trick” is to chain two mask layers together and be more explicit about where the masks are applied:

img {
  /* etc. */
  mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0) content-box;
}

Now we have two masks “sources”:

  1. content-box: one that is restricted to the image’s content,
  2. padding-box: one that covers the whole image area, including the padded area.

We need two layers because then we can combine them with the CSS mask-composite property. We have different ways to combine mask layers with mask-composite, one of which is to “exclude” the area where the two masks overlap each other.

img {
  /* etc. */
  mask:
    linear-gradient(#000 0 0) padding-box,
    linear-gradient(#000 0 0) content-box;
  mask-composite: exclude;
}

This will make only the gradient visible (the padded area), as you can see below.

See the Pen Overview of the exclude composition by Temani Afif.

Notice that we can remove the padding-box from the code since, by default, a gradient covers the whole area, and this is what we need.

Are there other ways we could do this without mask-composite? There are many ways to hide the content box while showing only the padded area. Here is one approach using a conic-gradient as the mask:

mask:
  conic-gradient(from 90deg at 10px 10px, #0000 25%, #000 0)
  0 0 / calc(100% - 10px) calc(100% - 10px);
  /* 10px is the value of padding */

See the Pen Border-only using conic-gradient by Temani Afif.

There are others, of course, but I think you get the idea. The approach you choose is totally up to you. I personally think that using mask-composite is best since it doesn’t require us to know the padding value in advance or change it in more than one place. Plus, it’s a good chance to practice using mask-composite.

Now, let’s replace the second gradient (the one covering only the content area) with a radial-gradient. We want a circle swipe for the hover transition, after all.

img {
  mask:
    linear-gradient(#000 0 0),
    radial-gradient(#000 70%,#0000 71%) content-box;
  mask-composite: exclude;
}

See the Pen Adding the radial-gradient by Temani Afif.

See that? The exclude mask composite creates a hole in the image. Let’s play with the size and position of that cutout and see what is happening. Specifically, I’m going to cut the size in half and position the circle in the center of the image:

mask:
  linear-gradient(#000 0 0),
  radial-gradient(#000 70%,#0000 71%) content-box
    center / 50% 50% no-repeat;
  mask-composite: exclude;

See the Pen Updating the radial-gradient size and position by Temani Afif.

I bet you can already see where this is going. We adjust the size of the radial-gradient to either hide the image (increase) or reveal the image (decrease). To fully hide the image, we need to scale the mask up to such an extent that the circle covers up the image. That means we need something greater than 100%. I did some boring math and found that 141% is the precise amount, but you could wing it with a round number if you’d like.

That gives us our final CSS for the effect:

img {
  padding: 10px; /* control the thickness of the gradient "border" */
  background: repeating-linear-gradient(45deg, #FF6B6B 0 10px, #4ECDC4 0 20px);
  mask:
    linear-gradient(#000 0 0),
    radial-gradient(#000 70%, #0000 71%) content-box
      50% / var(--_s, 150% 150%) no-repeat;
  mask-composite: exclude;
  transition: .5s;
}
img:hover {
  --_s: 0% 0%;
}

A few minor details:

  • We start with a size equal to 150% 150% to initially hide the image. I am taking the additional step of applying the size as a CSS variable (--_s) with the full size (150% 150%) as a fallback value. This way, all we need to do is update the variable on hover.
  • Add a hover state that decreases the size to zero so that the image is fully revealed.
  • Apply a slight transition of .5s to smooth out the hover effect.

Here’s the final demo one more time:

See the Pen Hover reveal animation using mask by Temani Afif.

We just created a nice reveal animation with only a few lines of CSS — and no additional markup! We didn’t even need to resort to pseudo-elements. And this is merely one way to configure things. For example, we could play with the mask’s position to create a slick variation of the effect:

See the Pen Another variation of the circular reveal animation by Temani Afif.

I’m a big fan of putting an idea out there and pushing it forward with more experiments. Fork the demo and let me know what interesting things you can make out of it!

Example 2: Diagonal Reveal

Let’s increase the difficulty and try to create a hover effect that needs three gradients instead of two.

See the Pen Hover reveal animation using mask II by Temani Afif.

Don't look at the code just yet. Let’s try to create it step-by-step, starting with a simpler effect that follows the same pattern we created in the first example. The difference is that we’re swapping the radial-gradient with a linear-gradient:

img {
  padding: 10px; /* control the thickness of the gradient "border" */
  background: repeating-linear-gradient(45deg, #FF6B6B 0 10px, #4ECDC4 0 20px);
  mask:
    linear-gradient(#000 0 0),
    linear-gradient(135deg, #000 50%, #0000 0) content-box 
      0% 0% / 200% 200% no-repeat;
  mask-composite: exclude;
  transition: .5s;
}
img:hover {
  mask-position: 100% 100%;
    }

You’ll notice that the other minor difference between this CSS and the first example is that the size of the mask is equal to 200% 200%. Also, this time, the mask’s position is updated on hover instead of its size, going from 0% 0% (top-left) to 100% 100% (bottom-right) to create a swiping effect.

See the Pen Diagonal reveal animation using mask by Temani Afif.

We can change the swipe direction merely by reversing the linear gradient angle from 135deg to -45deg, then updating the position to 0% 0% on hover instead of 100% 100%:

img {
  padding: 10px; /* control the thickness of the gradient "border" */
  background: repeating-linear-gradient(45deg, #FF6B6B 0 10px, #4ECDC4 0 20px);
  mask:
    linear-gradient(#000 0 0),
    linear-gradient(-45deg, #000 50%, #0000 0) content-box 
      100% 100% / 200% 200% no-repeat;
  mask-composite: exclude;
  transition: .5s;
}
img:hover {
  mask-position: 0% 0%;
}

See the Pen Diagonal reveal animation using mask by Temani Afif.

One more thing: I defined only one mask-position value on hover, but we have two gradients. If you’re wondering how that works, the mask’s position applies to the first gradient, but since a gradient occupies the full area it is applied to, it cannot be moved with percentage values. That means we can safely define only one value for both gradients, and it will affect only the second gradient. I explain this idea much more thoroughly in this Stack Overflow answer. The answer discusses background-position, but the same logic applies to mask-position.

Next, I’d like to try to combine the last two effects we created. Check the demo below to understand how I want the combination to work:

See the Pen Combination of two diagonal reveal by Temani Afif.

This time, both gradients start at the center (50% 50%). The first gradient hides the top-left part of the image, while the second gradient hides the bottom-right part of it. On hover, both gradients slide in the opposite direction to reveal the full image.

If you’re like me, you’re probably thinking: Add all the gradients together, and we’re done. Yes, that is the most intuitive solution, and it would look like this:

img {
  padding: 10px; /* control the thickness of the gradient "border" */
  background: repeating-linear-gradient(45deg, #FF6B6B 0 10px, #4ECDC4 0 20px);
  mask:
    linear-gradient(#000 0 0),
    linear-gradient(135deg, #000 50%, #0000 0) content-box 
      50% 50% / 200% 200% no-repeat,
    linear-gradient(-45deg, #000 50%, #0000 0) content-box 
      50% 50 / 200% 200% no-repeat;
  mask-composite: exclude;
  transition: .5s;
  cursor: pointer;
}
img:hover {
  mask-position: 0% 0%, 100% 100%;
}

See the Pen Combining both effects by Temani Afif.

This approach kind of works, but we have a small visual glitch. Notice how a strange diagonal line is visible due to the nature of gradients and issues with anti-aliasing. We can try to fix this by increasing the percentage slightly to 50.5% instead of 50%:

See the Pen Trying to fix the anti-aliasing issue by Temani Afif.

Yikes, that makes it even worse. You are probably wondering if I should decrease the percentage instead of increasing it. Try it, and the same thing happens.

The fix is to update the mask-composite property. If you recall, we are already using the exclude value. Instead of declaring exclude alone, we need to also apply the add value to make sure the bottom layers (the swiping gradients) aren’t excluded from each other but are instead added together:

img {
  mask:
    /* 1st layer */
    linear-gradient(#000 0 0),

    /* 2nd layer */
    linear-gradient(135deg, #000 50.5%, #0000 0) content-box 
      50% 50% / 200% 200% no-repeat,

    /* 3rd layer */
    linear-gradient(-45deg, #000 50.5%, #0000 0) content-box 
      50% 50% / 200% 200% no-repeat;

  mask-composite: exclude, add;
}

Now, the second and third layers will use the add composition to create an intermediate layer that will be excluded from the first one. In other words, we must exclude all the layers from the first one.

I know mask-composite is a convoluted concept. I highly recommend you read Ana Tudor’s crash course on mask composition for a deeper and more thorough explanation of how the mask-composite property works with multiple layers.

This fixes the line issue in our hover effect:

See the Pen Diagonal reveal animation using mask by Temani Afif.

One more small detail you may have spotted: we have defined three gradients in the code but only two mask-position values on the hover state:

img:hover {
  mask-position: 0% 0%, 100% 100%;
}

The first value (0% 0%) is applied to the first gradient layer; it won't move as it did before. The second value (100% 100%) is applied to the second gradient layer. Meanwhile, the third gradient layer uses the first value! When fewer values are declared on mask-position than the number of mask layers, the series of comma-separated values repeats until all of the mask layers are accounted for.

In this case, the series repeats circles back to the first value (0% 0%) to ensure the third mask layer takes a value. So, really, the code above is a more succinct equivalent to writing this:

img:hover {
  mask-position: 0% 0%, 100% 100%, 0% 0%;
}

Here is the final demo again with both variations. You will see that the second example uses the same code with minor updates.

See the Pen Hover reveal animation using mask II by Temani Afif.

Example 3: Zig-Zag Reveal

I have one more example for you, this time revealing the image with zig-zag edges sliding apart, sort of like teeth chomping on the image.

See the Pen Hover reveal animation using mask III by Temani Afif.

While this may look like a more complex hover effect than the last two we covered, it still uses the same underlying CSS pattern we’ve used all along. In fact, I’m not even going to dive into the code as I want you to reverse-engineer it using what you now know about using CSS gradients as masks and combining mask layers with mask-composite.

I won’t give you the answer, but I will share an article I wrote that demonstrates how I created the zig-zag shape. And since I’m feeling generous, I’ll link up this online border generator as another resource.

Wrapping Up

I hope you enjoyed this little experiment with CSS masks and gradients! Gradients can be confusing, but mixing them with masks is nothing short of complicated. But after spending the time it takes to look at three examples in pieces, we can clearly see how gradients can be used as masks as well as how we can combine them to “draw” visible areas.

Once we have an idea of how that works, it’s amazing that all we need to do to get the effect is update either the mask’s position or size on the element’s hover state. And the fact that we can accomplish all of this with a single HTML element shows just how powerful CSS is.

We saw how the same general CSS pattern can be tweaked to generate countless variations of the same effect. I thought I’d end this article with a few more examples for you to play with.

See the Pen Hover reveal animation using mask IV by Temani Afif.

See the Pen Hover reveal animation using mask V by Temani Afif.

See the Pen Hover reveal animation using mask VI by Temani Afif.

Further Reading on Smashing Magazine