Event Handler bugfix, a -> span

This commit is contained in:
DarkCat09 2022-12-30 16:41:02 +04:00
parent d68f20d917
commit 84cae569dd
3 changed files with 17 additions and 18 deletions

View file

@ -938,61 +938,61 @@
<div class="menu context-menu">
<ul>
<li class="change-img">
<a href="javascript:void(0)" data-img="img/earth.gif">
<span class="li-wrapper" data-img="img/earth.gif">
<span class="icon">
<i class="fas fa-globe-americas"></i>
</span>
Earth
</a>
</span>
</li>
<li class="change-img">
<a href="javascript:void(0)" data-img="img/moon.gif">
<span class="li-wrapper" data-img="img/moon.gif">
<span class="icon">
<i class="fas fa-moon"></i>
</span>
Moon
</a>
</span>
</li>
<li class="change-img">
<a href="javascript:void(0)" data-img="img/sun.gif">
<span class="li-wrapper" data-img="img/sun.gif">
<span class="icon">
<i class="fas fa-sun"></i>
</span>
Sun
</a>
</span>
</li>
<li class="change-img">
<a href="javascript:void(0)" data-img="img/mars.gif">
<span class="li-wrapper" data-img="img/mars.gif">
<span class="icon">
<i class="fa-solid fa-earth-europe"></i>
</span>
Mars
</a>
</span>
</li>
<li class="change-img">
<a href="javascript:void(0)" data-img="data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==">
<span class="li-wrapper" data-img="data:image/gif;base64,R0lGODlhAQABAIABAAAAAP///yH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==">
<span class="icon">
<i class="fa-regular fa-circle-xmark"></i>
</span>
Space
</a>
</span>
</li>
<li class="change-speed">
<a href="javascript:void(0)">
<span class="li-wrapper">
<span class="icon">
<i class="fas fa-wrench"></i>
</span>
Speed:
<input type="range" min="0" max="1170" step="30" value="720" />
</a>
</span>
</li>
<li class="land-to">
<a href="javascript:void(0)">
<span class="li-wrapper">
<span class="icon">
<i class="fa-solid fa-rocket"></i>
</span>
Land to Earth
</a>
</span>
</li>
</ul>
</div>

View file

@ -7,11 +7,10 @@ document.querySelectorAll('.copylink>.profile-link').forEach(
elem => elem.addEventListener('click', copyLink)
)
document.querySelectorAll('li.change-img>a').forEach(
document.querySelectorAll('li.change-img>.li-wrapper').forEach(
elem => elem.addEventListener('click', changePicture)
)
document.querySelector('li.change-speed a').addEventListener('mousedown', ev => ev.preventDefault())
document.querySelector('li.change-speed input').addEventListener('input', changeSpeed)
document.querySelector('li.change-speed input').addEventListener('mousedown', ev => ev.stopPropagation())
document.querySelector('li.land-to').addEventListener('click', landToEarth)

View file

@ -408,10 +408,10 @@ a {
background-color: @menuhl;
}
a {
.li-wrapper {
display: flex;
flex-direction: row;
gap: 5px;
gap: 10px;
}
.icon {