About this snippet

Keep users engaged while your app loads. We created a modern splash screen that fades out smoothly when the page is ready, so you get a highly professional entrance.

Size
1.7 KB
Uses
HTML, CSS, JavaScript
Loads
Nothing external
Views
233
<div class="splash-screen" id="splash">
  <div class="loader-circle"></div>
  <h2 class="loader-text">Loading Experience</h2>
</div>

<div class="main-content">
  <h1>Welcome to the Website</h1>
  <p>The beautiful splash screen has vanished, and now you can see the main content loaded perfectly.</p>
</div>
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  font-family: system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  background: #f3f4f6;
  margin: 0;
}

/* Splash Screen Styles */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #111827;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash-screen.hide {
  opacity: 0;
  visibility: hidden;
}

.loader-circle {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.loader-text {
  color: #ffffff;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.875rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Main Content Styles */
.main-content {
  padding: 100px 20px;
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
  color: #1f2937;
}
// We simulate a page load delay here so you can see the effect
window.addEventListener("load", function() {
  
  setTimeout(function() {
    const splash = document.getElementById("splash");
    splash.classList.add("hide");
  }, 1500);
  
});
Esc
↑↓ moveEnter select

Start from a template

Open an .html file, or HTML, CSS, JS, Markdown, Less or TypeScript files. You can also drop them here. Styles and scripts go into their panes.

Share

Source

Keyboard shortcuts

Save