Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

button-animation

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

button-animation - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

56

btnAnimation.js
export function buttonAnimation (e) {
e.target.style.position = 'relative'
e.target.style.overflow = 'hidden'
let style = document.querySelector('style')
style.innerHTML +=
'.buttonAnimation { \n' +
' position: absolute; \n' +
' height: 400px; \n' +
' width: 400px; \n' +
' background: #fff; \n' +
' top: 0; \n' +
' left: 0; \n' +
' border-radius: 50%; \n' +
' transform: translate(-50%, -50%); \n' +
' opacity: 0.5; \n' +
' animation: buttonAnimation 0.5s linear infinite; \n' +
'} \n' +
'@keyframes buttonAnimation { \n' +
' 0% { \n' +
' height: 0px; \n' +
' width: 0px; \n' +
' opacity: 0.5; \n' +
' } \n' +
' 100% { \n' +
' height: 400px; \n' +
' width: 400px; \n' +
' opacity: 0; \n' +
' } \n' +
'} \n'
const style = document.createElement('style')
style.innerHTML = '.buttonAnimation {' +
' position: absolute;' +
' height: 400px;' +
' width: 400px;' +
' background: #fff;' +
' top: 0;' +
' left: 0;' +
' border-radius: 50%;' +
' transform: translate(-50%, -50%);' +
' opacity: 0.5;' +
' animation: buttonAnimation 0.5s linear infinite;' +
'}' +
'@keyframes buttonAnimation {' +
' 0% {' +
' height: 0px;' +
' width: 0px;' +
' opacity: 0.5;' +
' }' +
' 100% {' +
' height: 400px;' +
' width: 400px;' +
' opacity: 0;' +
' }' +
'}'
e.target.appendChild(style)
e.target.style.cssText = 'position:relative;overflow:hidden;'
const overlay = document.createElement('span')

@@ -39,3 +38,4 @@ overlay.classList.add('buttonAnimation')

overlay.remove()
style.remove()
}, 500)
}
{
"name": "button-animation",
"version": "1.0.1",
"version": "1.0.2",
"description": "一个b站上学习到的按钮点击动画",

@@ -5,0 +5,0 @@ "main": "btnAnimation.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc