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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
import React from "react";
import ContestClock from "../../molecules/Clock";
import styled from "styled-components";
import styled, { css } from "styled-components";
import c from "../../../config";

const ClockWrapper = styled.div`
display: flex;
justify-content: center;

padding-top: 240px;
${c.FULL_SCREEN_CLOCK_PADDING_TOP == "center"
? css`
align-items: center;
width: 100%;
height: 100%;
`
: css`
padding-top: ${c.FULL_SCREEN_CLOCK_PADDING_TOP};
`
}
Comment on lines +10 to +19
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
`
}


font-family: ${c.FULL_SCREEN_CLOCK_FONT_FAMILY};
font-size: ${c.FULL_SCREEN_CLOCK_FONT_SIZE};
Expand Down
1 change: 1 addition & 0 deletions src/frontend/overlay/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ config.PICTURE_NAME_FONT_FAMILY = config.GLOBAL_DEFAULT_FONT_FAMILY;
// not used
config.TEAMVIEW_SMALL_FACTOR = "50%"; // css property

config.FULL_SCREEN_CLOCK_PADDING_TOP = "240px";
config.FULL_SCREEN_CLOCK_FONT_SIZE = "400px";
config.FULL_SCREEN_CLOCK_COLOR = "#eeeeee";
config.FULL_SCREEN_CLOCK_FONT_FAMILY = "Helvetica; monospace";
Expand Down
Loading