Nemuritor01 / css-swipe-card

9 stars 1 forks source link

Swipes not working in the browser #5

Open bladecell opened 3 days ago

bladecell commented 3 days ago

Hi, for some reason, the swiping to next card does not work for me on browser, only button navigation. On mobile the swiping works fine. Is it config issue?

type: custom:css-swipe-card
cardId: mainswipecard
template: slider-horizontal
auto_height: true
pagination: true
card_gap: 2rem
height: 10rem
cards:
  - type: custom:button-card
    entity: sensor.hall_temperature
    template: sensor_graph
    variables:
      hr_to_show: 36
      pts_per_hr: 0.3
  - type: custom:button-card
    entity: sensor.total_power_w
    template: sensor_graph
  - type: sensor
    entity: sensor.hall_temperature
    hours_to_show: 12
    detail: 1
    graph: line
    icon: none
    card_mod:
      class: graph
Nemuritor01 commented 3 days ago

Hi, its not your configuration. It's a CSS slider and css is (as far as I know) not capable of handling swipe gestures with a mouse. Therefore you can use pagination or navigation buttons. However, I will check if I can implement some Java code to make this work, but I do not want to transform the slider into "another" Java slider as this css slider should be lightweight and do not need lots of resources. I can't promise, that this will be in the next update, but I will keep you posted.

Nemuritor01 commented 2 days ago

I've implemented a Java script to handle swipe gestures with mouse. Will be implemented in next update.