Giter Site home page Giter Site logo

naver / egjs-flicking-plugins Goto Github PK

View Code? Open in Web Editor NEW
60.0 10.0 12.0 1.28 MB

Plugins for @egjs/flicking

Home Page: https://naver.github.io/egjs-flicking/Plugins

License: MIT License

JavaScript 21.81% TypeScript 58.98% CSS 4.27% HTML 14.94%
flicking flick effect egjs swipe carousel slider

egjs-flicking-plugins's People

Contributors

daybrush avatar granberia avatar gusrb3164 avatar malangfox avatar marco-adapttech avatar rudyblack avatar woodneck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

egjs-flicking-plugins's Issues

Bullet navigation should override moveType constraints

Description

Experiencing some odd behaviour with this;

If I have 4 panels and use moveType: 'strict' (1 panel at a time), clicking the 1st bullet when I'm on the 4th panel flicking flicks to the 3rd panel, but the 1st bullet becomes the "active" one.

Changing to moveType: 'snap' fixes the issue, but I prefer the UX of 'strict' for my case.

Steps to check or reproduce

Should be pretty easy to reproduce, but in case it isn't, my context is
Vue3 in Google Chrome Version 100.0.4896.88 (Official Build) (64-bit) on Arch Linux

Export plugin option interfaces?

Description

Not an issue, more of a suggestion for ease-of-access and maintainability.

For reference, my use-case is that I'm making a Vue3+TS single-file "Carousel" component, and I want to control the <Flicking> component's plugins prop, with props for my <Carousel>

// <script setup lang="ts">
import { defineProps, computed, PropType } from "vue";
// What I want to do:
// import { Pagination, PaginationOptions, Arrow, ArrowOptions, ... } from "@egjs/flicking-plugins";

// What I'm doing:
// interface PaginationOptions  {
//    parentEl: HTMLElement | null, 
//    ...copy everything from the PaginationOptions in this repo
// }
// interface ArrowOptions { ... }
// interface FadeArguments { ...Β }
// and so on


const props = defineProps({
  pagination: { type: Object as PropType<Partial<PaginationOptions> | null>, default: null },
  // same idea for arrows, autoplay, fade, parallax, sync
});
const plugins = computed(() => {
  return [ 
    props.pagination && new Pagination(props.pagination),
    // props.arrow && new Arrow(props.arrow), and so on
   ];
})

so that I can instantiate my Carousel component like this

<!-- Use default Pagination plugin options -->
<Carousel :pagination="{}">

<!-- Don't use the Pagination plugin-->
<Carousel>

<!-- Use Pagination plugin and overwrite some default pagination options -->
<Carousel :pagination="{ type: 'fraction' }">

Steps to check or reproduce

How can use this in CDN?

<script src="https://unpkg.com/@egjs/[email protected]/dist/flicking.pkgd.min.js"></script>
<script src="https://naver.github.io/egjs-flicking-plugins/release/latest/dist/plugins.min.js"></script>
<link rel="stylesheet" href="https://naver.github.io/egjs-flicking-plugins/release/latest/dist/flicking-plugins.css">
<link rel="stylesheet" href="https://unpkg.com/@egjs/[email protected]/dist/flicking.css">
<script>
  const flicking = new Flicking("#Carousel", {align: "center", circular: true, bound: true, renderOnlyVisible: true, useFractionalSize: true, align: "prev"})
  flicking.addPlugins(new Arrow());
</script>

Arrow is not defined.
How can use arrow plugin by CDN?

Expose start() and stop() functions on AutoPlay?

Description

Just a suggestion. Would love to be able to control this plugin a bit more (e.g. stopping on a specific index, stopping on focus inside panel, etc) instead of just stopping on hover πŸ˜ƒ

Steps to check or reproduce

Pagination의 type값쀑 'scroll'을 'bullet'으둜 λ³€κ²½ν•˜κ³  scroll에 λŒ€ν•œ μΆ”κ°€ μ˜΅μ…˜μ„ μ§€μ •ν•˜λŠ” λ°©μ‹μœΌλ‘œ λ³€κ²½ν•˜λ©΄ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€./It would be good to change 'scroll' to 'bullet' among the type values of pagination and change it to specify additional options for scroll.

Description

