You will be provided with a web data and a user prompt. The web data is from a result…
- User
You will be provided with a web data and a user prompt. The web data is from a result from a search engine. You please use the web data to answer the user prompt.
WEB DATA: Membuat sebuah website yang bagus dengan animasi memerlukan kombinasi dari HTML, CSS, dan JavaScript. Berikut adalah contoh sederhana untuk membuat sebuah website dengan animasi loading yang menarik:
HTML
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Website dengan Animasi</title> <link rel="stylesheet" href="style.css"> </head> <body> <div id="loader-wrapper"> <div id="loader"></div> <h2>Loading...</h2> </div> <script src="script.js"></script> </body> </html>CSS (style.css)
#loader-wrapper { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 1000; background-color: #f2f2f2; } #loader { display: block; position: relative; left: 49%; top: 20%; width: 150px; height: 150px; border-radius: 50%; margin: -75px 0 0 -75px; border: 5px solid transparent; border-top-color: #3498db; border-bottom-color: #3498db; z-index: 1001; animation: spin 1s linear infinite; } #loader:before { content: ""; position: absolute; top: 10px; left: 10px; right: 10px; bottom: 10px; border: 5px solid transparent; border-radius: 50%; border-left-color: #e74c3c; border-right-color: #e74c3c; z-index: 1001; animation: spin 0.5s ease-in-out infinite; } #loader:after { content: ""; position: absolute; top: 40px; left: 40px; right: 40px; bottom: 40px; border-radius: 50%; border: 5px solid transparent; border-top-color: #f9c922; border-bottom-color: #f9c922; z-index: 1001; animation: spin 1s ease infinite; } h2 { display: block; position: relative; top: 13%; font-size: 50px; font-family: Brush Script Std; text-align: center; color: blue; z-index: 1001; animation: mymove 1.5s infinite alternate; } @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } @keyframes mymove { 0% { opacity: 100; } 100% { opacity: 0; } }JavaScript (script.js)
// Tambahkan JavaScript untuk menghilangkan loader setelah beberapa detik setTimeout(function() { document.getElementById("loader-wrapper").style.display = "none"; }, 5000);Contoh ini membuat sebuah animasi loading yang menarik dengan menggunakan CSS dan JavaScript. Animasi ini akan berhenti setelah 5 detik dan loader akan hilang. Anda bisa menyesuaikan waktu dan animasi sesuai dengan kebutuhan Anda.
Referensi:
- :
- Assistant