This little one-pager will let you scan and save scores into your device localstorage, using the camera API to scan QR Codes. The purpose is to let visitors "collect" their score on differents waypoints and save them.
- Scan a specially formatted QR Code (see below) to save the score on the device
- Sum the different waypoints score and gives the total
- Once you have 50% of total collectable, you unlock a prize (visual feedback to the user)
- Configurable max points collectable
- Works on Android & iOS (and your regular computer)
- Clone the repository
yarn install
ornpm install
to install the devDependenciesyarn run buil
if you want to build it, oryarn run dev
if you're working on the project
Locate const max = parseInt(25000);
in index.js
and change the number (here 25k) by the max a user will be able to collect.
You need to follow this format : [id];[score]
.
If you want to store 10k points on the first waypoint, it will be g1;10000
then. Just generate a qrcode with this values.
In order to make the application work gracefully, you need to initialise de waypoints with the following object found at the first lines of index.js
:
const defaultScore = [{
id: "g1",
name: "Les Langues Européenes",
points: 0
},
{
id: "g2",
name: "La géographie",
points: 0
},
{
id: "g3",
name: "Les Monnaies",
points: 0
},
{
id: "g4",
name: "La géographie",
points: 0
}
];
You can see you need to edit waypoint object like this :
id
will be the key used for the QR Codename
is how you want the waypoint to appears in the apppoints
is the default points (here 0)
Well you can always open an Issue but there's no specific support planned for this project.
This project is release under the Do No Harm License - Draft
This project is staled and under no active developpemnt.
Feel free to contribute sending PR. I am using parcelJS for building.