-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5909 from tanerengiiin/master
Template Pages
- Loading branch information
Showing
265 changed files
with
3,038 additions
and
1,549 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react' | ||
|
||
const TemplateIntro = ({ | ||
title, | ||
description, | ||
imageURL | ||
}) => { | ||
return ( | ||
<div className='template-intro'> | ||
<h2>{title}</h2> | ||
<p>{description}</p> | ||
<div className='template-intro-image'> | ||
<img src={imageURL} alt='Template Hero Image'/> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default TemplateIntro |
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,28 @@ | ||
import React from 'react' | ||
|
||
const TemplateLicense = ({ license }) => { | ||
return ( | ||
<div className='template-license-wrapper'> | ||
<div className='template-license'> | ||
<div className='template-license-cards'> | ||
{license.licenseDetails.map(({ title, price, included }, i) => ( | ||
<div key={i} className='template-license-card'> | ||
<span>{title}</span> | ||
<h2>{price}</h2> | ||
<div className='template-license-card-included'> | ||
{included.map((txt, j) => ( | ||
<p key={j}>{txt}</p> | ||
))} | ||
</div> | ||
<a href='https://www.primefaces.org/layouts/licenses' target='_blank'><button>License Details</button></a> | ||
</div> | ||
))} | ||
</div> | ||
<p className='template-license-description'>{license.description}</p> | ||
<p className='template-license-visit'>Visit the <a href={license.documentLink} target='_blank'>official documentation</a> for more information.</p> | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default TemplateLicense |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
import React from 'react'; | ||
import React from 'react' | ||
|
||
const TemplateSeparator = ({ separatorLogo }) => { | ||
return ( | ||
<div className="template-seperator"> | ||
<span className="template-seperator-icon">{separatorLogo}</span> | ||
<div className="template-separator"> | ||
<span className="template-separator-icon">{separatorLogo}</span> | ||
</div> | ||
); | ||
}; | ||
} | ||
|
||
export default TemplateSeparator; | ||
export default TemplateSeparator |
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
44 changes: 27 additions & 17 deletions
44
components/templates/templateFeaturesAnimation/TemplateFeaturesAnimationInline.js
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 |
---|---|---|
@@ -1,29 +1,39 @@ | ||
import React, { useRef } from 'react'; | ||
import React, { useRef } from 'react' | ||
import useAnimatedFeatures from './useAnimatedFeatures'; | ||
|
||
const TemplateFeaturesAnimationInline = ({ inlineFeaturesData, parentHandleClick, parentID, inlineSeconds = 1000 }) => { | ||
const animationInlineRef = useRef(null); | ||
const { selectedID, handleClick } = useAnimatedFeatures(animationInlineRef, inlineFeaturesData.length, inlineSeconds); | ||
const TemplateFeaturesAnimationInline = ({ inlineFeaturesData, parentHandleClick, parentHandleHover, parentID, inlineSeconds = 1000 }) => { | ||
const animationInlineRef = useRef(null) | ||
const { selectedID, setHoveredID, handleClick, handleHover } = useAnimatedFeatures(animationInlineRef, inlineFeaturesData.length, inlineSeconds); | ||
|
||
const handleBtnClick = (id) => { | ||
handleClick(id); | ||
parentHandleClick(parentID); | ||
}; | ||
handleClick(id) | ||
parentHandleClick(parentID) | ||
} | ||
|
||
const enterCardArea = (id) => { | ||
setHoveredID(id); | ||
handleHover(id, 'onMouseEnter'); | ||
parentHandleHover(parentID, 'onMouseEnter'); | ||
} | ||
|
||
const leaveCardArea = (id) => { | ||
setHoveredID(null); | ||
handleHover(id, 'onMouseLeave'); | ||
parentHandleHover(parentID, 'onMouseLeave'); | ||
} | ||
|
||
return ( | ||
<div className="template-features-animation-right-inline" ref={animationInlineRef}> | ||
<div className="template-features-animation-right-inline-tabs"> | ||
<div className='template-features-animation-right-inline' ref={animationInlineRef}> | ||
<div className='template-features-animation-right-inline-tabs'> | ||
{inlineFeaturesData.map((data, i) => ( | ||
<button className={`${!!(data.id === selectedID) && 'template-features-animation-right-inline-tabs-btnActive'}`} onClick={() => handleBtnClick(data.id)} key={i}> | ||
{data.title} | ||
</button> | ||
<button onMouseEnter={() => enterCardArea(data.id)} onMouseLeave={() => leaveCardArea(data.id)} className={`${!!(data.id === selectedID) && "template-features-animation-right-inline-tabs-btnActive"}`} onClick={() => handleBtnClick(data.id)} key={i}>{data.title}</button> | ||
))} | ||
</div> | ||
<div className="template-features-animation-right-inline-image"> | ||
<img src={inlineFeaturesData[selectedID - 1].src} alt="Animation Inline Feature Image" /> | ||
<div className='template-features-animation-right-inline-image'> | ||
<img src={inlineFeaturesData[selectedID - 1].src} alt='Animation Inline Feature Image' /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
) | ||
} | ||
|
||
export default TemplateFeaturesAnimationInline; | ||
export default TemplateFeaturesAnimationInline |
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
44 changes: 30 additions & 14 deletions
44
components/templates/templateFeaturesAnimation/useAnimatedFeatures.js
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 |
---|---|---|
@@ -1,45 +1,61 @@ | ||
// useAnimatedFeatures.js | ||
import { useEffect, useState } from 'react'; | ||
import useVisible from './useVisible'; | ||
import React, { useEffect, useState } from "react"; | ||
import useVisible from "./useVisible"; | ||
|
||
const useAnimatedFeatures = (animationRef, arrayLength, seconds = 5000) => { | ||
const useAnimatedFeatures = (animationRef, arrayLength, seconds = 10000) => { | ||
const [selectedID, setSelectedID] = useState(1); | ||
const [intervalIds, setIntervalIds] = useState([]); | ||
const [cancelInterval, setCancelInterval] = useState(false); | ||
const [hoveredID, setHoveredID] = useState(null); | ||
const isVisible = useVisible(animationRef); | ||
|
||
const clearAllIntervals = () => { | ||
if (intervalIds.length <= 0) return; | ||
intervalIds.forEach((intervalId) => window.clearInterval(intervalId)); | ||
intervalIds.forEach(intervalId => window.clearInterval(intervalId)); | ||
setIntervalIds([]); | ||
}; | ||
|
||
const createInterval = () => { | ||
const interval = setInterval(() => { | ||
setSelectedID((prev) => (prev === arrayLength ? 1 : prev + 1)); | ||
setSelectedID(prev => (prev === arrayLength ? 1 : prev + 1)); | ||
}, seconds); | ||
|
||
setIntervalIds((prev) => [...prev, interval]); | ||
}; | ||
setIntervalIds(prev => [...prev, interval]); | ||
} | ||
|
||
const handleClick = (cardId) => { | ||
const handleClick = cardId => { | ||
clearAllIntervals(); | ||
setSelectedID(cardId); | ||
createInterval(); | ||
setCancelInterval(true) | ||
}; | ||
|
||
const handleHover = (cardId, type) => { | ||
if (cancelInterval || cardId !== selectedID) return; | ||
clearAllIntervals(); | ||
|
||
if (type === "onMouseLeave") { | ||
setSelectedID(cardId); | ||
createInterval() | ||
} | ||
}; | ||
|
||
useEffect(() => { | ||
clearAllIntervals(); | ||
|
||
if (isVisible) { | ||
createInterval(); | ||
createInterval() | ||
} else { | ||
clearAllIntervals(); | ||
setSelectedID(1); | ||
setSelectedID(1) | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [isVisible]); | ||
}, [animationRef, isVisible]); | ||
|
||
useEffect(() => { | ||
if (!hoveredID) null; | ||
handleHover(hoveredID, "onMouseEnter"); | ||
}, [selectedID]) | ||
|
||
return { selectedID, handleClick }; | ||
return { selectedID, setHoveredID, handleClick, handleHover }; | ||
}; | ||
|
||
export default useAnimatedFeatures; |
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.