Hide/Show layer when minutes in hour less than 10

Hey guys,

Am super new to Facer creation and coding and am struggling getting this expression to work.

I’m trying to have an image layer appear when the time is anything between :01 and :09.

This is what I’m working with: $#Dm#<=9?1:0$

EDIT: Finished face is here for others to inspect :slight_smile:

Basically I’m trying to make an image of “oh” appear since the string version of the minutes doesn’t spell out a zero integer.

I’ve tried adding a few different things to the expression but am striking out. Anyone know off-hand what I’ve missed?

THANK YOU! :pray:

1 Like

Try this instead:

$#Dm#<=09?100:0$

You will need to place that into the Opacity box of a text element with your “oh” text inside the text box.

3 Likes

Oh gosh, I think I love you - THANK YOU!! I guess I didn’t realize it had to be a value of 100 (but makes sense now from an opacity perspective). From the tutorial it seemed to just be 1 and 0, for show and hide resectively, so I didn’t even think to try adjusting that value.

You’re a king among men. :trophy: Made my day! Thank you again!!

2 Likes

You can also use that same kind of opacity for lesser amounts. Say you only want something on at 50% then your opacity would be 50:0. Or I use it to dim the leading zero on 12-hour time displays, but not on 24-hour time displays.

$#Db#<10&&#DTIMEFORMAT#==12?15:100$

Which in English means if the hour is less than 10 “and” the time format is 12 hour then dim the digit to 15%. If its anything else, then it’s 100%

2 Likes

That’s awesome - thank you! So && is ‘and’ in boolean. I was looking at that earlier thinking it was weird to double up on the ampersand but being new to coding I wasn’t sure exactly how to use it. I made a few little programs in visual basic in high school but that was like… 23 years ago now and the syntax isn’t the same, haha. Very much appreciate the English translation.

Trial and error was getting me nowhere and I KNEW it was something obvious and simple.

Thank you again. Super helpful!

1 Like

Welcome to the Community Erin, it seems @mrantisocialguy has you covered nicely here already, and it’s a nice creation you’ve got going there, well done :+1:

2 Likes

Thank you @icrltd4! Yup we got it covered in one hit and he saved me several more hours of ‘am I dumb?’ frustration! :grin: Very appreciative of the community that’s been established here :slightly_smiling_face:

2 Likes