js+css实现图片emoji贴纸编辑器效果代码
代码语言:html
所属分类:布局界面
代码描述:js+css实现图片emoji贴纸编辑器效果代码,可在图片上添加各种emoji表情贴纸。
下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>图片Emoji贴纸编辑器</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Microsoft YaHei', sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 1400px;
margin: 0 auto;
background: white;
border-radius: 20px;
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
padding: 30px;
}
h1 {
text-align: center;
color: #333;
margin-bottom: 30px;
font-size: 32px;
display: flex;
align-items: center;
justify-content: center;
gap: 10px;
}
.main-content {
display: grid;
grid-template-columns: 300px 1fr;
gap: 30px;
}
@media (max-width: 768px) {
.main-content {
grid-template-columns: 1fr;
}
}
/* 控制面板 */
.control-panel {
background: #f8f9fa;
border-radius: 15px;
padding: 20px;
}
.section {
margin-bottom: 25px;
}
.section-title {
font-size: 16px;
font-weight: 600;
color: #555;
margin-bottom: 10px;
display: flex;
align-items: center;
gap: 5px;
}
.btn {
width: 100%;
padding: 12px;
border: none;
border-radius: 10px;
cursor: pointer;
font-size: 15px;
font-weight: 500;
transition: all 0.3s;
margin-bottom: 10px;
}
.btn-primary {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.btn-success {
background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%);
color: white;
}
.btn-danger {
background: linear-gradient(135deg, #ff6b6b 0%, #feca57 100%);
color: white;
}
.btn-info {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
color: white;
}
.btn:hover {
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
.btn:active {
transform: translateY(0);
}
input[type="file"] {
display: none;
}
/* Emoji选择器 */
.emoji-picker {
background: white;
border-radius: 10px;
padding: 10px;
max-height: 300px;
overflow-y: auto;
border: 2px solid #e0e0e0;
}
.emoji-categories {
display: flex;
gap: 5px;
margin-bottom: 10px;
flex-wrap: wrap;
}
.category-btn {
padding: 5px 10px;
border: 1px solid #ddd;
border-radius: 5px;
background: white;
cursor: pointer;
font-size: 14px;
transition: all 0.2s;
}
.category-btn.active {
background: #667eea;
color: white;
border-color: #667eea;
}
.emoji-grid {
display: grid;
grid-template-columns: repeat(6, 1fr);
gap: 5px;
}
.emoji-item {
width: 100%;
aspect-ratio: 1;
display: flex;
align-items: center;
justify-content: center;
font-size: 24px;
cursor: pointer;
border-radius: 5px;
transition: all 0.2s;
border: 1px solid transparent;
}
.........完整代码请登录后点击上方下载按钮下载查看
















网友评论0