File size: 3,303 Bytes
509f3c2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
class CustomFeatureCard extends HTMLElement {
  constructor() {
    super();
    this.icon = this.getAttribute('icon') || 'code';
    this.title = this.getAttribute('title') || 'Feature';
    this.description = this.getAttribute('description') || 'Description';
    this.ctaText = this.getAttribute('cta-text') || 'Try Now';
    this.color = this.getAttribute('color') || 'primary';
  }

  connectedCallback() {
    this.attachShadow({ mode: 'open' });
    this.shadowRoot.innerHTML = `
      <style>
        :host {
          display: block;
        }
        .feature-card {
          background: linear-gradient(145deg, rgba(31, 41, 55, 0.8), rgba(17, 24, 39, 0.8));
          border: 1px solid rgba(55, 65, 81, 0.3);
          border-radius: 1rem;
          padding: 1.5rem;
          transition: all 0.3s ease;
          height: 100%;
        }
        .feature-card:hover {
          transform: translateY(-5px);
          box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3);
          border-color: rgba(34, 197, 94, 0.5);
        }
        .icon-container {
          width: 3.5rem;
          height: 3.5rem;
          border-radius: 0.75rem;
          display: flex;
          align-items: center;
            justify-content: center;
            margin-bottom: 1rem;
        }
        .primary-icon {
          background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
        }
        .secondary-icon {
          background: linear-gradient(135deg, rgba(217, 70, 239, 0.15), rgba(217, 70, 239, 0.05));
        }
        .primary-text {
          color: #22c55e;
        }
        .secondary-text {
          color: #d946ef;
        }
        h3 {
          font-size: 1.25rem;
          font-weight: 600;
          margin-bottom: 0.75rem;
        }
        p {
          color: #d1d5db;
          margin-bottom: 1rem;
          line-height: 1.5;
        }
        .cta-button {
          display: inline-flex;
          align-items: center;
          padding: 0.5rem 1rem;
          border-radius: 0.5rem;
          font-weight: 500;
          transition: all 0.2s ease;
        }
        .primary-cta {
          background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
          color: #22c55e;
        }
        .secondary-cta {
          background: linear-gradient(135deg, rgba(217, 70, 239, 0.15), rgba(217, 70, 239, 0.05));
          color: #d946ef;
        }
        .cta-button:hover {
          transform: translateX(3px);
        }
      </style>
      <div class="feature-card fade-in hover-lift">
        <div class="icon-container ${this.color === 'primary' ? 'primary-icon' : 'secondary-icon'}">
        <i data-feather="${this.icon}" class="w-6 h-6 ${this.color === 'primary' ? 'primary-text' : 'secondary-text'}"></i>
      </div>
      <h3>${this.title}</h3>
      <p>${this.description}</p>
      <a href="#try-sample" class="cta-button ${this.color === 'primary' ? 'primary-cta' : 'secondary-cta'}">
          <i data-feather="arrow-right" class="w-4 h-4 mr-2"></i>
          ${this.ctaText}
        </a>
      </div>
    `;
    
    setTimeout(() => {
      if (typeof feather !== 'undefined') {
        feather.replace();
      }
    }, 100);
  }
}

customElements.define('custom-feature-card', CustomFeatureCard);