imseldrith commited on
Commit
d38b838
·
1 Parent(s): ed1d808

Update templates/index.html

Browse files
Files changed (1) hide show
  1. templates/index.html +57 -29
templates/index.html CHANGED
@@ -1,34 +1,62 @@
 
1
  <html>
2
  <head>
3
- <title>Paraphraser Webapp</title>
4
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
5
- <script>
6
- function copyText(text) {
7
- navigator.clipboard.writeText(text).then(function() {
8
- console.log('Text copied to clipboard');
9
- }, function(err) {
10
- console.error('Could not copy text: ', err);
11
- });
12
- }
13
- </script>
14
  </head>
15
  <body>
16
- <h1>Paraphraser Webapp</h1>
17
- <form action="/" method="post">
18
- <textarea name="input_text" rows="10" cols="30"></textarea>
19
- <br><br>
20
- <input type="checkbox" name="options" value="remove_special_characters">Remove special characters<br>
21
- <input type="checkbox" name="options" value="correct_grammar">Correct grammar<br>
22
- <input type="checkbox" name="options" value="summarize">Summarize<br>
23
- <input type="checkbox" name="options" value="adjust_tone">Adjust tone<br>
24
- <br>
25
- <input type="submit" value="Paraphrase">
26
- </form>
27
- {% if result %}
28
- <p>Paraphrased text:</p>
29
- <textarea rows="10" cols="30">{{ result }}</textarea>
30
- <br><br>
31
- <button onclick="copyText()">Copy to Clipboard</button>
32
- {% endif %}
33
- </body>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  </html>
 
1
+ <!DOCTYPE html>
2
  <html>
3
  <head>
4
+ <meta charset="utf-8">
5
+ <title>Paraphrasing Webapp</title>
6
+ <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
7
+ <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
8
+ <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script>
9
+ <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
 
 
 
 
 
10
  </head>
11
  <body>
12
+ <div class="container mt-5">
13
+ <h1 class="text-center">Paraphrasing Webapp</h1>
14
+ <form method="post">
15
+ <div class="form-group">
16
+ <label for="text">Enter Text:</label>
17
+ <textarea class="form-control" id="text" rows="3" name="text">{{ text }}</textarea>
18
+ </div>
19
+ <div class="form-group">
20
+ <label for="paraphrase_option">Paraphrasing Option:</label>
21
+ <select class="form-control" id="paraphrase_option" name="paraphrase_option">
22
+ <option value="repeat">Repeat</option>
23
+ <option value="emotion_detector">Emotion Detector</option>
24
+ </select>
25
+ </div>
26
+ <div class="form-group form-check">
27
+ <input type="checkbox" class="form-check-input" id="remove_special_chars" name="remove_special_chars">
28
+ <label class="form-check-label" for="remove_special_chars">Remove Special Characters</label>
29
+ </div>
30
+ <div class="form-group form-check">
31
+ <input type="checkbox" class="form-check-input" id="correct_grammar" name="correct_grammar">
32
+ <label class="form-check-label" for="correct_grammar">Correct Grammar</label>
33
+ </div>
34
+ <div class="form-group form-check">
35
+ <input type="checkbox" class="form-check-input" id="summarize" name="summarize">
36
+ <label class="form-check-label" for="summarize">Summarize</label>
37
+ </div>
38
+ <button type="submit" class="btn btn-primary">Submit</button>
39
+ </form>
40
+ {% if paraphrased_text %}
41
+ <h3 class="mt-3">Paraphrased Text:</h3>
42
+ <p>{{ paraphrased_text }}</p>
43
+ <button class="btn btn-secondary" id="copy_button">Copy to Clipboard</button>
44
+ <div class="progress mt-3">
45
+ <div class="progress-bar" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
46
+ </div>
47
+ {% endif %}
48
+ </div>
49
+
50
+ </body>
51
+ <script>
52
+ $("#copy_button").click(function() {
53
+ var text = $("p").text();
54
+ var temp = $("<input>");
55
+ $("body").append(temp);
56
+ temp.val(text).select();
57
+ document.execCommand("copy");
58
+ temp.remove();
59
+ alert("Paraphrased text copied to clipboard.");
60
+ });
61
+ </script>
62
  </html>