typeκ°’ 쀑 bulletκ³Ό fraction은 UI의 ν˜•νƒœλ₯Ό κ΅¬λΆ„ν•˜μ—¬ 지어진 이름인데 λ°˜ν•΄, scroll은 ν˜•νƒœκ°€ μ•„λ‹Œ κΈ°λŠ₯ 일뢀('bullet' νƒ€μž…μΈλ° bullet λͺ‡ 개만 ν‘œμ‹œ, νŒ¨λ„ index에 따라 bullet μ»¨ν…Œμ΄λ„ˆλ₯Ό μŠ€ν¬λ‘€ν•¨)에 초점이 λ§žμΆ°μ§„ μ΄λ¦„μ΄λ―€λ‘œ bullet νƒ€μž…μ˜ μ„ΈλΆ€ μ˜΅μ…˜μœΌλ‘œ μ •μ˜λ˜λŠ” 것이 μ’€ 더 μžμ—°μŠ€λŸ¬μš΄ 것 κ°™μ•„ λ³΄μž…λ‹ˆλ‹€. μ˜ˆμ‹œ μ½”λ“œλŠ” μ½”λ“œ1 을 μ°Έμ‘° λΆ€νƒλ“œλ¦½λ‹ˆλ‹€.


Among the type values, bullet and fraction are names that distinguish the shape of the UI, whereas scroll is a part of a function rather than a shape ('bullet' type, but only a few bullets are displayed, and the bullet container is scrolled according to the panel index) ), so it seems more natural to be defined as a detailed option of type bullet. For example code, please refer to Code 1.

μ½”λ“œ1 - bullet νƒ€μž…μ˜ μΆ”κ°€ νŒŒλΌλ―Έν„° μ •μ˜ μ˜ˆμ‹œ
Code 1 - Example of defining additional parameters of bullet type

new Pagination({
  type: 'bullet',
  param: {
    // ν‘œμ‹œν•  bullet 개수. μƒλž΅μ‹œ 전체 ν‘œμ‹œ. 전체 값보닀 클 수 μ—†κ³ , 0μ΄ν•˜ κ°’ μ§€μ •μ‹œ bullet λΉ„ν‘œμ‹œ
    display: 5,
     // bullet의 ν˜•νƒœλ₯Ό κ²°μ •ν•˜λŠ” κ°’. A, BλŠ” μž„μ˜λ‘œ μ§€μ •ν•œ 값이며 ν•΄λ‹Ή bulletν˜•νƒœλ₯Ό 더 잘 μ„€λͺ…ν•˜λŠ” λ‹¨μ–΄λ‘œ λŒ€μ²΄λ  수 있으며 ν•„μš”μ‹œ μƒˆλ‘œμš΄ νƒ€μž…μ˜ μ •μ˜λ„ κ°€λŠ₯ν•©λ‹ˆλ‹€.
    // 'A': ν˜„μž¬ Pagination bullet 데λͺ¨μ™€ λ™μΌν•œ ν˜•νƒœ. 쀑간 index일 λ•Œλ§Œ display 개수 λ…ΈμΆœ 보μž₯. 처음과 끝 뢀뢄에선 ν•œ λ‘κ°œκ°€ 적을 수 있음
    // 'B': 항상 display 개수 만큼의 λ…ΈμΆœμ„ 보μž₯. 쀑간 index일 λ•ŒλŠ” 항상 1번 5번 bullet이 μž‘κ²Œ ν‘œμ‹œλ¨. 처음과 끝일 λ•ŒλŠ” 각각 졜우츑과 졜쒌츑 bullet이 μž‘κ²Œ ν‘œμ‹œλ¨
    shape: 'A'
  },
});

μŠ€ν¬λ¦°μƒ·1 - Pagination μƒμ„±μžμ˜ type μ˜΅μ…˜
Screenshot 1 - type option in Pagination constructor
image

Steps to check or reproduce

AutoPlay ν”ŒλŸ¬κ·ΈμΈ μ‚¬μš© μ‹œ 단말기 μ‹œκ°„ λ³€κ²½ ν›„ λΉ λ₯΄κ²Œ λ„˜μ–΄κ°€λŠ” ν˜„μƒ 문의

Description

μ•ˆλ…•ν•˜μ„Έμš”, Flicking AutoPlay μ‚¬μš© 쀑에 QAκ°€ λ°œμƒν•˜μ—¬ λ¬Έμ˜λ“œλ¦½λ‹ˆλ‹€.
ν•΄λ‹Ή ν”ŒλŸ¬κ·ΈμΈ μ‚¬μš© μ‹œ 단말기 μ‹œκ°„μ„ λ³€κ²½ν•œ ν›„ λ‹€μ‹œ μ ‘κ·Όν–ˆμ„λ•Œ ν”Œλ¦¬ν‚Ή μ˜μ—­μ΄ λΉ λ₯΄κ²Œ λ„˜μ–΄κ°€λŠ” ν˜„μƒμ΄ μ•„λž˜μ™€ 같이 λ°œμƒν•˜κ³  μžˆμŠ΅λ‹ˆλ‹€.

