Skip to content

Commit

Permalink
Implemented new animate web component and removed redundant packages
Browse files Browse the repository at this point in the history
  • Loading branch information
WillYallop committed Apr 5, 2023
1 parent fe1b978 commit 8b7aa14
Show file tree
Hide file tree
Showing 60 changed files with 517 additions and 1,290 deletions.
15 changes: 9 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,15 @@ Functionalities is a collection packages for the backend and frontend that aims

- [@functionalities/mediakit](/packages/mediakit/README.md)

## Frontend Packages
## Frontend Packages:

A core principle for these packages is that they should be easy to use, accessibility first, and if suitable: configured primarily in HTML markup to reduce the weight of your JS bundle.
A core principle for these packages is that they should be easy to use, accessibility first, and if suitable: configured primarily in HTML markup to reduce the weight of your JS bundle.

- [@functionalities/webcomponents](/packages/webcomponents/README.md)
- [@functionalities/toggler](/packages/toggler/README.md)
- [@functionalities/animations](/packages/animations/README.md)
- ~~[@functionalities/disclosure](/packages/disclosure/README.md)~~ (Moved to [webcomponents](/packages/webcomponents/README.md))
- ~~[@functionalities/stickyheader](/packages/stickyheader/README.md)~~ (Moved to [webcomponents](/packages/webcomponents/README.md))
- [Carousel](/packages/webcomponents/src/components/carousel)
- [Enhanced Details](/packages/webcomponents/src/components/enhanced-details)
- [Details Disclosure](/packages/webcomponents/src/components/detail-disclosure)
- [Checkbox Toggler](/packages/webcomponents/src/components/checkbox-toggler)
- [Sticky Header](/packages/webcomponents/src/components/sticky-header)
- [Animate](/packages/webcomponents/src/components/animate)
- [@functionalities/toggler](/packages/toggler/README.md)
1 change: 1 addition & 0 deletions apps/playground-fr/dist/assets/index.064323ab.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion apps/playground-fr/dist/assets/index.2f9c0d66.css

This file was deleted.

13 changes: 0 additions & 13 deletions apps/playground-fr/dist/assets/index.72a2b5bb.js

This file was deleted.

13 changes: 13 additions & 0 deletions apps/playground-fr/dist/assets/index.e4d7772a.js

Large diffs are not rendered by default.

35 changes: 31 additions & 4 deletions apps/playground-fr/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
href="https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css"
/>

<script type="module" crossorigin src="/assets/index.72a2b5bb.js"></script>
<link rel="stylesheet" href="/assets/index.2f9c0d66.css">
<script type="module" crossorigin src="/assets/index.e4d7772a.js"></script>
<link rel="stylesheet" href="/assets/index.064323ab.css">
</head>
<body>
<sticky-header
Expand Down Expand Up @@ -74,9 +74,7 @@ <h2>Web Components Example - Checkbox Toggler</h2>
>
<label
tabindex="0"
role="button"
for="checkbox-input"
aria-expanded="false"
aria-controls="checkbox-dropdown"
>Toggle</label
>
Expand Down Expand Up @@ -194,6 +192,35 @@ <h2>Web Components Example - Disclosure</h2>
</div>
</div>

<!-- Web Components row -->
<div class="playground-row">
<h2>Web Components Example - Animate</h2>
<animate-container on="visible" type="fade-in" animate="true">
Elit laboris amet deserunt ad non quis anim elit ex Lorem culpa. Id
labore id nostrud deserunt elit id labore sint do. Incididunt labore
fugiat excepteur culpa fugiat qui ipsum voluptate proident proident
ullamco do.
</animate-container>
<animate-container
on="visible"
reset="true"
delay="200"
type="fade-in"
animate="true"
>
Elit laboris amet deserunt ad non quis anim elit ex Lorem culpa. Id
labore id nostrud deserunt elit id labore sint do. Incididunt labore
fugiat excepteur culpa fugiat qui ipsum voluptate proident proident
ullamco do.
</animate-container>
<animate-container on="load" type="fade-in" animate="true">
Elit laboris amet deserunt ad non quis anim elit ex Lorem culpa. Id
labore id nostrud deserunt elit id labore sint do. Incididunt labore
fugiat excepteur culpa fugiat qui ipsum voluptate proident proident
ullamco do.
</animate-container>
</div>

