Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/code/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,26 @@ function createImage(key) {
const socialLinksContainer = document.getElementById("socialLinks");
function createSocialLink(key, value) {
const li = document.createElement("li");
// Here this will be a div which will come over the top of the icon and it will show the name of the app
const div = document.createElement("div")
const img = createImage(key);
div.classList.add('div-hover-effect')
//^ making the string short if it overflows (based upon its length)
if (key.length>8){
div.textContent = `${key.substr(0,8)+"..."}`
}else{
div.textContent = key
}
li.addEventListener("mouseenter",()=>{
img.style.display = 'none'
div.style.display = 'flex'
})
li.addEventListener('mouseleave',()=>{
img.style.display = 'block'
div.style.display = 'none'
})
img.onload = () => {
li.appendChild(div)
li.appendChild(img);
li.addEventListener("click", () => {
navigator.clipboard.writeText(value); // Copy the value to clipboard
Expand Down
15 changes: 15 additions & 0 deletions src/code/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,21 @@ p {
width: 100%;
height: 100%;
}
.div-hover-effect{
/* position: absolute;
top: 105%; */
display: none;
justify-content: center;
align-items: center;
height: inherit;
width: inherit;
border-radius: inherit;
font-size: 11px;
font-weight: 700;
color: white;
background-color: transparent;
overflow: hidden;
}

/* ============== Info Panel ============== */

Expand Down