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"> <div class="menu context-menu">
<ul> <ul>
<li class="change-img"> <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"> <span class="icon">
<i class="fas fa-globe-americas"></i> <i class="fas fa-globe-americas"></i>
</span> </span>
Earth Earth
</a> </span>
</li> </li>
<li class="change-img"> <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"> <span class="icon">
<i class="fas fa-moon"></i> <i class="fas fa-moon"></i>
</span> </span>
Moon Moon
</a> </span>
</li> </li>
<li class="change-img"> <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"> <span class="icon">
<i class="fas fa-sun"></i> <i class="fas fa-sun"></i>
</span> </span>
Sun Sun
</a> </span>
</li> </li>
<li class="change-img"> <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"> <span class="icon">
<i class="fa-solid fa-earth-europe"></i> <i class="fa-solid fa-earth-europe"></i>
</span> </span>
Mars Mars
</a> </span>
</li> </li>
<li class="change-img"> <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"> <span class="icon">
<i class="fa-regular fa-circle-xmark"></i> <i class="fa-regular fa-circle-xmark"></i>
</span> </span>
Space Space
</a> </span>
</li> </li>
<li class="change-speed"> <li class="change-speed">
<a href="javascript:void(0)"> <span class="li-wrapper">
<span class="icon"> <span class="icon">
<i class="fas fa-wrench"></i> <i class="fas fa-wrench"></i>
</span> </span>
Speed: Speed:
<input type="range" min="0" max="1170" step="30" value="720" /> <input type="range" min="0" max="1170" step="30" value="720" />
</a> </span>
</li> </li>
<li class="land-to"> <li class="land-to">
<a href="javascript:void(0)"> <span class="li-wrapper">
<span class="icon"> <span class="icon">
<i class="fa-solid fa-rocket"></i> <i class="fa-solid fa-rocket"></i>
</span> </span>
Land to Earth Land to Earth
</a> </span>
</li> </li>
</ul> </ul>
</div> </div>

View file

@ -7,11 +7,10 @@ document.querySelectorAll('.copylink>.profile-link').forEach(
elem => elem.addEventListener('click', copyLink) 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) 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('input', changeSpeed)
document.querySelector('li.change-speed input').addEventListener('mousedown', ev => ev.stopPropagation()) document.querySelector('li.change-speed input').addEventListener('mousedown', ev => ev.stopPropagation())
document.querySelector('li.land-to').addEventListener('click', landToEarth) document.querySelector('li.land-to').addEventListener('click', landToEarth)

View file

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