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

Updated: Add partial view of prev and next slide #167

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

intizarahmad
Copy link

@intizarahmad intizarahmad commented Nov 29, 2021

Hi @lyfeyaj,

I took the reference of #2 and fixed few issues:

  1. Now the partial option will support from two slides.
  2. If the continuous option is false the previous and next slides will not be shown if we are on first and last slide respectively.

Here is the demo
Thanks

@lyfeyaj
Copy link
Owner

lyfeyaj commented Dec 8, 2021

Hi @intizarahmad

Good job and thanks for your contribution. 👍

I think that allowing the partial option to accept a boolean value or a number value between 0 and 0.5 might be a more useful way to improve this library's user experience. That means user can adjust the percentage of shown partial slides as needed.

If you have time to make that happen, that will be great 😄

@intizarahmad
Copy link
Author

intizarahmad commented Dec 15, 2021

Hi @lyfeyaj

Now the partial option would accept as Boolean as well as Number between range .01 to .2.
If the partial value is true or a number which is out of range (.01 to .2) the default partial value would be .10

@ltoussaint
Copy link

Thanks @intizarahmad for this useful feature.

Still I have one case where I only want to display a part of the next slide, but not the previous one.
Could it be possible to split the feature for left and right, maybe with partialLeft and partialRight?

@intizarahmad
Copy link
Author

intizarahmad commented Jan 15, 2022

Hi @ltoussaint, I am glad you found this useful.
Thanks for the suggestions, But I can work on those feature in a separate PR, once this PR is approved and got merged by @lyfeyaj.

if (!browser.transitions) {
element.style[slideDir] = (index * -width) + 'px';
}

container.style.visibility = 'visible';

console.log('slidePos', slidePos)
Copy link
Owner

Choose a reason for hiding this comment

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

Please remove console.log from source code

Copy link
Author

Choose a reason for hiding this comment

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

Removed

swipe.js Outdated
@@ -713,6 +814,7 @@
}

function move(index, dist, speed) {
console.log({index, dist, speed})
Copy link
Owner

Choose a reason for hiding this comment

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

Please remove console.log from source code

Copy link
Author

Choose a reason for hiding this comment

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

Removed

swipe.js Outdated

/**
* Setting up defaul partial Width if partial defined but erither its boolean
* of the partial does not seems to be in range of .01 to .20
Copy link
Owner

Choose a reason for hiding this comment

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

Found several typos in above comment

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for reviewing, I have corrected the typos

@lyfeyaj
Copy link
Owner

lyfeyaj commented Feb 14, 2022

Hi @intizarahmad,

I was fully tested features of partial option, and found two strange behaviors:

  1. When clicking next button, three slides won't slide simultaneously, instead, the hidden slide will be slided to next by first and then come the next to middle and middle to prev. Click prev button will behave the same like clicking next button. See below video:
Video.record.2022-02-14.11.45.01.mov
  1. When changing partial from 0.1 to 0.2, the margin between three slides will change unexpectedly. For example: with partial is set to 0.19, the prev and next slides will cover parts of the middle slide, see below image:

image

Hoping these two strange behaviors can be fixed ^_^

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.

3 participants