-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
187 lines (168 loc) Β· 6.97 KB
/
script.js
File metadata and controls
187 lines (168 loc) Β· 6.97 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
const cryptoNews = [
{
title: "π BITCOIN TO 100K! LFG! Diamond Hands ONLY! ππ",
summary: "BTC MOONING HARDER THAN DOGE IN 2021! Apes are HODLING strong as institutions keep buying the dip. This is NOT financial advice but... WAGMI! π¦πͺ",
crypto: "π BTC",
time: "Just now",
vibe: "π₯π₯π₯"
},
{
title: "ETH GAS FEES FINALLY UNDER $5! WE DID IT DEGENS! π",
summary: "Layer 2 solutions are CRUSHING IT! Finally can afford to move our bags without selling a kidney. Time to mint some more NFTs! π¨β¨",
crypto: "π ETH",
time: "69 minutes ago",
vibe: "π"
},
{
title: "PEPE COIN PUMPS 420% - FROG SEASON IS HERE! πΈπ",
summary: "The meme coin king is back! Pepe holders are literally crying tears of joy (and profits). Don't fade the frog, ser! ππ",
crypto: "πΈ PEPE",
time: "4:20 AM",
vibe: "π€"
},
{
title: "BORED APES FLOOR PRICE HITS 200 ETH! HOLY GRAIL! π¦π",
summary: "Ape holders are eating GOOD tonight! Floor sweeping going crazy as celebrities keep buying in. If you know, you know! π―",
crypto: "π¨ NFT",
time: "1 hour ago",
vibe: "π"
},
{
title: "SOLANA NETWORK DOWN AGAIN BUT SOL STILL PUMPING? π€",
summary: "Classic Solana move - network goes brrr (stops working) but price goes BRRR (moon time). Degens gonna degen! ππ",
crypto: "π£ SOL",
time: "3 hours ago",
vibe: "π
"
},
{
title: "CRYPTO TWITTER DISCOVERS NEW 100X GEM! (NOT CLICKBAIT)",
summary: "CT is going absolutely WILD over this new low cap gem! DYOR but also... when CT speaks, we listen! ππ",
crypto: "π GEM",
time: "6 hours ago",
vibe: "π―"
},
{
title: "DEFI YIELD FARMING HITS 6900% APY - TOTALLY SUSTAINABLE! π",
summary: "New protocol promising astronomical yields with zero risk! What could go wrong? Apes are already depositing their life savings! π€‘π°",
crypto: "π¦ DEFI",
time: "12 hours ago",
vibe: "π€‘"
},
{
title: "WHALE MOVES 69,420 BTC TO UNKNOWN WALLET! PANIC MODE! π",
summary: "Whale watching Twitter is in shambles! Is this bullish or bearish? Nobody knows but everyone has an opinion! π€―π",
crypto: "π WHALE",
time: "1 day ago",
vibe: "π±"
},
{
title: "GM CRYPTO FAM! βοΈ Another Day, Another Dollar... OF LOSSES! π",
summary: "Portfolio is down but spirits are UP! We're building character (and buying more dips). This is the gwei! βπͺ",
crypto: "βοΈ GM",
time: "This morning",
vibe: "β"
},
{
title: "ELON TWEETS ABOUT DOGE AGAIN! MARKET GOES WILD! ππ",
summary: "One tweet, one pump! The dogefather strikes again and DOGE goes to the literal moon. Such wow, much gains! πβ¨",
crypto: "π DOGE",
time: "2 days ago",
vibe: "π"
}
];
function createNewsArticle(article) {
return `
<article class="news-article" onclick="celebrateClick(this)">
<div class="vibe-indicator">${article.vibe}</div>
<h3>${article.title}</h3>
<p>${article.summary}</p>
<div class="news-meta">
<span class="crypto-tag">${article.crypto}</span>
<span class="time-badge">${article.time}</span>
</div>
</article>
`;
}
function celebrateClick(element) {
element.style.animation = 'none';
element.offsetHeight; // Trigger reflow
element.style.animation = 'celebrateClick 0.6s ease';
// Add some random emojis flying around
const emojis = ['π', 'π', 'π₯', 'π', 'π¦', 'πΈ', 'β‘', 'π°', 'π', 'β¨'];
const randomEmoji = emojis[Math.floor(Math.random() * emojis.length)];
const flyingEmoji = document.createElement('div');
flyingEmoji.textContent = randomEmoji;
flyingEmoji.style.cssText = `
position: absolute;
font-size: 2rem;
pointer-events: none;
animation: flyAway 2s ease forwards;
z-index: 1000;
`;
const rect = element.getBoundingClientRect();
flyingEmoji.style.left = rect.left + Math.random() * rect.width + 'px';
flyingEmoji.style.top = rect.top + Math.random() * rect.height + 'px';
document.body.appendChild(flyingEmoji);
setTimeout(() => {
flyingEmoji.remove();
}, 2000);
}
function loadNews() {
const newsContainer = document.getElementById('news-container');
newsContainer.innerHTML = cryptoNews.map(createNewsArticle).join('');
}
function filterNews(filterType) {
const newsContainer = document.getElementById('news-container');
let filteredNews = cryptoNews;
if (filterType !== 'π latest alpha') {
const searchTerms = {
'βΏ bitcoin': ['btc', 'bitcoin'],
'π· ethereum': ['eth', 'ethereum', 'gas'],
'π¨ nfts': ['nft', 'ape', 'bored', 'art', 'mint'],
'π¦ defi': ['defi', 'yield', 'farming', 'protocol', 'apy']
};
const terms = searchTerms[filterType] || [filterType.toLowerCase()];
filteredNews = cryptoNews.filter(article =>
terms.some(term =>
article.crypto.toLowerCase().includes(term) ||
article.title.toLowerCase().includes(term) ||
article.summary.toLowerCase().includes(term)
)
);
}
newsContainer.innerHTML = filteredNews.map(createNewsArticle).join('');
// Add some spicy animation when filtering
const articles = document.querySelectorAll('.news-article');
articles.forEach((article, index) => {
article.style.animation = 'none';
article.style.opacity = '0';
setTimeout(() => {
article.style.animation = `slideIn 0.5s ease forwards`;
article.style.animationDelay = `${index * 0.1}s`;
}, 50);
});
}
document.addEventListener('DOMContentLoaded', function() {
loadNews();
const navLinks = document.querySelectorAll('.nav-btn');
navLinks.forEach(link => {
link.addEventListener('click', function(e) {
e.preventDefault();
navLinks.forEach(l => l.classList.remove('active'));
this.classList.add('active');
const filter = this.textContent.toLowerCase();
filterNews(filter);
});
});
// Add some initial loading animation
const articles = document.querySelectorAll('.news-article');
articles.forEach((article, index) => {
article.style.opacity = '0';
article.style.transform = 'translateY(50px)';
setTimeout(() => {
article.style.transition = 'all 0.5s ease';
article.style.opacity = '1';
article.style.transform = 'translateY(0)';
}, index * 100);
});
});