File size: 4,404 Bytes
cb48938
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
class CustomTestimonials extends HTMLElement {
    constructor() {
        super();
        this.attachShadow({ mode: 'open' });
        this.testimonials = [
            {
                name: "Sarah Johnson",
                role: "Frontend Developer",
                content: "These components saved me countless hours of development time. The quality is exceptional and they integrate seamlessly with my projects.",
                avatar: "http://static.photos/people/200x200/1"
            },
            {
                name: "Michael Chen",
                role: "UI Designer",
                content: "As a designer, I appreciate the attention to detail in these components. They're beautiful out of the box but also easy to customize.",
                avatar: "http://static.photos/people/200x200/2"
            },
            {
                name: "Emma Rodriguez",
                role: "Product Manager",
                content: "Our team's productivity has increased dramatically since we started using these components. Highly recommended!",
                avatar: "http://static.photos/people/200x200/3"
            }
        ];

        this.render();
    }

    render() {
        this.shadowRoot.innerHTML = `
            <style>
                :host {
                    display: block;
                }
                .testimonials-container {
                    max-width: 1200px;
                    margin: 0 auto;
                }
                .section-title {
                    text-align: center;
                    font-size: 2rem;
                    font-weight: 700;
                    margin-bottom: 3rem;
                    color: #111827;
                }
                .testimonials-grid {
                    display: grid;
                    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
                    gap: 2rem;
                }
                .testimonial-card {
                    background-color: white;
                    border-radius: 0.5rem;
                    padding: 2rem;
                    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
                    transition: all 0.3s ease;
                }
                .testimonial-card:hover {
                    transform: translateY(-5px);
                    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
                }
                .testimonial-content {
                    font-style: italic;
                    color: #4b5563;
                    margin-bottom: 1.5rem;
                    line-height: 1.6;
                }
                .testimonial-author {
                    display: flex;
                    align-items: center;
                    gap: 1rem;
                }
                .author-avatar {
                    width: 50px;
                    height: 50px;
                    border-radius: 50%;
                    object-fit: cover;
                }
                .author-info {
                    display: flex;
                    flex-direction: column;
                }
                .author-name {
                    font-weight: 600;
                    color: #111827;
                }
                .author-role {
                    color: #6b7280;
                    font-size: 0.875rem;
                }
            </style>
            <div class="testimonials-container">
                <h2 class="section-title">What People Are Saying</h2>
                <div class="testimonials-grid">
                    ${this.testimonials.map(testimonial => `
                        <div class="testimonial-card">
                            <p class="testimonial-content">"${testimonial.content}"</p>
                            <div class="testimonial-author">
                                <img src="${testimonial.avatar}" alt="${testimonial.name}" class="author-avatar">
                                <div class="author-info">
                                    <span class="author-name">${testimonial.name}</span>
                                    <span class="author-role">${testimonial.role}</span>
                                </div>
                            </div>
                        </div>
                    `).join('')}
                </div>
            </div>
        `;
    }
}
customElements.define('custom-testimonials', CustomTestimonials);