<!-- Toggler row -->
<div class="playground-row">
<h2>Toggler Example</h2>
Expand Down
29 changes: 29 additions & 0 deletions apps/playground-fr/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,35 @@ <h2>Web Components Example - Disclosure</h2>
</div>
</div>

<!-- Web Components row -->
<div class="playground-row">
<h2>Web Components Example - Animate</h2>
<animate-container on="visible" type="fade-in" animate="true">
Elit laboris amet deserunt ad non quis anim elit ex Lorem culpa. Id
labore id nostrud deserunt elit id labore sint do. Incididunt labore
fugiat excepteur culpa fugiat qui ipsum voluptate proident proident
ullamco do.
</animate-container>
<animate-container
on="visible"
reset="true"
delay="200"
type="fade-in"
animate="true"
>
Elit laboris amet deserunt ad non quis anim elit ex Lorem culpa. Id
labore id nostrud deserunt elit id labore sint do. Incididunt labore
fugiat excepteur culpa fugiat qui ipsum voluptate proident proident
ullamco do.
</animate-container>
<animate-container on="load" type="fade-in" animate="true">
Elit laboris amet deserunt ad non quis anim elit ex Lorem culpa. Id
labore id nostrud deserunt elit id labore sint do. Incididunt labore
fugiat excepteur culpa fugiat qui ipsum voluptate proident proident
ullamco do.
</animate-container>
</div>

<!-- Toggler row -->
<div class="playground-row">
<h2>Toggler Example</h2>
Expand Down
58 changes: 58 additions & 0 deletions apps/playground-fr/src/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -336,3 +336,61 @@ carousel-progress {
transition: 0;
}
}

// --------------------------------
// Animation styles
animate-container {
animation-delay: 0s;
animation-duration: 0.3s;
animation-timing-function: ease-in-out;
animation-fill-mode: both;
backface-visibility: hidden;
// Default DIV styles
display: block;
position: relative;

// Animate
&[animate="true"] {
// fade-in
&[type="fade-in"] {
animation-name: fade-in;
@media (prefers-reduced-motion: reduce) {
animation-name: fade-in-reduced;
}
}
// ADD MORE ANIMATIONS HERE
}

// Default
&[animate="false"] {
// fade-in
&[type="fade-in"] {
opacity: 0;
transform: translate3d(0, 10px, 0);
@media (prefers-reduced-motion: reduce) {
transform: translate3d(0, 0, 0);
}
}
}
}

// --------------------------------
// Keyframes
@keyframes fade-in {
0% {
opacity: 0;
transform: translate3d(0, 10px, 0);
}
100% {
opacity: 1;
transform: translate3d(0, 0, 0);
}
}
@keyframes fade-in-reduced {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
10 changes: 2 additions & 8 deletions apps/playground-fr/src/ts/main.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import Toggler from "@functionalities/toggler";
import Animations from "@functionalities/animations";
import {
EnhancedDetails,
DetailDisclosure,
StickyHeader,
CheckboxToggler,
Carousel,
Animation,
} from "@functionalities/webcomponents";

customElements.define("enhanced-details", EnhancedDetails);
customElements.define("detail-disclosure", DetailDisclosure);
customElements.define("sticky-header", StickyHeader);
customElements.define("checkbox-toggler", CheckboxToggler);
customElements.define("animate-container", Animation);

customElements.define("carousel-container", Carousel.Container);
customElements.define("carousel-track", Carousel.Track);
Expand All @@ -38,10 +39,3 @@ new Toggler({
},
},
});

// Animations
new Animations({
activeClass: "animate",
reset: true,
threshold: 1,
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "functionalities",
"version": "1.5.1",
"version": "1.6.0",
"private": true,
"workspaces": [
"apps/*",
Expand Down
4 changes: 0 additions & 4 deletions packages/animations/.eslintrc.js

This file was deleted.

80 changes: 0 additions & 80 deletions packages/animations/README.md

This file was deleted.

26 changes: 0 additions & 26 deletions packages/animations/dist/index.d.ts

This file was deleted.

Loading

0 comments on commit 8b7aa14

Please sign in to comment.