1- import React , { useState } from "react" ;
1+ import React from "react" ;
22import { Link } from "react-router-dom" ;
3- import Modal from "react-modal" ;
4- import { FaAngleRight , FaCheck , FaExternalLinkAlt } from "react-icons/fa" ;
3+ import { FaAngleRight , } from "react-icons/fa" ;
54import { starImage } from "../../assets/images" ;
65
7- const CodePlayground = ( { isOpen, onClose } ) => {
8- return (
9- < Modal
10- isOpen = { isOpen }
11- onRequestClose = { onClose }
12- contentLabel = "Code Playground"
13- className = "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center overflow-y-auto"
14- overlayClassName = " fixed inset-0 bg-black bg-opacity-50"
15- >
16- < div className = "bg-white py-7 lg:px-16 px-5 rounded-lg max-w-[90%] w-full lg:top-64 top-[400px] md:top-[200px] z-50 relative " >
17- < div className = "flex justify-between" >
18- < button
19- className = " hover:text-primaryPink transition-all"
20- onClick = { onClose }
21- >
22- Back
23- </ button >
24- < a
25- href = "https://codeplayground.vercel.app/"
26- target = "_blank"
27- rel = "noopener noreferrer"
28- className = "hover:text-primaryPink transition-all"
29- >
30- < FaExternalLinkAlt />
31- </ a >
32- </ div >
33- < h2 className = "text-2xl md:text-3xl lg:text-4xl mb-4 text-center " >
34- Explore Code Playground
35- </ h2 >
36- < div className = "flex mb-5 lg:justify-center flex-wrap gap-2 w-full" >
37- < div className = "flex items-center gap-2 " >
38- < span className = "text-primaryPink" >
39- < FaCheck />
40- </ span >
41- < p > HTML: The Building Blocks of Websites</ p >
42- </ div >
43- < div className = "flex items-center gap-2 " >
44- < span className = "text-primaryPink" >
45- < FaCheck />
46- </ span >
47- < p > CSS: Style Your Website Like a Pro</ p >
48- </ div >
49- < div className = "flex items-center gap-2 " >
50- < span className = "text-primaryPink" >
51- < FaCheck />
52- </ span >
53- < p > JavaScript: Bring Your Website to Life</ p >
54- </ div >
55- </ div >
56- < h2 className = "font-semibold text-lg my-4" > Description</ h2 >
57- < hr className = "border-primaryPink mb-5" />
58- < p className = "mb-10" >
59- This Playground allows you to experiment with code without having to
60- set up your own development environment. You can write HTML code to
61- structure the content of your webpage, CSS code to style the
62- appearance of your webpage, and JavaScript code to add interactivity
63- to your webpage. The playground will then execute your code and
64- display the results in a preview pane.
65- </ p >
66- < div className = "h-[70vh] overflow-y-auto mb-10" >
67- < iframe
68- src = "https://codeplayground.vercel.app/"
69- style = { { width : "100%" , height : "100%" , border : "none" } }
70- title = "Code Playground"
71- > </ iframe >
72- </ div >
73- </ div >
74- </ Modal >
75- ) ;
76- } ;
77-
78- const ReadyToCode = ( ) => {
79- const [ isLightboxOpen , setIsLightboxOpen ] = useState ( false ) ;
806
81- const openLightbox = ( ) => {
82- setIsLightboxOpen ( true ) ;
83- } ;
847
85- const closeLightbox = ( ) => {
86- setIsLightboxOpen ( false ) ;
87- } ;
8+ const ReadyToCode = ( ) => {
9+
8810
8911 return (
9012 < section
@@ -105,9 +27,8 @@ const ReadyToCode = () => {
10527 </ p >
10628 < div className = "flex justify-center my-7" >
10729 < Link
108- to = "# "
30+ to = "/code-playground "
10931 className = "text-white capitalize w-full max-w-[250px] h-[53px] rounded-[30px] text-sm flex items-center justify-center bg-primaryPink border-2 border-primaryPink hover:bg-transparent hover:text-primaryPink transition-all gap-2"
110- onClick = { openLightbox }
11132 >
11233 Click here to explore
11334 < span className = "text-sm flex items-center justify-center w-[24px] h-[24px] rounded-[50%] bg-white text-primaryPink" >
@@ -117,7 +38,6 @@ const ReadyToCode = () => {
11738 </ div >
11839 </ div >
11940 < img src = { starImage } alt = "" className = "max-md:hidden right-64 bottom-16 absolute" />
120- < CodePlayground isOpen = { isLightboxOpen } onClose = { closeLightbox } />
12141
12242 </ section >
12343 ) ;
0 commit comments