index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Avatar Upload</title>
<link rel="stylesheet" href="styles.css"/>
</head>
<body>
<form class="card">
<h2>Profile photo</h2>
<label class="upload">
<div class="avatar">👤</div>
<div class="badge">✏️</div>
<input type="file" accept="image/*"/>
</label>
<div class="info">
<p class="name">John Doe</p>
<p class="email">john@example.com</p>
</div>
<p class="formats">JPG, PNG or GIF - max 5MB</p>
<button type="submit">Save changes</button>
</form>
</body>
</html>
styles.css
* {
margin: 0;
box-sizing: border-box;
}
body {
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
background: linear-gradient(160deg, #0e0610, #140a14 40%, #100810);
font-family: system-ui, sans-serif;
}
.card {
width: 360px;
padding: 40px;
border-radius: 24px;
background: rgba(255, 255, 255, 0.03);
backdrop-filter: blur(40px);
border: 1px solid rgba(255, 255, 255, 0.07);
box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
}
h2 {
font-size: 20px;
font-weight: 700;
color: #fdf2f8;
}
.upload {
position: relative;
cursor: pointer;
}
.upload input {
position: absolute;
inset: 0;
opacity: 0;
cursor: pointer;
}
.avatar {
width: 120px;
height: 120px;
border-radius: 50%;
border: 2px dashed rgba(255, 255, 255, 0.12);
background: rgba(255, 255, 255, 0.02);
display: flex;
justify-content: center;
align-items: center;
font-size: 40px;
transition: border-color 0.3s;
}
.upload:hover .avatar {
border-color: rgba(244, 63, 94, 0.5);
}
.badge {
position: absolute;
bottom: 0;
right: 0;
width: 36px;
height: 36px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.1);
backdrop-filter: blur(10px);
display: flex;
justify-content: center;
align-items: center;
font-size: 14px;
}
.info {
text-align: center;
}
.name {
font-size: 16px;
font-weight: 600;
color: #fce7f3;
}
.email {
font-size: 13px;
color: rgba(255, 255, 255, 0.45);
}
.formats {
font-size: 11px;
color: rgba(255, 255, 255, 0.3);
}
button {
width: 100%;
padding: 14px;
border: none;
border-radius: 12px;
font-size: 14px;
font-weight: 600;
color: #fff;
cursor: pointer;
background: linear-gradient(135deg, #be123c, #e11d48, #f43f5e);
background-size: 200% 200%;
background-position: left center;
box-shadow: 0 4px 20px rgba(225, 29, 72, 0.25);
transition: background-position 0.3s;
}
button:hover {
background-position: right center;
}