-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* WIP: start typing the lib * more types * complete typings...
- Loading branch information
1 parent
249f051
commit 401150a
Showing
23 changed files
with
1,004 additions
and
486 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"root": true, | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"parser": "@typescript-eslint/parser", | ||
"env": { | ||
"es6": true, | ||
"node": false | ||
}, | ||
"parserOptions": { | ||
"sourceType": "module" | ||
}, | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"@typescript-eslint/explicit-module-boundary-types": "off" | ||
}, | ||
"plugins": ["@typescript-eslint", "prettier"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,5 @@ _loc | |
npm-debug.log | ||
.DS_Store | ||
config.cson | ||
yarn-error.log | ||
yarn-error.log | ||
dist |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { Settings } from './types'; | ||
export declare const VIDEO_EXTENSIONS: string[]; | ||
export declare const MEDIA_TYPES: { | ||
image: 'image'; | ||
video: 'video'; | ||
none: 'none'; | ||
}; | ||
export declare const ELEMENT_DATA_KEYS: { | ||
MEDIAPATH: string; | ||
MEDIATYPE: string; | ||
MUTE: string; | ||
HEIGHT: string; | ||
SPEED: string; | ||
}; | ||
export declare const defaultSettings: Settings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { Settings } from './types'; | ||
export declare const init: (userSettings: Partial<Settings>) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { Block, Container, Settings } from './types'; | ||
export declare const setBlockSpeed: (blockEl: HTMLElement, settings: Settings) => number; | ||
export declare const setBlockMediaProps: (blockEl: HTMLElement, settings: Settings) => { | ||
mediatype: "image" | "video" | "none"; | ||
mediapath: string | null; | ||
}; | ||
export declare const setBlockMute: (blockEl: HTMLElement, settings: Settings) => boolean; | ||
export declare const setBlockVisual: (block: Block) => void; | ||
export declare const setBlockAttributes: (container: Container, block: Block) => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import { Settings } from './types'; | ||
export declare const setContainerHeight: (containerEl: HTMLElement, settings: Settings) => string; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
import '../less/parallax-vanilla.less'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const resize: () => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export declare const translate: () => void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { MEDIA_TYPES } from './constants'; | ||
export interface Settings { | ||
container: { | ||
class: string; | ||
height: string; | ||
}; | ||
block: { | ||
class: string; | ||
speed: number; | ||
mediatype: keyof typeof MEDIA_TYPES; | ||
mediapath: null; | ||
mute: boolean; | ||
}; | ||
} | ||
export interface Block { | ||
blockEl: HTMLElement; | ||
speed: number; | ||
mediatype: string | null; | ||
mediapath: string | null; | ||
mute: boolean; | ||
muted: boolean; | ||
videoEl?: HTMLVideoElement; | ||
audioButton?: HTMLAnchorElement; | ||
} | ||
export interface Container { | ||
containerEl: HTMLElement; | ||
offset: number; | ||
height: number; | ||
blocks: Block[]; | ||
hasVideoBlock?: boolean; | ||
} | ||
export declare type PV = any; | ||
export interface Window { | ||
raf: typeof window.requestAnimationFrame; | ||
pv?: PV; | ||
orientation: typeof window.orientation; | ||
requestAnimationFrame: typeof window.requestAnimationFrame; | ||
webkitRequestAnimationFrame: typeof window.requestAnimationFrame; | ||
mozRequestAnimationFrame: typeof window.requestAnimationFrame; | ||
setTimeout: typeof window.setTimeout; | ||
onresize: () => void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.