<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- bootstrap -->
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous" defer></script>
    <title>QR ME!</title>
    <style>
        body{
            background: #2980B9;  /* fallback for old browsers */
            background: -webkit-linear-gradient(to right, #FFFFFF, #6DD5FA, #2980B9);  /* Chrome 10-25, Safari 5.1-6 */
            background: linear-gradient(to right, #FFFFFF, #6DD5FA, #2980B9); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
        }
    </style>
</head>
<body>
    <div class="container p-5">
        <h1 style="text-align: center;"> QR Code Generator</h1>
        <form class="form-group" action="/submit-form" method="get">
            <label>Place your text here:</label>
            <textarea class="form-control mt-2" id="" rows="3"  placeholder="e.g. link.com or 'i miss you'" name="textToQR"></textarea>
            <div class="d-flex justify-content-center mt-3">
                <input type="submit" class="btn btn-primary justify-content-center" value="Submit">
            </div>    
        </form>
        <h3 style="text-align: center;" class="mt-4 mb-4">Output:</h3>
        <div class="d-flex justify-content-center">
            <img src="data:image/svg+xml;charset=UTF-8,<%= output %>" alt="" width="30%" height="30%">
        </div>
    </div>   
</body>
</html>