Skip to content

Commit ec81729

Browse files
Merge pull request steam-bell-92#1418 from jainiksha/feature/one-click-copy-installation-commands
feat: add one-click copy support for installation commands
2 parents e132340 + 8877b23 commit ec81729

4 files changed

Lines changed: 82 additions & 16 deletions

File tree

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ python-mini-project/
8888

8989
#### 1. Clone the Repository
9090

91+
<div align="right">
92+
93+
<button class="copy-btn" data-copy="clone-command">📋 Copy</button>
94+
95+
</div>
96+
9197
```bash
9298
git clone https://github.com/steam-bell-92/python-mini-project.git
9399
cd python-mini-project
@@ -97,6 +103,12 @@ cd python-mini-project
97103

98104
For Linux/macOS:
99105

106+
<div align="right">
107+
108+
<button class="copy-btn" data-copy="linux-venv">📋 Copy</button>
109+
110+
</div>
111+
100112
```bash
101113
python3 -m venv venv
102114
source venv/bin/activate
@@ -118,6 +130,12 @@ venv\Scripts\Activate.ps1
118130

119131
#### 3. Install Dependencies
120132

133+
<div align="right">
134+
135+
<button class="copy-btn" data-copy="install-command">📋 Copy</button>
136+
137+
</div>
138+
121139
```bash
122140
pip install --upgrade pip
123141
pip install -r requirements.txt
@@ -161,6 +179,12 @@ The web app requires Node.js and npm:
161179

162180
#### Steps to Run Web App
163181

182+
<div align="right">
183+
184+
<button class="copy-btn" data-copy="web-command">📋 Copy</button>
185+
186+
</div>
187+
164188
```bash
165189
cd web-app
166190
npm install
@@ -173,6 +197,12 @@ The app will open at `http://localhost:3000` (or your configured port).
173197

174198
To verify that the projects work correctly, run the test suite:
175199

200+
<div align="right">
201+
202+
<button class="copy-btn" data-copy="pytest-command">📋 Copy</button>
203+
204+
</div>
205+
176206
```bash
177207
pytest tests/ -v
178208
```

web-app/css/styles.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7188,4 +7188,8 @@ body.sidebar-collapsed .sidebar-dock .sidebar-footer .sidebar-main-controls {
71887188
color:var(--text);
71897189
}
71907190

7191+
}
7192+
7193+
/* ============================
7194+
Bookmarked Projects Section
71917195
}

web-app/index.html

Lines changed: 32 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -774,12 +774,13 @@ <h3>Stay Updated</h3>
774774
const projectsData = [
775775
// GAMES (20+)
776776
{
777-
project: "number-sliding-puzzle",
778-
title: "Number Sliding Puzzle",
779-
category: "games",
780-
desc: "Arrange tiles in order by sliding them into empty space",
781-
tags: "game,puzzle,sliding,numbers",
782-
},
777+
project: "number-sliding-puzzle",
778+
title: "Number Sliding Puzzle",
779+
category: "games",
780+
difficulty: "Intermediate",
781+
desc: "Arrange tiles in order by sliding them into empty space",
782+
tags: "game,puzzle,sliding,numbers",
783+
},
783784
{
784785
project: "2048-game",
785786
title: "2048 Game",
@@ -1197,16 +1198,31 @@ <h3>Stay Updated</h3>
11971198
const starClass = isFavorite ? "fas fa-star" : "far fa-star";
11981199

11991200
card.innerHTML = `
1200-
<img class="card-banner" src="assets/banners/${proj.project}.webp?v=2" alt="${proj.title}" loading="lazy">
1201-
<div class="card-actions">
1202-
<button class="btn-play" data-project="${proj.project}" aria-label="Play PyMini Logo">Try It</button>
1203-
<button class="btn-favorite" data-project="${proj.project}" aria-label="Add to favorites">
1204-
<i class="${starClass}"></i>
1205-
</button>
1206-
</div>
1207-
<h3>${proj.title}</h3>
1208-
<p>${proj.desc}</p>
1209-
`;
1201+
<div class="difficulty-badge ${proj.difficulty.toLowerCase()}">
1202+
${proj.difficulty}
1203+
</div>
1204+
1205+
<img class="card-banner"
1206+
src="assets/banners/${proj.project}.webp?v=2"
1207+
alt="${proj.title}"
1208+
loading="lazy">
1209+
1210+
<div class="card-actions">
1211+
<button class="btn-play"
1212+
data-project="${proj.project}">
1213+
Try It
1214+
</button>
1215+
1216+
<button class="btn-favorite"
1217+
data-project="${proj.project}">
1218+
<i class="${starClass}"></i>
1219+
</button>
1220+
</div>
1221+
1222+
<h3>${proj.title}</h3>
1223+
1224+
<p>${proj.desc}</p>
1225+
`;
12101226

12111227
projectsGrid.appendChild(card);
12121228
});

web-app/js/main.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,6 +1455,22 @@ document.addEventListener("DOMContentLoaded", function () {
14551455
═══════════════════════════════════════════════════════════════ */
14561456
function wireProjectCard(card) {
14571457
var name = card.getAttribute("data-project");
1458+
const difficulty =
1459+
card.getAttribute("data-difficulty");
1460+
1461+
if(difficulty){
1462+
1463+
const badge=document.createElement("span");
1464+
1465+
badge.className=
1466+
"difficulty-badge "+
1467+
difficulty.toLowerCase();
1468+
1469+
badge.textContent=difficulty;
1470+
1471+
card.appendChild(badge);
1472+
1473+
}
14581474

14591475
/* ── Favorite Button ──────────────────────────────────── */
14601476
// Remove any existing favorite button first to avoid duplicates

0 commit comments

Comments
 (0)