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
3 changes: 3 additions & 0 deletions src/code/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ <h1>SocialRepo</h1>
<section id="home">
<ul id="socialLinks">
</ul>
<div id="copyConfirm" class="copy-confirm">
<span class="copy-text"></span>
</div>
</section>
<section id="info" class="hidden">
<div id="heading">
Expand Down
9 changes: 9 additions & 0 deletions src/code/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ const socialLinks = getSocialLinks();
// ============== Home ==============
function showCopyMessage(key) {
console.log(`Copied ${key} to clipboard!`);
const copyConfirm = document.getElementById('copyConfirm');
const copyText = copyConfirm.querySelector('.copy-text');
copyText.textContent = `✅${key} profile copied.`;
copyConfirm.style.display = 'flex';

setTimeout(() => {
copyConfirm.style.display = 'none';
}, 3000);

};

function createImage(key) {
Expand Down
20 changes: 20 additions & 0 deletions src/code/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -542,3 +542,23 @@ table td {
transform: scale(0.9);
transition-duration: 100ms;
}
.copy-confirm {
display: none;
position: absolute;
bottom: 20px;
left: 50%;
transform: translateX(-50%);
background-color: var(--primary-color);
color: var(--text-color);
padding: 0.5rem 1rem;
border-radius: 5px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
font-size: 1rem;
display: flex;
align-items: center;
gap: 0.5rem;
}

.copy-confirm .check {
font-size: 1.2rem;
}