Skip to content

Commit

Permalink
Merge pull request #3 from Statuxia/revert-1-develop
Browse files Browse the repository at this point in the history
1.1 Notification update
  • Loading branch information
Statuxia authored Mar 2, 2024
2 parents 69a99c7 + acaab2d commit 0a818b2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 50 deletions.
1 change: 0 additions & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ const app = express();
const port = 8881;

app.use(bodyParser.urlencoded({ extended: true }));
app.use(express.json());
const path = require('path');

app.use('/', express.static(path.join(__dirname), {
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ services:
container_name: youtube_audio_saver
ports:
- "8881:8881"
image: youtubeaudiosaver:1.0
image: youtubeaudiosaver:1.1
11 changes: 0 additions & 11 deletions index.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,6 @@ button:hover {
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

.messageBox {
max-width: 400px;
margin: 0 auto;
padding: 20px;
background-color: #333333;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
display: none;
text-align: center;
}

.githubButton {
background-color: white;
margin-bottom: 0px;
Expand Down
40 changes: 3 additions & 37 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@

<body>
<h1 align="center">Загрузить музыку с YouTube</h1>
<form id="downloadForm" action="/download" method="post">
<form action="/download" method="post">
<label for="url">URL видео YouTube:</label><br>
<input type="text" id="url" name="url"><br>
<span id="speedValue">Скорость музыки: 1.0</span><br><br>
<input type="range" min="0.5" max="2" step="0.1" value="1" id="speed" name="audioSpeed" oninput="changeSpeed()">
<button type="submit" id="downloadButton">Скачать</button>
<button type="submit">Скачать</button>
</form>
<br>
<div class="messageBox" id="messageBox"></div>
<br>
<div class="social">
<a href="https://github.com/Statuxia" target="_blank">
<button class="githubButton" style="font-size:24px">GitHub <i class="fa fa-github"></i></button>
<button class="githubButton" style="font-size:24px">Github <i class="fa fa-github"></i></button>
</a>
</div>

Expand All @@ -32,38 +30,6 @@ <h1 align="center">Загрузить музыку с YouTube</h1>
var speedValue = document.getElementById('speed').value;
document.getElementById('speedValue').textContent = "Скорость музыки: " + speedValue;
}

document.getElementById('downloadForm').addEventListener('submit', function (event) {
event.preventDefault();
showMessage('Загрузка началась');
var formData = new FormData(this);
fetch('/download', {
method: 'POST',
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({
url: formData.get("url"),
audioSpeed: formData.get("audioSpeed")
})
})
.then(function (response) {
if (response.ok) {
showMessage('Файл успешно загружен');
} else {
showMessage('Произошла ошибка при загрузке файла');
}
})
.catch(function (error) {
console.error('Произошла ошибка:', error);
});
});

function showMessage(message) {
var messageBox = document.getElementById('messageBox');
messageBox.textContent = message;
messageBox.style.display = 'block';
}
</script>
</body>

Expand Down

0 comments on commit 0a818b2

Please sign in to comment.