Responsive Image gallery in React js | Build a Photo Gallery With React js | Image Gallery in React

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ก.ย. 2024
  • Responsive Image gallery in React js | Build a Photo Gallery With React js
    ________________________________________
    Buy me a coffee: www.buymeacoff...
    React js frontend Project Tutorial Playlist :
    • React js frontend Proj...
    Telegram Channel Link-
    t.me/Reactjs_B...
    Instagram Link -
    / codewithyd
    Fb group-
    / 849818908701780
    _____________________________________________________
    This video is only education proposed
    This video is not designed to harm anyone.
    _____________________________________________________
    Track: Arc North - Meant To Be (feat. Krista Marina)
    Link: • Arc North - Meant To B...
    ______________________________________________________
    Track: Culture Code - Make Me Move (feat. Karra) [NCS Release]
    Music provided by NoCopyrightSounds.
    Watch: • Culture Code - Make Me...
    Free Download / Stream: ncs.io/makememove
    ______________________________________________________
    Track: Killercats - Kaibu [NCS Release]
    Music provided by NoCopyrightSounds.
    Video: • Killercats - Kaibu | T...
    Free Download / Stream: ncs.io/kaibu
    ______________________________________________________
    #codewithyd

ความคิดเห็น • 93

  • @eves.2825
    @eves.2825 8 หลายเดือนก่อน

    I tried so many galleries and libraries. This one was the nicest looking and the simplest to build! thank you, you're awesome

  • @lalamax3d
    @lalamax3d ปีที่แล้ว +4

    i love this video, thanks. ideally if git repo link is attached, that would have helped to see, why my result / behaviour is slightly different at end.

  • @MadmicadXP2
    @MadmicadXP2 ปีที่แล้ว +2

    Everything works up until the CloseIcon section! i implement the closeicon i get
    "ERROR Invalid hook call. "

  • @carlosvalenciahenao4629
    @carlosvalenciahenao4629 3 ปีที่แล้ว +5

    do you have the repo ? i have a problem and i can't fix it.
    the image when I click it shows me the stretched width

  • @muhammadumair9743
    @muhammadumair9743 2 ปีที่แล้ว +1

    Thanks man you solve my big problem by this short video thanks again💖

  • @curvesandcastles
    @curvesandcastles 2 ปีที่แล้ว +3

    Thank you! I used styled components instead of a css file and it worked great!

    • @codewithyd
      @codewithyd  2 ปีที่แล้ว +2

      Great support thanks 👍

    • @RohanRaj-cx5cz
      @RohanRaj-cx5cz 2 ปีที่แล้ว +1

      How did you style (model? 'model open' : "model") class using styled components?

    • @sandikos4943
      @sandikos4943 2 ปีที่แล้ว

      @@codewithyd how to add prev/next slide arrows?

    • @hagopderderian6824
      @hagopderderian6824 ปีที่แล้ว

      @@sandikos4943 theres a great video for that

  • @persitka
    @persitka 2 ปีที่แล้ว +2

    Cool, Круто спасибо! просто и ясно, а галерея получилась супер!

  • @suneelmekala54
    @suneelmekala54 25 วันที่ผ่านมา +1

    Excellent work

  • @dondrzzy
    @dondrzzy ปีที่แล้ว +2

    Exactly what I was looking for. Thanks

  • @Areeb_B
    @Areeb_B 22 วันที่ผ่านมา

    thank you so much for this video 🥰

  • @navaneethdevan-t3y
    @navaneethdevan-t3y 7 หลายเดือนก่อน

    The downside is that the order of the images goes from top to bottom and then to the next column. In most cases, we would want the order to be left to right.

  • @technosujeet
    @technosujeet 2 ปีที่แล้ว +2

    what is key={index}?? at 7:44
    BTW awesome tutorial man really loved it

  • @musefavori
    @musefavori 2 หลายเดือนก่อน

    Thank you so much for this tutorial !! 🤗

  • @sugarful5950
    @sugarful5950 2 ปีที่แล้ว +4

    beautiful work but how can we add the prev/next slide to this project

  • @devagunalan1056
    @devagunalan1056 2 ปีที่แล้ว

    Thank you very much for this .. Wish all the best in your development journey

  • @PavelHryn
    @PavelHryn 2 ปีที่แล้ว +1

    Vielen dank du hast mir sehr gut geholfen! Alles gute

    • @codewithyd
      @codewithyd  2 ปีที่แล้ว

      Thank you for your great support 👍👍

  • @billyalani2001
    @billyalani2001 2 ปีที่แล้ว +1

    thank you , you saved a lot of my time

  • @LeHoHoangThanhK17HCM
    @LeHoHoangThanhK17HCM 11 หลายเดือนก่อน

    thanks man, you save my life

  • @codewithnarutos
    @codewithnarutos 14 วันที่ผ่านมา

    Amazing bro🎉🎉😊

  • @sire906
    @sire906 ปีที่แล้ว

    makes complete sense thanks bro

  • @engbesher7479
    @engbesher7479 2 ปีที่แล้ว +1

    thanks it works but i have add more steps from my slef

    • @codewithyd
      @codewithyd  2 ปีที่แล้ว

      That's the great thing

  • @gulistabintemarium6402
    @gulistabintemarium6402 ปีที่แล้ว

    when I click the cross icon the modal doesn't ckise, i ahve 2 hours tryting to find the error and fix it, i used font awesome react icon, and exactly followed your code. even chatgpt couldn't figure out

  • @tharakaprabhath1236
    @tharakaprabhath1236 3 หลายเดือนก่อน

    thank you so much

  • @lessonscript
    @lessonscript 2 ปีที่แล้ว +1

    Thank you very much for this

    • @codewithyd
      @codewithyd  2 ปีที่แล้ว

      Welcome bro 🤗

  • @arkantostas8606
    @arkantostas8606 ปีที่แล้ว

    Hey, how about adding a see more button to show more images, i implemented but the sequence is broken of the image, some images go up

  • @ammarmansab4663
    @ammarmansab4663 6 หลายเดือนก่อน

    It doesn't work after deployment

  • @piantoart2199
    @piantoart2199 ปีที่แล้ว

    Thanks you it's amazing !

  • @johansapulete
    @johansapulete ปีที่แล้ว

    wht is the different between js and JSX..? because mine it isn't work but when i used tailwind class this is work

  • @FirstHighFlight
    @FirstHighFlight ปีที่แล้ว +1

    It helps, thanks!

  • @robervalfilho6291
    @robervalfilho6291 3 ปีที่แล้ว +1

    Thank you, very cool! ^^

    • @codewithyd
      @codewithyd  3 ปีที่แล้ว +2

      Thank you soo much for your great support .

  • @jarokgames
    @jarokgames 2 ปีที่แล้ว

    Hello, and how to implement on that "template" to move to another image? with side arrows (left, right) .. when opened last img, then reroll to first one

  • @moon-5-Line
    @moon-5-Line 5 หลายเดือนก่อน

    Thank you 🥰

  • @fred5882
    @fred5882 2 ปีที่แล้ว

    What would be the best approach to incorporate a "about me" and "contact" view? And why are my images not responsive or distortioned? I copy the exact same code.

  • @ArunG273
    @ArunG273 3 ปีที่แล้ว +1

    Is it possible to make like this in Gatsbyjs? There are very few video about it in youtube.

  • @lorenadufaur9500
    @lorenadufaur9500 2 ปีที่แล้ว +1

    Excelent! thanks

    • @codewithyd
      @codewithyd  2 ปีที่แล้ว

      Welcome to CodeWithYd 🤗

  • @carlosernestofz256
    @carlosernestofz256 2 ปีที่แล้ว +1

    Dude, Why does my pictures looks like the side of the website even with the CSS code? It is organized in column of 3, but no margin no nothing.
    Thanks//

    • @codewithyd
      @codewithyd  2 ปีที่แล้ว

      Welcome to CodeWithYd bro 🤗

  • @igbuduchibuzor7605
    @igbuduchibuzor7605 2 ปีที่แล้ว +1

    please what extension on chrome are you using to test the responsiveness

    • @codewithyd
      @codewithyd  2 ปีที่แล้ว +1

      I'm using chrome developer tool

    • @igbuduchibuzor7605
      @igbuduchibuzor7605 2 ปีที่แล้ว

      @@codewithyd thank You. please can you make a tutorial on how to add videos to the gallery? and a way to add many pictures without having to import them one by one and giving each one an id... like using a loop to add many pictures from a folder to the gallery

  • @balamuralimedia1653
    @balamuralimedia1653 ปีที่แล้ว

    Thanks bro ❤

  • @najibullahnaziry2018
    @najibullahnaziry2018 6 หลายเดือนก่อน

    close button is now working help me plz...

  • @Human_Evolution-
    @Human_Evolution- 2 ปีที่แล้ว +2

    Would rather have words.

  • @ajinathshinde5562
    @ajinathshinde5562 2 ปีที่แล้ว +1

    mast yaar,

    • @codewithyd
      @codewithyd  2 ปีที่แล้ว

      Thank you bro 🤗

  • @mariabibi9976
    @mariabibi9976 ปีที่แล้ว +1

    sir with your code i have face many errors because i havedoing react with typescript can you plz do this gallary with typescript

    • @codewithyd
      @codewithyd  ปีที่แล้ว

      Can you please share with me your source code

  • @cherishi.o9051
    @cherishi.o9051 3 ปีที่แล้ว +5

    I have looked at this 3 times now and I can't get my images to open up. I don't know what I am doing wrong

    • @codewithyd
      @codewithyd  3 ปีที่แล้ว

      Watch this video proper and code
      And thanks for your support 👍

    • @cherishi.o9051
      @cherishi.o9051 3 ปีที่แล้ว +13

      If anyone watching in the future has the same problems check your spacing for the names in the CSS.
      E.g.
      .model.open Not .model .open
      there should be no spacing, that was my problem

    • @shrion3128
      @shrion3128 3 ปีที่แล้ว

      @@cherishi.o9051 Hi cherish I am not able to close my model pointer is not displaying can you help

    • @shrion3128
      @shrion3128 3 ปีที่แล้ว +1

      .gallery {
      -webkit-column-count: 3;
      -moz-column-count: 3;
      column-count: 3;
      -webkit-column-width: 33%;
      -moz-column-width: 33%;
      column-width: 33%;
      padding: 0 12px;
      }
      .gallery .pics {
      -webkit-transition: all 350ms ease;
      transition: all 350ms ease;
      cursor: pointer;
      margin-bottom: 12px;
      }
      .gallery .pics:hover {
      filter: opacity(.8);
      }
      @media (max-width: 991px){
      .gallery {
      -webkit-column-count: 2;
      -moz-column-count: 2;
      column-count: 2;
      }
      }
      @media (max-width: 480px){
      .gallery {
      -webkit-column-count: 1;
      -moz-column-count: 1;
      column-count: 1;
      -webkit-column-width: 100%;
      -moz-column-width: 100%;
      column-width: 100%;
      }
      }
      /*model */
      .model {
      width: 100;
      height: 100vh;
      position: fixed;
      top:0;
      left: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: #000000;
      transition: opacity .4s ease, visibility .4s ease, transform .5s ease-in-out ;
      visibility: hidden;
      opacity: 0;
      transform: scale(0);
      overflow: hidden;
      z-index: 999;
      }
      .model.open {
      visibility: visible;
      opacity: 1;
      transform: scale(1);
      }
      .model img{
      width: auto;
      max-width: 100%;
      max-height: 100%;
      height: auto;
      display: block;
      line-height: 0;
      box-sizing: border-box;
      padding: 20px 0 20px;
      margin: 0 auto;
      }
      .model.open svg{
      position: fixed;
      top: 10px;
      right: 10px;
      width: 2rem;
      height: 2rem;
      padding: 5px;
      background-color: rgba(0, 0, 0, 0.4);
      color: #ffffff;
      cursor: pointer;
      }

    • @shrion3128
      @shrion3128 3 ปีที่แล้ว +1

      import React,{useState} from "react";
      import '../CSS/gallery.css';
      import CloseIcon from '@material-ui/icons/Close';
      const Gallery = () => {
      let data = [
      {
      id:1,
      imgSrc: 'Images/Home1.jpg',
      alt:''
      },
      {
      id:2,
      imgSrc: 'Images/Home2.jpg',
      alt:''
      },
      {
      id:3,
      imgSrc: 'Images/Home3.jpg',
      alt:''
      },
      {
      id:4,
      imgSrc: 'Images/collage.jpg',
      alt:''
      },
      {
      id:5,
      imgSrc: 'Images/Fantasy.jpg',
      alt:''
      },
      {
      id:6,
      imgSrc: 'Images/collage2.jpg',
      alt:''
      },
      {
      id:7,
      imgSrc: 'Images/home.jpg',
      alt:''
      },
      {
      id:8,
      imgSrc: 'Images/Home7.png',
      alt:''
      },
      {
      id:9,
      imgSrc: 'Images/Home8.jpg',
      alt:''
      },
      {
      id:10,
      imgSrc: 'Images/Home9.png',
      alt:''
      },
      {
      id:11,
      imgSrc: 'Images/Home10.jpg',
      alt:''
      },
      {
      id:12,
      imgSrc: 'Images/Home11.jpg',
      alt:''
      },
      {
      id:13,
      imgSrc: 'Images/Home12.jpg',
      alt:''
      },
      {
      id:14,
      imgSrc: 'Images/Home13.jpg',
      alt:''
      },
      {
      id:15,
      imgSrc: 'Images/Home14.jpg',
      alt:''
      },
      {
      id:16,
      imgSrc: 'Images/Home15.jpg',
      alt:''
      },
      {
      id:17,
      imgSrc: 'Images/Home16.jpg',
      alt:''
      },
      {
      id:18,
      imgSrc: 'Images/Home17.png',
      alt:''
      },
      {
      id:19,
      imgSrc: 'Images/Home18.jpg',
      alt:''
      },
      {
      id:20,
      imgSrc: 'Images/Home19.jpg',
      alt:''
      },
      ]
      const [model, setModel] = useState(false);
      const [tempimgSrc, setTempImgSrc] = useState('');
      const getImg = (imgSrc) => {
      setTempImgSrc(imgSrc);
      setModel(true);
      }
      return(

      setModel(false)} />
      { data.map((item,index)=>{
      return (
      getImg(item.imgSrc)}>
      )
      })}

      )
      }
      export default Gallery;

  • @上官安阳
    @上官安阳 2 ปีที่แล้ว

    how to add load more function to this project

  • @Abhinav-eb2xj
    @Abhinav-eb2xj 2 ปีที่แล้ว

    pics are unable to load

  • @kay1olukayode437
    @kay1olukayode437 2 ปีที่แล้ว

    whats the title of the song

  • @Abhinav-eb2xj
    @Abhinav-eb2xj 2 ปีที่แล้ว

    can i get source code and pics

  • @abdurrashidsawom1629
    @abdurrashidsawom1629 11 หลายเดือนก่อน

    source code??

  • @shrion3128
    @shrion3128 3 ปีที่แล้ว

    Hi cannot close the model can you help me can you share the code

    • @codewithyd
      @codewithyd  3 ปีที่แล้ว +1

      Check your project css and thank you for your support

    • @shrion3128
      @shrion3128 3 ปีที่แล้ว +1

      @@codewithyd Hi I have checked the video 5 times have not been able to resolve this issue im on last step cannot close the image after clicking it
      import React,{useState} from "react";
      import '../CSS/gallery.css';
      import CloseIcon from '@material-ui/icons/Close';
      const Gallery = () => {
      let data = [
      {
      id:1,
      imgSrc: 'Images/Home1.jpg',
      alt:''
      },
      {
      id:2,
      imgSrc: 'Images/Home2.jpg',
      alt:''
      },
      {
      id:3,
      imgSrc: 'Images/Home3.jpg',
      alt:''
      },
      {
      id:4,
      imgSrc: 'Images/collage.jpg',
      alt:''
      },
      {
      id:5,
      imgSrc: 'Images/Fantasy.jpg',
      alt:''
      },
      {
      id:6,
      imgSrc: 'Images/collage2.jpg',
      alt:''
      },
      {
      id:7,
      imgSrc: 'Images/home.jpg',
      alt:''
      },
      {
      id:8,
      imgSrc: 'Images/Home7.png',
      alt:''
      },
      {
      id:9,
      imgSrc: 'Images/Home8.jpg',
      alt:''
      },
      {
      id:10,
      imgSrc: 'Images/Home9.png',
      alt:''
      },
      {
      id:11,
      imgSrc: 'Images/Home10.jpg',
      alt:''
      },
      {
      id:12,
      imgSrc: 'Images/Home11.jpg',
      alt:''
      },
      {
      id:13,
      imgSrc: 'Images/Home12.jpg',
      alt:''
      },
      {
      id:14,
      imgSrc: 'Images/Home13.jpg',
      alt:''
      },
      {
      id:15,
      imgSrc: 'Images/Home14.jpg',
      alt:''
      },
      {
      id:16,
      imgSrc: 'Images/Home15.jpg',
      alt:''
      },
      {
      id:17,
      imgSrc: 'Images/Home16.jpg',
      alt:''
      },
      {
      id:18,
      imgSrc: 'Images/Home17.png',
      alt:''
      },
      {
      id:19,
      imgSrc: 'Images/Home18.jpg',
      alt:''
      },
      {
      id:20,
      imgSrc: 'Images/Home19.jpg',
      alt:''
      },
      ]
      const [model, setModel] = useState(false);
      const [tempimgSrc, setTempImgSrc] = useState('');
      const getImg = (imgSrc) => {
      setTempImgSrc(imgSrc);
      setModel(true);
      }
      return(



      setModel(false)} />


      { data.map((item,index)=>{
      return (
      getImg(item.imgSrc)}>


      )
      })}



      )

      }
      export default Gallery;

    • @shrion3128
      @shrion3128 3 ปีที่แล้ว

      .gallery {
      -webkit-column-count: 3;
      -moz-column-count: 3;
      column-count: 3;
      -webkit-column-width: 33%;
      -moz-column-width: 33%;
      column-width: 33%;
      padding: 0 12px;
      }
      .gallery .pics {
      -webkit-transition: all 350ms ease;
      transition: all 350ms ease;
      cursor: pointer;
      margin-bottom: 12px;
      }
      .gallery .pics:hover {
      filter: opacity(.8);

      }
      @media (max-width: 991px){
      .gallery {
      -webkit-column-count: 2;
      -moz-column-count: 2;
      column-count: 2;

      }
      }

      @media (max-width: 480px){
      .gallery {
      -webkit-column-count: 1;
      -moz-column-count: 1;
      column-count: 1;
      -webkit-column-width: 100%;
      -moz-column-width: 100%;
      column-width: 100%;

      }
      }
      /*model */
      .model {
      width: 100;
      height: 100vh;
      position: fixed;
      top:0;
      left: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      background-color: #000000;
      transition: opacity .4s ease, visibility .4s ease, transform .5s ease-in-out ;
      visibility: hidden;
      opacity: 0;
      transform: scale(0);
      overflow: hidden;
      z-index: 999;
      }
      .model.open {
      visibility: visible;
      opacity: 1;
      transform: scale(1);
      }
      .model img{
      width: auto;
      max-width: 100%;
      max-height: 100%;
      height: auto;
      display: block;
      line-height: 0;
      box-sizing: border-box;
      padding: 20px 0 20px;
      margin: 0 auto;

      }
      .model.open svg{
      position: fixed;
      top: 10px;
      right: 10px;
      width: 2rem;
      height: 2rem;
      padding: 5px;
      background-color: rgba(0, 0, 0, 0.4);
      color: #ffffff;
      cursor: pointer;
      }

    • @shrion3128
      @shrion3128 3 ปีที่แล้ว

      @@codewithyd hi it is resolved thanks for help

    • @parmeshwarpatil1545
      @parmeshwarpatil1545 3 ปีที่แล้ว

      @@shrion3128Hii bro, can u please send me the working code u have.. Please bez I got lots of error.. Please

  • @navaneethdevan-t3y
    @navaneethdevan-t3y 7 หลายเดือนก่อน

    The downside is that the order of the images goes from top to bottom and then to the next column. In most cases, we would want the order to be left to right.

  • @TheZx9man
    @TheZx9man 2 ปีที่แล้ว +1

    thanks for the great tutorial. I've tried to add a caption under the image. this doesn't work maybe because of the flex prop from the model class?

    • @TheZx9man
      @TheZx9man 2 ปีที่แล้ว +2

      I solved it with a div on the bottom, give it position fixed, width 100%, text-align center, some padding and background.

    • @codewithyd
      @codewithyd  2 ปีที่แล้ว

      Great 👍

  • @hosseinsarshar5462
    @hosseinsarshar5462 ปีที่แล้ว +1

    That's great, thanks man! Saved a ton of time

  • @svetlinnikolov5923
    @svetlinnikolov5923 2 ปีที่แล้ว

    if i want to move specific picture somewhere else ,how do i use this id in css file ?i try but..

  • @YogeshKumar-jz6cx
    @YogeshKumar-jz6cx 3 ปีที่แล้ว +1

    bro where are you I am eagerly waiting for your videos

    • @codewithyd
      @codewithyd  3 ปีที่แล้ว

      Sorry bro me thoda busy hu is liye

  • @pankajrao8764
    @pankajrao8764 ปีที่แล้ว

    Bro error is coming while importing gallery from './gallery';

    • @codewithyd
      @codewithyd  ปีที่แล้ว

      You check the code of './gallery' once, there must have been some mistake, that's why this error is there.

  • @corticent
    @corticent 2 ปีที่แล้ว +1

    This is awesome, thank you.😀

    • @codewithyd
      @codewithyd  2 ปีที่แล้ว

      Welcome to code with yd

  • @Fratilitau
    @Fratilitau 2 ปีที่แล้ว +1

    Awesome work sir, thank you!

  • @akashshil3575
    @akashshil3575 ปีที่แล้ว +1

    thanks

  • @oybekxayriddinov4619
    @oybekxayriddinov4619 2 ปีที่แล้ว +1

    good job

  • @kawsar.130
    @kawsar.130 2 ปีที่แล้ว

    Thanks for the Tutorial. Great work.