File size: 3,109 Bytes
ea4b4e5
 
 
7ba9378
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ea4b4e5
 
 
 
7ba9378
 
 
 
 
 
 
 
 
 
 
ea4b4e5
 
7ba9378
 
ea4b4e5
 
7ba9378
 
 
 
 
 
ea4b4e5
7ba9378
ea4b4e5
 
7ba9378
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ea4b4e5
 
 
7ba9378
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>AI Detector</title>
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
    <style>
        body, html {
            height: 100%;
            margin: 0;
        }
        .bg {
            background-image: url('your-background-image.jpg'); /* Replace with your image URL */
            height: 100%;
            background-position: center;
            background-repeat: no-repeat;
            background-size: cover;
        }
        .container {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            text-align: center;
        }
        .title {
            font-size: 3em; /* Makes the title larger */
        }
        .submit-btn {
            font-size: 1.2em; /* Makes the button text larger */
            padding: 10px 24px; /* Larger button padding */
        }
        .auto-expand {
            overflow-y: hidden;
            resize: none; /* Prevents resizing manually */
            min-height: 50px; /* Minimum height */
        }
    </style>
</head>
<body>

<div class="bg">
    <div class="container">
        <h1 class="title">AI Detector</h1>
        <form id="aiForm">
            <div class="form-group">
                <label for="inputData">Baljinder and Jay for ICCAE</label>
                <textarea class="form-control auto-expand" id="inputData" placeholder="Enter data"></textarea>
            </div>
            <button type="submit" class="btn btn-primary submit-btn">Submit</button>
        </form>
        <p id="result" class="lead"></p>
    </div>
</div>

<!-- Load jQuery from CDN -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.2/dist/js/bootstrap.bundle.min.js"></script>
<script>
    // Function to resize textarea based on content
    function resizeTextarea (id) {
        const textarea = document.getElementById(id);
        textarea.style.height = 'auto';
        textarea.style.height = (textarea.scrollHeight) + 'px';
    }

    // Initial resize
    resizeTextarea('inputData');

    // Resize on input
    $('#inputData').on('input', function () {
        resizeTextarea('inputData');
    });

    $('#aiForm').submit(function(event) {
        event.preventDefault();
        var inputText = $('#inputData').val();

        // AJAX call to send data to server
        $.ajax({
            type: "POST",
            url: "/",  // Assuming your Flask route is '/'
            contentType: "application/json;charset=UTF-8",
            data: JSON.stringify({text: inputText}),
            success: function(response) {
                // Display the result
                $('#result').text('Classified as: ' + response.classification);
            },
            error: function(error) {
                console.log(error);
            }
        });
    });
</script>

</body>
</html>