1.0.0 • Published 2 years ago

shoutrlabs-image v1.0.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

shoutrlabs-image

Install

npm install shoutrlabs-image

Getting Started

<template>
	<ShoutrImage :mediaObject="mediaObject" />
</template>

<script>
import { ShoutrImage } from 'shoutrlabs-image';
export default Vue.extend({
	name: 'MyComponent',
	components: {
		ShoutrImage,
	},
});
</script>

Publish new version

  • Major: npm run release:major
  • Minor: npm run release:minor
  • Patch: npm run release:patch
  • Dev:
    • Set version manually in the version-key and the release:dev-script in package.json
    • npm run release:dev

Props

NameTypeDescription
mediaObjectobjectRequired. Must be shour labs MediaObject.
imageSizesnumber | arrayIf array, a srcset is generated. Default: [512, 1024, 2048]
srcKeystringDefault: source. Set, if the the source-key in the mediaObject is different (e.g. thumbsource at video-element).
alignmentobjectDefault: cover and 50%/50%
loadingstringDefault: lazy. Possible Values: lazy, eager, priority.
languagestringDefault: de
rootObjectDefault: Null. Intersection Observer’s root property. Defaults to window, if set null.
rootMarginstringDefault: 200px. Intersection Observer’s rootMargin property.
thresholdnumber or array of numbersDefault: 0.0. Intersection Observer’s threshold property.
skipAnimationbooleanDefault: false. Adds class skipAnimation to img.

Loading

  • lazy: The image is lazyloaded.
  • eager: The image is loaded immediately.
  • priority: The image is loaded upfront by injecting a preload-link in the document’s head. Currently this has no effect in the shoutr-system, since it is only relevant for statically rendered sites. But maybe we’ll have this in the future. https://web.dev/preload-responsive-images/

Alignment

<template>
	<ShoutrImage
		:alignment="{
			mode: 'cover' || 'contain' || 'original',
			// only for cover or contain:
			alignmentx: '50%',
			alignmenty: '50%',
		}"
	/>
</template>
1.0.0

2 years ago

0.0.12

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.3

3 years ago

0.0.8

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.1

3 years ago