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

feat(TwoColorWord.js): implement blinking #86

Closed
wants to merge 1 commit into from
Closed

feat(TwoColorWord.js): implement blinking #86

wants to merge 1 commit into from

Conversation

IepIweidieng
Copy link
Contributor

@IepIweidieng IepIweidieng commented May 13, 2021

TwoColorWord achieves the two-color-word effect by adding a half-word overlay to a full-width character ("word").

By making use of the overlay, the blinking effect can be achieved by the following cases:

  • Only the tail blinks: Overlay the head and blink only the underneath word
  • Only the head blinks: Overlay the tail and blink only the underneath word
  • Both blink: Overlay the head and blink both the underneath word and the overlay

For overlaying the tail, a negative text-indent is applied to the overlay to truncate off the left half of the overlay character.

The background color is handled by the .b* CSS classes but was also affected by the .qq* classes. This further complicated the TwoColorWord blinking implementation.

Therefore, I removed the .qq* classes, except for the .qq class, which does not affect the background color.

Demonstration:
PttChrome 2021-05-14 TwoColorWord blinking

@IepIweidieng

This comment has been minimized.

@IepIweidieng

This comment has been minimized.

TwoColorWord achieves the two-color-word effect
by adding a half-word overlay to a full-width character ("word").

By making use of the overlay,
the blinking effect can be achieved by the following cases:
* Only the tail blinks: Overlay the head and blink only the underneath word
* Only the head blinks: Overlay the tail and blink only the underneath word
* Both blink: Overlay the head and blink both the underneath word and the overlay

For overlaying the tail,
a negative text-indent is applied to the overlay
to truncate off the left half of the overlay character.

The background color is handled by the .b* CSS classes
but was also affected by the .qq* classes.
This further complicated the TwoColorWord blinking implementation.

Therefore, I removed the .qq* classes,
except for the .qq class, which does not affect the background color.

* src/components/Row/WordSegmentBuilder/ColorSpan.js
    * Use CSS class .qq for the blinking effect
* src/components/Row/WordSegmentBuilder/TwoColorWord.js
    * Add implementation description
    * Implement blinking
* src/css/color.css
    * Use class .qq for the blinking effect solely and remove other .qq* classes
@IepIweidieng
Copy link
Contributor Author

Superseded by #102, where a simpler implementation is given. Closed.

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.

1 participant