Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +160 -119
templates/index.html
CHANGED
|
@@ -1,119 +1,160 @@
|
|
| 1 |
-
<!DOCTYPE html>
|
| 2 |
-
<html lang="tr">
|
| 3 |
-
<head>
|
| 4 |
-
<meta charset="UTF-8">
|
| 5 |
-
<title>🎙️Transkript</title>
|
| 6 |
-
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
|
| 7 |
-
<style>
|
| 8 |
-
html, body {
|
| 9 |
-
margin: 0;
|
| 10 |
-
padding: 0;
|
| 11 |
-
height: 100%;
|
| 12 |
-
font-family: "cursive";
|
| 13 |
-
overflow: hidden;
|
| 14 |
-
display: flex;
|
| 15 |
-
justify-content: center;
|
| 16 |
-
align-items: center;
|
| 17 |
-
}
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
.
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
<
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
</
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
"
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
"
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
}
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="tr">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<title>🎙️Transkript</title>
|
| 6 |
+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
|
| 7 |
+
<style>
|
| 8 |
+
html, body {
|
| 9 |
+
margin: 0;
|
| 10 |
+
padding: 0;
|
| 11 |
+
height: 100%;
|
| 12 |
+
font-family: "cursive";
|
| 13 |
+
overflow: hidden;
|
| 14 |
+
display: flex;
|
| 15 |
+
justify-content: center;
|
| 16 |
+
align-items: center;
|
| 17 |
+
}
|
| 18 |
+
#particles-js {
|
| 19 |
+
position: fixed;
|
| 20 |
+
width: 100%;
|
| 21 |
+
height: 100%;
|
| 22 |
+
background-color: #0d1b2a;
|
| 23 |
+
z-index: -1;
|
| 24 |
+
}
|
| 25 |
+
.container {
|
| 26 |
+
max-width: 1000px;
|
| 27 |
+
width: 95%;
|
| 28 |
+
background: rgba(176, 26, 26, 0.459);
|
| 29 |
+
padding: 50px;
|
| 30 |
+
border-radius: 20px;
|
| 31 |
+
box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
|
| 32 |
+
z-index: 1;
|
| 33 |
+
color: #fff;
|
| 34 |
+
}
|
| 35 |
+
.output-box {
|
| 36 |
+
margin-top: 15px;
|
| 37 |
+
background: #e9ecef;
|
| 38 |
+
padding: 10px;
|
| 39 |
+
border-radius: 10px;
|
| 40 |
+
white-space: pre-wrap;
|
| 41 |
+
max-height: 300px;
|
| 42 |
+
overflow-y: auto;
|
| 43 |
+
color: #000;
|
| 44 |
+
}
|
| 45 |
+
.progress-wrapper {
|
| 46 |
+
display: none;
|
| 47 |
+
margin-top: 15px;
|
| 48 |
+
}
|
| 49 |
+
.progress-bar {
|
| 50 |
+
background-color: green;
|
| 51 |
+
text-align: center;
|
| 52 |
+
color: white;
|
| 53 |
+
}
|
| 54 |
+
</style>
|
| 55 |
+
</head>
|
| 56 |
+
<body>
|
| 57 |
+
<div id="particles-js"></div>
|
| 58 |
+
|
| 59 |
+
<div class="container">
|
| 60 |
+
<h2 class="text-center mb-4">🎙️ Ses Dosyasını Metne Dönüştür</h2>
|
| 61 |
+
|
| 62 |
+
<div class="mb-3">
|
| 63 |
+
<label for="file" class="form-label">Ses Dosyası Seç (.mp3)</label>
|
| 64 |
+
<input class="form-control" type="file" name="file" id="file" required>
|
| 65 |
+
</div>
|
| 66 |
+
|
| 67 |
+
<div class="progress-wrapper">
|
| 68 |
+
<div id="progress-bar" class="progress-bar" style="width:0%">0%</div>
|
| 69 |
+
</div>
|
| 70 |
+
|
| 71 |
+
<div class="d-grid">
|
| 72 |
+
<button id="uploadBtn" class="btn btn-primary btn-lg">Yükle ve Dönüştür</button>
|
| 73 |
+
</div>
|
| 74 |
+
|
| 75 |
+
<div id="result"></div>
|
| 76 |
+
</div>
|
| 77 |
+
|
| 78 |
+
<p style="position: fixed; bottom: 20px; left: 20px; color:#ffffff;">Designer by: Burak Tuğrul Aşık & Tarık Kahraman</p>
|
| 79 |
+
|
| 80 |
+
<script src="https://cdn.jsdelivr.net/npm/particles.js"></script>
|
| 81 |
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
| 82 |
+
<script>
|
| 83 |
+
particlesJS('particles-js', {
|
| 84 |
+
"particles": {
|
| 85 |
+
"number": { "value": 90, "density": { "enable": true, "value_area": 800 } },
|
| 86 |
+
"color": { "value": "#ffffff" },
|
| 87 |
+
"shape": { "type": "star", "stroke": { "width": 0, "color": "#ffffff" }, "polygon": { "nb_sides": 5 } },
|
| 88 |
+
"opacity": { "value": 0.5, "random": false },
|
| 89 |
+
"size": { "value": 3, "random": false },
|
| 90 |
+
"line_linked": { "enable": true, "distance": 150, "color": "#ffffff", "opacity": 0.4, "width": 1 },
|
| 91 |
+
"move": { "enable": true, "speed": 1, "direction": "none", "random": false, "straight": false, "out_mode": "out", "bounce": false }
|
| 92 |
+
},
|
| 93 |
+
"interactivity": {
|
| 94 |
+
"detect_on": "canvas",
|
| 95 |
+
"events": {
|
| 96 |
+
"onhover": { "enable": true, "mode": "repulse" },
|
| 97 |
+
"onclick": { "enable": true, "mode": "push" },
|
| 98 |
+
"resize": true
|
| 99 |
+
},
|
| 100 |
+
"modes": {
|
| 101 |
+
"repulse": { "distance": 100, "duration": 0.4 },
|
| 102 |
+
"push": { "particles_nb": 4 }
|
| 103 |
+
}
|
| 104 |
+
},
|
| 105 |
+
"retina_detect": true
|
| 106 |
+
});
|
| 107 |
+
|
| 108 |
+
$("#uploadBtn").click(function(e) {
|
| 109 |
+
e.preventDefault();
|
| 110 |
+
var fileInput = $("#file")[0].files[0];
|
| 111 |
+
if (!fileInput) {
|
| 112 |
+
alert("Lütfen bir dosya seçin!");
|
| 113 |
+
return;
|
| 114 |
+
}
|
| 115 |
+
var formData = new FormData();
|
| 116 |
+
formData.append("file", fileInput);
|
| 117 |
+
|
| 118 |
+
$(".progress-wrapper").show();
|
| 119 |
+
$("#progress-bar").css("width", "0%").text("0%");
|
| 120 |
+
$("#result").html("");
|
| 121 |
+
|
| 122 |
+
$.ajax({
|
| 123 |
+
xhr: function() {
|
| 124 |
+
var xhr = new window.XMLHttpRequest();
|
| 125 |
+
xhr.upload.addEventListener("progress", function(e) {
|
| 126 |
+
if (e.lengthComputable) {
|
| 127 |
+
var percent = Math.round((e.loaded / e.total) * 100);
|
| 128 |
+
$("#progress-bar").css("width", percent + "%").text(percent + "%");
|
| 129 |
+
}
|
| 130 |
+
});
|
| 131 |
+
return xhr;
|
| 132 |
+
},
|
| 133 |
+
type: "POST",
|
| 134 |
+
url: "/",
|
| 135 |
+
data: formData,
|
| 136 |
+
processData: false,
|
| 137 |
+
contentType: false,
|
| 138 |
+
success: function(response) {
|
| 139 |
+
if (response.error) {
|
| 140 |
+
$("#result").html(`<p style="color:red;">${response.error}</p>`);
|
| 141 |
+
return;
|
| 142 |
+
}
|
| 143 |
+
$("#progress-bar").css("width", "100%").text("100%");
|
| 144 |
+
$("#result").html(
|
| 145 |
+
`<div class="output-box">
|
| 146 |
+
<h5>🎧 Dönüştürülen Metin:</h5>
|
| 147 |
+
<p>${response.metin}</p>
|
| 148 |
+
<h5>📝 Metnin Özeti:</h5>
|
| 149 |
+
<p>${response.ozet}</p>
|
| 150 |
+
</div>`
|
| 151 |
+
);
|
| 152 |
+
},
|
| 153 |
+
error: function() {
|
| 154 |
+
alert("Bir hata oluştu.");
|
| 155 |
+
}
|
| 156 |
+
});
|
| 157 |
+
});
|
| 158 |
+
</script>
|
| 159 |
+
</body>
|
| 160 |
+
</html>
|