Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
3 changes: 3 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ <h2 class="text-center">Оставайтесь на связи</h2>
<div class="card-body">
<p class="text-center">Оставьте ваши контакты и мы свяжемся с вами сегодня!</p>
<form>
<p class="invisible">
Ваши координаты: <span id="user-coords"></span>
</p>
<div class="form-group">
<label for="contact">Email или Телефон*</label>
<input type="text" class="form-control" id="contact" required>
Expand Down
10 changes: 10 additions & 0 deletions js/app.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
(async () => {

if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(position => {
const coordsEl = document.querySelector('#user-coords');
coordsEl.textContent = `${position.coords.latitude}, ${position.coords.longitude}`
coordsEl.parentElement.classList.remove('invisible');
});
}

// TODO: add custom logic here

})();