shap-po / obsidian-party

An implementation of party.js for Obsidian
MIT License
25 stars 1 forks source link

Add effect to task checkbox click #1

Closed dsarman closed 1 year ago

dsarman commented 1 year ago

Hi, I added configurable option to show effects on task checkbox click if you would be interested. Screen Recording 2022-09-25 at 14 56 09

shap-po commented 1 year ago

Hello! I love your idea! But there is one issue: I don't think particles should be shown when you uncheck a task

shap-po commented 1 year ago

I think we should do smth like this:

if (
  target.hasClass("task-list-item-checkbox") &&
  (target.getAttribute("data-task") === " " || // task was unchecked
    (!target.hasAttribute("data-task") && // task is embedded
    !target.hasAttribute("checked"))) // embedded task was unchecked
)
  this.taskEffect(evt);