1.2.2 • Published 5 years ago

@times-stories/image-container v1.2.2

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

@times-stories/image-container

The background image container template for the @times-stories suite of packages

Installation

$ yarn add @times-stories/image-container

Usage

This is the base component for many of the @times-stories page templates, and handles image placement / transition logic.

This component provides an interface for placing the focus point of your background image within a pre-defined safe area. This will work across any breakpoint, and will work for any image size.

The backgroundImage prop should be an object containing your image src and a focusPoint object with x and y percentages, defining where the focus point of your background image is.

The centerPoint props should be an object containing the x and y percentages defining where the safe area of your template is. If, for example, you had text positioned on the left of the template, then you may choose to define your safe area on the right hand side.

import Story from "@times-stories/story";
import Page from "@times-stories/page";
import ImageContainer from "@times-stories/image-container";

const backgroundImage = {
  src: `url/to/image`,
  focusPoint: {
    x: 30,
    y: 60
  }
};

const centerPoint = {
  x: 20,
  y: 40
};

export default () => (
  <ImageContainer
    backgroundImage={backgroundImage}
    centerPoint={centerPoint}
    withBlur={true}
    withOverlay={true}
    withImpact={false}
  >
    <p>Any JSX here</p>
  </ImageContainer>
);
1.2.2

5 years ago

1.2.1

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.16

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago