view mrjunejune/src/tools/file_converter/index.html @ 97:3bdfffaad162

[MrJuneJune] Updated so it is mobile friendly and fixed few font sizes.
author June Park <parkjune1995@gmail.com>
date Fri, 02 Jan 2026 20:21:58 -0800
parents be91a73d801a
children
line wrap: on
line source

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>File Format Converter</title>
    {{/parts/base_head.html}}
    <style>
        .container {
            max-width: 800px;
            margin: 2rem auto;
            padding: 2rem;
        }

        .converter-section {
            border-radius: 8px;
            border: 2px solid var(--lightgray);
            padding: 2rem;
            margin-bottom: 2rem;
        }

        .converter-section h2 {
            margin-top: 0;
            color: var(--black);
        }

        .file-input-wrapper {
            margin: 1rem 0;
        }

        .file-input-wrapper label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 600;
        }

        input[type="file"] {
            padding: 0.75rem;
            border: 2px dashed #ccc;
            border-radius: 4px;
            background: white;
            font-size: 16px;
        }

        button {
            background: var(--purple);
            font-family: "More Thin", sans-serif;
            color: var(--gray-gradient);
            border: none;
            padding: 0.75rem 1.5rem;
            border-radius: 4px;
            cursor: pointer;
            font-size: 1rem;
            margin-top: 1rem;
            min-height: 44px;
        }

        button:hover {
            background: var(--orange);
        }

        button:disabled {
            background: var(--gray);
            cursor: not-allowed;
        }

        .result {
            margin-top: 1rem;
            padding: 1rem;
            background: white;
            border-radius: 4px;
            display: none;
        }

        .result.show {
            display: block;
        }

        .result.success {
            border-left: 4px solid var(--blue);
        }

        .result.error {
            border-left: 4px solid var(--red);
        }

        .download-link {
            display: inline-block;
            margin-top: 0.5rem;
            color: var(--awesome);
            text-decoration: none;
        }

        .download-link:hover {
            text-decoration: underline;
        }

        .loading {
            display: none;
            margin-top: 1rem;
        }

        .loading.show {
            display: block;
        }

        /* Mobile responsive */
        @media (max-width: 720px) {
            .container {
                padding: 1rem;
                margin: 1rem auto;
            }

            .converter-section {
                padding: 1.5rem 1rem;
            }

            .converter-section h2 {
                font-size: 1.5rem;
            }

            .file-input-wrapper label {
                font-size: 1rem;
            }

            button {
                font-size: 1.1rem;
                padding: 1rem 1.5rem;
            }

            .result {
                padding: 1rem;
                font-size: 1rem;
            }
        }
    </style>
</head>
<body>
    {{/parts/header.html}}

    <div class="container">
        <h1>File Format Converter</h1>
        <p>Convert your images and videos to different formats using FFmpeg</p>

        <div class="converter-section">
            <h2>Image to WebP Converter</h2>
            <p>Upload an image file (PNG, JPG, GIF, etc.) to convert it to WebP format</p>

            <div class="file-input-wrapper">
                <label for="imageInput">Choose an image file:</label>
                <input type="file" id="imageInput" accept="image/*">
            </div>

            <button id="convertImageBtn" onclick="convertImageToWebP()">Convert to WebP</button>

            <div class="loading" id="imageLoading">Converting... Please wait.</div>

            <div class="result" id="imageResult">
                <p id="imageMessage"></p>
                <a id="imageDownload" class="download-link" style="display: none;">Download WebP Image</a>
            </div>
        </div>

        <div class="converter-section">
            <h2>Video to MP4 Converter</h2>
            <p>Upload a video file (AVI, MOV, MKV, etc.) to convert it to MP4 format</p>

            <div class="file-input-wrapper">
                <label for="videoInput">Choose a video file:</label>
                <input type="file" id="videoInput" accept="video/*">
            </div>

            <button id="convertVideoBtn" onclick="convertVideoToMP4()">Convert to MP4</button>

            <div class="loading" id="videoLoading">Converting... Please wait.</div>

            <div class="result" id="videoResult">
                <p id="videoMessage"></p>
                <a id="videoDownload" class="download-link" style="display: none;">Download MP4 Video</a>
            </div>
        </div>
        {{/parts/footer.html}}
    </div>
    <script src="/tools/file_converter/index.js"></script>
</body>
</html>