0.2.3 • Published 10 months ago

vuejs-grid-zoom v0.2.3

Weekly downloads
-
License
ISC
Repository
github
Last release
10 months ago

VueJS GridZoom

VueJS 3 GridZoom wrapper for codrops/GridZoom

This component adds a few features like color-filled, HTML and component cells.

:warning: Disclaimer :warning: I'm not the author of the original script. I've created this wrapper so it can be easily implemented on Vue.js files.

Using

  1. Add import {GridZoom} from 'vuejs-grid-zoom' and @import 'vuejs-grid-zoom/dist/style.css'; to your .vue file;
  2. Create the cell mapping. You can check out an example below on how to do that

Sample:

<script setup lang="ts">
import {GridZoom} from 'vuejs-grid-zoom'
import {OtherComponent} from 'other-component'

const cells = [
  {
    type: 'image',
    position: 'c1-r1',
    padded: true,
    title: 'Title goes here',
    text: '<p>HTML for the internal content goes here</p>',
    link: '#',
    linkText: 'Click here',
    image: 'https://placehold.co/450x275'
  },
  {
    type: 'image',
    position: 'c3-r2',
    padded: true,
    title: 'Another title',
    text: '<p>HTML for the internal content goes here</p>',
    link: '#',
    linkText: 'Click here',
    image: 'https://placehold.co/450x275'
  },
  {
    type: 'html',
    position: 'c4-r2',
    html: "<h1>HTML type cell</h1>"
  },
  {
    type: 'image',
    position: 'c2-r3',
    padded: true,
    title: 'Title goes here',
    text: '<p>HTML for the internal content goes here</p>',
    link: '#',
    linkText: 'Click here',
    image: 'https://placehold.co/450x275'
  },
  {
    type: 'filled',
    position: 'c3-r3',
    padded: true,
    color: '#32BFE5'
  },
  {
    type: 'image',
    position: 'c3-r4',
    padded: true,
    title: 'Title goes here',
    text: '<p>HTML for the internal content goes here</p>',
    link: '#',
    linkText: 'Click here',
    image: 'https://placehold.co/450x275'
  },
  {
    type: 'filled',
    position: 'c3-r5',
    color: '#2B85F8',
    padded: true
  },
  {
    type: 'image',
    position: 'c2-r5',
    padded: true,
    title: 'Title goes here',
    text: '<p>HTML for the internal content goes here</p>',
    link: '#',
    linkText: 'Click here',
    image: 'https://placehold.co/450x275'
  },
]
</script>

<template>
<GridZoom :cells="cells"/>
</template>

<style>
@import 'vuejs-grid-zoom/dist/style.css';
</style>

Cell options

OptionTypeRequiredDetails
typestringyesCan be "image", "component", "html", "filled"
positionstringyesPosition class for the cell ("c" means column, "r" means row"). e.g. "c3-r2" means third column, second row
titlestringnoTitle to be shown on the cell details
textstringnoText (HTML) to be shown on the cell details
linkstringnoLink to the cell details button
linkTextstringnoText to the "link" option
paddedbooleannoWhether to add the "padded" class on this cell. This adds a predefined padding value if used
imagestringif "type" === "image"Cell image
componentreferenceif "type" === "component"Component to be rendered on the cell
componentPropsobjectnoProperties to be passed to component if "type" === "component"
colorstringif "type" === "filled"Cell color
htmlstringif "type" === "html"HTML to be rendered on the cell

Important

This component supports grids up to 4x5. If you need bigger grids, you can extend it creating classes for the extra cells, like this:

.grid__cell-c2-r6 { // column 2, row 6
    grid-column: 4;
    grid-row: 6;
}

This component uses the GSAP library, which is free for most use cases, but there is cases when you'll need a business license. You can see details here

0.2.1

10 months ago

0.2.3

10 months ago

0.2.2

10 months ago

0.2.0

10 months ago

0.1.20

11 months ago

0.1.19

11 months ago

0.1.18

11 months ago

0.1.17

11 months ago

0.1.16

11 months ago

0.1.15

11 months ago

0.1.14

11 months ago

0.1.13

11 months ago

0.1.12

11 months ago

0.1.11

11 months ago

0.1.10

11 months ago

0.1.9

11 months ago

0.1.8

11 months ago

0.1.6

11 months ago

0.1.5

11 months ago

0.1.4

11 months ago

0.1.3

11 months ago

0.1.1

11 months ago

0.1.0

11 months ago