random bun scripts that dont fit anywhere else

chore: remove pills

dunkirk.sh 01aa2d42 61b52d3d

verified
+1 -139
+1 -139
bluesky-community-verifications.user.js
··· 201 201 202 202 console.log(`${profileDid} is not verified by any trusted users`); 203 203 204 - // Add recheck button even when no verifications are found 205 - createPillButtons(); 206 - 207 204 return false; 208 205 }; 209 206 210 - // Function to create a pill with recheck and settings buttons 211 - const createPillButtons = () => { 212 - // Remove existing buttons if any 213 - const existingPill = document.getElementById( 214 - "trusted-users-pill-container", 215 - ); 216 - if (existingPill) { 217 - existingPill.remove(); 218 - } 219 - 220 - // Create pill container 221 - const pillContainer = document.createElement("div"); 222 - pillContainer.id = "trusted-users-pill-container"; 223 - pillContainer.style.cssText = ` 224 - position: fixed; 225 - bottom: 20px; 226 - right: 20px; 227 - z-index: 10000; 228 - display: flex; 229 - border-radius: 20px; 230 - overflow: hidden; 231 - box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2); 232 - `; 233 - 234 - // Create recheck button (left half of pill) 235 - const recheckButton = document.createElement("button"); 236 - recheckButton.id = "trusted-users-recheck-button"; 237 - recheckButton.innerHTML = "↻ Recheck"; 238 - recheckButton.style.cssText = ` 239 - padding: 10px 15px; 240 - background-color: #2D578D; 241 - color: white; 242 - border: none; 243 - cursor: pointer; 244 - font-weight: bold; 245 - border-top-left-radius: 20px; 246 - border-bottom-left-radius: 20px; 247 - `; 248 - 249 - // Add click event to recheck 250 - recheckButton.addEventListener("click", async () => { 251 - if (currentProfileDid) { 252 - // Remove any existing badges when rechecking 253 - const existingBadge = document.getElementById( 254 - "user-trusted-verification-badge", 255 - ); 256 - if (existingBadge) { 257 - existingBadge.remove(); 258 - } 259 - 260 - // Show loading state 261 - recheckButton.innerHTML = "⟳ Checking..."; 262 - recheckButton.disabled = true; 263 - 264 - // Recheck verifications 265 - await checkTrustedUserVerifications(currentProfileDid); 266 - 267 - // Reset button 268 - recheckButton.innerHTML = "↻ Recheck"; 269 - recheckButton.disabled = false; 270 - } 271 - }); 272 - 273 - // Create vertical divider 274 - const divider = document.createElement("div"); 275 - divider.style.cssText = ` 276 - width: 1px; 277 - background-color: rgba(255, 255, 255, 0.3); 278 - `; 279 - 280 - // Create settings button (right half of pill) 281 - const settingsButton = document.createElement("button"); 282 - settingsButton.id = "bsky-trusted-settings-button"; 283 - settingsButton.textContent = "Settings"; 284 - settingsButton.style.cssText = ` 285 - padding: 10px 15px; 286 - background-color: #2D578D; 287 - color: white; 288 - border: none; 289 - cursor: pointer; 290 - font-weight: bold; 291 - border-top-right-radius: 20px; 292 - border-bottom-right-radius: 20px; 293 - `; 294 - 295 - // Add elements to pill 296 - pillContainer.appendChild(recheckButton); 297 - pillContainer.appendChild(divider); 298 - pillContainer.appendChild(settingsButton); 299 - 300 - // Add pill to page 301 - document.body.appendChild(pillContainer); 302 - 303 - // Add event listener to settings button 304 - settingsButton.addEventListener("click", () => { 305 - if (settingsModal) { 306 - settingsModal.style.display = "flex"; 307 - updateTrustedUsersList(); 308 - } else { 309 - createSettingsModal(); 310 - } 311 - }); 312 - }; 313 - 314 207 // Function to display verification badge on the profile 315 208 const displayVerificationBadge = (verifierHandles) => { 316 209 // Find the profile header or name element to add the badge to ··· 364 257 365 258 nameElement.appendChild(badge); 366 259 } 367 - 368 - // Also add pill buttons when verification is found 369 - createPillButtons(); 370 260 }; 371 261 372 262 // Function to show a popup with all verifiers ··· 983 873 updateTrustedUsersList(); 984 874 }; 985 875 986 - // Function to create the settings UI if it doesn't exist yet 987 - const createSettingsUI = () => { 988 - // Create pill with buttons 989 - createPillButtons(); 990 - 991 - // Create the settings modal if it doesn't exist yet 992 - if (!settingsModal) { 993 - createSettingsModal(); 994 - } 995 - }; 996 - 997 876 // Function to check the current profile 998 877 const checkCurrentProfile = () => { 999 878 const currentUrl = window.location.href; ··· 1005 884 ) { 1006 885 const handle = currentUrl.split("/profile/")[1].split("/")[0]; 1007 886 console.log("Detected profile page for:", handle); 1008 - 1009 - // Create and add the settings UI (only once) 1010 - createSettingsUI(); 1011 887 1012 888 // Fetch user profile data 1013 889 fetch( ··· 1040 916 ); 1041 917 if (existingBadge) { 1042 918 existingBadge.remove(); 1043 - } 1044 - 1045 - const existingPill = document.getElementById( 1046 - "trusted-users-pill-container", 1047 - ); 1048 - if (existingPill) { 1049 - existingPill.remove(); 1050 919 } 1051 920 } 1052 921 }; ··· 1278 1147 existingBadge.remove(); 1279 1148 } 1280 1149 1281 - const existingPill = document.getElementById( 1282 - "trusted-users-pill-container", 1283 - ); 1284 - if (existingPill) { 1285 - existingPill.remove(); 1286 - } 1287 - 1288 1150 // Check if we're on a profile page now 1289 1151 setTimeout(checkCurrentProfile, 500); // Small delay to ensure DOM has updated 1290 1152 1291 1153 if (window.location.href.includes("bsky.app/settings")) { 1292 1154 // Give the page a moment to fully load 1293 - setTimeout(addSettingsButton, 500); 1155 + setTimeout(addSettingsButton, 200); 1294 1156 } 1295 1157 } 1296 1158 });