Designing a login window that appears as a popup and blurs out the background page for enhanced security

I am in the process of developing a login/register page and I would like to implement a feature where, upon clicking the 'register now' button on the home page, a popup appears within the same website with a transparent and dull background. An example of what I have in mind can be seen here:

I also came across this reference that demonstrates a similar concept:

Essentially, I am seeking guidance on how to achieve this effect without relying too heavily on JavaScript or jQuery. Your assistance is greatly appreciated. Thank you.

Answer №1

To achieve a true blur effect, consider experimenting with CSS filter effects. Keep in mind that these effects are only compatible with Webkit browsers and may impact performance due to their resource-intensive nature.

Alternatively, a simpler approach involves overlaying a semi-transparent black background onto your page. Obtain a transparent PNG image (such as one from this site) and use it as a background for a large element covering the entire page. Place your form on top of this element for a straightforward solution.

Both the CSS blur technique and the semi-transparent background can be achieved using CSS alone, eliminating the need for Javascript or jQuery. However, if you plan to create a popup feature, some basic scripting may be necessary.

Answer №2

Hey, check this out - I created this cool JavaScript script:- Just copy the code and paste it in your browser:-

<head>
<title>My Awesome Page</title>

<script language="javascript" type="text/javascript">


 function SubscribeToUpdates()
{
DarkenPage();
ShowUpdatePanel();
}

function ShowUpdatePanel()
{
var update_panel = document.getElementById('update_panel');

// w is a width of the update panel
w = 300;
// h is a height of the update panel
h = 300;

// get the x and y coordinates to center the update panel
xc = Math.round((document.body.clientWidth/2)-(w/2))
yc = Math.round((document.body.clientHeight/2)-(h/2))

// show the update panel
update_panel.style.left = xc + "px";
update_panel.style.top  = yc + "px";
update_panel.style.display = 'block';
}



 // this function puts the dark screen over the entire page
function DarkenPage()
{
var page_screen = document.getElementById('page_screen');
page_screen.style.height = document.body.parentNode.scrollHeight + 'px';
page_screen.style.display = 'block';
}


</script>

<style type="text/css">

body
{
 padding:0px;
 margin:0px;
 }

 #page_screen
 {
 background-color:#000000;
 filter:alpha(opacity=80);
 opacity: 0.8;
 position:absolute;
 top:0px;
 left:0px;
 width:100%;
 display:none;
 }

 #update_panel
 {
 width:300px;
 height:300px;
 background-color:#FFFFFF;
 border:1px solid #000000;
 position:absolute;
 top:0px;
 left:0px;
 }
</style>

</head>
<body>
<h2>
    <span style="font-family: Trebuchet MS">Check this out&nbsp;
    <input id="Button1" type="button" value="Subscribe for updates!"        
    onclick="SubscribeToUpdates();"
     /></span></h2>
<div id="sampletext">

 </div>

<div id="page_screen">
    &nbsp;
</div>
<div id="update_panel" style="display:none;">
    Subscribe for our
    <h3 style="color:#FF6600;">UPDATES</h3>

    your email address :
    <input type="text" />
    <br />

    <input type="button" value="Sign up!" onclick="Subscribe();" />
</div>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Troubleshooting issues with cloning a row using jquery

I'm having trouble figuring out why my code isn't working. I want to duplicate a div and add it to the beginning of its parent div. Here's the code I have so far: //Adding a new row function addRow(btn) { var CopiedRow = $(this).closest( ...

Guide on showing a toast message labeled as "Busy" using Google Docs extension

Whenever I launch Spreadsheet or Doc add-ons from the respective stores, I notice a dynamic progress toast appearing at the bottom of the window: This feature doesn't seem to be present in my own add-ons, leading me to believe that it is not integrat ...

What is causing the border-bottom in these inline divs to not display when using a fractional height? (Specifically in Chrome)

Here is a jsfiddle I'd like to share with you: https://jsfiddle.net/ionescho/4d07k799/4/ The HTML code: <div class='container'> <div class="row"></div><div class="row"></div><div class="row"></div> ...

Eliminate Bootstrap's validation glyphs

