1.1.0 • Published 6 years ago

reverse-scroll v1.1.0

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

Reverse scroll

Two columns, one scroll.

Reverse scroll

ReverseScroll reverses scroll for two columns.

Installation

npm install reverse-scroll

Usage

JavaScript

const container = document.getElementsByClassName('js-container')[0];
const options = {};
const Rs = new ReverseScroll.default(container, options);

CSS

body {
	overflow: hidden;
}

// Utilities
.h-xs-100 {
	height: 100%;
}

.reverse-scroll {
	position: relative;
	height: 100vh;
}

.reverse-scroll__columns {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
}

.reverse-scroll__row {
	position: absolute;
	right: 0;
	left: 0;
	margin-right: 15px;
	margin-left: 15px;
}

.reverse-scroll__row--left {
	top: 100%;
	transform: translate3d( 0, 100%, 0 );
}

.reverse-scroll__row--right {
	bottom: 100%;
	transform: translate3d( 0, -100%, 0 );
}

.reverse-scroll__column {
	padding-top: 12vh;
	padding-bottom: 12vh;

	align-items: center;
	height: 100vh;
}

.reverse-scroll__image {
	height: 100%;
	width: 100%;

	max-width: 100%;

	object-position: center;
}

HTML

<div class="reverse-scroll">
	<div class="reverse-scroll__columns js-container container-fluid">
		<div class="row h-xs-100">
			<div class="col-5 offset-1 h-xs-100">
				<div class="reverse-scroll__row reverse-scroll__row--left js-row-left">
					<div class="reverse-scroll__column">
						<img
							class="reverse-scroll__image"
							src="https://picsum.photos/528/348"
							width="528"
							height="348"
							alt=""
						/>
					</div>
				</div>
			</div>
			<div class="col-12 col-lg-5 h-xs-100">
				<div class="reverse-scroll__row reverse-scroll__row--right js-row-right">
					<div class="reverse-scroll__column">
						<img
							class="reverse-scroll__image"
							src="https://picsum.photos/528/348"
							width="528"
							height="348"
							alt=""
						/>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>

Options

Example

An example is located right here, see sources.

Authors

Acknowledgments

To do

1.1.0

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 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.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago