I’m making a neocities site, and I want the page to have a warning popup(first container) that the user will have to click an "enter" button on in order to unblur the content(second container), background, see the content. I’m extremely new to all of this and help would be greatly appreciated!(I have images to show what I’m trying to do, but can’t post them yet, lol.)
I’m not sure where to even start. I’ve tried different popup codes, but none fit what I was trying to achieve.
2
Answers
I’ll try to explain it as best I can for someone new…
In CSS there are 2 ways to create a blur effect, but in your case the best property will be filter: blur([n]px); where n is a number. With exception to a div where you have your popup, put the rest of your body into a main tag. This may look something like the following:
From here In order to unblur the content the user is going to need some type of input. Namely a button, and that button in JavaScript is going to need to get rid of the filter: blur(10px);. The easiest way to do this is to modify the filter: blur(10px); line of css into filter: blur(0px);. One example of executing this may be
There are alternate ways to do this, but this is the simplest one to explain as the code speaks for itself, even for someone new. Hope this solution helps!
First, you need to create two containers in your
HTML file:
one for the popup and the other for the content.CSS file (styles.css):
JavaScript:
Here is code pen link