Spaces:
Running
Running
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Paraphrasing Webapp</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous"> | |
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script> | |
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-9/reFTGAW83EW2RDu2S0VKaIzap3H66lZH81PoYlFhbGU+6BZp6G7niu735Sk7lN" crossorigin="anonymous"></script> | |
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script> | |
</head> | |
<body> | |
<div class="container mt-5"> | |
<h1 class="text-center">Paraphrasing Webapp</h1> | |
<form method="post"> | |
<div class="form-group"> | |
<label for="text">Enter Text:</label> | |
<textarea class="form-control" id="text" rows="3" name="text">{{ text }}</textarea> | |
</div> | |
<div class="form-group"> | |
<label for="paraphrase_option">Paraphrasing Option:</label> | |
<select class="form-control" id="paraphrase_option" name="paraphrase_option"> | |
<option value="repeat">Repeat</option> | |
<option value="emotion_detector">Emotion Detector</option> | |
</select> | |
</div> | |
<div class="form-group form-check"> | |
<input type="checkbox" class="form-check-input" id="remove_special_chars" name="remove_special_chars"> | |
<label class="form-check-label" for="remove_special_chars">Remove Special Characters</label> | |
</div> | |
<div class="form-group form-check"> | |
<input type="checkbox" class="form-check-input" id="correct_grammar" name="correct_grammar"> | |
<label class="form-check-label" for="correct_grammar">Correct Grammar</label> | |
</div> | |
<div class="form-group form-check"> | |
<input type="checkbox" class="form-check-input" id="summarize" name="summarize"> | |
<label class="form-check-label" for="summarize">Summarize</label> | |
</div> | |
<button type="submit" class="btn btn-primary">Submit</button> | |
</form> | |
{% if paraphrased_text %} | |
<h3 class="mt-3">Paraphrased Text:</h3> | |
<p>{{ paraphrased_text }}</p> | |
<button class="btn btn-secondary" id="copy_button">Copy to Clipboard</button> | |
<div class="progress mt-3"> | |
<div class="progress-bar" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div> | |
</div> | |
{% endif %} | |
</div> | |
</body> | |
<script> | |
$("#copy_button").click(function() { | |
var text = $("p").text(); | |
var temp = $("<input>"); | |
$("body").append(temp); | |
temp.val(text).select(); | |
document.execCommand("copy"); | |
temp.remove(); | |
alert("Paraphrased text copied to clipboard."); | |
}); | |
</script> | |
</html> |