Files
aurora-admin/frameworks/ProgressVariants.html
T

49 lines
2.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Aurora Admin · ProgressVariants(普通 H5)</title>
<link rel="stylesheet" href="../.design_library/aurora-admin/colors_and_type.css" />
<link rel="stylesheet" href="ProgressVariants.css" />
<style>body{margin:0;padding:24px;background:#F5F7FA;display:flex;flex-direction:column;gap:24px;}
.aa-card{background:#fff;border:1px solid #E8ECF1;border-radius:8px;padding:20px;max-width:420px;}</style>
</head>
<body>
<div class="aa-card">
<div class="aa-progress is-success" style="margin-bottom:12px">
<div class="aa-progress-line-wrap">
<div class="aa-progress-line"><div class="aa-progress-line-fill" style="width:100%"></div></div>
<span class="aa-progress-text">完成</span>
</div>
</div>
<div class="aa-progress">
<div class="aa-progress-line-wrap">
<div class="aa-progress-line"><div class="aa-progress-line-fill" style="width:60%"></div></div>
<span class="aa-progress-text">60%</span>
</div>
</div>
</div>
<div class="aa-card" style="display:flex;gap:24px;align-items:center">
<div class="aa-progress-circle" id="c1"></div>
<div class="aa-progress-circle" id="c2"></div>
</div>
<script>
var C = 2 * Math.PI * 42;
function circle(el, percent, status) {
var color = { success: '#52C41A', warning: '#FA8C16', error: '#F5222D', normal: '#2F54EB' }[status] || '#2F54EB';
el.className = 'aa-progress-circle' + (status !== 'normal' ? ' is-' + status : '');
el.innerHTML = '<svg width="100" height="100" viewBox="0 0 100 100">' +
'<circle cx="50" cy="50" r="42" fill="none" stroke="#E8ECF1" stroke-width="8" />' +
'<circle cx="50" cy="50" r="42" fill="none" stroke="' + color + '" stroke-width="8" stroke-linecap="round" ' +
'stroke-dasharray="' + C + '" stroke-dashoffset="' + (C * (1 - percent / 100)).toFixed(2) + '" transform="rotate(-90 50 50)" /></svg>' +
'<span class="aa-progress-circle-text">' + percent + '%</span>';
}
circle(document.getElementById('c1'), 72, 'normal');
circle(document.getElementById('c2'), 88, 'success');
</script>
</body>
</html>