项目作者: tanmaybinaykiya

项目描述 :
Web app for Center of Puppetry Arts' Puppet Archive
高级语言: HTML
项目地址: git://github.com/tanmaybinaykiya/CPA-Archive.git
创建时间: 2017-11-15T18:48:01Z
项目社区:https://github.com/tanmaybinaykiya/CPA-Archive

开源协议:

下载


Center for Puppetry Arts: Puppet Archive

Deployment

Can be run locally using any web server of your choice. A simple way is to run the following command in the project directory.

  1. $ python -m SimpleHTTPServer

The web app can now be viewed in any modern browser at http://localhost:8000

Data updates

The website is made dynamic through the use of a json file(data.json). The json file corresponds to a json array of puppets in the archive.

To add/modify any data, the said json file needs to be updated.

To add a puppet

Simply replace the following blob with the appropriate contents and add it to data.json.

  • The collection field allows only the given values(AFRICAN | AMERICAS | ASIAN | EUROPEAN | MIDEAST)
  • The info section is scalable as long as the key/value format is followed.
  • The unity section provides links to the appropriate unity files
  • If the unity section is not found in the object, the title image is displayed in place of the unity element.
  • imageTitle refers to the URL of the image displayed on the search page and in the case that unity files are not available
  1. {
  2. "name":"Puppet Name",
  3. "description":"Puppet Description goes here",
  4. "collection":"AFRICAN | AMERICAS | ASIAN | EUROPEAN | MIDEAST",
  5. "images":["./path/to/image.jpg", "./path/to/another/image.jpg"],
  6. "imageTitle":"./path/to/title/image.jpg",
  7. "info":[
  8. { "key":"Accession Number", "value":"someValue"},
  9. { "key":"Collector", "value":"someValue"},
  10. { "key":"Artist", "value":"someValue"},
  11. { "key":"Category", "value":"someValue"},
  12. { "key":"Subcategory Othername", "value":"someValue"},
  13. { "key":"Received as", "value":"someValue"},
  14. { "key":"Accession date", "value":"someValue"},
  15. { "key":"Cataloged by", "value":"someValue"},
  16. { "key":"Catalog date", "value":"someValue"},
  17. { "key":"Source", "value":"someValue"},
  18. { "key":"Credit Line", "value":"someValue"},
  19. { "key":"Home loc", "value":"someValue"},
  20. { "key":"Year Range", "value":"someValue"},
  21. { "key":"Height", "value":"someValue"},
  22. { "key":"Width", "value":"someValue"},
  23. { "key":"Depth", "value":"someValue"},
  24. { "key":"Material", "value":"someValue"},
  25. { "key":"Condition", "value":"someValue"},
  26. { "key":"Condition by", "value":"someValue"},
  27. { "key":"Condition Date", "value":"someValue"},
  28. { "key":"Condition Notes", "value":"someValue"},
  29. { "key":"Current Value Min", "value":"someValue"},
  30. { "key":"Current Value Min", "value":"someValue"}
  31. ],
  32. "unity":{
  33. "dataUrl": "unity/file.data",
  34. "codeUrl": "unity/file.js",
  35. "asmUrl": "unity/file.asm.js",
  36. "memUrl": "unity/file.mem"
  37. }
  38. }

Development

Libraries Used

  • Bootstrap: UI elements
  • MustacheJS: JSON based Templating
  • UnityJS: 3d - Unity elements

Code structure

  • index.html: Renders the search page
  • puppet.html: Renders the puppet’s information page.
  • js/: Hosts all the javascript files
    • index-scripts.js: Contains the script to render the index.html page
    • puppet-scripts.js: Contains the script to render the puppet.html page
    • UnityLoader.js: Contains the script to render the unity elements on the puppet.html page [Maintainer: Pierce McBride]
  • css/: Hosts all stylesheets
    • fonts/: hosts fonts used for icons
  • img/: Hosts all images required for the app

Developed by: Tanmay Binaykiya