Giter Club home page Giter Club logo

zoomist's People

Contributors

cotton123236 avatar dependabot[bot] avatar frnhr 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

zoomist's Issues

React NextJS: external CSS error

Great lib, but I am struggling to get it function in a React - NextJS project.
It seems that the provided Zoomist distribution is not self-contained, I already tried to add SASS dependency but it only works for storybook. The real app says this:

./node_modules/zoomist/src/scss/index.scss
Global CSS cannot be imported from within node_modules.
Read more: https://nextjs.org/docs/messages/css-npm
Location: node_modules/zoomist/src/index.js

But why it refers to src at all?

There is a solution however:

Instead of

import Zoomist from "zoomist"

write

import Zoomist from "zoomist/dist/zoomist.min.js";
import "zoomist/dist/zoomist.min.css";

But this is not very nice in a React app...

Multiple Images

Hello @cotton123236 , thanks for your library. What do we do if we have several images? Because the wrapper is for a single image and not several. Thanks Nicolas

Zoomend event

Hi
I noticed that the image position always shifts after zooming, but the data from the on.zoom() event is the data before zooming. I would like to know if it is possible to get the coordinates of the image after zooming.

Horizontal scroll breaks zoom

repro:

  1. Load the demo page.
  2. Try to scroll horizontally (I'm using the touchpad on a laptop).

Zooming breaks in any direction after attempting to scroll horizontally.

Unable to resolve path to module 'zoomist/css'.

Having the issue with css - import 'zoomist/css';
The above results with:
Cannot find module 'zoomist/css' from 'src/components/organisms/Component1.tsx'.

If I disable the error it works in storybook, but jest tests fail. Any idea?

please help on not found element issue

  • my Component

constructor(config: NgbCarouselConfig) {
config.interval = 100000000;
config.wrap = false;
config.keyboard = false;
config.pauseOnHover = false;

new Zoomist(".cat-zoomist", {
  maxScale: 5,
  slider: true,
  zoomer: true
});

}

  • my style.scss
  .cat-zoomist {
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.cat-zoomist .zoomist-image {
    aspect-ratio: 4 / 3;
}

.cat-zoomist img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

this is my code , i'm not sure why there is an issue happen , do you have any advice ? my angular version is 7

CarouselComponent_Host.ngfactory.js:1 ERROR Error: Element .cat-zoomist is not exist.

Zoom overpasses the limit

Screenshot_20220511_173038

you can go as much as you want by zooming out even tho the scrolling bar says it is at its limit.

Small bugs in your introduction/readme

Script tag include

<link rel="stylesheet" src="zoomist.min.css"/>
<script src="zoomist.min.js"></script>
<link rel="stylesheet" src="https://cdn.jsdelivr.net/gh/cotton123236/zoomist@latest/dist/zoomist.min.css"/>            
<script src="https://cdn.jsdelivr.net/gh/cotton123236/zoomist@latest/dist/zoomist.min.js"></script>

All need to be href not src

Basic Usage Section

const myZoomist = document.querySelector('#my-zoomist')
new Zoomist(zoomistElement, {

Is myZoomist suppost to be zoomistElement?

Reset button

It would be nice to add a reset button under zoomist-zoomer, for example )

Module parse failed error when using it in an angular project.

Below you find the compilation error which I am getting.

./node_modules/zoomist/src/scss/index.scss:1:0 - Error: Module parse failed: Unexpected token (1:0)
File was processed with these loaders:

  • ./node_modules/resolve-url-loader/index.js
  • ./node_modules/@angular-devkit/build-angular/node_modules/sass-loader/dist/cjs.js
    You may need an additional loader to handle the result of these loaders.

.zoomist-container {
| position: relative;
| touch-action: none;

Issue with Angular v17

After Angular update to V17, the current version of Zoomist ("zoomist": "^1.1.1") throws following error during build:

./node_modules/zoomist/src/scss/index.scss?ngGlobalStyle:1:0 - Error: Module parse failed: Unexpected token (1:0)
File was processed with these loaders:

  • ./node_modules/resolve-url-loader/index.js
  • ./node_modules/sass-loader/dist/cjs.js
    You may need an additional loader to handle the result of these loaders.

.zoomist-container {
| position: relative;
| touch-action: none;

Using the newer version of Zoomist 2 ("zoomist": "^2.0.11" ) resolves the above issue, but throws up a different error during build:

Error: Can't resolve 'node_modules/zoomist/src/scss/index.scss'

Can I use the click event

Hi, great work on this library. I want to use this and after zooming and dragging use the click event to get coordinates of the position I clicked on the image. But it seems I am not able to use the click event. Can I override this somehow?

Regards
Mark

Set zoom focal point

at the moment, using the zoom buttons uses the center of the image as the focal point to zoom into. this is not really useful, when e.g. using zoomist to generate a profile image or avatar. for that use case it would be great to add a setting, that uses the center of the wrapper as the focal point.

Trying to get the Image base64 encoded that is the result of the zoom and transform

Hi, thanks for building Zoomist... is far the best zoom library.
I have used without issues and works brilliantly but now I need to get back the image that has been transformed as base64 to be uploaded in the server.

I have tried several things but the image is just stays as the original image and I can see only the styles properties changing so I don't have a way to get the new image fully transformed.

If you can please help.

Rotate Image?

I'm using zoomist with images that are being pulled in via an API, so they're of a set width, height, orientation, etc. It's working great but one thing that would be beneficial for my project is if the images were landscape as opposed to their original portrait. I have naturally tried doing this with CSS but Zoomist hates it because it's accounting for the image being portrait as opposed to landscape so it won't fit well in it's container and it sends the panning of the image off as well.

In short, is there any way to rotate an image in Zoomist which keeps the pan and zoom functionality intact?

Not working on Desktop Safari

An error is raised when trying to use this library on Safari Desktop due to the use of TouchEvent (see caniuse)

ReferenceError: Can't find variable: TouchEvent

Is it possible to fix it ?

Add accessibility to Zoom buttons

Currently the zoom buttons (+/-) are SVGs and some browser does not support focus for SVG.
We are working on application that supports accessibility and tabbing/focusable is a must.

It would be great if these buttons are focusable.
Thanks

TS definitions

Hi there! I didn't know any other place to reach you, so here I am.
I've made Ts definitions for your library on DefinitelyTyped, maybe you wouldn't mind to review them and help me maintain them?
I'm using them in a tricky way through my git repo, so I want them to be published ASAP.
Thanks in advance for your assistance!

Zoomist v2.0 does not work

Zoomist v2.0 no longer works.

Using the CDN version - https://cdn.jsdelivr.net/gh/cotton123236/zoomist@latest/dist/zoomist.min.js

The following error is displayed in Chrome:

zoomist.min.js:7
Uncaught SyntaxError: Unexpected token 'export' (at zoomist.min.js:7:17636)

And in Firefox:

zoomist.min.js:7
Uncaught SyntaxError: export declarations may only appear at top level of a module

This appears in all version 2 packages.

The last working commit was on 11 August 2022.
https://github.com/cotton123236/zoomist/tree/bdf1158e9022c6eb161ad92095c703df855c0508

This version includes the dist/zoomist.min.js file which works correctly.

Maybe touch-action:none; only after first Zoom Event ?

I would really like to use Zoomist in a current project, unfortunately, if implement on mobile the whole image container becomes a "deadzone" for scrolling. Especially when a bigger portrait image occupies a lot of screen real estate, the user has to search for some left over whitespace to continue scrolling.

To counter this problem, I was planning to set the container class to touch-action: manipulation; and change it to none in case of a zoom event.

From my understanding, I would have to give every container some kind of id-name and have it initialised separately.
Is it possible, to keep that naming global and trigger that css change with zoom(zoomist, scale) {...} only for the zoomist-container that is being used ?

Update @types/zoomist

Currently @types/zoomist still has data structure of version 1.1.0
While in the latest version (1.1.1), some data structure have been modified/updated.

Would you update the data structure in @types/zoomist and publish the package for version 1.1.1

Zoomist in slideshow UIKit

Hi. Thanks for the script. It works fine, but there is a situation. I'm building a slide show on UIKit using the
Zoomist.
The first slide works fine, but when the inactive slide becomes active (gets uk-active class) the zoomist-image has no size, i.e. style="width: 0px; height: 0px; left: 0px; top: 0px;" fill: "contain" is set in the parameters

If fill: "none", then zoomist-image is sized, but the left, top position is broken and the image crawls off the screen.

error

Uncaught SyntaxError: Unexpected token 'export' (at zoomist.min.js:7:17636)

Initial Zoom state

Hi there. Is there a way to begin with an initial zoom and position state? For example, I would like an initial zoom of around 0.8, then allow people to zoom out to see the whole image. Alongside that, can I set an offset to the image, so the image shows a particular place first? Thank you for your time!

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.