Sure! Here’s a more complex and aesthetically pleasing single-page website design that utilizes more advanced CSS styles, animations, and JavaScript. This example features a hero section with a captivating background, stylish typography, hover effects, and some interactive elements.
You can copy and paste this code into a new HTML file (e.g., index.html) and open it in your web browser to see the result.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Elegant Aesthetic Landing Page</title>
<style>
body {
margin: 0;
height: 100vh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #ffafbd, #ffc3a0);
color: #3d3d3d;
text-align: center;
overflow: hidden;
animation: backgroundAnimation 10s infinite alternate;
}
@keyframes backgroundAnimation {
0% { background: linear-gradient(135deg, #ffafbd, #ffc3a0); }
100% { background: linear-gradient(135deg, #add8e6, #f0e68c); }
}
.hero {
position: relative;
z-index: 1;
padding: 2rem;
border-radius: 15px;
backdrop-filter: blur(10px);
}
h1 {
font-size: 4em;
margin: 0;
text-shadow: 2px 2px 5px rgba(255, 255, 255, 0.7);
transition: transform .3s ease;
}
h1:hover {
transform: scale(1.1);
}
p {
font-size: 1.5em;
margin: 1em 0;
opacity: 0.9;
transition: color 0.3s ease;
}
p:hover {
color: #ff6f61;
}
button {
padding: 15px 30px;
font-size: 1.2em;
border: none;
border-radius: 25px;
background-color: #3d3d3d;
color: white;
cursor: pointer;
transition: background-color 0.3s ease, transform 0.3s ease;
box-shadow: 0px 5px 15px rgba(0, 0, 0, 0.3);
z-index: 2;
}
button:hover {
background-color: #2e2e2e;
transform: translateY(-3px);
}
footer {
position: absolute;
bottom: 10px;
font-size: 0.8em;
color: rgba(255,255,255,0.8);
}
</style>
</head>
<body>
<div class="hero">
<h1>Welcome to My World</h1>
<p>Discover the beauty that surrounds us.</p>
<button onclick="inspireMe()">Inspire Me!</button>
</div>
<footer>
© 2023 My Aesthetic Space
</footer>
<script>
const quotes = [
"Every moment is a fresh beginning.",
"The beauty of life is in the simplicity.",
"Dream big, sparkle more, shine bright!",
"Believe you can and you're halfway there.",
"Life is what happens when you're busy making other plans."
];
function inspireMe() {
const randomIndex = Math.floor(Math.random() * quotes.length);
document.querySelector('p').innerText = quotes[randomIndex];
}
</script>
</body>
</html>
Explanation of the Code:
-
HTML Structure:
- The code includes a hero section with a heading, a paragraph, and a button for interaction. There’s also a footer for copyright information.
-
CSS Styles:
- The background features a dynamic gradient that changes subtly over time, creating an inviting atmosphere.
- Typography is styled with shadows and hover effects to enhance visual appeal.
- The button has both color and shadow effects, making it stand out and feel interactive.
- The entire layout uses a flexbox-centered approach for a responsive design.
-
JavaScript Functionality:
- A function named
inspireMe() changes the text of the paragraph to a random quote from a predefined array, adding interactivity.
-
Animations:
- A CSS keyframe animation on the background provides a gentle, soothing visual effect that draws attention without being distracting.
Feel free to modify colors, fonts, or effects to personalize the design according to your tastes! This page aims to offer an immersive, aesthetically pleasing experience. Enjoy!