-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
58 lines (51 loc) · 1.71 KB
/
Copy pathscript.js
File metadata and controls
58 lines (51 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
const palette = document.getElementById('palette');
const quoteEl = document.getElementById('quote');
const moodNameEl = document.getElementById('moodName');
const generateBtn = document.getElementById('generateBtn');
const moods = [
{
name: "Silent Power",
quote: "Move with intention. Speak with results.",
colors: ["#0D0D0D", "#1C1C1E", "#C6A664", "#E5E5E5"]
},
{
name: "Stillness",
quote: "Calm is a form of intelligence.",
colors: ["#F5F5F5", "#D9D9D9", "#A8A8A8", "#2E2E2E"]
},
{
name: "Old Money Discipline",
quote: "Consistency is the most elegant form of strength.",
colors: ["#1B1B1B", "#2C3E50", "#C0B283", "#EAE7DC"]
},
{
name: "Ascend",
quote: "Earn the silence that follows your success.",
colors: ["#0F172A", "#1E293B", "#FACC15", "#F8FAFC"]
},
{
name: "Inner Fire",
quote: "Discipline built the man. Emotion followed.",
colors: ["#1A1A1A", "#F97316", "#FBBF24", "#F3F4F6"]
}
];
function generateMood() {
palette.innerHTML = '';
const randomMood = moods[Math.floor(Math.random() * moods.length)];
moodNameEl.textContent = randomMood.name;
quoteEl.textContent = `"${randomMood.quote}"`;
randomMood.colors.forEach(color => {
const div = document.createElement('div');
div.classList.add('color-box');
div.style.background = color;
div.textContent = color.toUpperCase();
div.addEventListener('click', () => {
navigator.clipboard.writeText(color);
div.textContent = 'Copied!';
setTimeout(() => div.textContent = color.toUpperCase(), 1000);
});
palette.appendChild(div);
});
}
generateMood();
generateBtn.addEventListener('click', generateMood);