What I have: the code that just animates the progress bar
import {local} from ‘wix-storage’;
$ w.onReady (function () {});
export function button1_click_ (event) {
$ w (“# progressBar10”). value = +10;
local.setItem (‘progress’, $ w (‘# progressBar10’). value);
const progress = local.getItem (‘progress’);
$ w (‘# progressBar10’). value = progress; }
What I’m trying to do:
1- the user logs in;
2 - When doing an action (clicking a button for example) this action makes the bar move
So far I’ve managed to resolve it.
3 - this action is saved in the database and causes the bar to remain in the same position even if the user leaves.
4 - the bar will have 3 movements (33.33% for each animation)
5 - the action of one user does not interfere in the database of the other.
I got close to that, the problem is that when leaving the page or updating the page the user loses the progress of the bar. In addition, the action of one interferes with the action of the other user. I’m not getting the bar to read its previous status.