react-achievements 1.3.4 → 1.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -11
- package/images/delete_local_storage.png +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,6 +5,9 @@ A flexible and customizable achievement system for React applications, perfect f
|
|
|
5
5
|
|
|
6
6
|
[](https://youtu.be/BWdtiE53S-8)
|
|
7
7
|
|
|
8
|
+
If you want to test the package, you can try it out here:
|
|
9
|
+
|
|
10
|
+
https://stackblitz.com/edit/vitejs-vite-sccdux
|
|
8
11
|
|
|
9
12
|
|
|
10
13
|
<h2 align="center">🚀 Installation</h2>
|
|
@@ -69,42 +72,42 @@ import questMasterIcon from './icons/quest-master.png';
|
|
|
69
72
|
const achievementConfig = {
|
|
70
73
|
level: [
|
|
71
74
|
{
|
|
72
|
-
check: (value) => value >=
|
|
75
|
+
check: (value) => value >= 1,
|
|
73
76
|
data: {
|
|
74
|
-
id: '
|
|
77
|
+
id: 'level_1',
|
|
75
78
|
title: 'Novice Adventurer',
|
|
76
|
-
description: 'Reached level
|
|
79
|
+
description: 'Reached level 1',
|
|
77
80
|
icon: levelUpIcon
|
|
78
81
|
}
|
|
79
82
|
},
|
|
80
83
|
{
|
|
81
|
-
check: (value) => value >=
|
|
84
|
+
check: (value) => value >= 5,
|
|
82
85
|
data: {
|
|
83
|
-
id: '
|
|
86
|
+
id: 'level_5',
|
|
84
87
|
title: 'Seasoned Warrior',
|
|
85
|
-
description: 'Reached level
|
|
88
|
+
description: 'Reached level 5',
|
|
86
89
|
icon: levelUpIcon
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
92
|
],
|
|
90
93
|
monstersDefeated: [
|
|
91
94
|
{
|
|
92
|
-
check: (value) => value >=
|
|
95
|
+
check: (value) => value >= 10,
|
|
93
96
|
data: {
|
|
94
97
|
id: 'monster_slayer',
|
|
95
98
|
title: 'Monster Slayer',
|
|
96
|
-
description: 'Defeated
|
|
99
|
+
description: 'Defeated 10 monsters',
|
|
97
100
|
icon: monsterSlayerIcon
|
|
98
101
|
}
|
|
99
102
|
}
|
|
100
103
|
],
|
|
101
104
|
questsCompleted: [
|
|
102
105
|
{
|
|
103
|
-
check: (value) => value >=
|
|
106
|
+
check: (value) => value >= 1,
|
|
104
107
|
data: {
|
|
105
108
|
id: 'quest_master',
|
|
106
109
|
title: 'Quest Master',
|
|
107
|
-
description: 'Completed
|
|
110
|
+
description: 'Completed 1 quest',
|
|
108
111
|
icon: questMasterIcon
|
|
109
112
|
}
|
|
110
113
|
}
|
|
@@ -367,7 +370,12 @@ badgesButton: {
|
|
|
367
370
|
|
|
368
371
|
```
|
|
369
372
|
|
|
370
|
-
|
|
373
|
+
<h2 align="center">Resetting React Achievements</h2>
|
|
374
|
+
|
|
375
|
+
The achievements are stored in local storage. In order to reset the package in your app, you need to delete the key-value pairs in local storage:
|
|
376
|
+
|
|
377
|
+

|
|
378
|
+
|
|
371
379
|
|
|
372
380
|
<h2 align="center">📄 License</h2>
|
|
373
381
|
MIT
|
|
Binary file
|