Skip to content

jackkav/reticulating-splines

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reticulating Splines

A fun addition to your loading screen, based on The Sims.

example

Installing

Install via yarn

    yarn add jackkav/reticulating-splines

Use the React render props pattern, design your own layout

In the following example, spline is the random loading text.

<ReticulatingSplines theme="sims" interval={3000}>
  {({ spline }) => (
    <div>
      <p>{spline}</p>
      <div className="bar" />
    </div>
  )}
</ReticulatingSplines>
.bar {
  width: 100%;
  height: 20px;
  border: 1px solid #2980b9;
  border-radius: 3px;
  background-image: repeating-linear-gradient(
    -45deg,
    #2980b9,
    #2980b9 11px,
    #eee 10px,
    #eee 20px /* determines size */
  );
  background-size: 28px 28px;
  animation: move 0.5s linear infinite;
}

@keyframes move {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 28px 0;
  }
}

You can also pass a list of loading texts

<ReticulatingSplines splines={["something", "something else"]}>
  {({ spline }) => (
    <div>
      <p>{spline}</p>
      <div className="bar" />
    </div>
  )}
</ReticulatingSplines>

Available Themes

  • 'sims' - A collection of messages from The Sims
  • 'web' - A collection of web/management jargon (buzz words)

Development

First you'll need NodeJS, and then you'll need to do an npm install.

    yarn build:watch

This will watch for changes and build the minified script.

About

A fun addition to your loading screen, based on The Sims. As well as a simple example of render props.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%