Skip to content

Commit

Permalink
Merge pull request #15 from SchnapsterDog/develop
Browse files Browse the repository at this point in the history
style: replacing constants with enum inside transitionmap
  • Loading branch information
SchnapsterDog authored Nov 4, 2023
2 parents f1a8259 + 4dea68d commit 1c333d6
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vue-preloader",
"description": "Vue-Preloader is a versatile and easy-to-use Vue.js component that allows you to add loading animations to your Vue.js or Nuxt.js projects. It is compatible with both Vue 2 and Vue 3.",
"version": "1.1.2",
"version": "1.1.3",
"private": false,
"homepage": "https://vue-preloader.com/",
"author": {
Expand Down
4 changes: 0 additions & 4 deletions src/constants/index.ts

This file was deleted.

26 changes: 13 additions & 13 deletions src/utils/transitionmap.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import {
TRANSITION_FADE_LEFT,
TRANSITION_FADE_RIGHT,
TRANSITION_FADE_UP,
TRANSITION_FADE_DOWN
} from '../constants';
enum Transition {
FADE_LEFT = 'fade-left',
FADE_RIGHT = 'fade-right',
FADE_UP = 'fade-up',
FADE_DOWN = 'fade-down',
}

export const transitionMap = {
[TRANSITION_FADE_LEFT]: { transform: 'translate(-100%, 0)' },
[TRANSITION_FADE_RIGHT]: { transform: 'translate(100%, 0)' },
[TRANSITION_FADE_UP]: { transform: 'translate(0, -100%)' },
[TRANSITION_FADE_DOWN]: { transform: 'translate(0, 100%)' },
default: { transform: 'transform(-100%, 0)' }
}
export const transitionMap: Record<Transition | 'default', { transform: string }> = {
[Transition.FADE_LEFT]: { transform: 'translate(-100%, 0)' },
[Transition.FADE_RIGHT]: { transform: 'translate(100%, 0)' },
[Transition.FADE_UP]: { transform: 'translate(0, -100%)' },
[Transition.FADE_DOWN]: { transform: 'translate(0, 100%)' },
default: { transform: 'transform(-100%, 0)' },
};

0 comments on commit 1c333d6

Please sign in to comment.