Skip to content

feat(TwoColorWord.js): implement blinking#86

Closed
IepIweidieng wants to merge 1 commit into
robertabcd:devfrom
IepIweidieng:feat/two-color-word-blinking
Closed

feat(TwoColorWord.js): implement blinking#86
IepIweidieng wants to merge 1 commit into
robertabcd:devfrom
IepIweidieng:feat/two-color-word-blinking

Conversation

@IepIweidieng

@IepIweidieng IepIweidieng commented May 13, 2021

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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