Skip to content

Commit a6c473e

Browse files
Merge pull request #2860 from Subhajit-2023-44/feature-branch-1
Add a pop up dialog box for subscribing to newsletter done !
2 parents 65a1b76 + 8a4e588 commit a6c473e

File tree

3 files changed

+235
-0
lines changed

3 files changed

+235
-0
lines changed

index.html

+201
Original file line numberDiff line numberDiff line change
@@ -3170,6 +3170,207 @@ <h2 class="modal-title">Newsletter Registration</h2>
31703170

31713171
</style>
31723172

3173+
<!-- Newsletter pop-up -->
3174+
<style>
3175+
.popup-nl {
3176+
3177+
display: none;
3178+
position: fixed;
3179+
top: 0;
3180+
left: 0;
3181+
width: 100%;
3182+
height: 100%;
3183+
background-color: rgba(0, 0, 0, 0.7);
3184+
justify-content: center;
3185+
align-items: center;
3186+
z-index: 1009;
3187+
3188+
}
3189+
3190+
.popup-content-nl {
3191+
3192+
display: flex;
3193+
background-color: white;
3194+
border-radius: 10px;
3195+
max-width: 800px;
3196+
height: 450px;
3197+
width: 700px;
3198+
overflow: hidden;
3199+
position: relative;
3200+
box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
3201+
3202+
}
3203+
3204+
.close1-btn-nl {
3205+
3206+
width: 20px;
3207+
cursor: pointer;
3208+
margin: 18px 10px;
3209+
position: absolute;
3210+
top: -4px;
3211+
right: 12px;
3212+
font-size: 18px;
3213+
font-weight: 800;
3214+
3215+
}
3216+
3217+
.popup-left-nl img {
3218+
3219+
width: 100%;
3220+
height: 100%;
3221+
object-fit: cover;
3222+
3223+
}
3224+
3225+
.popup-right-nl {
3226+
3227+
padding: 20px;
3228+
width: 50%;
3229+
display: flex;
3230+
flex-direction: column;
3231+
align-items: center;
3232+
justify-content: center;
3233+
3234+
}
3235+
3236+
.popup-nl h1 {
3237+
3238+
font-size: 24px;
3239+
background: linear-gradient(to right, #ff4aac, #faa2d3);
3240+
-webkit-text-fill-color: transparent;
3241+
-webkit-background-clip: text;
3242+
text-align: center;
3243+
margin-bottom: 12px;
3244+
margin-top: 35px;
3245+
3246+
}
3247+
3248+
.h2-nl{
3249+
3250+
font-size: 18px;
3251+
margin-bottom: 8px;
3252+
text-align: center;
3253+
color: #333;
3254+
3255+
}
3256+
3257+
.pop_up-nl {
3258+
3259+
margin-bottom: 15px;
3260+
font-weight: bold;
3261+
background: linear-gradient(135deg, #0d4670, #32bbdc);
3262+
-webkit-background-clip: text;
3263+
-webkit-text-fill-color: transparent;
3264+
font-size: 12.7px;
3265+
3266+
}
3267+
3268+
.bold{
3269+
3270+
font-size: 13.1px;
3271+
3272+
}
3273+
3274+
input[type="email"] {
3275+
3276+
width: 100%;
3277+
padding: 10px;
3278+
margin-bottom: 16px;
3279+
border: 1px solid #000000;
3280+
border-radius: 5px;
3281+
font-size: 14px;
3282+
3283+
}
3284+
3285+
.signup-btn1-nl {
3286+
3287+
width: 100%;
3288+
height: 40px;
3289+
text-align: center;
3290+
background: radial-gradient(circle, #f74b9f, #653b51);
3291+
color: white;
3292+
border: none;
3293+
border-radius: 5px;
3294+
cursor: pointer;
3295+
font-size: 16px;
3296+
3297+
}
3298+
3299+
.signup-btn1-nl:hover {
3300+
3301+
background-color: #ff4aac;
3302+
3303+
}
3304+
3305+
.no-thanks-nl {
3306+
3307+
display: block;
3308+
margin-top: 10px;
3309+
color: #888;
3310+
text-decoration: none;
3311+
margin-bottom: 15px;
3312+
3313+
}
3314+
3315+
.no-thanks-nl:hover {
3316+
3317+
color: #000000;
3318+
font-size: 14px;
3319+
3320+
}
3321+
3322+
.terms-nl {
3323+
3324+
margin-top: 15px;
3325+
font-size: 10px;
3326+
color: #888;
3327+
3328+
}
3329+
3330+
.terms-nl a {
3331+
3332+
display: inline;
3333+
3334+
}
3335+
3336+
.terms-nl a:hover {
3337+
3338+
text-decoration: underline;
3339+
3340+
}
3341+
3342+
.popup-right-nl p {
3343+
3344+
margin-top: 0;
3345+
margin-bottom: 10px;
3346+
text-align: center;
3347+
3348+
}
3349+
3350+
</style>
3351+
<div id="popup-nl" class="popup-nl">
3352+
<div class="popup-content-nl">
3353+
<div class="popup-left-nl">
3354+
<img src="newspopup.jpg" alt="finance">
3355+
</div>
3356+
3357+
<div class="popup-right-nl">
3358+
<a href="# " class="close1-btn-nl close-nl">X</a>
3359+
<h1>Subscribe to Newsletter</h1>
3360+
<h2 class="h2-nl">Stay Ahead in Your Financial Journey!</h2>
3361+
<p class="pop_up-nl">Join our community of financial learners and gain exclusive access to expert insights, helpful tools, personalized tips, interactive quizzes, and more!</p>
3362+
<form id="emailForm-nl">
3363+
<input type="email" id="email-nl" placeholder="Enter your email" required>
3364+
<button type="submit" class="signup-btn1-nl">Subscribe</button>
3365+
</form>
3366+
<a href="#" class="no-thanks-nl close-nl">No thanks</a>
3367+
<p class="terms-nl" style="white-space: nowrap;">By subscribing to newsletters, you agree to our <br><a href="terms&cond.html">Terms of Service</a> and <a href="privacynotice.html">Privacy Policy</a>.</p>
3368+
</div>
3369+
</div>
3370+
</div>
3371+
<script src="newspopup.js"></script>
3372+
3373+
31733374
</body>
31743375

31753376
</html>

newspopup.jpg

299 KB
Loading

newspopup.js

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Show the pop-up automatically when the page loads
2+
window.onload = function() {
3+
document.getElementById('popup-nl').style.display = 'flex';
4+
};
5+
6+
// Close the pop-up when the user clicks the close button
7+
document.querySelector('.close-nl').addEventListener('click', function() {
8+
document.getElementById('popup-nl').style.display = 'none';
9+
});
10+
11+
// // Close the pop-up when clicking outside the pop-up content
12+
// window.addEventListener('click', function(event) {
13+
// const popupContent = document.querySelector('.popup-content'); // Select the popup content
14+
// if (event.target === document.getElementById('popup')) {
15+
// document.getElementById('popup').style.display = 'none';
16+
// }
17+
// });
18+
19+
// Handle form submission
20+
document.getElementById('emailForm-nl').addEventListener('submit', function(event) {
21+
event.preventDefault();
22+
23+
const email = document.getElementById('email-nl').value;
24+
if (email) {
25+
alert(`Your email ID ${email} has been registered successfully for the newsletter.`);
26+
document.getElementById('popup').style.display = 'none';
27+
}
28+
});
29+
30+
// Handle "No thanks" link
31+
document.querySelector('.no-thanks-nl').addEventListener('click', function(event) {
32+
event.preventDefault();
33+
document.getElementById('popup-nl').style.display = 'none';
34+
});

0 commit comments

Comments
 (0)