Skip to content

Commit

Permalink
fixed remove bookmark feature and css
Browse files Browse the repository at this point in the history
  • Loading branch information
anurag-pratik committed Feb 9, 2022
1 parent b7a86b5 commit d5dd579
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 10 deletions.
8 changes: 4 additions & 4 deletions popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ <h2 id="question">

<div class="icon-box">
<div>
<a id="bookmark"><img id="bookmark-heart" class="like-icon zoom" src="/assets/heart-icon-grey.png"
<a id="bookmark"><img id="bookmark-heart" class="like-icon zoom-2" src="/assets/heart-icon-grey.png"
alt="Bookmark Question" /></a>
</div>
<div>
<img id="tooltip-button" class="tap-icon zoom" src="/assets/eye-icon.png" alt="View Details" />
<img id="tooltip-button" class="tap-icon zoom-2" src="/assets/eye-icon.png" alt="View Details" />
</div>
</div>

Expand All @@ -100,7 +100,7 @@ <h2 id="question">
</div>

<div class="bt-container">
<button id="solve-btn" class="btn zoom" type="button">
<button id="solve-btn" class="btn" type="button">
<h3 class="btn-text">SOLVE</h3>
</button>
</div>
Expand All @@ -117,7 +117,7 @@ <h3 class="btn-text">SOLVE</h3>
<div class="footer-box gh-container">
<span><a id="gt-icon" href="https://github.com/Hack-Repository" target="_blank">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" fill="currentColor"
class="bi bi-github zoom" viewBox="0 0 16 16">
class="bi bi-github zoom-2" viewBox="0 0 16 16">
<path
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z" />
</svg>
Expand Down
13 changes: 8 additions & 5 deletions popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,16 +234,19 @@ let question = document.getElementById("question");
let list = [];

document.addEventListener("DOMContentLoaded", function () {
let bookmarkIcon = document.getElementById("bookmark-heart");
bookmarkIcon.addEventListener("click", generateBookmark);
bookmarkHeart.addEventListener("click", generateBookmark);
});

// Unitity Methods:
function generateBookmark() {
let index = list.indexOf(ui_elements.problem_statement);

if(index !== -1)
removeBookmark(index)
let index = list.findIndex(item => {
listObject = JSON.parse(item);
return listObject.question == ui_elements.problem_statement
});

if(index != -1)
removeBookmark(list[index])
else{
let bookmarkObject = {question: question, url: ui_elements.url}
let stringifiedObject = JSON.stringify(bookmarkObject);
Expand Down
2 changes: 1 addition & 1 deletion styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ a {
.btn {
width: 18vw;
height: 15vh;
color: rgb(212, 212, 212);
color: rgb(226, 226, 226);
background: rgb(70, 70, 70);
cursor: pointer;
position: relative;
Expand Down

0 comments on commit d5dd579

Please sign in to comment.