Skip to content

Commit ee0c198

Browse files
JacekDabrowski1JacekDabrowski1
authored andcommitted
Add a copy button to the installation command on the homepage
Add a copy-to-clipboard button to the `$ pip install pycleora` command in `index.html` and corresponding styles in `style.css`. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ec794acd-c4a5-47f6-b906-d70ac3c316ee Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: bd287782-2034-4249-8a79-ae5a0c74c7c7 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/28ec11df-9ccf-40bc-9ff4-d0523e5b6a98/ec794acd-c4a5-47f6-b906-d70ac3c316ee/gB0CJOR Replit-Helium-Checkpoint-Created: true
1 parent 227c236 commit ee0c198

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

website/static/style.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,34 @@ nav {
284284
font-size: 0.9rem;
285285
color: var(--green);
286286
text-align: left;
287+
position: relative;
288+
display: flex;
289+
align-items: center;
290+
justify-content: space-between;
287291
}
288292

289293
.install-block .prompt { color: var(--text-dim); }
290294

295+
.copy-btn {
296+
background: none;
297+
border: 1px solid rgba(255,255,255,0.1);
298+
border-radius: 6px;
299+
padding: 6px;
300+
cursor: pointer;
301+
color: var(--text-dim);
302+
display: flex;
303+
align-items: center;
304+
justify-content: center;
305+
transition: all 0.2s;
306+
flex-shrink: 0;
307+
margin-left: 12px;
308+
}
309+
.copy-btn:hover { color: var(--text); border-color: rgba(255,255,255,0.25); background: rgba(255,255,255,0.05); }
310+
.copy-btn .check-icon { display: none; }
311+
.copy-btn.copied .copy-icon { display: none; }
312+
.copy-btn.copied .check-icon { display: block; }
313+
.copy-btn.copied { color: var(--green); border-color: var(--green); }
314+
291315
/* SECTIONS */
292316
.section {
293317
max-width: 1200px;

website/templates/index.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ <h1 class="animate-in delay-1">#1 Accuracy.<br>Every Dataset.</h1>
1717
</div>
1818
<div class="install-block animate-in delay-4">
1919
<span class="prompt">$</span> pip install pycleora
20+
<button class="copy-btn" onclick="navigator.clipboard.writeText('pip install pycleora').then(function(){var b=document.querySelector('.copy-btn');b.classList.add('copied');setTimeout(function(){b.classList.remove('copied')},1500)})" aria-label="Copy to clipboard">
21+
<svg class="copy-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/></svg>
22+
<svg class="check-icon" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"/></svg>
23+
</button>
2024
</div>
2125
</section>
2226

0 commit comments

Comments
 (0)