效果预览
部分源码如下:
html, body, #root {
width: 100%;
height: 100%;
overflow: hidden;
margin: 0;
}
#root {
display: flex;
flex-direction: column;
align-items: center;
min-height: 100vh;
background: #f0f0f0;
margin: 0;
font-family: Arial, sans-serif;
}
.image-container {
width: 500px;
height: 350px;
border-radius: 10px;
overflow: hidden;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
margin: 20px 0;
transition: filter 1s ease;
}
#filterImage {
width: 100%;
height: 100%;
object-fit: cover;
}
.controls {
display: flex;
gap: 15px;
align-items: center;
}
button {
padding: 12px 24px;
background: #2196F3;
color: white;
border: none;
border-radius: 6px;
cursor: pointer;
transition: transform 0.2s, background 0.3s;
}
button:hover {
background: #1976D2;
transform: translateY(-2px);
}
#currentFilter {
min-width: 120px;
padding: 8px 16px;
background: #fff;
border-radius: 4px;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}