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 separator to mark last turn transition #68

Merged
merged 2 commits into from Apr 28, 2020

Conversation

Neicigam
Copy link
Contributor

No description provided.

Comment on lines 45 to 47
{props.cardsThisTurn === index + 1 && index !== 5 && (
<CardLogSeparator />
)}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don’t think inserting an extra element alongside the columns is necessary. I think we should be able to apply an extra class to all cards that are the first in a turn. Something like:

<Image
  wrapperClassName={[
    'DryRunnerCardLog__image-wrapper',
    props.cardsThisTurn === index + 1 &&
      index !== 5 &&
      'DryRunnerCardLog__image-wrapper--turn',
  ].filter(Boolean)}
  className='DryRunnerCardLog__image'
  src={card.image}
  alt={card.name}
  onClick={() => setZoomedCard(card)}
  data-testid='card-log-image'
/>

Then on the CSS:

.DryRunnerCardLog__image-wrapper--turn::after {
  content: '';
  position: absolute;
  right: -0.5em;
  height: 80%;
  top: 50%;
  width: 1px;
  transform: translateY(-50%);
  background: linear-gradient(
    to bottom,
    transparent,
    var(--dark-beige),
    transparent
  );

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, and for the pseudo element to be able to be absolutely positioned, .DryRunnerCardLog__image-wrapper needs to be position: relative.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Great it looks amazing!!

@@ -6,7 +6,7 @@ import Row from '../Row'
import arrayPad from '../../helpers/arrayPad'
import './index.css'

const DryRunnerCardLog = React.memo(props => {
export default React.memo(function DryRunnerCardLog(props) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thank you! 👍

@KittySparkles KittySparkles merged commit 521938a into Stormbound-Games:master Apr 28, 2020
@Neicigam Neicigam deleted the add-sep branch April 28, 2020 19:47
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.

None yet

2 participants