';
- }
- });
+ blueprintData = data.pillar_breakdown;
+ renderBlueprintPillars(blueprintData);
+ renderBlueprintList();
});
}
+ function renderBlueprintPillars(pb) {
+ var container = document.getElementById('blueprint-pillars');
+ if (!container) return;
+ var html = '';
+ PILLARS.forEach(function(p){
+ var info = pb[p.name] || {};
+ var m = info.morning || 0, e = info.evening || 0, s = info.study || 0;
+ var total = m + e + s;
+ html += '
' +
+ '
' + p.emoji + '
' +
+ '
' + p.name + '
' +
+ '
' +
+ (m ? '🥼' + m + '' : '') +
+ (e ? '🔍' + e + '' : '') +
+ (s ? '📚' + s + '' : '') +
+ (total === 0 ? '—' : '') +
+ '
' +
+ '
';
+ });
+ container.innerHTML = html;
+ }
+
+ function renderBlueprintList() {
+ var list = document.getElementById('bp-list');
+ var empty = document.getElementById('bp-list-empty');
+ if (!list || !blueprintData) return;
+ var items = [];
+ PILLARS.forEach(function(p){
+ var info = blueprintData[p.name] || {};
+ if (blueprintFilter === 'all' || blueprintFilter === 'morning') {
+ (info.morning_items || []).forEach(function(mi){ items.push({pillar: p, text: mi.text, type: 'morning'}); });
+ }
+ if (blueprintFilter === 'all' || blueprintFilter === 'evening') {
+ (info.evening_items || []).forEach(function(ei){ items.push({pillar: p, text: ei.mistake || ei.improvement, type: 'evening'}); });
+ }
+ if (blueprintFilter === 'all' || blueprintFilter === 'study') {
+ (info.study_items || []).forEach(function(si){ items.push({pillar: p, text: si.name, type: 'study', done: si.done}); });
+ }
+ });
+ if (items.length === 0) {
+ list.innerHTML = '';
+ if (empty) empty.style.display = 'block';
+ return;
+ }
+ if (empty) empty.style.display = 'none';
+ var typeLabels = {morning: '立志', evening: '责善', study: '勤学'};
+ var html = '';
+ items.forEach(function(item){
+ html += '