code-stats-vscode/assets/profile.html.eex
Valentin Ivanov ae430493d7 SVG styling
2018-07-04 13:37:33 +02:00

71 lines
2.5 KiB
Elixir

<link rel="stylesheet" href="file:///${style}">
<h3> ${profile.user} Level ${profile.level} (${profile.total_xp} XP)
<% if( profile.new_xp > 0 ) { %>
<sup>(+
<%= profile.new_xp %>)</sup>
<% } %>
</h3>
<div class="progress">
<div class="progress-bar progress-bar-success" style='width:${profile.progress}%;'>
<span class="sr-only">Level progress ${profile.progress - profile.new_progress}%.</span>
</div>
<div class="progress-bar progress-bar-striped progress-bar-warning" style='width:${profile.new_progress}%;'>
<span class="sr-only">Recent level progress ${profile.new_progress}%.</span>
</div>
</div>
<div class="languages">
<% for( let l in languages) { %>
<div class="language-progress">
<div class="language">
<%= languages[l].name %>
<span>
<%= languages[l].level %>
</span>
</div>
<span class="tooltiptext">
<strong><%=languages[l].xp %> XP</strong>
<% if( languages[l].new_xp > 0 ) { %>
<sup>(+
<%= languages[l].new_xp %>)</sup>
<% } %>
</span>
<svg viewBox="0 0 100 100">
<circle class="backg" cx="50" cy="50" r="45" ></circle>
<circle class="newxp" cx="50" cy="50" r="45" stroke-dasharray="282.6" stroke-dashoffset='${ ((100-languages[l].progress) * 282.6 / 100) }'></circle>
<circle class="oldxp" cx="50" cy="50" r="45" stroke-dasharray="282.6" stroke-dashoffset='${ ((100-languages[l].progress + languages[l].new_progress) * 282.6 / 100) }'></circle>
</svg>
</div>
<% } %>
</div>
<p/>
<div class="machines">
<% for( let m in machines) { %>
<div class="machine">
<strong>
<%= machines[m].name %>
</strong>
<span class="level">
level <%= machines[m].level %>
</span>
<span class="xp">
(<%= machines[m].xp %> XP)
<% if( machines[m].new_xp > 0 ) { %>
<sup>(+
<%= machines[m].new_xp %>)</sup>
<% } %>
</span>
<div class="progress">
<div class="progress-bar progress-bar-success" style='width:${machines[m].progress}%;'>
<span class="sr-only">Level progress ${machines[m].progress - machines[m].new_progress}%.</span>
</div>
<div class="progress-bar progress-bar-striped progress-bar-warning" style='width:${machines[m].new_progress}%;'>
<span class="sr-only">Recent level progress ${machines[m].new_progress}%.</span>
</div>
</div>
</div>
<% } %>
</div>