Giter Site home page Giter Site logo

dozmia-front's Introduction

Dozmia Font-End

Note: this does not include the code for the mobile site.

For a demo, see http://papyrusoft.com/dozmia

Project Structure

  • assets/ - images, fonts and related files
  • pages/ - PHP scripts generating content for "pages". See how it works
  • lib/ - currently just 3rd party or vendor JS scripts
  • src/ - home of the application logic JS scripts
  • index.php - renders the initial HTML layout, fetches JS scripts and other resources
  • page.php - a simple "controller" that defers to the appropriate script in pages/

How it works

Chronologically, index.php "bootstraps" the app by creating the minimum HTML, then the scripts under src/ take over. Specifically, dozmia-main.js does the following:

  • sets up the global module variable dozmia
  • creates the resource manager (dozmia.rman)
  • creates the player model (dozmia.player)
  • creates the router (dozmia.MainRouter)
  • defines a base view (dozmia.BaseView)
  • creates the router, kicking off the app, once the DOM is ready

Once the router is created, it handles any request for a URL with a hash portion matching one of its routes (Ideally, the # in the URL would not be necessary. I think this just requires a slightly more sophisticated backend set up.) The router relies on the resource manager to provide instances of objects needed to render the page for the current route. The resource manager's purpose is to prevent duplication, both of code and of run-time objects. The most interesting route is the otherPage route, which installs the master view and tells it the name of the requested page. The master view then renders the fixed parts of the layout and makes an Ajax request to the server for the content specific to the request page and places it in a special container in the middle of the page.

The player model (dozmia.player) stores information about the currently playing song and the player view dozmia.PlayerView responds to changes in the player model. Standard MVC stuff.

Thanks

Dozmia ~ Thanks for building your front-end with Papyrus. Go forth and conquer! ~ Patrick

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.