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.
- package/lib/templates/fortune.html +10 -10
- package/package.json +1 -1
|
@@ -159,20 +159,20 @@
|
|
|
159
159
|
<script>
|
|
160
160
|
(function() {
|
|
161
161
|
var luck = {{LUCK}};
|
|
162
|
-
// 运势 0~99
|
|
163
|
-
var starCount
|
|
164
|
-
//
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
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);
|