Animated SVG modal window
✭ Full-screen SVG modal window for the site ✭
Creation, development, manufacturing sites | WEB-STYDIA.COM

5/51 rating

Today, walking around the Internet, I came across an interesting implementation of a full-screen modal window that was created using the SVG and JS elements, and I could not resist not sharing a beautiful animated pop-up window with you.

This is a very simple but at the same time unusually beautiful modal window, while SVG graphics are currently rapidly gaining momentum among web developers, a modal window with an animated background using modern technologies that now allow you to create a ready-made website for any website or online store amazing effects. Plus there is full support for IE9 +.

We have been experimenting with SVG animation for a long time, and today in this article, using the example of creating a modern pop-up window, we will tell you how to animate several SVG paths at once and make an amazingly stylish background effect for a modal window.

Why do you need a modal window script, you ask? - Well then! You have probably seen more than once how these windows are used on different sites, someone uses modern pop-up windows to accept an application for any order on the site, someone uses a modal window to hide some bulky content that will be opened by clicking a button , some use the pop-up module in order to provide the user with some important information, the general purpose of using modal windows for each site is different, but they are very popular on almost any site.

I already wrote a lot of articles on the topic of pop-ups with some you can find on our site here our site here , but today we will explore a completely new approach to creating a modal window that will also open by the click of a button and will completely hide the background of the site, thereby fully focusing the user's attention on the provided him information, while the modal window has a beautiful smooth anima tion.

As always, you can download the finished modal window on our website under this article, there you can see our example of a modal window with an animated background, which we will now study. Well then, let's step back from theory and get down to practice, create a modern modal window for your site.

The first step with which we will begin to create a pop-up window is to use HTML markup, which has a very simple structure and consists of two main elements <section>, action to wrap the button itself #modal-trigger, block div.cd-modal that is, the modal window itself, the content block .cd-modal-content modal window, well and the last one is div.cd-svg-bg, which will create the effect of covering the background.

There was also the use of an additional layer div.cd-cover-layer which is intended to cover the main content at the time of opening the animated pop-up window.

Our next step is to add styles to our window, the original value in .cd-modal visibility: hidden; position: fixed; height: 100%; and width: 100%;, and when the modal window button is called, that is, when you click on a # modal-trigger, the visibility of the window changes from hidden to visible .modal-is-visible.

Due to the fact that the color of the .cd-modal-content block is the same as the background block .cd-cover-layer, the main displayed content will be the one that is on the green svg background while .cd-cover-layer will be hidden.
We’ve finished the styles, now the last point remains: we need to connect the JS handler so that our pop-up window works.

That's all, we have created an example of a beautiful form of a pop-up window and now you can successfully connect a modal window to your website. What else can I say here, use your health, and I will be glad if someone likes this implementation of the pop-up window.

View live example

You can also download the finished full-screen modal window below.

You may also like

No Comment

You can post first response comment.

Leave A Comment

Please enter your name. Please enter an valid email address. Please enter a message.