js+css实现本地选择多张图片不同排布布局拼图设置导出一张图片效果代码

代码语言:html

所属分类:其他

代码描述:js+css实现本地选择多张图片不同排布布局拼图设置导出一张图片效果代码

代码标签: js css 本地 选择 多张 图片 不同 排布 布局 拼图 设置 导出 一张 图片

下面为部分代码预览,完整代码请点击下载或在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>高级图片拼图工具</title>

    <!-- CSS 代码 -->
    <style>
        :root {
            --panel-width: 280px;
            --border-radius: 8px;
            --primary-color: #007bff;
            --light-gray: #f0f2f5;
        }

        body {
            font-family: system-ui, -apple-system, sans-serif;
            background-color: var(--light-gray);
            margin: 0;
            color: #333;
        }

        .app-container {
            display: flex;
            height: 100vh;
            padding: 15px;
            box-sizing: border-box;
            gap: 15px;
        }

        .panel {
            width: var(--panel-width);
            background: #fff;
            border-radius: var(--border-radius);
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
            padding: 20px;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
        }

        .panel h2 {
            margin: 0 0 20px 0;
            font-size: 1.2em;
            padding-bottom: 10px;
            border-bottom: 1px solid #e5e5e5;
        }

        /* 左侧布局 */
        #layout-options {
            overflow-y: auto;
        }
        .layout-template {
            padding: 12px 15px;
            margin-bottom: 10px;
            background-color: #f8f9fa;
            border-radius: 5px;
            cursor: pointer;
            font-size: 0.9em;
            transition: all 0.2s ease;
            border: 1px solid transparent;
        }
        .layout-template:hover {
            border-color: var(--primary-color);
        }
        .layout-template.active {
            background-color: var(--primary-color);
            color: white;
            font-weight: bold;
        }
        .layout-template.disabled {
            cursor: not-allowed;
            opacity: 0.5;
        }

        /* 中间内容 */
        .main-content {
            flex-grow: 1;
            display: flex;
            flex-direction: column;
            gap: 15px;
        }
        .controls {
            text-align: center;
        }
        .custom-file-upload {
            display: inline-block;
            padding: 12px 25px;
            cursor: pointer;
            background-color: #28a745;
            color: white;
            border-radius: 5px;
            font-size: 1em;
            font-weight: bold;
            transition: background-color 0.2s;
        }
        .custom-file-upload:hover {
            background-color: #218838;
        }
        #image-selector {
            display: none;
        }

        #collage-preview-wrapper {
            flex-grow: 1;
            background: #fff;
            border-radius: var(--border-radius);
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
            padding: 15px;
            display: flex;
            justify-content: center;
            align-items: center;
        }
        #collage-preview {
            width: 100%;
            height: 100%;
            backgr.........完整代码请登录后点击上方下载按钮下载查看

网友评论0