iOS

RPReplay_Final1713284590.mp4

Android

Screen_Recording_20240417_065108_Settings.mp4

ν˜Ήμ‹œ ν•΄λ‹Ή ν˜„μƒ μˆ˜μ •μ΄ κ°€λŠ₯할지 λ¬Έμ˜λ“œλ¦½λ‹ˆλ‹€ πŸ™‡β€β™‚οΈπŸ™‡β€β™‚οΈ

κ°μ‚¬ν•©λ‹ˆλ‹€

Steps to check or reproduce

Arrow and Pagination(Bullet) plugins have to click two times to move panel

Description

I face the problem about Arrow and Pagination(Bullet) plugin. It has to click two times to move panel.

Steps to check or reproduce

I created a sample project on Codesandbox. You could check on this link.

Dependencies

@egjs/flicking-plugins: 4.1.0
@egjs/vue-flicking: 4.1.2
vue: 2.6.11

Reproduce

Open the website from this project, and click to navigate panel by clicking on arrow or bullet.
Screen Shot 2564-07-19 at 22 32 30

Pause autoplay animation on hover

Description

I'm trying to reach a marquee effect. My configuration is working fine and smooth. The only issue I encountered is when I hover the slider it gets paused correctly but only when it reaches the next slide, aka I would like to have the possibility to interrupt the animation while slide is actually changing. In the video below you can see the behaviour of the bottom slider (flicking) and the top slider (another library - splidejs -):

Video.senza.titolo.-.Realizzato.con.Clipchamp.2.mp4

I would like to have the same pause behaviour of the top slider. Also this Splide plugin has some performance issues so I would like to switch to flicking if possible.

Steps to check or reproduce

Svelte

import Flicking, { FlickingPanel } from '@egjs/svelte-flicking';
import { AutoPlay } from '@egjs/flicking-plugins';
import '@egjs/svelte-flicking/dist/flicking.css';

let flicking: Flicking;
const plugins = [
	new AutoPlay({ duration: 0, animationDuration: 3000, direction: 'NEXT', stopOnHover: true })
];

<Flicking
	bind:this={flicking}
	{plugins}
	hideBeforeInit={true}
	firstPanelSize="16rem"
	options={{
		align: 'center',
		circular: true,
		easing: (x) => x,
                interruptable: true,
		autoResize: true,
		moveType: 'freeScroll'
	}}
