Skip to content

Commit

Permalink
remove button delete left and right
Browse files Browse the repository at this point in the history
  • Loading branch information
duynlk committed Dec 9, 2023
1 parent c38ffd3 commit b371c29
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 29 deletions.
Binary file modified capture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 17 additions & 17 deletions custom/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,12 @@ toastr.options.preventDuplicates = true;
$(document).ready(function(){

// click button clear input
$("#btn-clear-input").click(function(){
$("#btn-clear").click(function(){
var input = $("#input-lyric").val();
if(input != "") {
$("#input-lyric").val("");
toastr.success('Input is cleared');
}else{
toastr.error('Input is null');
}
});

// click button clear output
$("#btn-clear-output").click(function(){
var outputLyric = $("#output-lyric").val();
if(outputLyric != "") {
$("#output-lyric").val("");
toastr.success('Output is cleared');
}else{
toastr.error('Output is null');
toastr.success('Cleared your content');
}
});

Expand Down Expand Up @@ -50,13 +38,20 @@ $(document).ready(function(){
// scroll input-lyric
$("#input-lyric").on("scroll", function(){
if($("#sync-chk").is(":checked")){
syncScroll();
syncScrollOutput();
}
});

// scroll output-lyric
$("#output-lyric").on("scroll", function(){
if($("#sync-chk").is(":checked")){
syncScrollInput();
}
});

// click sync checkbox
$("#sync-chk").click(function(){
syncScroll();
syncScrollOutput();
});

function handleRemakeLyric(input) {
Expand Down Expand Up @@ -121,8 +116,13 @@ $(document).ready(function(){
return strVal.substring(0, strVal.length - 1);
}

function syncScroll() {
function syncScrollOutput() {
var scrollPos = $("#input-lyric").scrollTop();
$("#output-lyric").scrollTop(scrollPos);
}

function syncScrollInput() {
var scrollPos = $("#output-lyric").scrollTop();
$("#input-lyric").scrollTop(scrollPos);
}
});
1 change: 0 additions & 1 deletion img/arrows-rotate.svg

This file was deleted.

1 change: 0 additions & 1 deletion img/delete-left.svg

This file was deleted.

1 change: 1 addition & 0 deletions img/eraser.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 3 additions & 7 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

<body>
<div class="container is-widescreen">
<!-- header -->

<h5 class="title is-5 mt-4">
REMAKE TOOL FOR <span class="has-text-info">VANGSON.INFO</span>
</h5>
Expand All @@ -32,12 +32,9 @@ <h5 class="title is-5 mt-4">
<button id="btn-copy" class="button is-success mb-3">
<i class="fa-regular fa-copy"></i>
</button><br>
<button id="btn-clear-input" class="button is-danger mb-3">
<i class="fa-solid fa-delete-left"></i>
<button id="btn-clear" class="button is-danger mb-3">
<i class="fa-solid fa-eraser"></i>
</button><br>
<button id="btn-clear-output" class="button is-danger mb-5">
<i class="fa-solid fa-delete-left" style="transform: rotate(180deg);"></i>
</button>
<input id="sync-chk" type="checkbox" checked> Sync
</div>

Expand All @@ -46,7 +43,6 @@ <h5 class="title is-5 mt-4">
</div>
</div>

<!-- footer -->
<div>
<small>&copy; 2023 by <b>DuyNLK</b></small>
</div>
Expand Down
10 changes: 7 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ Make the smooth lyrics for website https://vangson.info

#### Button List:

1. ![acopy](img/copy.svg) - Copy output to clipboard
1. ![acopy](img/copy.svg) - Copy Output to clipboard

2. ![delete-left](img/delete-left.svg) - Empty input/output
2. ![eraser](img/eraser.svg) - Empty Input and Output

3. "Sync" checkbox: Sync scroll position of input/output
3. "Sync" checkbox: Sync scroll position of Input and Output

---

### Demo

![capture](capture.png)

0 comments on commit b371c29

Please sign in to comment.