ウェブサイトにクレイジー カーソル クリック効果を追加します。
クリックして魔法を見てください!
Github
プレビュー
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Happy Diwali - Bomb Blast Animation</title> <link rel="stylesheet" href="styles.css"> </head> <body> <div> <p><strong>CSS</strong><br> </p> <pre class="brush:php;toolbar:false">* { margin: 0; padding: 0; box-sizing: border-box; } body { background: linear-gradient(to bottom, #2c3e50, #4ca1af); height: 100vh; overflow: hidden; color: white; font-family: 'Arial', sans-serif; } .container { position: relative; width: 100%; height: 100%; } .container { position: relative; text-align: center; /* Center text */ font-size: 2em; /* Increase font size */ font-weight: bold; /* Make text bold */ color: #ffcc00; /* Text color */ text-shadow: 2px 2px 10px rgba(255, 255, 0, 0.8); /* Add shadow for effect */ } .bomb { position: absolute; width: 20px; height: 20px; background: #ffcc00; border-radius: 50%; animation: pulse 0.4s forwards; } .light { position: absolute; border-radius: 50%; animation: lightSpread 1s forwards; opacity: 0; } @keyframes pulse { 0% { transform: scale(1); } 100% { transform: scale(1.5); opacity: 0; } } @keyframes lightSpread { 0% { transform: scale(0); opacity: 1; } 100% { transform: scale(4); opacity: 0; } }
JavaScript
document.addEventListener('DOMContentLoaded', () => { const container = document.getElementById('container'); container.addEventListener('click', (e) => { // Create the bomb element const bomb = document.createElement('div'); bomb.className = 'bomb'; bomb.style.left = e.clientX + 'px'; bomb.style.top = e.clientY + 'px'; container.appendChild(bomb); // Create light effects for (let i = 0; i < 10; i++) { const light = document.createElement('div'); light.className = 'light'; light.style.left = e.clientX + 'px'; light.style.top = e.clientY + 'px'; light.style.background = `hsl(${Math.random() * 360}, 100%, 50%)`; light.style.width = Math.random() * 20 + 10 + 'px'; // Random width light.style.height = light.style.width; // Keep it circular // Set a random angle and distance for spreading lights const angle = Math.random() * 2 * Math.PI; // Random angle const distance = Math.random() * 200 + 50; // Random distance light.style.transform = `translate(${Math.cos(angle) * distance}px, ${Math.sin(angle) * distance}px)`; container.appendChild(light); // Remove the light effect after animation setTimeout(() => { light.remove(); }, 1000); } // Remove the bomb after animation setTimeout(() => { bomb.remove(); }, 400); }); });
以上がウェブサイトにクレイジー カーソル クリック効果を追加します。の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。

ホットAIツール

Undresser.AI Undress
リアルなヌード写真を作成する AI 搭載アプリ

AI Clothes Remover
写真から衣服を削除するオンライン AI ツール。

Undress AI Tool
脱衣画像を無料で

Clothoff.io
AI衣類リムーバー

Video Face Swap
完全無料の AI 顔交換ツールを使用して、あらゆるビデオの顔を簡単に交換できます。

人気の記事

ホットツール

メモ帳++7.3.1
使いやすく無料のコードエディター

SublimeText3 中国語版
中国語版、とても使いやすい

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

ドリームウィーバー CS6
ビジュアル Web 開発ツール

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)

ホットトピック











新しいプロジェクトの開始時に、SASSコンピレーションは瞬く間に起こります。これは、特にbrowsersyncとペアになっている場合は素晴らしい気分です。

今週のプラットフォームニュースのラウンドアップで、Chromeは、Web開発者のロード、アクセシビリティ仕様、およびBBCの動きのための新しい属性を導入します

これは私が初めてHTML要素を見ていることです。私はしばらくの間それを知っていましたが、まだスピンしていませんでした。かなりクールです

購入またはビルドは、テクノロジーの古典的な議論です。自分で物を構築することは、あなたのクレジットカードの請求書にはラインアイテムがないため、安価に感じるかもしれませんが

しばらくの間、iTunesはポッドキャストの大きな犬だったので、「ポッドキャストにサブスクライブ」をリンクした場合:

今週のラウンドアップ、タイポグラフィを検査するための便利なブックマークレットである。

サイトの訪問者と使用データを追跡するのに役立つ分析プラットフォームがたくさんあります。おそらく、特にGoogleアナリティクスが広く使用されています
