Skip to content

Commit 8eba262

Browse files
committed
🚀 ADD - blog++, projects++
1 parent 1fa913b commit 8eba262

File tree

17 files changed

+449
-4
lines changed

17 files changed

+449
-4
lines changed

components/MDXComponents.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import ConsCard from "@/components/ConsCard";
1111
import Step from "@/components/Step";
1212
import StepLarge from "@/components/StepLarge";
1313
import StepCheck from "@/components/StepCheck";
14+
import VideoDemo from "./VideoDemo";
1415

1516
const CustomLink = (props) => {
1617
const href = props.href;
@@ -36,6 +37,7 @@ const MDXComponents = {
3637
StepLarge,
3738
StepCheck,
3839
Tweet,
40+
VideoDemo,
3941
};
4042

4143
export default MDXComponents;

components/ProjectCard.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,24 @@ export default function ProjectCard({ title, description, href, icon, tags }) {
2121
</svg>
2222
</div>
2323
)}
24+
{icon === "devmedium" && (
25+
<div className="h-8 w-8 ml-2 mr-4">
26+
<svg
27+
className="h-8 w-8 min-w-lg text-gray-900 dark:text-gray-100"
28+
xmlns="http://www.w3.org/2000/svg"
29+
fill="none"
30+
viewBox="0 0 24 24"
31+
stroke="currentColor"
32+
>
33+
<path
34+
stroke-linecap="round"
35+
stroke-linejoin="round"
36+
stroke-width="2"
37+
d="M7 8h10M7 12h4m1 8l-4-4H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-3l-4 4z"
38+
/>
39+
</svg>
40+
</div>
41+
)}
2442
{icon === "github" && (
2543
<div className="h-8 w-8 ml-2 mr-4">
2644
<svg

components/VideoDemo.js

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import React from "react";
2+
import { useState, useEffect, useRef } from "react";
3+
4+
export default function VideoDemo({ src, width, label = false }) {
5+
const [speed, setSpeed] = useState(parseFloat(4.0));
6+
7+
// useEffect(() => {}, [speed]);
8+
const videoRef = useRef();
9+
10+
const setPlayback = () => {
11+
videoRef.current.playbackRate = parseFloat(speed);
12+
console.log(videoRef.current.playbackRate);
13+
};
14+
15+
const changePlayback = (e) => {
16+
setSpeed(parseFloat(e.target.value));
17+
videoRef.current.playbackRate = parseFloat(speed);
18+
};
19+
return (
20+
<div className="flex flex-col justify-center">
21+
<div>
22+
<video
23+
ref={videoRef}
24+
onCanPlay={setPlayback}
25+
playsInline
26+
src={src}
27+
muted
28+
autoPlay
29+
loop
30+
width={width}
31+
></video>
32+
</div>
33+
{label && (
34+
<label htmlFor="video-speed" className="mt-8">
35+
🐢{" "}
36+
<input
37+
type="range"
38+
min="0.8"
39+
max="4.2"
40+
step="0.10"
41+
value={speed}
42+
name="video-speed"
43+
onChange={(e) => changePlayback(e)}
44+
/>{" "}
45+
🐇
46+
</label>
47+
)}
48+
</div>
49+
);
50+
}

0 commit comments

Comments
 (0)