I want to make a glassmorphism website in HTML, CS
I want to make a glassmorphism website in HTML, CS
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Glassmorphism Links</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
min-height: 100vh;
background: linear-gradient(45deg, #ff9a9e, #fad0c4, #ffecd2);
display: flex;
justify-content: center;
align-items: center;
}
.container {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
padding: 20px;
max-width: 1200px;
}
.card {
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
border-radius: 10px;
padding: 20px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
transition: transform 0.3s ease;
}
.card:hover {
transform: translateY(-5px);
}
.card h2 {
margin-top: 0;
color: #fff;
}
.card ul {
list-style-type: none;
padding: 0;
}
.card li {
margin-bottom: 10px;
}
.card a {
color: #fff;
text-decoration: none;
transition: color 0.3s ease;
}
.card a:hover {
color: #ffecd2;
}
</style>
</head>
<body>
<div></div>
<script>
const links = [
{
category: "Social Media",
sites: [
{ name: "Facebook", url: "https://www.facebook.com" },
{ name: "Twitter", url: "https://www.twitter.com" },
{ name: "Instagram", url: "https://www.instagram.com" }
]
},
{
category: "News",
sites: [
{ name: "CNN", url: "https://www.cnn.com" },
{ name: "BBC", url: "https://www.bbc.com" },
{ name: "Reuters", url: "https://www.reuters.com" }
]
},
{
category: "Technology",
sites: [
{ name: "TechCrunch", url: "https://techcrunch.com" },
{ name: "Wired", url: "https://www.wired.com" },
{ name: "The Verge", url: "https://www.theverge.com" }
]
},
{
category: "Entertainment",
sites: [
{ name: "IMDb", url: "https://www.imdb.com" },
{ name: "Rotten Tomatoes", url: "https://www.rottentomatoes.com" },
{ name: "Metacritic", url: "https://www.metacritic.com" }
]
}
];
links.forEach(category => {
const card = document.createElement('div');
card.className = 'card';
container.appendChild(card);
});
</script>
</body>
</html>
This code creates a responsive glassmorphism website with cards containing links to
other websites[1][2]. Here's a breakdown of the key features:
2. The cards have a semi-transparent background with a blur effect, creating the
glassmorphism look[1][2].
3. The layout is responsive, using CSS Grid to adjust the number of columns based on
screen size.
4. Each card represents a category of links, with a title and a list of website links.
5. The links are stored in a JavaScript array, making it easy to add, remove, or modify
links.
6. Hover effects are added to the cards and links for better interactivity.
To use this code, simply save it as an HTML file and open it in a web browser. You can
customize the links by modifying the links array in the JavaScript section[3].
To further enhance the glassmorphism effect, you could add more subtle shadows, adjust
the transparency levels, or incorporate subtle animations [1][2]. Remember to test the
website on different devices and browsers to ensure compatibility and readability [3].
1. https://webdesign.tutsplus.com/what-is-the-glassmorphism-web-design-trend--cms-93333a
2. https://www.interaction-design.org/literature/topics/glassmorphism
3. https://blog.logrocket.com/ux-design/glassmorphism-what-it-is-how-its-going/