Coder Social home page Coder Social logo

starswebsite's Introduction

Welcome to the World of Stars

Fun Facts about Stars

Stars are fascinating celestial objects that have captured human imagination for centuries. Here are some fun facts about them:

  • Stars are giant balls of glowing gas, primarily hydrogen and helium.
  • Our Sun is a star, and it provides us with heat and light.
  • Stars vary in size, temperature, and brightness.
  • The color of a star depends on its temperature, with cooler stars appearing red and hotter stars appearing blue.
  • Stars go through various stages of life, including formation, main sequence, and eventually, they can explode as supernovas.

Explore the wonders of the night sky and learn more about the mysteries of the universe.

  1. Link to more stars info!

Dynamic Components

Enter Your Name: Submit
<script> // JavaScript code for dynamic components // (You can place this in an external script.js file) const userInputForm = document.getElementById("userInputForm"); const dateAndTime = document.getElementById("dateAndTime"); const quoteOfTheDay = document.getElementById("quoteOfTheDay");
    // Form submission handler
    userInputForm.addEventListener("submit", function (e) {
        e.preventDefault();
        const userName = document.getElementById("userName").value;
        alert(`Hello, ${userName}!`);
    });

    // Update date and time
    function updateDateTime() {
        const now = new Date();
        dateAndTime.innerText = now.toLocaleString();
    }
    setInterval(updateDateTime, 1000); // Update every second

    // Change the quote of the day (sample quotes)
    const quotes = [
        "The universe is full of stars waiting to be discovered.",
        "Look up at the stars and not down at your feet.",
        "Stars can't shine without darkness.",
    ];
    function updateQuoteOfTheDay() {
        const randomIndex = Math.floor(Math.random() * quotes.length);
        quoteOfTheDay.innerText = `"${quotes[randomIndex]}"`;
    }
    updateQuoteOfTheDay(); // Initial quote
    setInterval(updateQuoteOfTheDay, 10000); // Change every 10 seconds
</script>

starswebsite's People

Contributors

cheeseman757 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.