MCPcopy Create free account
hub / github.com/ChinaGodMan/UserScripts / createProgressBar

Function createProgressBar

popup-window/popup-window.user.js:861–875  ·  view source on GitHub ↗
(colorStart = '#4caf50', colorEnd = '#81c784')

Source from the content-addressed store, hash-verified

859 }
860 }
861 function createProgressBar(colorStart = '#4caf50', colorEnd = '#81c784') {
862 if (!config.showCountdown && !config.showCountdowndrag) return null
863 const progressBar = document.createElement('div')
864 Object.assign(progressBar.style, {
865 position: 'fixed',
866 height: '6px',
867 width: '5%',
868 background: `linear-gradient(to right, ${colorStart}, ${colorEnd})`,
869 borderRadius: '3px',
870 boxShadow: '0 2px 5px rgba(0, 0, 0, 0.3)',
871 zIndex: '9999'
872 })
873 document.body.appendChild(progressBar)
874 return progressBar
875 }
876 let mouseDownTime = 0
877 function handleMouseDown(event) {
878 const linkElement = event.target.tagName === 'A' ? event.target : event.target.closest('a')

Callers 2

handleDragStartFunction · 0.85
handleMouseDownFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected