|
<!DOCTYPE html> |
|
<html lang="en"> |
|
<head> |
|
<meta charset="UTF-8"> |
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
|
<title>Text to Speech Converter</title> |
|
<style> |
|
body { |
|
font-family: 'Arial', sans-serif; |
|
background: linear-gradient(135deg, #667eea, #764ba2); |
|
margin: 0; |
|
padding: 20px; |
|
color: #333; |
|
} |
|
.container { |
|
max-width: 800px; |
|
margin: 0 auto; |
|
background: white; |
|
padding: 30px; |
|
border-radius: 15px; |
|
box-shadow: 0 0 20px rgba(0,0,0,0.1); |
|
} |
|
h1 { |
|
color: #4a4a4a; |
|
text-align: center; |
|
margin-bottom: 30px; |
|
} |
|
textarea { |
|
width: 100%; |
|
height: 150px; |
|
padding: 15px; |
|
border: 2px solid #ddd; |
|
border-radius: 8px; |
|
font-size: 16px; |
|
resize: vertical; |
|
margin-bottom: 20px; |
|
} |
|
select { |
|
padding: 10px; |
|
font-size: 16px; |
|
border-radius: 8px; |
|
margin-bottom: 20px; |
|
width: 200px; |
|
} |
|
.button { |
|
background: #667eea; |
|
color: white; |
|
padding: 12px 25px; |
|
border: none; |
|
border-radius: 8px; |
|
cursor: pointer; |
|
font-size: 16px; |
|
transition: background 0.3s; |
|
} |
|
.button:hover { |
|
background: #5a6cd3; |
|
} |
|
.voice-grid { |
|
display: grid; |
|
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); |
|
gap: 20px; |
|
margin-top: 30px; |
|
} |
|
.voice-card { |
|
background: #f8f9fa; |
|
padding: 15px; |
|
border-radius: 8px; |
|
text-align: center; |
|
} |
|
.voice-card button { |
|
margin-top: 10px; |
|
background: #764ba2; |
|
} |
|
.voice-card button:hover { |
|
background: #633d87; |
|
} |
|
.error { |
|
color: #dc3545; |
|
text-align: center; |
|
margin-top: 20px; |
|
} |
|
</style> |
|
</head> |
|
<body> |
|
<div class="container"> |
|
<h1>Text to Speech Converter</h1> |
|
<form method="post"> |
|
<textarea name="text" placeholder="Enter your text here..."></textarea> |
|
<select name="voice"> |
|
{% for voice in voices %} |
|
<option value="{{ voice }}">{{ voice }}</option> |
|
{% endfor %} |
|
</select> |
|
<button type="submit" name="generate" class="button">Generate & Download</button> |
|
</form> |
|
|
|
<h2 style="margin-top: 40px; text-align: center;">Voice Previews</h2> |
|
<div class="voice-grid"> |
|
{% for voice in voices %} |
|
<div class="voice-card"> |
|
<h3>{{ voice }}</h3> |
|
<form method="post"> |
|
<input type="hidden" name="preview_voice" value="{{ voice }}"> |
|
<button type="submit" name="preview" class="button">Preview</button> |
|
</form> |
|
</div> |
|
{% endfor %} |
|
</div> |
|
|
|
{% if error %} |
|
<p class="error">Error: {{ error }}</p> |
|
{% endif %} |
|
</div> |
|
</body> |
|
</html> |