@@ -174,6 +174,11 @@ const generateStyles = () => `
174
174
font-weight: 600;
175
175
}
176
176
177
+ h5 {
178
+ color: var(--text-color);
179
+ font-weight: 500;
180
+ }
181
+
177
182
.form-label {
178
183
font-weight: 500;
179
184
color: var(--text-color);
@@ -581,13 +586,28 @@ const generateStyles = () => `
581
586
animation: slideIn 0.3s var(--transition-timing) forwards;
582
587
}
583
588
589
+ .custom-rule.removing {
590
+ animation: slideOut 0.3s var(--transition-timing) forwards;
591
+ }
592
+
584
593
@keyframes slideIn {
585
594
to {
586
595
opacity: 1;
587
596
transform: translateY(0);
588
597
}
589
598
}
590
599
600
+ @keyframes slideOut {
601
+ from {
602
+ opacity: 1;
603
+ transform: translateY(0);
604
+ }
605
+ to {
606
+ opacity: 0;
607
+ transform: translateY(-20px);
608
+ }
609
+ }
610
+
591
611
/* 暗色模式切换动画 */
592
612
body {
593
613
transition: background-color 0.3s var(--transition-timing),
@@ -665,7 +685,6 @@ const generateForm = () => `
665
685
666
686
<div id="advancedOptions">
667
687
<div class="form-section">
668
- <div class="form-section-title">Rule Configuration</div>
669
688
${ generateRuleSetSelection ( ) }
670
689
</div>
671
690
@@ -680,14 +699,12 @@ const generateForm = () => `
680
699
</span>
681
700
</div>
682
701
<div class="mb-3">
683
- <label for="configType" class="form-label">Config Type:</label>
684
702
<select class="form-select" id="configType">
685
703
<option value="singbox">SingBox (JSON)</option>
686
704
<option value="clash">Clash (YAML)</option>
687
705
</select>
688
706
</div>
689
707
<div class="mb-3">
690
- <label for="configEditor" class="form-label">Custom Base Config:</label>
691
708
<textarea class="form-control" id="configEditor" rows="3" placeholder="Paste your custom config here..."></textarea>
692
709
</div>
693
710
<div class="d-flex gap-2">
@@ -936,7 +953,6 @@ const generateRuleSetSelection = () => `
936
953
</div>
937
954
938
955
<div class="content-container mb-3">
939
- <label for="predefinedRules" class="form-label">Rule Sets:</label>
940
956
<select class="form-select" id="predefinedRules" onchange="applyPredefinedRules()">
941
957
<option value="custom">Custom</option>
942
958
<option value="minimal">Minimal</option>
@@ -955,7 +971,7 @@ const generateRuleSetSelection = () => `
955
971
` ) . join ( '' ) }
956
972
</div>
957
973
<div class="mt-4">
958
- <h4 >Custom Rules</h4 >
974
+ <h5 >Custom Rules</h5 >
959
975
<div class="form-check form-switch mb-3">
960
976
<input class="form-check-input" type="checkbox" id="crpinToggle">
961
977
<label class="form-check-label" for="crpinToggle">Pin Custom Rules</label>
@@ -1219,8 +1235,11 @@ const customRuleFunctions = `
1219
1235
function removeCustomRule(button) {
1220
1236
const ruleDiv = button.closest('.custom-rule');
1221
1237
if (ruleDiv) {
1222
- ruleDiv.remove();
1223
- customRuleCount--;
1238
+ ruleDiv.classList.add('removing');
1239
+ ruleDiv.addEventListener('animationend', () => {
1240
+ ruleDiv.remove();
1241
+ customRuleCount--;
1242
+ }, { once: true });
1224
1243
}
1225
1244
}
1226
1245
` ;
0 commit comments