This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

add font

+116 -26
+30 -4
app/src/app/api/bluesky/stats/route.ts
··· 140 140 new Date(entry.created_at) >= thirtyDaysAgo 141 141 ); 142 142 143 - // Get unique DIDs from recent records 143 + // Get unique DIDs from recent records - excluding test accounts and plumber 144 144 const recentUniqueDids = new Set<string>(); 145 145 recentRecords?.forEach(entry => { 146 - if (entry.did) { 146 + // Only count if not an excluded account 147 + if (entry.did && 148 + !excludedDids.includes(entry.did) && 149 + !(entry.handle && excludedHandles.includes(entry.handle))) { 147 150 recentUniqueDids.add(entry.did); 148 151 } 149 152 }); 150 153 151 - const monthlyActiveFlushers = recentUniqueDids.size; 154 + let monthlyActiveFlushers = recentUniqueDids.size; 152 155 console.log(`Monthly Active Flushers (last 30 days): ${monthlyActiveFlushers}`); 153 156 154 157 // Calculate Daily Active Flushers (DAFs) 155 158 // This is the average number of unique users who post per day over the last 30 days 156 159 const dailyActiveUserCounts = new Map<string, Set<string>>(); 157 160 158 - // Group users by day 161 + // Group users by day - excluding test accounts and plumber 159 162 recentRecords?.forEach(entry => { 160 163 if (!entry.did) return; // Skip entries without a DID 164 + 165 + // Skip excluded accounts 166 + if (excludedDids.includes(entry.did) || 167 + (entry.handle && excludedHandles.includes(entry.handle))) { 168 + return; 169 + } 161 170 162 171 const date = new Date(entry.created_at); 163 172 const dateKey = `${date.getFullYear()}-${String(date.getMonth() + 1).padStart(2, '0')}-${String(date.getDate()).padStart(2, '0')}`; ··· 179 188 } 180 189 console.log(`Daily Active Flushers (average over last 30 days): ${dailyActiveFlushers}`); 181 190 191 + // Sanity check: daily active flushers (average) should not exceed monthly active flushers 192 + if (dailyActiveFlushers > monthlyActiveFlushers) { 193 + console.error(`Warning: Daily active flushers avg (${dailyActiveFlushers}) exceeds monthly active flushers (${monthlyActiveFlushers}). This should not happen.`); 194 + // Cap daily active flushers at the monthly active flushers value 195 + dailyActiveFlushers = parseFloat(Math.min(monthlyActiveFlushers, dailyActiveFlushers).toFixed(1)); 196 + console.log(`Correcting daily active flushers to ${dailyActiveFlushers}`); 197 + } 198 + 182 199 // 3. Get top flushers (leaderboard) - excluding test accounts 183 200 const { data: leaderboardData, error: leaderboardError } = await supabase 184 201 .from('flushing_records') ··· 235 252 // Calculate total unique flushers (count of unique DIDs) 236 253 const totalFlushers = didCounts.size; 237 254 console.log(`Total unique flushers: ${totalFlushers}`); 255 + 256 + // Sanity check: make sure monthly active flushers is not greater than total flushers 257 + if (monthlyActiveFlushers > totalFlushers) { 258 + console.error(`Warning: Monthly active flushers (${monthlyActiveFlushers}) exceeds total flushers (${totalFlushers}). This should never happen.`); 259 + // If we somehow still have an inconsistency, cap the monthly active flushers 260 + const correctedMAF = Math.min(totalFlushers, monthlyActiveFlushers); 261 + console.log(`Correcting monthly active flushers from ${monthlyActiveFlushers} to ${correctedMAF}`); 262 + monthlyActiveFlushers = correctedMAF; 263 + } 238 264 239 265 // Return the data 240 266 return NextResponse.json({
+31 -1
app/src/app/globals.css
··· 145 145 padding: 0; 146 146 } 147 147 148 + /* Font definitions */ 149 + .font-regular { 150 + font-family: 'decoy', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, 151 + Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; 152 + font-weight: 400; 153 + font-style: normal; 154 + } 155 + 156 + .font-medium { 157 + font-family: 'decoy', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, 158 + Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; 159 + font-weight: 500; 160 + font-style: normal; 161 + } 162 + 163 + .font-bold { 164 + font-family: 'decoy', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, 165 + Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; 166 + font-weight: 700; 167 + font-style: normal; 168 + } 169 + 170 + .font-black { 171 + font-family: 'decoy', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, 172 + Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; 173 + font-weight: 900; 174 + font-style: normal; 175 + } 176 + 148 177 html, 149 178 body { 150 - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, 179 + font-family: 'decoy', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, 151 180 Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; 181 + font-weight: 400; 152 182 line-height: 1.6; 153 183 color: var(--text-color); 154 184 background-color: var(--background-color);
+3
app/src/app/layout.tsx
··· 47 47 }) { 48 48 return ( 49 49 <html lang="en"> 50 + <head> 51 + <link rel="stylesheet" href="https://use.typekit.net/gik3riw.css" /> 52 + </head> 50 53 <body> 51 54 <AuthProvider> 52 55 <ThemeProvider>
+25 -17
app/src/app/stats/page.tsx
··· 216 216 <span className={styles.user}>User</span> 217 217 <span className={styles.count}>Flushes</span> 218 218 </div> 219 - {statsData.leaderboard.map((item, index) => ( 220 - <div key={index} className={`${styles.leaderboardItem} ${index === 0 ? styles.topRank : ''}`}> 221 - <span className={styles.rank}>#{index + 1}</span> 222 - <span className={styles.user}> 223 - {item.handle ? ( 224 - <Link href={`/profile/${item.handle}`}> 225 - @{item.handle} 226 - </Link> 227 - ) : ( 228 - <span className={styles.unknownUser}> 229 - {item.did.substring(0, 10)}... 230 - </span> 231 - )} 232 - </span> 233 - <span className={styles.count}>{item.count}</span> 234 - </div> 235 - ))} 219 + {statsData.leaderboard.map((item, index) => { 220 + // Determine rank style class based on position 221 + let rankClass = ''; 222 + if (index === 0) rankClass = styles.topRank; 223 + else if (index === 1) rankClass = styles.secondRank; 224 + else if (index === 2) rankClass = styles.thirdRank; 225 + 226 + return ( 227 + <div key={index} className={`${styles.leaderboardItem} ${rankClass}`}> 228 + <span className={styles.rank}>#{index + 1}</span> 229 + <span className={styles.user}> 230 + {item.handle ? ( 231 + <Link href={`/profile/${item.handle}`} title={`@${item.handle}`}> 232 + @{item.handle} 233 + </Link> 234 + ) : ( 235 + <span className={styles.unknownUser}> 236 + {item.did.substring(0, 10)}... 237 + </span> 238 + )} 239 + </span> 240 + <span className={styles.count}>{item.count}</span> 241 + </div> 242 + ); 243 + })} 236 244 </div> 237 245 ) : ( 238 246 <p className={styles.noDataMessage}>No leaderboard data available</p>
+25 -2
app/src/app/stats/stats.module.css
··· 369 369 } 370 370 371 371 .topRank { 372 - background-color: rgba(255, 193, 7, 0.1); 372 + background-color: rgba(255, 193, 7, 0.1); /* Gold - 1st place */ 373 + } 374 + 375 + .secondRank { 376 + background-color: rgba(192, 192, 192, 0.1); /* Silver - 2nd place */ 377 + } 378 + 379 + .thirdRank { 380 + background-color: rgba(205, 127, 50, 0.1); /* Bronze - 3rd place */ 373 381 } 374 382 375 383 .rank { ··· 381 389 color: var(--primary-color); 382 390 text-decoration: none; 383 391 font-weight: 500; 392 + white-space: nowrap; 393 + overflow: hidden; 394 + text-overflow: ellipsis; 395 + display: block; 396 + max-width: 100%; 384 397 } 385 398 386 399 .user a:hover { ··· 478 491 } 479 492 480 493 .leaderboardHeader, .leaderboardItem { 481 - grid-template-columns: 60px 1fr 80px; 494 + grid-template-columns: 50px 1fr 70px; 482 495 padding: 0.75rem; 483 496 font-size: 0.9rem; 497 + } 498 + 499 + .user { 500 + max-width: 100%; 501 + overflow: hidden; 502 + } 503 + 504 + .user a, .unknownUser { 505 + font-size: 0.85rem; 506 + max-width: 100%; 484 507 } 485 508 }
+1 -1
app/src/components/NavigationBar.module.css
··· 54 54 .logoText { 55 55 display: inline-block; 56 56 color: var(--primary-color); 57 - font-weight: 600; 57 + font-weight: 900; 58 58 } 59 59 60 60 .navLinks {
+1 -1
app/src/components/NavigationBar.tsx
··· 25 25 <nav className={styles.navbar}> 26 26 <div className={styles.navStart}> 27 27 <Link href="/" className={styles.logo}> 28 - <span className={styles.logoText}>Flushes 🧻</span> 28 + <span className={`${styles.logoText} font-black`}>Flushes 🧻</span> 29 29 </Link> 30 30 31 31 <div className={styles.navLinks}>