koishi-plugin-jrys-plus 1.0.5 → 1.0.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.
@@ -159,20 +159,20 @@
159
159
  <script>
160
160
  (function() {
161
161
  var luck = {{LUCK}};
162
- // 运势 0~99 均匀映射为 1~10 颗星(每档 10%)
163
- var starCount = Math.floor(luck / 10) + 1;
164
- // 十种彩色
165
- var colors = [
166
- '#ff4757', '#ff6b81', '#ffa502', '#eccc68',
167
- '#2ed573', '#1e90ff', '#5352ed', '#9b59b6',
168
- '#ff6348', '#00d2d3'
169
- ];
170
- // 用运势值 + 星星序号做种子,保证同一天同一用户颜色固定
162
+ // 运势 0~99 加权映射 1~5 ★,越多越稀有
163
+ var starCount;
164
+ if (luck < 45) starCount = 1; // 45%
165
+ else if (luck < 72) starCount = 2; // 27%
166
+ else if (luck < 88) starCount = 3; // 16%
167
+ else if (luck < 97) starCount = 4; // 9%
168
+ else starCount = 5; // 3%
169
+ // 五种彩色(低星暖色 → 高星冷色)
170
+ var colors = ['#ff6348', '#ffa502', '#ffd700', '#1e90ff', '#9b59b6'];
171
171
  var baseSeed = luck * 31 + {{UID}};
172
172
  var area = document.getElementById('stars-area');
173
173
  for (var i = 0; i < starCount; i++) {
174
174
  var span = document.createElement('span');
175
- span.textContent = '';
175
+ span.textContent = '';
176
176
  var ci = (baseSeed + i * 7) % colors.length;
177
177
  span.style.color = colors[ci];
178
178
  area.appendChild(span);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "koishi-plugin-jrys-plus",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "今日运势签到 + 排行榜,精简优化版",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",