|  | 
|  | 1 | +const testimonialsContainer = document.querySelector(".testimonial-container"); | 
|  | 2 | +const testimonial = document.querySelector(".testimonial"); | 
|  | 3 | +const userImage = document.querySelector(".user-avater"); | 
|  | 4 | +const username = document.querySelector(".username"); | 
|  | 5 | +const twitterHandle = document.querySelector(".twitter-handle"); | 
|  | 6 | + | 
|  | 7 | +const testimonials = [ | 
|  | 8 | + { | 
|  | 9 | + name: "Guillermo Rauch", | 
|  | 10 | + position: "@rauchg", | 
|  | 11 | + photo: | 
|  | 12 | + "https://pbs.twimg.com/profile_images/1450115233205272576/CFTTK-0I_400x400.jpg", | 
|  | 13 | + text: "If I had to recommend a way of getting into programming today, it would be HTML + CSS with @tailwindcss The RoI is just incredible. This responsive demo is just ~21 custom CSS props. The whole thing is mostly built-in tailwind classes and vanilla HTML.", | 
|  | 14 | + }, | 
|  | 15 | + { | 
|  | 16 | + name: "Dacey Nolan", | 
|  | 17 | + position: "@dacey_nolan", | 
|  | 18 | + photo: | 
|  | 19 | + "https://pbs.twimg.com/profile_images/1356685491127656449/db8jKmuZ_400x400.jpg", | 
|  | 20 | + text: "I started using @tailwindcss. I instantly fell in love with their responsive modifiers, thorough documentation, and how easy it was customizing color palettes.", | 
|  | 21 | + }, | 
|  | 22 | + { | 
|  | 23 | + name: "Sarah Dayan", | 
|  | 24 | + position: "@frontstuff_io", | 
|  | 25 | + photo: | 
|  | 26 | + "https://pbs.twimg.com/profile_images/977873484759158784/mOItIR7M_400x400.jpg", | 
|  | 27 | + text: "Tailwind CSS is bridging the gap between design systems and products. It's becoming the defacto API for styling.", | 
|  | 28 | + }, | 
|  | 29 | + { | 
|  | 30 | + name: "Igor Randjelovic", | 
|  | 31 | + position: "@igor_randj", | 
|  | 32 | + photo: | 
|  | 33 | + "https://pbs.twimg.com/profile_images/970109919444824064/X0XU8ZD9_400x400.jpg", | 
|  | 34 | + text: "Tailwind clicked for me almost immediately. I can't picture myself writing another BEM class ever again. Happy user since the first public release! Productivity is at an all time high, thanks to @tailwindcss", | 
|  | 35 | + }, | 
|  | 36 | + { | 
|  | 37 | + name: "Dan Malone", | 
|  | 38 | + position: "@ohhdanm", | 
|  | 39 | + photo: | 
|  | 40 | + "https://pbs.twimg.com/profile_images/1523786296308736000/aJ7nC2LN_400x400.jpg", | 
|  | 41 | + text: "CSS has always been the hardest part of offering a digital service. It made me feel like a bad developer. Tailwind gives me confidence in web development again. Their docs are my first port of call.", | 
|  | 42 | + }, | 
|  | 43 | + { | 
|  | 44 | + name: "Sergio Peris", | 
|  | 45 | + position: "@sertxudev", | 
|  | 46 | + photo: | 
|  | 47 | + "https://pbs.twimg.com/profile_images/1526657447326371842/vtmVANH7_400x400.jpg", | 
|  | 48 | + text: "I thought 'Why would I need Tailwind CSS? I already know CSS and use Bootstrap', but after giving it a try I decided to switch all my projects to Tailwind.", | 
|  | 49 | + }, | 
|  | 50 | + { | 
|  | 51 | + name: "marckohlbrugge.eth", | 
|  | 52 | + position: "@marckohlbrugge", | 
|  | 53 | + photo: | 
|  | 54 | + "https://pbs.twimg.com/profile_images/1517414077534191616/fUc3KRh6_400x400.jpg", | 
|  | 55 | + text: "Before Tailwind CSS I was banging my head against the wall trying to make sense of my CSS spaghetti. Now I am banging my head against the wall wondering why I didn't try it earlier. My head hurts and my wall has a big hole in it. But at least using CSS is pleasant again!", | 
|  | 56 | + }, | 
|  | 57 | +]; | 
|  | 58 | + | 
|  | 59 | +let counter = 1; | 
|  | 60 | + | 
|  | 61 | +function showNextTestimonial() { | 
|  | 62 | + const { name, position, photo, text } = testimonials[counter]; | 
|  | 63 | + | 
|  | 64 | + testimonial.innerHTML = text; | 
|  | 65 | + userImage.src = photo; | 
|  | 66 | + username.innerHTML = name; | 
|  | 67 | + twitterHandle.innerHTML = position; | 
|  | 68 | + | 
|  | 69 | + counter++; | 
|  | 70 | + | 
|  | 71 | + if (counter > testimonials.length - 1) { | 
|  | 72 | + counter = 0; | 
|  | 73 | + } | 
|  | 74 | +} | 
|  | 75 | + | 
|  | 76 | +setInterval(showNextTestimonial, 10000); | 
0 commit comments