Last active
October 27, 2025 13:06
-
-
Save mo-karbalaee/30ad922206e52ba9fc033df86b12099d to your computer and use it in GitHub Desktop.
Revisions
-
mo-karbalaee revised this gist
Oct 27, 2025 . No changes.There are no files selected for viewing
-
mo-karbalaee revised this gist
Oct 27, 2025 . 2 changed files with 13 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ ```countdown-to title: Semester Period startDate: 2025-10-01 startTime: 08:00:00 endDate: 2026-03-29 endTime: 14:00:00 type: circle color: #ff5722 trailColor: #f5f5f5 infoFormat: {percent}% complete - {remaining} until {end:LLL d, yyyy} updateInRealTime: true updateIntervalInSeconds: 30 ``` File renamed without changes. -
mo-karbalaee created this gist
Oct 27, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ ```dataviewjs // Get all tasks in the current note let tasks = dv.current().file.tasks; // Store counts in variables let totalTasks = tasks.length; let completedTasks = tasks.filter(t => t.checked).length; let notCompletedTasks = tasks.filter(t => !t.checked).length; // Compute ratio of undone/done if needed let ratioUndoneToDone = notCompletedTasks / completedTasks; // Now all numbers are stored in variables and can be used in code // Example: using them in a string let statusSummary = `Total: ${totalTasks}, Completed: ${completedTasks}, Not Completed: ${notCompletedTasks}, Ratio Undone/Done: ${ratioUndoneToDone}`; statusSummary // this line "returns" the string in the note ``` ```dataviewjs // Get tasks let tasks = dv.current().file.tasks; let totalTasks = tasks.length; let completedTasks = tasks.filter(t => t.checked).length; let notCompletedTasks = totalTasks - completedTasks; // Calculate ratio let ratio = totalTasks === 0 ? 0 : completedTasks / totalTasks; // Progress bar styling let barWidth = 300; // total width in pixels let filledWidth = barWidth * ratio; // Generate HTML progress bar let htmlBar = ` <div style="background-color:#eee; border-radius:8px; width:${barWidth}px; height:20px; overflow:hidden;"> <div style="background-color:#4caf50; width:${filledWidth}px; height:100%; transition: width 0.3s;"></div> </div> <div style="margin-top:4px; font-weight:bold;">${completedTasks}/${totalTasks} completed</div> </div> `; // Render HTML dv.el("div", htmlBar, {allowHTML: true}); ```