monica-alexandria 3.4.49 → 3.4.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "monica-alexandria",
3
- "version": "3.4.49",
3
+ "version": "3.4.50",
4
4
  "description": "A styled-components styles library for Doitforme platorm and universal tweeks to create your own new styled library for your project",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.es.js",
@@ -5,4 +5,5 @@ export * from './form'
5
5
  export * from './nav';
6
6
  export * from './sidebar';
7
7
  export * from './steps';
8
- export * from './slider';
8
+ export * from './slider';
9
+ export * from './loader';
@@ -0,0 +1,90 @@
1
+ import React from 'react'
2
+ import styled, { keyframes } from 'styled-components'
3
+
4
+ const Fade = keyframes`
5
+ 0% {
6
+ opacity: 1;
7
+ }
8
+ 20% {
9
+ opacity: 0.5;
10
+ }
11
+ 90%{
12
+ opacity: 0.8;
13
+ }
14
+ 100% {
15
+ opacity: 1;
16
+ }
17
+ `
18
+
19
+ const Slide = keyframes`
20
+ 0%{
21
+ transform: translate(-100%);
22
+ }
23
+ 100% {
24
+ transform: translate(100%);
25
+ }
26
+ `
27
+
28
+ const CardLoader = styled.div`
29
+ width: 100%;
30
+ background: ${p => p.theme.mid};
31
+ height: 30rem;
32
+ border-radius: var(--normalRadius);
33
+ overflow: hidden;
34
+ animation: ${Fade} infinite 2s ease-in-out;
35
+ `
36
+
37
+ const CardSlider = styled.div`
38
+ animation: ${Slide} infinite 2s ease-in-out;
39
+ height: 100%;
40
+ width: 100%;
41
+ position: absolute;
42
+ top: 0;
43
+ left: 0;
44
+ background: linear-gradient(to right, transparent, ${p => p.theme.high});
45
+ `
46
+
47
+ const CardLoaderImg = styled.div`
48
+ position: relative;
49
+ height: 20rem;
50
+ background-color: ${p => p.theme.low};
51
+ display: flex;
52
+ align-items: center;
53
+ overflow: hidden;
54
+ justify-content: center;
55
+ `
56
+
57
+ const CardLoaderCircle = styled.div`
58
+ width: 10rem;
59
+ height: 10rem;
60
+ border-radius: 50%;
61
+ background-color: ${p => p.theme.mid};
62
+ position: relative;
63
+ `
64
+
65
+ const CardLoaderTitle = styled.div`
66
+ width: 80%;
67
+ height: 2rem;
68
+ border-radius: 4rem;
69
+ background-color: ${p => p.theme.low};
70
+ margin: 2rem auto;
71
+ overflow: hidden;
72
+ position: relative;
73
+ `
74
+
75
+ export const Card_Loader = (props) => {
76
+ return (
77
+ <CardLoader key={props.key}>
78
+ <CardLoaderImg>
79
+ <CardSlider/>
80
+ {props.circle &&
81
+ <CardLoaderCircle></CardLoaderCircle>
82
+ }
83
+ </CardLoaderImg>
84
+ <CardLoaderTitle>
85
+ <CardSlider></CardSlider>
86
+ </CardLoaderTitle>
87
+ {props.children}
88
+ </CardLoader>
89
+ )
90
+ }
@@ -0,0 +1,7 @@
1
+ import React from 'react'
2
+
3
+ export const Forty_Card_Loader = (props) => {
4
+ return (
5
+ <div>Forty_Card_Loader</div>
6
+ )
7
+ }
@@ -0,0 +1,45 @@
1
+ import React, { useState } from 'react'
2
+ import styled from 'styled-components'
3
+ import { breakPoints } from '../../helpers/MediaQ'
4
+ import { CardsFull } from '../../styles/Cards'
5
+ import { Card_Loader } from './Card_Loader'
6
+
7
+ const FullCardLoader = styled(CardsFull)`
8
+
9
+ `
10
+
11
+ export const Full_Card_Loader = (props) => {
12
+
13
+ let width = 1440;
14
+
15
+ const [repeats , setRepeats] = useState();
16
+ const ChangeRepeats = () => {
17
+ if (width > breakPoints.lg) {
18
+ setRepeats(10);
19
+ }
20
+ else if ( width <= breakPoints.lg && width > breakPoints.md) {
21
+ setRepeats(6);
22
+ }
23
+ else if ( width <= breakPoints.md && width > breakPoints.sm) {
24
+ setRepeats(4);
25
+ }
26
+ else if (width <= breakPoints.sm) {
27
+ setRepeats(2);
28
+ }
29
+ }
30
+
31
+ window.addEventListener('resize', () =>
32
+ {
33
+ width = window.innerWidth
34
+ ChangeRepeats()
35
+ }
36
+ )
37
+
38
+ return (
39
+ <FullCardLoader>
40
+ {[...Array(repeats)].map((i) =>
41
+ <Card_Loader key={i} children={props.children} circle={props.circle}/>
42
+ )}
43
+ </FullCardLoader>
44
+ )
45
+ }
@@ -0,0 +1,39 @@
1
+ import React, { useEffect, useState } from 'react'
2
+ import styled from 'styled-components'
3
+ import { breakPoints } from '../../helpers/MediaQ'
4
+ import { CardsSixty } from '../../styles/Cards'
5
+ import { Card_Loader } from './Card_Loader'
6
+
7
+ const SixtyCardLoader = styled(CardsSixty)`
8
+
9
+ `
10
+
11
+ export const Sixty_Card_Loader = (props) => {
12
+
13
+ const [repeats , setRepeats] = useState();
14
+ const ChangeRepeats = () => {
15
+ if (window.innerWidth > breakPoints.md) {
16
+ setRepeats(6);
17
+ }
18
+ else if (window.innerWidth > breakPoints.sm) {
19
+ setRepeats(1);
20
+ }
21
+ }
22
+
23
+ let width
24
+ window.addEventListener('resize', () =>
25
+ {
26
+ width = window.innerWidth
27
+ console.log(width);
28
+ ChangeRepeats()
29
+ }
30
+ )
31
+
32
+ return (
33
+ <SixtyCardLoader>
34
+ {[...Array(repeats)].map((i) =>
35
+ <Card_Loader key={i} children={props.children} circle={props.circle}/>
36
+ )}
37
+ </SixtyCardLoader>
38
+ )
39
+ }
@@ -0,0 +1 @@
1
+ export * from './Full_Card_Loader.js'
@@ -1,4 +1,4 @@
1
- const breakPoints = {
1
+ export const breakPoints = {
2
2
  xs: 576,
3
3
  sm: 768,
4
4
  md: 992,
@@ -0,0 +1,19 @@
1
+ import { Full_Card_Loader } from "../../export/components/loader/Full_Card_Loader"
2
+ import { Sixty_Card_Loader } from "../../export/components/loader/Sixty_Card_Loader"
3
+
4
+
5
+ export default{
6
+ title: 'Components/Loader'
7
+ }
8
+
9
+ export const Full = (args) => <Full_Card_Loader {...args}/>
10
+ Full.args ={
11
+ circle : false
12
+ }
13
+
14
+ export const Sixty = (args) => <Sixty_Card_Loader {...args}/>
15
+ Full.args ={
16
+ circle : false
17
+ }
18
+
19
+ export const Forty = (args) => <Full_Card_Loader {...args}/>