PluginProbe ʕ •ᴥ•ʔ
Presto Player / trunk
Presto Player vtrunk
4.3.0 4.2.4 4.2.3 4.2.2 4.2.0 4.2.1 trunk 1.10.0 1.10.1 1.10.2 1.11.0 1.12.0 1.13.0 1.14.0 1.14.1 1.5.10 1.5.11 1.5.12 1.5.13 1.5.14 1.5.15 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.10 1.6.11 1.6.12 1.6.13 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 1.6.9 1.7.0 1.7.1 1.7.2 1.8.0 1.8.1 1.8.2 1.8.3 1.8.4 1.8.5 1.8.6 1.9.0 1.9.1 1.9.10 1.9.11 1.9.12 1.9.13 1.9.14 1.9.2 1.9.3 1.9.4 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.1 2.0.10 2.0.11 2.0.12 2.0.13 2.0.14 2.0.15 2.0.16 2.0.2 2.0.3 2.0.4 2.0.5 2.0.6 2.0.7 2.0.8 2.0.9 2.1.0 2.2.0 2.2.1 2.2.2 2.2.3 2.2.3-beta1 2.3.0 2.3.1 2.3.2 2.3.3 3.0.0 3.0.0-beta1 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.1.0 3.1.1 3.1.2 3.1.3 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.0.5 4.0.6 4.0.7 4.0.8 4.1.0 4.1.1 4.1.2 4.1.3 4.1.4
presto-player / src / admin / dashboard / components / Onboarding / Welcome.js
presto-player / src / admin / dashboard / components / Onboarding Last commit date
Done.js 1 month ago Integrations.js 1 month ago PremiumFeatures.js 1 month ago UserInfo.js 1 month ago Welcome.js 1 month ago
Welcome.js
123 lines
1 import { useState, useEffect } from "react";
2 import { Button, Text, Title, Container } from "@bsf/force-ui";
3 import { ChevronRight, Check, Play, X } from "lucide-react";
4
5 const { __ } = wp.i18n;
6
7 const VIDEO_ID = "7ibtk_KTgCw";
8 const THUMBNAIL_URL = `https://img.youtube.com/vi/${VIDEO_ID}/maxresdefault.jpg`;
9
10 const HIGHLIGHTS = [
11 __("Embed YouTube, Vimeo, Bunny.net, self-hosted videos, and audio", "presto-player"),
12 __("Customize controls, branding, and chapter markers", "presto-player"),
13 __("Capture leads with opt-in gates and in-video CTAs", "presto-player"),
14 __("Works with Gutenberg, Elementor, Divi, and major LMS plugins", "presto-player"),
15 ];
16
17 const Welcome = ({ goToNextStep }) => {
18 const [isVideoOpen, setIsVideoOpen] = useState(false);
19
20 useEffect(() => {
21 if (!isVideoOpen) return;
22 const handleKeyDown = (e) => {
23 if (e.key === "Escape") setIsVideoOpen(false);
24 };
25 document.addEventListener("keydown", handleKeyDown);
26 return () => document.removeEventListener("keydown", handleKeyDown);
27 }, [isVideoOpen]);
28
29 return (
30 <>
31 <Container direction="column" gap="lg" className="gap-6">
32 <Container direction="column" gap="xs">
33 <Title
34 size="lg"
35 tag="h2"
36 title={__("Welcome to Presto Player", "presto-player")}
37 className="text-[30px] leading-[38px]"
38 />
39 <Text size={16} weight={500}>
40 {__("The Professional Video Player for WordPress.", "presto-player")}
41 </Text>
42 </Container>
43
44 <div
45 className="cursor-pointer group"
46 onClick={() => setIsVideoOpen(true)}
47 role="button"
48 aria-label={__("Play introduction video", "presto-player")}
49 tabIndex={0}
50 onKeyDown={(e) => {
51 if (e.key === "Enter" || e.key === " ") {
52 e.preventDefault();
53 setIsVideoOpen(true);
54 }
55 }}
56 >
57 <div className="relative w-full overflow-hidden rounded-xl">
58 <img
59 src={THUMBNAIL_URL}
60 alt={__("Presto Player Introduction", "presto-player")}
61 className="w-full h-auto object-cover block"
62 />
63 <div className="absolute inset-0 bg-black bg-opacity-0 group-hover:bg-opacity-10 transition-all duration-200" />
64 <div className="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-16 h-16 flex items-center justify-center bg-white bg-opacity-90 rounded-full shadow-lg group-hover:scale-110 transition-transform duration-200">
65 <Play className="size-7 text-brand-primary-600 ml-1 fill-current" />
66 </div>
67 </div>
68 </div>
69
70 <Container direction="column" gap="xs">
71 {HIGHLIGHTS.map((text, index) => (
72 <Container key={index} direction="row" align="center" gap="xs">
73 <Check className="size-4 text-icon-interactive flex-shrink-0" />
74 <Text size={14} weight={600} color="secondary">
75 {text}
76 </Text>
77 </Container>
78 ))}
79 </Container>
80
81 <hr className="border-t border-solid border-border-subtle border-b-0 m-0 w-full" />
82
83 <Container direction="row" justify="start" align="center">
84 <Button
85 className="px-4 w-max"
86 iconPosition="right"
87 icon={<ChevronRight />}
88 onClick={goToNextStep}
89 >
90 {__("Let's Get Started", "presto-player")}
91 </Button>
92 </Container>
93 </Container>
94
95 { isVideoOpen && (
96 <div
97 className="fixed inset-0 flex items-center justify-center bg-black bg-opacity-70 cursor-pointer w-screen z-[999999]"
98 onClick={ () => setIsVideoOpen( false ) }
99 >
100 <div className="text-white absolute top-4 right-4 flex items-center gap-2">
101 <span className="text-sm font-medium">{ __( 'Esc', 'presto-player' ) }</span>
102 <X size={ 20 } className="cursor-pointer" onClick={ () => setIsVideoOpen( false ) } />
103 </div>
104 <div
105 className="relative rounded-lg shadow-lg w-4/5 cursor-default"
106 onClick={ ( e ) => e.stopPropagation() }
107 >
108 <iframe
109 className="w-full lg:h-188 sm:h-120 h-60 rounded-lg border-0"
110 src={ `https://www.youtube-nocookie.com/embed/${VIDEO_ID}?autoplay=1` }
111 title={ __( 'Presto Player Introduction', 'presto-player' ) }
112 allow="autoplay; encrypted-media"
113 allowFullScreen
114 />
115 </div>
116 </div>
117 ) }
118 </>
119 );
120 };
121
122 export default Welcome;
123