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 CSS on mouse interaction with card #6636

Merged
merged 16 commits into from
May 6, 2024
Merged

Add CSS on mouse interaction with card #6636

merged 16 commits into from
May 6, 2024

Conversation

ahuang11
Copy link
Contributor

@ahuang11 ahuang11 commented Apr 1, 2024

Better notify the user that it's clickable and makes it feel nicer.

  • Update pointer on hover
  • Lower contrast upon hover
Screen.Recording.2024-04-01.at.2.24.50.PM.mov

@ahuang11 ahuang11 requested a review from philippjfr April 1, 2024 21:26
Copy link

codecov bot commented Apr 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.89%. Comparing base (e9cc695) to head (96b1d8a).
Report is 41 commits behind head on main.

❗ Current head 96b1d8a differs from pull request most recent head 8d61d14. Consider uploading reports for the commit 8d61d14 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #6636       +/-   ##
===========================================
+ Coverage   39.99%   82.89%   +42.89%     
===========================================
  Files         313      313               
  Lines       46103    46119       +16     
===========================================
+ Hits        18438    38229    +19791     
+ Misses      27665     7890    -19775     
Flag Coverage Δ
ui-tests 39.99% <ø> (+<0.01%) ⬆️
unitexamples-tests 71.18% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hoxbro
Copy link
Member

hoxbro commented Apr 2, 2024

Can't this be done with CSS?

@philippjfr
Copy link
Member

Yeah, this should definitely be done with CSS.

@ahuang11
Copy link
Contributor Author

ahuang11 commented Apr 2, 2024

Templates + original with these changes
image
image
image
image

@philippjfr
Copy link
Member

Reducing contrast on hover seems a little counter-intuitive, I'll try to come up with a different visual change but am open to your suggestions.

@ahuang11
Copy link
Contributor Author

ahuang11 commented Apr 2, 2024

Brightness didn't seem to work for me. Opacity is worse than contrast. Transform is a little strange so I stuck with contrast. Color maybe could change to theme accent

  1. Opacity: Adjusting the opacity of an element can create a subtle hover effect.

    .card-button:hover {
      opacity: 0.8;
    }
  2. Brightness: The brightness() filter can be used to control the brightness of an element.

    .card-button:hover {
      filter: brightness(0.8);
    }
  3. Box Shadow: Adding a box shadow can create a sense of depth and highlight on hover.

    .card-button:hover {
      box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    }
  4. Transform Scale: Scaling the element slightly on hover can provide a nice visual effect.

    .card-button:hover {
      transform: scale(1.1);
    }
  5. Color: Changing the color of the element on hover can draw attention.

    .card-button:hover {
      color: #ff0000; /* Change to the desired color */
    }

@philippjfr
Copy link
Member

I'd be okay with a box-shadow of some sort.

@ahuang11
Copy link
Contributor Author

ahuang11 commented Apr 17, 2024

Here's box shadow.

Screen.Recording.2024-04-17.at.11.17.31.AM.mov

@philippjfr philippjfr merged commit 896b7f2 into main May 6, 2024
11 of 14 checks passed
@philippjfr philippjfr deleted the card_mouse_css branch May 6, 2024 17:12
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

5 participants