-
-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: added touch/slide on prematch option buttons (#1529) #2517
feat: added touch/slide on prematch option buttons (#1529) #2517
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heya! Some things that should probably be poked.
src/index.ejs
Outdated
@@ -74,91 +74,121 @@ | |||
<h2>Player Mode <span id="playerModeType"></span></h2> | |||
<div id="playerMode" class="typeRadio"> | |||
<input type="radio" id="p2" name="playerMode" value="2" checked> | |||
<label for="p2">1 versus 1</label> | |||
<label for ="p2" class="draggable-label">1 versus 1</label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Space, the final frontier.
src/index.ejs
Outdated
<input type="radio" id="p4" name="playerMode" value="4"> | ||
<label for="p4">2 versus 2</label> | ||
<label for="p4" class="draggable-label">2 versus 2</label> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe class name should be way shorter, like "dragit" or so.
src/index.ejs
Outdated
</div> | ||
</div> | ||
<!--Script to add sliding to prematch option buttons--> | ||
<script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Best to make index file smaller (as we even plan to split it into files). Would be best if script was separate file in src/ui
and be imported using webpack or whatever.
src/index.ejs
Outdated
selectedRadio = radio.previousElementSibling; | ||
}); | ||
|
||
// check new dragged radio/button |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment style consistency: capitalized first letter, // Check...
@Mandolinx I've tested this and works well, however, I've opened a review regarding the coding itself to polish things. |
Hi @DreadKnight I've just updated my code such that the script is now in a separate file in UI called "slider.js", and fixed various syntax and style issues. During my process, I was not familiar with webpack so I'm not entirely sure if my method of importing is suitable for this issue so that may be an area of focus in the review. Also, my script file that does the slide is in a separate file but it only contains a function, so I was wondering whether it'd be better to just add the function directly to script.ts or add the function to Button.ts. Thanks! p.s. interface.js is said to be changed but all I did was copy and paced the interface file from repo because git pull was not working. |
Moving the stuff in Regarding |
@DreadKnight As requested, I reverted to my original version of interface and I put the buttonSlider into the button file. I also changed the function to use jquery since I was having problems earlier copy and pasting my old function into the file without it, but it has the same functionality so everything should be fine for that. Thanks! |
@Mandolinx Thanks way better, good job! 👍🏻 |
This fixes issue: #1529
clicking on a pre-match button game option and dragging to the next button will click that next button and reset original button.