MCPcopy Create free account
hub / github.com/dajie111/nodeseek-userscript / showSaveNotification

Function showSaveNotification

notes.js:1572–1625  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1570
1571 // 显示手动保存提示
1572 function showSaveNotification() {
1573 // 移除已存在的提示框
1574 const existingNotification = document.querySelector('.nsn-save-notification');
1575 if (existingNotification) {
1576 existingNotification.remove();
1577 }
1578
1579 // 创建提示框
1580 const notification = createElement('div', {
1581 className: 'nsn-save-notification',
1582 style: {
1583 position: 'absolute',
1584 bottom: '60px',
1585 right: '20px',
1586 background: 'linear-gradient(135deg, #409eff, #3785e6)',
1587 color: 'white',
1588 padding: '8px 16px',
1589 borderRadius: '6px',
1590 fontSize: '12px',
1591 fontWeight: '500',
1592 boxShadow: '0 4px 20px rgba(64, 158, 255, 0.3), 0 2px 8px rgba(0, 0, 0, 0.1)',
1593 zIndex: '1000000001',
1594 pointerEvents: 'none',
1595 opacity: '0',
1596 transform: 'translateY(20px)',
1597 transition: 'all 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
1598 backdropFilter: 'blur(10px)',
1599 border: '1px solid rgba(255, 255, 255, 0.2)'
1600 }
1601 }, ['✓ 已保存']);
1602
1603 // 确保提示框显示在弹窗内部
1604 dialog.appendChild(notification);
1605
1606 // 触发入场动画
1607 requestAnimationFrame(() => {
1608 notification.style.opacity = '1';
1609 notification.style.transform = 'translateY(0)';
1610 });
1611
1612 // 5秒后自动消失
1613 setTimeout(() => {
1614 if (notification && notification.parentNode) {
1615 notification.style.opacity = '0';
1616 notification.style.transform = 'translateY(20px)';
1617
1618 setTimeout(() => {
1619 if (notification && notification.parentNode) {
1620 notification.remove();
1621 }
1622 }, 300);
1623 }
1624 }, 5000); // 5秒
1625 }
1626
1627 // 停止自动保存
1628 function stopAutoSave() {

Callers 1

buildDialogFunction · 0.85

Calls 1

createElementFunction · 0.85

Tested by

no test coverage detected