Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhanced Newsletter Subscription Experience #521

Merged
merged 3 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/app/components/realworld/realworld.component.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
font-weight: 500; /* Medium weight for specific elements */
font-style: normal; /* Normal font style */
}

body {
font-family: "Montserrat", sans-serif; /* Apply Montserrat to the body for all text */
font-weight: 400; /* Regular weight for body text */
Expand Down
160 changes: 141 additions & 19 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,67 @@
transition: width 0.2s ease;
}
</style>



<!-- <style>
.newsletter-container {
max-width: 400px;
margin: 50px auto;
padding: 20px;
background-color: #f8f9fa;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
text-align: center;
}

.newsletter-title {
font-size: 24px;
color: #333;
margin-bottom: 10px;
}

.newsletter-description {
font-size: 16px;
color: #666;
margin-bottom: 20px;
}

.newsletter-form {
display: flex;
flex-direction: column;
gap: 10px;
}

.newsletter-input {
padding: 10px;
font-size: 16px;
border: 1px solid #ddd;
border-radius: 5px;
outline: none;
transition: border-color 0.3s;
}

.newsletter-input:focus {
border-color: #007bff;
}

.newsletter-button {
padding: 15px; /* Increased padding for a larger button */
font-size: 18px; /* Increased font size */
color: #fff;
background-color: #007bff;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
margin-top: 25px; /* Added spacing above the button */
}

.newsletter-button:hover {
background-color: #0056b3;
}
</style> -->
</head>

<body>
Expand All @@ -498,15 +559,85 @@
<a href="../contributor/contributor.html">Our Contributors</a>
</div>

<!-- Newsletter Section -->
<div class="newsletter-container">
<h2 class="newsletter-title">Stay Updated with DFS-BFS</h2>
<p>Subscribe to our newsletter for the latest on algorithms, tips, and coding challenges.</p>
<form onsubmit="handleSubmit(event)">
<input type="email" placeholder="Enter your email" id="emailInput" required name="email" />
<button type="submit">Subscribe</button>
</form>
</div>
<!-- Newsletter Section -->
<div class="newsletter-container">
<h2 class="newsletter-title">Stay Updated with DFS-BFS</h2>
<p class="newsletter-description">Subscribe to our newsletter for the latest on algorithms, tips, and coding challenges.</p>
<form onsubmit="handleSubmit(event)" class="newsletter-form">
<input type="email" placeholder="Enter your email" id="emailInput" required name="email" class="newsletter-input" />
<button type="submit" class="newsletter-button">Subscribe</button>
</form>
</div>

<script>
function handleSubmit(event) {
event.preventDefault();
const email = document.getElementById('emailInput').value;
alert(`Thank you for subscribing! We have added ${email} to our newsletter.`);
document.getElementById('emailInput').value = '';
}
</script>

<style>
.newsletter-container {
max-width: 400px;
margin: 50px auto;
padding: 20px;
background-color: #f8f9fa;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
text-align: center;
}

.newsletter-title {
font-size: 24px;
color: #333;
margin-bottom: 10px;
}

.newsletter-description {
font-size: 16px;
color: #666;
margin-bottom: 20px;
}

.newsletter-form {
display: flex;
flex-direction: column;
gap: 10px;
}

.newsletter-input {
padding: 10px;
font-size: 16px;
border: 1px solid #ddd;
border-radius: 5px;
outline: none;
transition: border-color 0.3s;
}

.newsletter-input:focus {
border-color: #007bff;
}

.newsletter-button {
padding: 15px; /* Increased padding for a larger button */
font-size: 18px; /* Increased font size */
color: #fff;
background-color: #007bff;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
margin-top: 15px; /* Added spacing above the button */
}

.newsletter-button:hover {
background-color: #0056b3;
}
</style>



<!-- Copyright Section -->
<p class="copyright">
Expand Down Expand Up @@ -673,16 +804,7 @@ <h2>Contact Us</h2>
</script>

<script>
function handleSubmit(event) {
event.preventDefault();
const emailInput = document.getElementById('emailInput');
const email = emailInput.value.trim();

if (email) {
showToast(`Thank you for subscribing, ${email}! Stay tuned for DSA updates.`);
emailInput.value = ''; // Clear input after submission
}
}


function showToast(message) {
const toast = document.getElementById('toast');
Expand Down
Loading