Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FULL_SCREEN_CLOCK_PADDING_TOP param #223

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ArsNotFound
Copy link
Contributor

Automatically center full screen clock if FULL_SCREEN_CLOCK_PADDING_TOP equals "center"

@Mond1c Mond1c self-requested a review December 17, 2024 13:27
Comment on lines +10 to +19
${c.FULL_SCREEN_CLOCK_PADDING_TOP == "center"
? css`
align-items: center;
width: 100%;
height: 100%;
`
: css`
padding-top: ${c.FULL_SCREEN_CLOCK_PADDING_TOP};
`
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't really like that FULL_SCREEN_CLOCK_PADDING_TOP can be the "center" and the number of pixles.

Perhaps you should enter another constant in the config IS_FULL_SCREEN_CLOCK_CENTERED. Then FULL_SCREEN_CLOCK_PADDING_TOP can be a number, not a string.

Copy link
Contributor Author

@ArsNotFound ArsNotFound Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, but which parameter should take precedence?
For example, we have FULL_SCREEN_CLOCK_PADDING_TOP and IS_FULL_SCREEN_CLOCK_CENTERED in the configuration. What should the program do? I see four options here:

  1. Just add padding to the clock
  2. Just center the clock
  3. Center and add padding to the clock (padding is calculated from the center)
  4. Add padding and center the clock (the center is shifted by the padding)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If our value IS_FULL_SCREEN_CLOCK_CENTERED is true, we will center the clock. Just do something like this:

${c.IS_FULL_SCREEN_CLOCK_CENTERED
     ? css`
          // your code
        `
      : css`
           // your code
`
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants