კატეგორია/ სკრიპტები
კომენტარები/ 0
Code
<script>
function createClickEffect(event) {
const effect = document.createElement('div');
effect.className = 'click-effect';
const x = event.clientX;
const y = event.clientY;
effect.style.left = x + 'px';
effect.style.top = y + 'px';
const container = document.querySelector('.click-effect-container');
container.appendChild(effect);
// Add sound effect
const audio = new Audio('http://geleson.at.ua/gels.mp3'); // Provided sound link
audio.play();
effect.addEventListener('animationend', () => {
effect.parentNode.removeChild(effect);
});
}
document.addEventListener('click', createClickEffect);
</script>
<div class="click-effect-container"></div>
<style>
/* Style the container */
.click-effect-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 9999;
}
/* Style the effect */
.click-effect {
position: absolute;
width: 20px;
height: 20px;
border-radius: 3000%;
background-color: rgba(255, 0, 0);
pointer-events: none;
animation: clickEffectAnimation 0.200s ease-out;
}
@keyframes clickEffectAnimation {
0% {
transform: scale(0);
opacity: 100;
}
100% {
transform: scale(2);
opacity: 0.1;
}
}
#dle-speedbar {
display: block;
float: left;
height: 33px;
padding-right: 14px;
line-height: 32px;
color: #666;
text-shadow: 0px 1px 0px #fff;
}
</style>
function createClickEffect(event) {
const effect = document.createElement('div');
effect.className = 'click-effect';
const x = event.clientX;
const y = event.clientY;
effect.style.left = x + 'px';
effect.style.top = y + 'px';
const container = document.querySelector('.click-effect-container');
container.appendChild(effect);
// Add sound effect
const audio = new Audio('http://geleson.at.ua/gels.mp3'); // Provided sound link
audio.play();
effect.addEventListener('animationend', () => {
effect.parentNode.removeChild(effect);
});
}
document.addEventListener('click', createClickEffect);
</script>
<div class="click-effect-container"></div>
<style>
/* Style the container */
.click-effect-container {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
z-index: 9999;
}
/* Style the effect */
.click-effect {
position: absolute;
width: 20px;
height: 20px;
border-radius: 3000%;
background-color: rgba(255, 0, 0);
pointer-events: none;
animation: clickEffectAnimation 0.200s ease-out;
}
@keyframes clickEffectAnimation {
0% {
transform: scale(0);
opacity: 100;
}
100% {
transform: scale(2);
opacity: 0.1;
}
}
#dle-speedbar {
display: block;
float: left;
height: 33px;
padding-right: 14px;
line-height: 32px;
color: #666;
text-shadow: 0px 1px 0px #fff;
}
</style>
წარმოგიდგენთ
GELESON.AT.UA
დრო/ 19.09.2024 14:49
ნახვები/ 85