All Projects → nickmcmillan → react-pig

nickmcmillan / react-pig

Licence: other
Arrange images in a responsive, progressive-loading grid managed in JavaScript using CSS transforms.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

Projects that are alternatives of or similar to react-pig

photos
"Fx Fotos" is an opensource gallery app in react native with the same smoothness and features of Google Photos and Apple Photos. It is backend gnostic and connects to decentralized backends like "box", "Dfinity", "Filecoin" and "Crust".
Stars: ✭ 620 (+1219.15%)
Mutual labels:  gallery, google-photos
Ownphotos
Self hosted alternative to Google Photos
Stars: ✭ 2,587 (+5404.26%)
Mutual labels:  gallery, google-photos
google-photos-vue
Google Photos album viewer built with Vue.js
Stars: ✭ 17 (-63.83%)
Mutual labels:  gallery, google-photos
vimeography
The easiest way to display beautiful video collections on your WordPress site.
Stars: ✭ 14 (-70.21%)
Mutual labels:  gallery
envadrouille
Fast and customizable photo gallery.
Stars: ✭ 18 (-61.7%)
Mutual labels:  gallery
myphotoshare
MOVED TO GITLAB! --- A Web 2.0 Photo Gallery Done Right via Static JSON, Dynamic Javascript and a bit of php for sharing
Stars: ✭ 12 (-74.47%)
Mutual labels:  gallery
PrivateGalleryCreator
Create private extension galleries for Visual Studio
Stars: ✭ 96 (+104.26%)
Mutual labels:  gallery
Sphinx Gallery
Sphinx extension for automatic generation of an example gallery
Stars: ✭ 239 (+408.51%)
Mutual labels:  gallery
vuerollr
Mouseover gallery plugin for Vue.js
Stars: ✭ 23 (-51.06%)
Mutual labels:  gallery
fancybox
jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable.
Stars: ✭ 7,261 (+15348.94%)
Mutual labels:  gallery
chaos-sticker-collection
A collection of chaos event / nerd culture related stickers.
Stars: ✭ 36 (-23.4%)
Mutual labels:  gallery
MediaSliderView
Pure java based, highly customizable media slider gallery supporting both images and videos for android.
Stars: ✭ 85 (+80.85%)
Mutual labels:  gallery
Marquee
A powerful implementation of Marquee(scrolling text or label) in SwiftUI, which supports any content view, including text(label), image, video, etc.
Stars: ✭ 44 (-6.38%)
Mutual labels:  gallery
Selfhosted-Google-Photos-Alternative
A complete guide on exiting Google, Amazon or any proprietary service Photos storage with all the features you would want.
Stars: ✭ 143 (+204.26%)
Mutual labels:  gallery
SSImagePicker
Easy to use and configurable library to Pick an image from the Gallery or Capture an image using a Camera... 📸
Stars: ✭ 227 (+382.98%)
Mutual labels:  gallery
PixelCrop
A Crop library like Google Photos
Stars: ✭ 52 (+10.64%)
Mutual labels:  google-photos
Tikz
Galley of Tikz drawings.
Stars: ✭ 251 (+434.04%)
Mutual labels:  gallery
meiupic
简洁好用的多用户图片社区。
Stars: ✭ 165 (+251.06%)
Mutual labels:  gallery
gallerize
Create a static HTML/CSS image gallery from a bunch of images.
Stars: ✭ 19 (-59.57%)
Mutual labels:  gallery
GPhotoApp
This is a GAS library for retrieving and creating the albums and media items using Google Photo API using Google Apps Script (GAS).
Stars: ✭ 25 (-46.81%)
Mutual labels:  google-photos

react-pig

Arrange images in a responsive, progressive-loading grid managed in JavaScript using CSS transforms.

View Demo

NPM npm bundle size JavaScript Style Guide

A re-implementation of @schlosser's pig.js in React.

Instead of hosting images locally I've used Cloudinary - an image hosting provider, which adds the benefit of on-the-fly image resizing. So we don't need to worry about managing/generating multiple versions of an image at different resolutions. Like the original version of Pig.js we still need to provide an array of objects containing metadata about each image. I've created a node script upload.js to do this for us, see below section on upload.js.

In addition each image is now clickable and will expand to the center of the screen. It uses React Spring to handle the transition.

React-pig-utils

React Pig requires that a specific JSON format be supplied. So this project comes with a companion repo which provides utilities for doing that. Check it out here react-pig-utils.

Example usage of react-pig

yarn add react-pig
# or
npm i react-pig
import Pig from 'react-pig'
import imageData from './imageData.json' // the file generated by using react-pig-utils

class App extends Component {
  render() {
    return (
      <Pig
        imageData={imageData} // Array. Required.
        groupByDate // Boolean. Optional. Groups images by 'date' value. And uses the first 'location' in the group for the heading text.
        gridGap={10} // Integer. Optional. Defaults to 8
        expandedSize={1600} // Integer. Optional. Expanded image will be loaded in that size. Defaults to 1000
        thumbnailSize={25} // Integer. Optional. Thumbnail image will be loaded in that size. Defaults to 10
        sortFunc={(a, b) => a.imageOrder > b.imageOrder} // Function. Optional. Used for sorting images f.ex. if you add custom fields to the json file
        bgColor="#fff" // String. Optional. Used for outlines when image is expanded, and for group headings
        getUrl={(url, pxHeight) => {
          // Pig calls this function every time it needs to fetch an image.
          // The url arg will be provided as is from imageData
          // Assuming the imageData was generated using upload.js, the url string will contain {{HEIGHT}}
          // The purpose of this function is to replace {{HEIGHT}} value with a dynamic value (which is passed in with pxHeight)
          // Eg this:
          // http://res.cloudinary.com/cloudinaryusername/image/upload/h_{{HEIGHT}}/v12345678/cloudinaryfolder/image.jpg
          // Becomes this:
          // http://res.cloudinary.com/cloudinaryusername/image/upload/h_800/v12345678/cloudinaryfolder/image.jpg
          // This gives you flexibility to define what the url looks like in case you're using something other than Cloudinary.
          // getUrl is optional.
          // If you omit this prop completely, Pig will do exactly this;
        }}
      />
    )
  }
}

export default App

This React library was packaged with https://github.com/transitive-bullshit/create-react-library

License

MIT © nickmcmillan

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].