File size: 3,114 Bytes
f03e6d2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
class TestimonialsSlider extends HTMLElement {
  connectedCallback() {
    this.attachShadow({ mode: 'open' });
    this.shadowRoot.innerHTML = `
      <style>
        :host {
          display: block;
          padding: 2rem 0;
          background: var(--light);
        }
        .testimonials-container {
          max-width: 1200px;
          margin: 0 auto;
          padding: 0 20px;
        }
        .testimonials-title {
          text-align: center;
          margin-bottom: 2rem;
          color: var(--dark);
        }
        .testimonials-slider {
          display: flex;
          overflow-x: auto;
          scroll-snap-type: x mandatory;
          gap: 1rem;
          padding: 1rem 0;
          -webkit-overflow-scrolling: touch;
        }
        .testimonial-card {
          min-width: 300px;
          scroll-snap-align: start;
          background: white;
          border-radius: 12px;
          padding: 1.5rem;
          box-shadow: 0 4px 12px rgba(0,0,0,0.05);
        }
        .testimonial-content {
          font-style: italic;
          margin-bottom: 1rem;
          color: var(--dark);
        }
        .testimonial-author {
          display: flex;
          align-items: center;
          gap: 0.5rem;
        }
        .author-avatar {
          width: 40px;
          height: 40px;
          border-radius: 50%;
          object-fit: cover;
        }
        .author-info {
          display: flex;
          flex-direction: column;
        }
        .author-name {
          font-weight: 600;
          color: var(--dark);
        }
        .author-role {
          font-size: 0.8rem;
          color: var(--gray);
        }
      </style>
      
      <div class="testimonials-container">
        <h2 class="testimonials-title">Vad våra kunder säger</h2>
        <div class="testimonials-slider">
          <div class="testimonial-card">
            <p class="testimonial-content">
              "SafeSwitch har revolutionerat vår bilhandel. Inga mer oro för bedrägerier eller försenade betalningar."
            </p>
            <div class="testimonial-author">
              <img src="http://static.photos/people/120x120/1" alt="Anders" class="author-avatar">
              <div class="author-info">
                <span class="author-name">Anders Lundberg</span>
                <span class="author-role">VD, Lundbergs Bil</span>
              </div>
            </div>
          </div>
          <div class="testimonial-card">
            <p class="testimonial-content">
              "Som privatperson känner jag mig trygg med SafeSwitch. Allt är tydligt och lagligt."
            </p>
            <div class="testimonial-author">
              <img src="http://static.photos/people/120x120/2" alt="Maria" class="author-avatar">
              <div class="author-info">
                <span class="author-name">Maria Svensson</span>
                <span class="author-role">Privatkund</span>
              </div>
            </div>
          </div>
        </div>
      </div>
    `;
  }
}

customElements.define('testimonials-slider', TestimonialsSlider);