Skip to content

Commit 36269bd

Browse files
authored
Merge pull request #2 from ajm19826/main
Add wand button
2 parents 278602b + fd0c004 commit 36269bd

3 files changed

Lines changed: 85 additions & 0 deletions

File tree

src/app.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,27 @@ fetch("buttons.json")
1313
<button class="${btn.class}">Click me</button>
1414
`;
1515

16+
root.appendChild(card);
17+
});
18+
});
19+
fetch("buttons.json")
20+
.then(res => res.json())
21+
.then(buttons => {
22+
const root = document.getElementById("buttons");
23+
24+
buttons.forEach(btn => {
25+
const card = document.createElement("div");
26+
card.className = "button-card";
27+
28+
card.innerHTML = `
29+
<h3>${btn.name}</h3>
30+
<p>by ${btn.author}</p>
31+
<div>
32+
<button class="${btn.class}"></button>
33+
${btn.label ? `<div class="wand-label">${btn.label}</div>` : ""}
34+
</div>
35+
`;
36+
1637
root.appendChild(card);
1738
});
1839
});

src/buttons.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,11 @@
99
"author": "core",
1010
"class": "btn-outline"
1111
}
12+
{
13+
"name": "Magic Wand",
14+
"author": "ajm19826",
15+
"class": "btn-wand",
16+
"label": "Cast Spell"
17+
}
18+
1219
]

src/styles.css

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,60 @@ footer {
6565
margin-top: 40px;
6666
opacity: 0.7;
6767
}
68+
/* ✨ Magic Wand Button */
69+
70+
.btn-wand {
71+
position: relative;
72+
width: 60px;
73+
height: 180px;
74+
margin: 0 auto;
75+
background: linear-gradient(180deg, #111827, #374151);
76+
border-radius: 999px;
77+
border: 2px solid #6366f1;
78+
cursor: pointer;
79+
outline: none;
80+
overflow: visible;
81+
}
82+
83+
/* Wand tip */
84+
.btn-wand::before {
85+
content: "";
86+
position: absolute;
87+
top: -16px;
88+
left: 50%;
89+
width: 20px;
90+
height: 20px;
91+
background: radial-gradient(circle, #fde68a, #facc15);
92+
border-radius: 50%;
93+
transform: translateX(-50%);
94+
box-shadow: 0 0 12px rgba(250,204,21,0.9);
95+
}
96+
97+
/* Sparkles */
98+
.btn-wand::after {
99+
content: "✨ ✦ ✧ ✨";
100+
position: absolute;
101+
top: -42px;
102+
left: 50%;
103+
transform: translateX(-50%) scale(0);
104+
color: #fde68a;
105+
font-size: 18px;
106+
opacity: 0;
107+
transition: transform 0.3s ease, opacity 0.3s ease;
108+
pointer-events: none;
109+
}
110+
111+
/* Click sparkle animation */
112+
.btn-wand:active::after {
113+
transform: translateX(-50%) scale(1.4);
114+
opacity: 1;
115+
}
116+
117+
/* Text below the wand */
118+
.wand-label {
119+
margin-top: 12px;
120+
text-align: center;
121+
font-size: 14px;
122+
color: #c7d2fe;
123+
user-select: none;
124+
}

0 commit comments

Comments
 (0)