-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* about video component * overlay using gradients * add video preview * use in homepaeg * use in npo page * remove dependabo * about video feedback * add vtt
- Loading branch information
Showing
12 changed files
with
221 additions
and
78 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
Binary file not shown.
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,92 @@ | ||
import poster from "assets/images/about-video-preview.webp"; | ||
import { useEffect, useRef, useState } from "react"; | ||
import subtitle from "./about-video.vtt"; | ||
|
||
type VideoStatus = "loading" | "error" | "loaded"; | ||
|
||
const videoUrl = | ||
"https://elktqtbc25yfiipw.public.blob.vercel-storage.com/about-better-giving-HXqlfIWwctto66xyOTStih3rWj9Ajg"; | ||
export const AboutVideo = ({ classes = "" }) => { | ||
const videoRef = useRef<HTMLVideoElement>(null); | ||
const containerRef = useRef<HTMLDivElement>(null); | ||
const [isIntersecting, setIsIntersecting] = useState<boolean>(false); | ||
const [status, setStatus] = useState<VideoStatus>("loading"); | ||
|
||
useEffect(() => { | ||
const observer = new IntersectionObserver( | ||
([entry]: IntersectionObserverEntry[]) => { | ||
setIsIntersecting(entry.isIntersecting); | ||
}, | ||
{ rootMargin: "50px", threshold: 0.1 } | ||
); | ||
|
||
if (containerRef.current) { | ||
observer.observe(containerRef.current); | ||
} | ||
|
||
return () => { | ||
if (containerRef.current) { | ||
observer.unobserve(containerRef.current); | ||
} | ||
}; | ||
}, []); | ||
|
||
useEffect(() => { | ||
if (isIntersecting && status === "loading") { | ||
const video = videoRef.current; | ||
if (video) { | ||
video.load(); | ||
setStatus("loaded"); | ||
} | ||
} | ||
}, [isIntersecting, status]); | ||
|
||
const handleError = ( | ||
e: React.SyntheticEvent<HTMLVideoElement, Event> | ||
): void => { | ||
setStatus("error"); | ||
console.error("Video loading error:", e); | ||
}; | ||
|
||
return ( | ||
<div className={`w-full ${classes}`}> | ||
<div | ||
ref={containerRef} | ||
className="relative w-full" | ||
style={{ paddingBottom: "56.25%" }} | ||
> | ||
<div className="absolute inset-0 bg-gray-l4 rounded-lg overflow-hidden"> | ||
{status === "loading" && ( | ||
<div className="absolute inset-0 flex items-center justify-center"> | ||
<div className="text-gray-400">Loading...</div> | ||
</div> | ||
)} | ||
{status === "error" && ( | ||
<div className="absolute inset-0 flex items-center justify-center"> | ||
<div className="text-red-500">Failed to load video</div> | ||
</div> | ||
)} | ||
<video | ||
poster={poster} | ||
src={videoUrl} | ||
ref={videoRef} | ||
className={`absolute top-0 left-0 w-full h-full object-cover`} | ||
playsInline | ||
controls | ||
preload="none" | ||
onError={handleError} | ||
> | ||
<track | ||
kind="captions" | ||
src={subtitle} | ||
srcLang="en" | ||
label="English" | ||
default | ||
/> | ||
<p>Your browser doesn't support HTML5 video.</p> | ||
</video> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; |
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,106 @@ | ||
WEBVTT | ||
NOTE | ||
This file was generated by Descript <www.descript.com> | ||
00:00:00.000 --> 00:00:00.460 | ||
Time. | ||
|
||
00:00:00.890 --> 00:00:02.600 | ||
It's your most precious resource. | ||
|
||
00:00:03.130 --> 00:00:07.220 | ||
Yet non profits spend 40% | ||
of it on financial tasks. | ||
|
||
00:00:07.380 --> 00:00:09.440 | ||
Let's give that time back to your mission. | ||
|
||
00:00:09.730 --> 00:00:12.760 | ||
Raising funds easily and | ||
growing them effortlessly. | ||
|
||
00:00:13.439 --> 00:00:17.060 | ||
As a non profit ourselves, Better | ||
Giving understands this challenge. | ||
|
||
00:00:18.054 --> 00:00:20.604 | ||
and provides you with a | ||
complete financial platform. | ||
|
||
00:00:21.944 --> 00:00:26.614 | ||
Integrating free donation processing with | ||
high yield savings and investment growth. | ||
|
||
00:00:27.574 --> 00:00:31.354 | ||
Our best in class donation form | ||
lets you accept any type of donation | ||
|
||
00:00:31.355 --> 00:00:33.035 | ||
directly from your own website. | ||
|
||
00:00:34.105 --> 00:00:37.410 | ||
From cash and donor advised | ||
funds to crypto and stocks. | ||
|
||
00:00:38.470 --> 00:00:41.690 | ||
Receive grants directly to your | ||
bank account or save and invest | ||
|
||
00:00:41.690 --> 00:00:42.880 | ||
a portion for your future. | ||
|
||
00:00:42.880 --> 00:00:47.080 | ||
Better Giving's optional fund management | ||
services provide a secure high | ||
|
||
00:00:47.080 --> 00:00:51.280 | ||
yield savings account and balanced | ||
investment funds to grow your donations. | ||
|
||
00:00:51.980 --> 00:00:56.080 | ||
You maintain complete control of | ||
your funds, request monthly transfers | ||
|
||
00:00:56.080 --> 00:00:57.880 | ||
or grants whenever you need them. | ||
|
||
00:00:59.030 --> 00:01:03.430 | ||
We handle all reporting, tax | ||
receipts and compliance, even | ||
|
||
00:01:03.430 --> 00:01:04.920 | ||
for crypto and stock donations. | ||
|
||
00:01:06.255 --> 00:01:09.475 | ||
We believe in three fundamental | ||
rights for all non profits. | ||
|
||
00:01:09.825 --> 00:01:14.685 | ||
Financial self sufficiency, organizational | ||
autonomy, and equal opportunity. | ||
|
||
00:01:15.185 --> 00:01:19.474 | ||
That's why we offer accessible fund | ||
management, empower non profit choice, and | ||
|
||
00:01:19.475 --> 00:01:21.695 | ||
provide free donation processing globally. | ||
|
||
00:01:22.385 --> 00:01:22.814 | ||
Join the | ||
|
||
00:01:22.814 --> 00:01:26.465 | ||
thousands of organizations are | ||
already able to fundraise, save, | ||
|
||
00:01:26.615 --> 00:01:28.505 | ||
and invest with Better Giving. | ||
|
||
00:01:28.785 --> 00:01:32.855 | ||
Register today at better.giving to | ||
get your time back, simplify your | ||
|
||
00:01:32.855 --> 00:01:35.394 | ||
fundraising, and amplify your impact. | ||
|
This file was deleted.
Oops, something went wrong.
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
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 was deleted.
Oops, something went wrong.
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.