fitsblb's picture
Deploy advanced sentiment analyzer with 4-model ensemble system
82c705b
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Error - AI Sentiment Analyzer</title>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css" rel="stylesheet">
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
}
.error-container {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
padding: 3rem 2rem;
border-radius: 20px;
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
max-width: 600px;
width: 100%;
text-align: center;
animation: fadeInUp 0.5s ease-out;
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.error-icon {
font-size: 4rem;
color: #ef4444;
margin-bottom: 1.5rem;
animation: bounce 2s infinite;
}
@keyframes bounce {
0%, 20%, 50%, 80%, 100% {
transform: translateY(0);
}
40% {
transform: translateY(-10px);
}
60% {
transform: translateY(-5px);
}
}
.error-code {
font-size: 6rem;
font-weight: 700;
background: linear-gradient(135deg, #ef4444, #dc2626);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 1rem;
line-height: 1;
}
.error-title {
font-size: 2rem;
font-weight: 600;
color: #374151;
margin-bottom: 1rem;
}
.error-message {
font-size: 1.1rem;
color: #6b7280;
margin-bottom: 2rem;
line-height: 1.6;
}
.error-details {
background: #f8fafc;
border-left: 4px solid #ef4444;
padding: 1rem 1.5rem;
border-radius: 0 10px 10px 0;
margin-bottom: 2rem;
text-align: left;
}
.error-details h4 {
color: #374151;
font-weight: 600;
margin-bottom: 0.5rem;
}
.error-details p {
color: #6b7280;
font-size: 0.9rem;
}
.actions {
display: flex;
gap: 1rem;
justify-content: center;
flex-wrap: wrap;
}
.btn {
padding: 1rem 2rem;
border: none;
border-radius: 15px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
text-decoration: none;
display: inline-flex;
align-items: center;
gap: 8px;
}
.btn-primary {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}
.btn-secondary {
background: white;
color: #667eea;
border: 2px solid #667eea;
}
.btn-secondary:hover {
background: #667eea;
color: white;
transform: translateY(-2px);
}
.suggestions {
background: #f0f9ff;
border: 1px solid #bae6fd;
padding: 1.5rem;
border-radius: 15px;
margin-top: 2rem;
text-align: left;
}
.suggestions h4 {
color: #0369a1;
font-weight: 600;
margin-bottom: 1rem;
display: flex;
align-items: center;
gap: 8px;
}
.suggestions ul {
color: #0369a1;
padding-left: 1.5rem;
}
.suggestions li {
margin-bottom: 0.5rem;
}
@media (max-width: 768px) {
.error-container {
padding: 2rem 1.5rem;
margin: 10px;
}
.error-code {
font-size: 4rem;
}
.error-title {
font-size: 1.5rem;
}
.actions {
flex-direction: column;
}
.btn {
width: 100%;
justify-content: center;
}
}
</style>
</head>
<body>
<div class="error-container">
<div class="error-icon">
<i class="fas fa-exclamation-triangle"></i>
</div>
<div class="error-code">{{ error_code or 'Error' }}</div>
<h1 class="error-title">
{% if error_code == 400 %}
Bad Request
{% elif error_code == 404 %}
Page Not Found
{% elif error_code == 413 %}
Request Too Large
{% elif error_code == 500 %}
Server Error
{% elif error_code == 503 %}
Service Unavailable
{% else %}
Something Went Wrong
{% endif %}
</h1>
<p class="error-message">
{{ error_message or 'An unexpected error occurred. Please try again later.' }}
</p>
{% if error_code == 400 %}
<div class="suggestions">
<h4><i class="fas fa-lightbulb"></i> Suggestions:</h4>
<ul>
<li>Make sure your text is between 3-1000 characters</li>
<li>Check that you've entered some text to analyze</li>
<li>Try using plain text without special formatting</li>
</ul>
</div>
{% elif error_code == 413 %}
<div class="suggestions">
<h4><i class="fas fa-lightbulb"></i> Suggestions:</h4>
<ul>
<li>Shorten your text to under 1000 characters</li>
<li>Try analyzing smaller chunks of text</li>
<li>Break long documents into smaller pieces</li>
</ul>
</div>
{% elif error_code == 500 or error_code == 503 %}
<div class="suggestions">
<h4><i class="fas fa-lightbulb"></i> What you can do:</h4>
<ul>
<li>Wait a moment and try again</li>
<li>Check your internet connection</li>
<li>Try with a shorter text sample</li>
<li>Contact support if the problem persists</li>
</ul>
</div>
{% endif %}
<div class="actions">
<a href="/" class="btn btn-primary">
<i class="fas fa-home"></i>
Go Home
</a>
<button class="btn btn-secondary" onclick="history.back()">
<i class="fas fa-arrow-left"></i>
Go Back
</button>
</div>
</div>
<script>
// Auto-refresh for server errors after 10 seconds
{% if error_code == 500 or error_code == 503 %}
let countdown = 10;
const refreshBtn = document.createElement('div');
refreshBtn.style.cssText = `
position: fixed;
bottom: 20px;
right: 20px;
background: rgba(102, 126, 234, 0.9);
color: white;
padding: 10px 20px;
border-radius: 10px;
font-size: 0.9rem;
backdrop-filter: blur(10px);
`;
refreshBtn.innerHTML = `Auto-refresh in ${countdown}s`;
document.body.appendChild(refreshBtn);
const timer = setInterval(() => {
countdown--;
refreshBtn.innerHTML = `Auto-refresh in ${countdown}s`;
if (countdown <= 0) {
clearInterval(timer);
window.location.reload();
}
}, 1000);
// Click to cancel auto-refresh
refreshBtn.addEventListener('click', () => {
clearInterval(timer);
refreshBtn.remove();
});
{% endif %}
</script>
</body>
</html>