Giter Club home page Giter Club logo

pixi-kaleidoscope's Introduction

Kaleidoscope in WebGL

Overview

This repo is the code for the kaleidoscope made with Pixi.js.

A node.js app.

Setup

Clone this repo, change to the project directory and run

npm install

Structure

Key components:

  • /src - Contains the source and configuration files for the animation. There are two configuraton files - /src/config/default.js is for dev, and /src/config/prd.js is used for the production build. The main difference in production config file is the image paths being passed in through localStorage, for integration with the Shopify store.

  • /assets - Image assets used for the kaleidoscope. When you click on 'Next Image' in the kaleidoscope, these are the images the animation will cycle through.

Development

To run the local development environment run

npm run dev

This build will use the config values in /src/config/default.js.

Building for deployment

Build Jobs

There are two jobs to perform a production build:

  • build - Performs an unminified production build
  • build-min - Perform a minified production build. Also enables compression to reduce the final bundle size.

Configuring for build

Before running the build, make sure the image asset paths (specified in /src/config/prd.js) are correct. The kaleidoscope is initialised with the first image in this list.

images: [
    './assets/bg--alt-01.jpg',
    './assets/bg--alt-02.jpg',
    './assets/bg--alt-03.jpg',
    './assets/bg--alt-04.jpg',
    './assets/bg--alt-05.jpg',
    './assets/bg--alt-06.jpg',
    './assets/bg--alt-07.jpg',
    './assets/bg--main-bertrand.jpg',
    './assets/bg--main-geza.jpg',
    './assets/bg--main-mark.jpg'
]

These paths should be relative to the location of the webpage with the canvas element or absolute paths.

Running the build

To perform a build, use the npm script:
npm run build or npm run build-min

You can also run both builds with one command:
npm run build-all

This will produce two files kal.js and kal.min.js in the /dist directory of the project.

Deployment

The application looks for a canvas element with the id kaleidoscope in the HTML document. Before deployment, please make sure this element exists.

pixi-kaleidoscope's People

Contributors

ramkumarshankar avatar

Stargazers

 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.