Giter VIP home page Giter VIP logo

page-not-found's Introduction

page-not-found

996.icu LICENSE GitHub license

A collection of components for 404 pages. No dependencies.

Quick Start

  1. Include pnf.min.js in your page.
<script src="pnf.min.js"></script>
  1. Choose your container.
<div class="pnf-container"></div>
  1. Initialize with PnF.
PnF.fragment('.pnf-container')

API

.fragment(selector, options)

Demo

options

Option Type Default Description
homeUrl string null Url to homepage.
homeLabel string 'Home' Label text for link button.
maxRotate number 120 Fragment rotation. Will rotate between -maxRotate / 2 to maxRotate / 2.
layers [layer] miscellaneous Layer objects array. See below.

layer

Option Type Default Description
offset number miscellaneous The intensity of layer translation. A negative offset produces reverse translation.
fragments [string] | number miscellaneous Fragment strings array or fragment count.
color color string miscellaneous Background colors for fragments.

Styling

Generated HTML markup is displayed below. You may style it any way you'd like.

<div class="fragment-container">
  <a class="fragment-home">...</a>
  <div class="fragment-layer-1">
    <div class="fragment"></div>
    <div class="fragment"></div>
  </div>
  <div class="fragment-layer-2">
    <div class="fragment"></div>
    <div class="fragment"></div>
  </div>
  <div class="fragment-layer-3">
    <div class="fragment"></div>
    <div class="fragment"></div>
  </div>
</div>

Style sample:

body {
  margin: 0;
}
.fragment-container {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  position: relative;
}
.fragment-container div[class*="fragment-layer-"] {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  transition: 0.1s;
}
.fragment-container .fragment-home {
  color: #fff;
  border-radius: 4px;
  border: none;
  outline: 0;
  box-shadow: 0px 0px 16px 0px rgba(24, 144, 255, 0.3);
  background-color: rgba(24, 144, 255, 0.6);
  padding: 12px 20px;
  font-size: 20px;
  cursor: pointer;
  margin: 50vh auto 0;
  display: block;
  width: max-content;
  text-decoration: none;
  position: relative;
  transition: linear 0.2s;
}
.fragment-container .fragment-home:hover {
  box-shadow: 0px 0px 16px 0px rgba(24, 144, 255, 0.7);
  background-color: rgba(24, 144, 255, 0.95);
}
.fragment-container .fragment-layer-1 .fragment {
  text-align: center;
  line-height: 1.5;
  padding: 5px 10px;
  font-size: 18px;
  color: #fff;
}
.fragment-container .fragment-layer-2 .fragment {
  width: 20px;
  height: 20px;
}
.fragment-container .fragment-layer-3 .fragment {
  width: 10px;
  height: 10px;
}

TODO

  • Locate text layer fragments from left to right. Currently it's totally random.

LICENSE

  1. Under the MIT License. See the LICENSE file for details.
  2. Under the Anti 996 License. See the Anti 996 LICENSE file for details.

page-not-found's People

Contributors

dependabot[bot] avatar luhaopeng avatar

Watchers

 avatar  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.