>
	{#each slides as slide, i}
		<FlickingPanel class="h-36 !w-64 !mb-8">
			CONTENT
		</FlickingPanel>
	{/each}
</Flicking>

AutoPlay ν”ŒλŸ¬κ·ΈμΈ κ΄€λ ¨ 질문

Description

μ•ˆλ…•ν•˜μ„Έμš”. AutoPlay ν”ŒλŸ¬κ·ΈμΈμ„ μ‚¬μš©ν•˜λ˜ 쀑 κΆκΈˆν•œ 점이 생겨 질문 λ“œλ¦½λ‹ˆλ‹€.
duration은 μ• λ‹ˆλ©”μ΄μ…˜μ—μ„œ ν•΄λ‹Ή 탭이 μœ μ§€λ˜λŠ” μ‹œκ°„μ΄λΌκ³  μ΄ν•΄ν–ˆλŠ”λ°μš”.
ν˜Ήμ‹œ λ‹€μŒ νƒ­κΉŒμ§€ μ΄λ™ν•˜λŠ”λ°μ— κ±Έλ¦¬λŠ” μ‹œκ°„(speed)λ₯Ό μ‘°μ ˆν•  수 μžˆλŠ” parameterκ°€ μžˆμ„κΉŒμš”?

κ°μ‚¬ν•©λ‹ˆλ‹€.

Arrow and Bullet touchstart listeners should be passive

Description

As far as I can tell, both Arrow and Bullet plugins are the only ones that listen for the touchstart event. This event should be a passive listener to improve scrolling performance per Lighthouse and https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md. It does not look like these listeners use preventDefault(), only stopPropagation(), so it shouldn't be too much of a change.

Hammer.js also exhibits this problem, though I don't know what is calling hammer's addEventListener function

I modified the dist files locally and don't see any regressions.

Steps to check or reproduce

I can produce one if needed

Component render empties flicking-pagination-bullets

Description

Component render empties the bullets container. If no re-render appears, the plugin works well. But if state change causes component re-render then bullets disappear.

The situation happens in React.js.

Steps to check or reproduce

const flickingRef = useRef<Flicking | null>(null);
const plugins = [new Pagination({ type: "bullet" })];
const [isMoving, setIsMoving] = useState(false);

const handleMoveStart = () => {
    setIsMoving(true);
};

const handleMoveEnd = () => {
    setIsMoving(false);
};

<Flicking
            ref={flickingRef}
            circular={true}
            align="prev"
            onMove={handleMoveStart}
            onMoveEnd={handleMoveEnd}
            plugins={plugins}
          >
            <div className="recommendation-box">
                container1
            </div>
            <div className="recommendation-box">
                container2
            </div>
            <div className="recommendation-box">
                container3
            </div>
            <div className="recommendation-box">
                container4
            </div>
            <ViewportSlot>
              <div className="flicking-pagination"></div>
            </ViewportSlot>
          </Flicking>

When onMove and onMoveEnd handlers modify state, causing component rerender, then

<div class="flicking-pagination flicking-pagination-bullets">
<span class="flicking-pagination-bullet flicking-pagination-bullet-active"></span>
<span class="flicking-pagination-bullet"></span>
<span class="flicking-pagination-bullet"></span>
<span class="flicking-pagination-bullet"></span>
</div>

becomes

<div class="flicking-pagination flicking-pagination-bullets"></div>

Issues on dragging arrows

Description

I have the problem that the arrows do not go by themselves, one step forward or back. Also, the arrows can be dragged so that it can move. (see video)

Documentation I followed: https://naver.github.io/egjs-flicking/Plugins

Steps to check or reproduce

<script setup lang="ts">
import Flicking from "@egjs/vue3-flicking";
import {Arrow} from "@egjs/flicking-plugins";

const plugins = ref([new Arrow()]);

function test() {
    console.log('button works')
}
</script>
<template>
<Flicking
    ref="swiper"
    :plugins="plugins"
    :options="{ circular: true }"
    class="w-full h-full"
>
    <div
        class="h-full w-full flex bg-cover rounded-md"
        :key="img.id"
        v-for="img in resort.media"
        :style="`background: url('${img.original_url}'); background-size: cover;`"
    >
    </div>
    <template #viewport>
        <span @click="test" class="flicking-arrow-prev"></span>
        <span class="flicking-arrow-next"></span>
    </template>
</Flicking>
</template>
<style scoped>
@import url("@egjs/vue3-flicking/dist/flicking.css");
@import url("@egjs/flicking-plugins/dist/flicking-plugins.css");
@import url("@egjs/flicking-plugins/dist/arrow.css");
</style>

Video

Bildschirmaufnahme.2023-09-29.um.11.33.05.mov

Pagination bullet is not showing

Description

Version I use :
"@egjs/flicking-plugins": "^4.2.1",
"@egjs/ngx-flicking": "^4.3.0",

I tried the pagination plugin as described in the document, but it is not rendered.
I found that DOM has been created, but the height is 0, and the font-size of each bullet is 0 as well.
However, when I set the type as "fraction", it worked just fine.

Steps to check or reproduce

AutoPlay doesn't work when there are multiple flickings.

Version I use :
"@egjs/flicking-plugins": "^4.2.1",
"@egjs/ngx-flicking": "^4.3.0",

Hello, @WoodNeck !

It seems like that AutoPlay doesn't work when there are multiple flickings.
Here I attach my code snippets below:
https://codesandbox.io/s/nifty-moon-fu0fx?file=/src/app/app.component.html

And sometimes I found that the multiple autoplay works when I resize the browser window, but I couldn't reproduce this symptom in the demo.

By the way, I really enjoy your work here! Thank you for this awesome component.

μ»€μŠ€ν…€ plug-inκ°œλ°œμ„ μœ„ν•œ API μ°Έμ‘° λ¬Έμ„œκ°€ ν•„μš”ν•©λ‹ˆλ‹€./API reference documentation for custom plug-in development is required.

Description

plug-inκ°œλ°œμ„ μœ„ν•œ μ°Έμ‘° λ¬Έμ„œκ°€ μ—†λŠ” 것 κ°™μŠ΅λ‹ˆλ‹€. μ»€μŠ€ν…€ plug-in의 개발 ν˜Ήμ€ κΈ°μ‘΄ 개발된 plug-in의 μ»€μŠ€ν„°λ§ˆμ΄μ§•λ“±μ„ μœ„ν•΄μ„œλŠ” κ΄€λ ¨ λ‚΄μš©μ΄ μ •λ¦¬λœ λ¬Έμ„œκ°€ ν•„μš”ν•©λ‹ˆλ‹€. λ¬Έμ„œ μ œμž‘ λΆ€νƒλ“œλ¦½λ‹ˆλ‹€.

There seems to be no reference documentation for plug-in development. In order to develop a custom plug-in or to customize an existing plug-in, a document with related contents is required. Please create a document.

Steps to check or reproduce

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.