Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
tc0715888 authored Apr 20, 2024
1 parent 2648a53 commit 41d9c20
Showing 1 changed file with 30 additions and 31 deletions.
61 changes: 30 additions & 31 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,37 @@

}
</script>
<script>
// 提取域名后缀并统计数量
var domains = document.querySelectorAll('#followers-list li strong');
var suffixes = {};
domains.forEach(function (domain) {
var suffix = domain.textContent.split('.').pop();
if (suffixes[suffix]) {
suffixes[suffix]++;
} else {
suffixes[suffix] = 1;
}
});

// 显示后缀汇总
var suffixSummary = document.getElementById('suffix-summary');
for (var suffix in suffixes) {
var li = document.createElement('li');
li.textContent = suffix + ': ' + suffixes[suffix];
suffixSummary.appendChild(li);
}

// 计算并显示续费总计金额
var renewalTotal = document.getElementById('renewal-total');
var totalAmount = 0;
{%- for domain in site.domains -%}
{%- if domain.price -%}
totalAmount += parseFloat('{{ domain.price }}');
{%- endif -%}
{%- endfor -%}
renewalTotal.textContent = totalAmount.toFixed(2);
</script>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Expand Down Expand Up @@ -84,36 +114,5 @@ <h3 class="page-head">
</div>
</footer>
</body>
<script>
// 提取域名后缀并统计数量
var domains = document.querySelectorAll('#followers-list li strong');
var suffixes = {};
domains.forEach(function (domain) {
var suffix = domain.textContent.split('.').pop();
if (suffixes[suffix]) {
suffixes[suffix]++;
} else {
suffixes[suffix] = 1;
}
});

// 显示后缀汇总
var suffixSummary = document.getElementById('suffix-summary');
for (var suffix in suffixes) {
var li = document.createElement('li');
li.textContent = suffix + ': ' + suffixes[suffix];
suffixSummary.appendChild(li);
}

// 计算并显示续费总计金额
var renewalTotal = document.getElementById('renewal-total');
var totalAmount = 0;
{%- for domain in site.domains -%}
{%- if domain.price -%}
totalAmount += parseFloat('{{ domain.price }}');
{%- endif -%}
{%- endfor -%}
renewalTotal.textContent = totalAmount.toFixed(2);
</script>

</html>

0 comments on commit 41d9c20

Please sign in to comment.