text_gen_class / templates /generation.html
Scezui's picture
Refactor code for improved performance and readability
dfe58cd
<!DOCTYPE html>
<html>
<head>
<script src="{{ url_for('static', filename='js/js.js')}}"></script>
<link rel="icon" type="image/x-icon" href="{{ url_for('static', filename='images/logo.png')}}">
<meta charset="utf-8 " />
<title>Classifiers</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/css.css')}}">
<link href="https://fonts.googleapis.com " rel="preconnect " />
<link href="https://fonts.gstatic.com " rel="preconnect " crossorigin="anonymous " />
</head>
<body style="background-color: transparent; padding:0; margin:0; scroll-behavior: smooth;">
<div class="container1">
<div class="text-generator">
<h1>Text Generator</h1>
<div class="input-section">
<form id="generation-form" method="POST" action="/generation" onsubmit="return validateForm()">
<label for="user-input">Enter Text:</label>
<input type="text" class="glass-input" id="user-input" name="sentence" placeholder="Type your text here" required>
<div class="radio-input" style="margin-top: 10px;">
<input type="radio" id="value-1" name="valueradio" value="10">
<label for="value-1">10 Words</label>
<input type="radio" id="value-2" name="valueradio" value="15">
<label for="value-2">15 Words</label>
<input type="radio" id="value-3" name="valueradio" value="20">
<label for="value-3">20 Words</label>
</div>
<button class="glass-button" id="generate-btn" type="submit">Generate Text</button>
</form>
</div>
<p style="font-size: 14px;">Typed Text: <b>{{ sentence }}</b></p>
<p style="font-size: 14px;">Number of words: <b>{{ valueradio }}</b></p>
</div>
<div class="text-generated" id="generated-text">
<div class="message-container">
<img class="profile-image" src="{{ url_for('static', filename='images/Hero.png')}}" alt="User Profile Image">
<div class="message-content">
<p class="message-name">LSTM</p>
<p class="message-text" >{{LSTM_Pred }}</p>
</div>
</div>
<div class="message-container">
<img class="profile-image" src="{{ url_for('static', filename='images/Hero.png')}}" alt="Friend Profile Image">
<div class="message-content">
<p class="message-name">GRU</p>
<p class="message-text">{{GRU_Pred }}</p>
</div>
</div>
<div class="message-container">
<img class="profile-image" src="{{ url_for('static', filename='images/Hero.png')}}" alt="Friend Profile Image">
<div class="message-content">
<p class="message-name">BiLSTM</p>
<p class="message-text">{{BILSTM_Pred }}</p>
</div>
</div>
</div>
</div>
<div class="loader" id="loader"></div>
<script src="{{ url_for('static', filename='js/js.js')}}"></script>
<script>
// Add event listener to the submit button
document.getElementById("generation-form").addEventListener("submit", function() {
// Show the loader
document.getElementById("loader").style.display = "block";
// Apply opacity to the background elements
document.querySelector(".container1").classList.add("blur-background");
});
</script>
</body>
</html>