|
273 | 273 | height: 14px; |
274 | 274 | } |
275 | 275 |
|
| 276 | + /* -- Notification balloon (Win98 tray style) -- */ |
| 277 | + .tray-notification { |
| 278 | + position: absolute; |
| 279 | + bottom: 34px; |
| 280 | + right: 8px; |
| 281 | + width: 260px; |
| 282 | + background: #ffffe1; |
| 283 | + border: 1px solid #000; |
| 284 | + box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3); |
| 285 | + font-size: 11px; |
| 286 | + z-index: 10000; |
| 287 | + animation: notif-fadein 0.3s ease; |
| 288 | + cursor: default; |
| 289 | + } |
| 290 | + |
| 291 | + .tray-notification::before { |
| 292 | + content: ""; |
| 293 | + position: absolute; |
| 294 | + bottom: -6px; |
| 295 | + right: 20px; |
| 296 | + width: 10px; |
| 297 | + height: 6px; |
| 298 | + background: #ffffe1; |
| 299 | + clip-path: polygon(0 0, 100% 0, 50% 100%); |
| 300 | + border-left: 1px solid #000; |
| 301 | + border-right: 1px solid #000; |
| 302 | + } |
| 303 | + |
| 304 | + .notif-header { |
| 305 | + display: flex; |
| 306 | + align-items: center; |
| 307 | + gap: 6px; |
| 308 | + padding: 6px 8px 2px; |
| 309 | + font-weight: bold; |
| 310 | + } |
| 311 | + |
| 312 | + .notif-body { |
| 313 | + padding: 2px 8px 8px; |
| 314 | + line-height: 1.5; |
| 315 | + } |
| 316 | + |
| 317 | + .notif-body a { |
| 318 | + color: #0000ff; |
| 319 | + text-decoration: underline; |
| 320 | + } |
| 321 | + |
| 322 | + .notif-body a:visited { |
| 323 | + color: #800080; |
| 324 | + } |
| 325 | + |
| 326 | + .notif-body a:hover { |
| 327 | + color: #ff0000; |
| 328 | + } |
| 329 | + |
| 330 | + .notif-close { |
| 331 | + margin-left: auto; |
| 332 | + background: none; |
| 333 | + border: none; |
| 334 | + font-size: 11px; |
| 335 | + font-family: inherit; |
| 336 | + cursor: default; |
| 337 | + color: #000; |
| 338 | + padding: 0 2px; |
| 339 | + } |
| 340 | + |
| 341 | + .notif-close:hover { |
| 342 | + color: #ff0000; |
| 343 | + } |
| 344 | + |
| 345 | + @keyframes notif-fadein { |
| 346 | + from { |
| 347 | + opacity: 0; |
| 348 | + transform: translateY(4px); |
| 349 | + } |
| 350 | + to { |
| 351 | + opacity: 1; |
| 352 | + transform: translateY(0); |
| 353 | + } |
| 354 | + } |
| 355 | + |
276 | 356 | /* Mobile adjustments */ |
277 | 357 | @media (max-width: 480px) { |
278 | 358 | .desktop-area { |
@@ -441,6 +521,28 @@ <h2>Welcome to Clippy.js!</h2> |
441 | 521 | Start |
442 | 522 | </button> |
443 | 523 | <div class="taskbar-tray"> |
| 524 | + <!-- GitHub tray icon --> |
| 525 | + <span id="gh-tray-icon" title="GitHub" style="cursor: default; display: flex; align-items: center;"> |
| 526 | + <svg width="14" height="14" viewBox="0 0 16 16" style="image-rendering: pixelated;"> |
| 527 | + <circle cx="8" cy="8" r="7" fill="#000" stroke="#808080" stroke-width="0.5"/> |
| 528 | + <path d="M8 2.5C4.7 2.5 2 5.1 2 8.3c0 2.6 1.7 4.7 4 5.5.3.1.4-.1.4-.3v-1c-1.6.4-2-.8-2-.8-.3-.7-.7-.9-.7-.9-.5-.4 0-.4 0-.4.6 0 .9.6.9.6.5.9 1.4.6 1.7.5.1-.4.2-.6.4-.8-1.3-.1-2.7-.6-2.7-2.8 0-.6.2-1.1.6-1.5-.1-.1-.3-.7.1-1.5 0 0 .5-.2 1.5.6.5-.1.9-.2 1.4-.2s1 .1 1.4.2c1.1-.8 1.5-.6 1.5-.6.3.8.1 1.4.1 1.5.4.4.6.9.6 1.5 0 2.2-1.4 2.7-2.7 2.8.2.2.4.5.4 1.1v1.6c0 .2.1.4.4.3 2.3-.8 4-2.9 4-5.5C14 5.1 11.3 2.5 8 2.5z" fill="#fff"/> |
| 529 | + </svg> |
| 530 | + </span> |
| 531 | + <!-- Notification balloon --> |
| 532 | + <div class="tray-notification" id="gh-notification"> |
| 533 | + <div class="notif-header"> |
| 534 | + <svg width="12" height="12" viewBox="0 0 16 16"> |
| 535 | + <circle cx="8" cy="8" r="7" fill="#0000aa"/> |
| 536 | + <text x="8" y="12" text-anchor="middle" fill="#fff" font-size="11" font-weight="bold">i</text> |
| 537 | + </svg> |
| 538 | + ClippyJS on GitHub |
| 539 | + <button class="notif-close" id="notif-close-btn">×</button> |
| 540 | + </div> |
| 541 | + <div class="notif-body"> |
| 542 | + View source code, report issues, and contribute on GitHub:<br/> |
| 543 | + <a href="https://github.com/pi0/clippyjs" target="_blank">github.com/pi0/clippyjs</a> |
| 544 | + </div> |
| 545 | + </div> |
444 | 546 | <span id="clock"></span> |
445 | 547 | </div> |
446 | 548 | </div> |
@@ -524,6 +626,26 @@ <h2>Welcome to Clippy.js!</h2> |
524 | 626 | currentIntervals.push(setInterval(() => agent.animate(), 3000 + Math.random() * 4000)); |
525 | 627 | } |
526 | 628 |
|
| 629 | + // GitHub tray notification |
| 630 | + const ghNotification = document.getElementById("gh-notification"); |
| 631 | + const ghTrayIcon = document.getElementById("gh-tray-icon"); |
| 632 | + const notifCloseBtn = document.getElementById("notif-close-btn"); |
| 633 | + |
| 634 | + // Show after a short delay |
| 635 | + ghNotification.style.display = "none"; |
| 636 | + setTimeout(() => { |
| 637 | + ghNotification.style.display = ""; |
| 638 | + }, 2000); |
| 639 | + |
| 640 | + notifCloseBtn.addEventListener("click", (e) => { |
| 641 | + e.stopPropagation(); |
| 642 | + ghNotification.style.display = "none"; |
| 643 | + }); |
| 644 | + |
| 645 | + ghTrayIcon.addEventListener("click", () => { |
| 646 | + ghNotification.style.display = ghNotification.style.display === "none" ? "" : "none"; |
| 647 | + }); |
| 648 | + |
527 | 649 | // Taskbar clock |
528 | 650 | function updateClock() { |
529 | 651 | const now = new Date(); |
|
0 commit comments