Skip to content

Commit

Permalink
Update Table UI loader, Add border animation
Browse files Browse the repository at this point in the history
  • Loading branch information
cagataycivici committed Jan 12, 2024
1 parent efea09a commit ecc117f
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 12 deletions.
10 changes: 5 additions & 5 deletions components/demo/DeferredDemo.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, useEffect, useRef } from 'react';
import { useRef, useState } from 'react';

const DeferredDemo = ({ options, children, onLoad }) => {
const [visible, setVisible] = useState(false);
Expand All @@ -7,7 +7,7 @@ const DeferredDemo = ({ options, children, onLoad }) => {
const observerRef = useRef(null);
const elementRef = useRef(null);

useEffect(() => {
/*useEffect(() => {
const handleIntersection = ([entry]) => {
clearTimeout(timeoutRef.current);
Expand All @@ -33,13 +33,13 @@ const DeferredDemo = ({ options, children, onLoad }) => {
clearTimeout(timeoutRef.current);
};
}, [visible, onLoad, options]);
}, [visible, onLoad, options]);*/

return (
<>
{!visible && (
<div ref={elementRef} className="demo-section-loading">
Loading...
<div ref={elementRef} class="card">
<div class="deferred-demo-loading"></div>
</div>
)}
{visible && children}
Expand Down
33 changes: 26 additions & 7 deletions styles/layout/_doc.scss
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,34 @@
}
}

.demo-section-loading {
display: grid;
place-items: center;
padding: 2rem;
.deferred-demo-loading {
border-radius: 10px;
margin-bottom: 1rem;
font-size: 2rem;
height: 350px;
background: var(--maskbg);
position: relative;
overflow: hidden;
}

.deferred-demo-loading::after {
content: '';
animation: deferred-demo-loading 1.2s infinite;
left: 0;
position: absolute;
right: 0;
top: 0;
height: 100%;
transform: translateX(-100%);
z-index: 1;
border-radius: 10px;
background: linear-gradient(90deg, rgba(255, 255, 255, 0), var(--surface-100), rgba(255, 255, 255, 0));
}

@keyframes deferred-demo-loading {
from {
transform: translateX(-100%);
}
to {
transform: translateX(100%);
}
}

.doc-tabpanel,
Expand Down
46 changes: 46 additions & 0 deletions styles/layout/landing/_main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,52 @@
border: 1px solid var(--home-border-color);
border-radius: 10px;
background-color: var(--home-box-bg);
position: relative;
z-index: 0;

&::before,
&::after {
content: "";
position: absolute;
top: -2px;
left: -2px;
right: -2px;
bottom: -2px;
border: 2px solid var(--home-box-ring-color);
transition: all .5s;
animation: clippath 3s infinite linear;
border-radius: 10px;
opacity: 0;
z-index: -1;
}

&::after {
animation: clippath 3s infinite -1.5s linear;
}

&:hover {
&::before,
&::after {
opacity: 1;
}
}
}

@keyframes clippath {
0%,
100% {
clip-path: inset(0 0 98% 0);
}

25% {
clip-path: inset(0 98% 0 0);
}
50% {
clip-path: inset(98% 0 0 0);
}
75% {
clip-path: inset(0 0 0 98%);
}
}

.linkbox {
Expand Down
1 change: 1 addition & 0 deletions styles/layout/variables/landing/_dark.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@
--home-templates-btn-border-bottom:4px solid #424b57;
--home-templates-btn-border-left:3px solid #424b57;
--home-features-card-shadow: none;
--home-box-ring-color: rgba(34, 211, 238, .3)
}
1 change: 1 addition & 0 deletions styles/layout/variables/landing/_light.scss
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@
--home-templates-btn-border-bottom:4px solid rgba(0,0,0,.1);
--home-templates-btn-border-left:3px solid rgba(0,0,0,.1);
--home-features-card-shadow: 0px 7px 15px 0px rgba(0, 0, 0, 0.02), 0px 28px 28px 0px rgba(0, 0, 0, 0.02), 0px 63px 38px 0px rgba(0, 0, 0, 0.01);
--home-box-ring-color: var(--primary-100);
}

1 comment on commit ecc117f

@vercel
Copy link

@vercel vercel bot commented on ecc117f Jan 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

primereact – ./

primereact-primetek.vercel.app
primereact-git-prod-primetek.vercel.app
primereact.org

Please sign in to comment.