Skip to content

Latest commit

 

History

History

docs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

PhytoJS Samples for the web browser

./docs has use-cases for the web browser, if you're looking for examples to run in nodejs please look at the ./samples folder; if you're looking for the documentation of the PhytoJS service component please look at the project ./README.md

codepen.io interactive coding example

Super simple examples to learn how to import PhytoJS as a JS Module on Codepen; Start here and have fun creating your application with PhytoJS

This collection ha only two pens which differ from one another only by the vernacular name sought

  1. origano
  2. menta

Introductory tutorial showing how easy it is to build powerful browser based applications with preact and phytojs

You can see step by step adding features to the page and have fun playing with styles or creating your first web application with PhytoJS

  1. Search plants by vernacular name

    please check the pen for basic scaffolding.

  2. Add taxon rank to each plant

return h("li", null, `${plant.scientificName}  - [${plant.taxonRankLabel}]`);
// instead of ..>
return h("li", null, plant.scientificName);
  1. Add plant image and basic styles
return 
    h("li", 
        {id: `${plant.wdEntityId}`, class: "plantTitle"}, 
        `${plant.scientificName}`,
    h("span",{class: "taxonRank"},` [${plant.taxonRankLabel}]`),
    h("img",{src: plant.image}));
  1. Add link to the plant page
return 
    h("li", 
        {id: plant.wdEntityId, class: "plantTitle"}, 
        h("a", 
            {href: plant.specieArticle, target:"_blank"},
            `${plant.scientificName}`),
        h("span",{class: "taxonRank"},` [${plant.taxonRankLabel}]`),
        h("img",{src: plant.image}));

... more and more pens

Follow the link to search newest PhytoJS pens

Vanillajs (ECMAScript.next) MVC Example

Live Demo demo sources

demo video

Will work in your browser in these cases:

  • Safari 10.1.
  • Chrome 61.
  • Firefox 54 – behind the dom.moduleScripts.enabled setting in about:config.
  • Edge 15 – behind the Experimental JavaScript Features setting in about:flags.

Vanillajs development

# this demo require http-server; if you haven't it then install it: `npm i http-server -g`
npm start 
# then navigate to http:https://localhost:8080 

In any case this is a Single-Page Application (SPA) of static pages with browser friendly ES Modules therefore you can choose to serve it the way you like; for example:

git clone https://github.com/rondinif/phytojs.git
cd ./phytojs/docs/mvc 
python -m SimpleHTTPServer
# Serving HTTP on 0.0.0.0 port 8000 ...
#  then navigate to http:https://localhost:8000 

Acknowledgments

This example was created by rondinif importing the PhytoJs library into a a Single-Page Application (SPA) inspired by the following works

Contributing

we encourage contributions from everyone