разбил файл profile.html на 2 других файла html и js соответственно + переписал в файлах list-rooms и profile пути к остальным файлам, т к при отправке на удаленный репозиторий возникают конфликты

This commit is contained in:
Fedor_Kitanin 2024-08-05 16:12:35 +03:00
parent 4a43cd9c7e
commit 3526883328
2 changed files with 14 additions and 14 deletions

View File

@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="../css/style.css">
<title>Профиль</title> <title>Профиль</title>
</head> </head>
<body> <body>
@ -13,7 +13,7 @@
<form> <form>
<div class="columns"> <div class="columns">
<div class="column"> <div class="column">
<img class="avatar" src="/pics/empty_avatar.png" id="avatar" height="200" width="200"><br> <img class="avatar" src="../img/empty_avatar.png" id="avatar" height="200" width="200"><br>
<input type="file" id="fileInput" style="display:none"> <input type="file" id="fileInput" style="display:none">
<button class="add" type="button" onclick="document.getElementById('fileInput').click();"></button><br> <button class="add" type="button" onclick="document.getElementById('fileInput').click();"></button><br>
</div> </div>
@ -30,17 +30,7 @@
</form> </form>
</div> </div>
<script> <script src="../js/list-rooms.js"> </script>
document.getElementById('fileInput').addEventListener('change', function(event) {
const file = event.target.files[0];
if (file) {
const reader = new FileReader();
reader.onload = function(e) {
document.getElementById('avatar').src = e.target.result;
};
reader.readAsDataURL(file);
}
});
</script>
</body> </body>
</html> </html>

10
assets/js/profile.js Normal file
View File

@ -0,0 +1,10 @@
document.getElementById('fileInput').addEventListener('change', function(event) {
const file = event.target.files[0];
if (file) {
const reader = new FileReader();
reader.onload = function(e) {
document.getElementById('avatar').src = e.target.result;
};
reader.readAsDataURL(file);
}
});