dvargas92495 / SmartBlocks

Useful examples from developer community for Roam42 SmartBlocks
147 stars 7 forks source link

Colour-formatted Timestamps #167

Open JasperGeh opened 3 years ago

JasperGeh commented 3 years ago

✂️ Copy of your #42SmartBlock from Roam

📋 Describe the SmartBlock

Inserts a timestamp, colour-formatted according to the current time of day, and an empty block nested underneath, ready to be filled with insight. I like to see the passage of time – from light blue to dark red – on my daily notes page.

✅ Describe any prerequisites or dependencies that are required for this SmartBlock

Requires Cato Minor's coloured text CSS. Cato's tags are #c:color**Text**, I added rm- in front of my tags, as you can see in the second to last block. Change according to your preferred tag-structure

📷 Screenshot of your #42SmartBlock workflow/template from Roam

Bildschirmfoto 2020-12-31 um 12 51 23

💡 Additional Info

Colours Bildschirmfoto 2020-12-31 um 12 52 44

Example on my DNP Bildschirmfoto 2020-12-31 um 12 59 04

jeffrappaport commented 3 years ago

Hi Jasper, thank you for this smartblock. great feature! I am receiving the wrong color for 10:58 AM is blue - should be olive note: I am using the Roam Colored Font alternative https://gist.github.com/ciceronianus/21f3c7f88efb9d515377ad3c3e09dca6

pls let me know if you can think of a fix for this, thanks!

image image

JasperGeh commented 3 years ago

You're right, I had a typo in the olive block and set the colour for times between dayjs().hour() >= 13 && dayjs().hour() < 12), which obviously fails. I corrected it to >=10 && <12. Thanks for catching that!