Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <style>
  
  @import url("https://fonts.googleapis.com/css2?family=Londrina+Solid:wght@100;300;400;900&display=swap");

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: #dddddd;
  font-size: 4.5vmin;
}
.fireworks-container {
  position: fixed;
  width: 100%;
  height: 100%;
}
.fireworks-container:nth-of-type(2){
  z-index: 9;
}
.countdown {
  display: flex;
  gap: 1rem;
  font-family: "Londrina Solid", cursive;
  color: rgb(255,255,255);
  filter: 
    drop-shadow(-0.05em -0.05em 0.05em rgba(128, 0, 128,1))
    drop-shadow(0.05em 0.05em 0.05em rgba(0,0,0,1))
    drop-shadow(0 0 .5em rgba(255, 192, 203,.5));
}
.countdown div {
  display: flex;
  flex-direction: column;
  text-align: center;
}
.countdown div .value {
  font-size: 2.5em;
  font-weight: 400;
  /* text-shadow: 0 0 0.05em red, 0 0 0.1em black; */
}
.countdown div .label {
  font-size: 0.8em;
  font-weight: 300;
  background: rgba(255, 192, 203,1);
  color: rgb(0,0,0);
}
.countdown div .yeardigit {
  font-size: 8em;
  line-height: 0.9em;
  font-weight: 900;
  /* text-shadow: 0 0 0.02em red, 0 0 0.05em black; */
}

</style>



<body>
	<div class="fireworks-container"></div>
  <div class="fireworks-container"></div>
	<div class="countdown">
		<div>
			<div class="value days">0</div>
			<div class="label">Tage</div>
			<div class="yeardigit">0</div>
		</div>
		<div>
			<div class="value hours">0</div>
			<div class="label">Stunden</div>
			<div class="yeardigit">0</div>
		</div>
		<div>
			<div class="value minutes">0</div>
			<div class="label">Minuten</div>
			<div class="yeardigit">0</div>
		</div>
		<div>
			<div class="value seconds">0</div>
			<div class="label">Sekunden</div>
			<div class="yeardigit">0</div>
		</div>
	</div>
</body>

<script src="https://cdn.jsdelivr.net/npm/fireworks-js@latest/dist/fireworks.js"></script>


<script id="rendered-js">
initFireWorks();
initCountDown();

function initFireWorks() {
  const containers = document.querySelectorAll('.fireworks-container');
  containers.forEach((container, index) => {
    index += 1;
    const fireworks = new Fireworks(container, {
      hue: { min: 0, max: 360 },
      delay: { min: 50 / index, max: 100 / index },
      brightness: { min: 80, max: 100 },
      rocketsPoint: 50,
      opacity: 1,
      speed: 1 / index,
      acceleration: 1.05,
      friction: 0.97,
      gravity: 2,
      particles: 200 / index,
      trace: 4 / index,
      explosion: 40 / index });

    fireworks.start();
  });
}
function initCountDown() {
  const countdown = setInterval(() => {
    const nextYear = new Date().getFullYear() + 1;
    const nextYearDate = new Date(nextYear, 0, 1);
    const diff = countDownDate(nextYearDate);

    Object.keys(diff).forEach(key => {
      document.querySelector("." + key).textContent = diff[key];
    });

    document.querySelectorAll('.yeardigit').forEach((digit, index) => {
      digit.textContent = String(nextYear)[index];
    });
  }, 1);
}

function countDownDate(date_future) {
  const date_now = new Date();
  let seconds = Math.floor((date_future - date_now) / 1000);
  let minutes = Math.floor(seconds / 60);
  let hours = Math.floor(minutes / 60);
  let days = Math.floor(hours / 24);

  hours = hours - days * 24;
  minutes = minutes - days * 24 * 60 - hours * 60;
  seconds = seconds - days * 24 * 60 * 60 - hours * 60 * 60 - minutes * 60;
  return { days, hours, minutes, seconds };
}
//# sourceURL=pen.js
    </script>
              
            
!

CSS

              
                
              
            
!

JS

              
                
              
            
!
999px

Console