Issue Description I am attempting to eliminate the validation icons from Bootstrap, such as the "x" and "check" symbols. Despite my efforts to search thoroughly, I have been unable to locate where these icons are located in the code. Code Sample You can ...

Incrementing counters within nested div elements

Looking to implement a counter-increment feature on ordered lists. The goal is for each ol to pick up where the previous count left off. The functionality is successful when there are no separate wrapping divs around the ols. However, the issue arises whe ...

Achieving equal heights for div boxes while aligning list items inside

I have 8 green boxes on my site, each containing an image and either 3 or 4 list items with text only. The issue I'm facing is that the boxes are not of equal height due to two reasons: (1) One box may have an extra list item pushing the rest down, or ...

Use JavaScript to enclose elements that are siblings within a DIV

Can you help me convert the elements with class "a" into a div using JavaScript, while maintaining their order within their sibling elements? I've been struggling with the code below and would appreciate any assistance. const elementParent= documen ...

Show jQuery block and make it fade in

I'm attempting to put together a simple tab system where each tab is supposed to appear using a fadeIn effect. In the code below, the .field element is initially hidden with CSS. Although the tabs are displayed correctly, the desired fadeIn effect is ...

What could be causing my dangerouslySetInnerHTML to show altered content?

I am working on a project using React and have encountered an issue with the code: const externalMarkup = ` <a data-refpt='DN_0OKF_177480_ID0EMPAC' /> <ol> <li value='1'> <p> <strong&g ...

What are some ways to reuse an angular component multiple times?

I am utilizing an angular component to dynamically load charts into my widget: Below is an example of the component: angular.module("generalApp").component("chartPie", { template: "<div class=Pie></div>", bindings: { data: "=", }, control ...

leveraging Excel input for data manipulation in Java

I am looking to create a code that will help me generate a line of flight using data from an Excel spreadsheet. The process involves calculating the time between flights, ensuring the plane has enough time on the ground before taking off again, and determi ...

the drawer conceals the paper

I am having an issue with my drawer overlapping the content on the page. I would like it to be aligned to the left without covering any other elements. This is my first time working with material-ui, so if anyone could help explain how to fix this, I wou ...

What is the best approach to transforming my jQuery function into CSS to ensure responsiveness?

I have created a jQuery animation with four functions named ani1(), ani2(), ani3(), and ani4(). Everything is working fine on desktop, but now I am facing the challenge of making it responsive for mobile devices. I am looking for CSS code to replicate the ...

Is there a way to make the onKeyDown event function properly in Next.js/React?

I'm currently developing a website with Next.js and am facing an issue trying to execute a simple function when a key is pressed. Strangely, the onKeyDown event isn't getting triggered as expected in my code snippet: <main onKeyDown={e => c ...

Not motivated to write HTML content

Recently, I've been utilizing the lazySizes plugin for optimizing my images. However, I encountered an issue when trying to implement it for HTML content display. Is there a simpler way to achieve this and maintain my current HTML structure? $(&apo ...

Position the Mui Card Action at the Upper Right corner

Struggling to align a checkbox within a MUI card to the top right? It has been a challenge for me as well. Here is an image of my current layout . I really want that button to be placed in the top right corner, even when the window size changes. Below is ...

Selecting Content Dynamically with jQuery

I have a webpage with multiple dynamic content sections. <div id="content-1"> <div id="subcontent-1"></div> <i id="delete-1"></i> </div> . . . <div id="content-10"> <div id="subcontent-10"></d ...

Tips for positioning Material Ui buttons beside a list of images

I have a list of images and I would like to display buttons beneath each image Here is my current code: export const Media = (stuff) => { const { medias } = stuff; console.log(medias); const classes = useStyles(); return ( <div classNam ...

"Within the node.js framework, the search/query section of the URL appears

I am currently working on a website (client + server) that both operate from the same machine. Despite not encountering any issues in Chrome's developer tools, I am struggling to identify the source of a problem. My dilemma is with trying to POST a s ...

Aligned to the right, the ::before element stands out in the design

I have a button that already includes an ::after element below it, but I am looking to add a shape/element to the right side of the div. a { position: relative; display: inline-block; padding: 15px 10px; margin: 0 5px; color: #222; f ...