imseldrith commited on
Commit
e6ebfa2
·
verified ·
1 Parent(s): 0d187ac

Add more features

Browse files
Files changed (5) hide show
  1. components/feature-card.js +51 -0
  2. features.html +123 -105
  3. index.html +1 -0
  4. script.js +21 -1
  5. style.css +29 -1
components/feature-card.js ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ class FeatureCard extends HTMLElement {
2
+ connectedCallback() {
3
+ this.attachShadow({ mode: 'open' });
4
+ this.shadowRoot.innerHTML = `
5
+ <style>
6
+ .feature-card {
7
+ background: white;
8
+ border-radius: 0.5rem;
9
+ padding: 1.5rem;
10
+ box-shadow: 0 1px 3px rgba(0,0,0,0.1);
11
+ transition: all 0.3s ease;
12
+ height: 100%;
13
+ }
14
+ .feature-card:hover {
15
+ transform: translateY(-5px);
16
+ box-shadow: 0 10px 20px rgba(0,0,0,0.1);
17
+ }
18
+ .icon-container {
19
+ display: inline-flex;
20
+ padding: 0.75rem;
21
+ border-radius: 50%;
22
+ margin-bottom: 1rem;
23
+ }
24
+ h3 {
25
+ font-size: 1.25rem;
26
+ font-weight: 600;
27
+ margin-bottom: 0.75rem;
28
+ color: #1f2937;
29
+ }
30
+ p {
31
+ color: #6b7280;
32
+ margin-bottom: 1rem;
33
+ }
34
+ .feature-content {
35
+ margin-top: 1rem;
36
+ }
37
+ </style>
38
+ <div class="feature-card">
39
+ <div class="icon-container" style="background: ${this.getAttribute('icon-bg') || '#eef2ff'}; color: ${this.getAttribute('icon-color') || '#6366f1'}">
40
+ <i data-feather="${this.getAttribute('icon') || 'star'}"></i>
41
+ </div>
42
+ <h3>${this.getAttribute('title') || 'Feature'}</h3>
43
+ <p>${this.getAttribute('description') || 'Feature description'}</p>
44
+ <div class="feature-content">
45
+ <slot></slot>
46
+ </div>
47
+ </div>
48
+ `;
49
+ }
50
+ }
51
+ customElements.define('feature-card', FeatureCard);
features.html CHANGED
@@ -15,128 +15,146 @@
15
  <div class="max-w-6xl mx-auto">
16
  <h1 class="text-4xl font-bold text-gray-800 mb-4 text-center">Advanced Features</h1>
17
  <p class="text-xl text-gray-600 mb-12 text-center max-w-3xl mx-auto">Explore all the powerful tools to customize your handwriting experience</p>
18
-
19
  <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
20
- <!-- Feature 1 -->
21
- <div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition">
22
- <div class="p-6">
23
- <div class="flex items-center gap-3 mb-4">
24
- <div class="p-3 rounded-full bg-indigo-100 text-indigo-600">
25
- <i data-feather="type"></i>
26
- </div>
27
- <h3 class="text-xl font-semibold text-gray-800">Multiple Fonts</h3>
28
- </div>
29
- <p class="text-gray-600">Choose from 10+ realistic handwriting styles to match your personal writing</p>
30
- <div class="mt-4">
31
- <select class="w-full border border-gray-300 rounded-lg px-4 py-2">
32
- <option>Standard Handwriting</option>
33
- <option>Neat Print</option>
34
- <option>Casual Script</option>
35
- <option>Formal Cursive</option>
36
- </select>
37
- </div>
 
 
 
 
 
 
 
 
38
  </div>
39
- </div>
40
 
41
- <!-- Feature 2 -->
42
- <div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition">
43
- <div class="p-6">
44
- <div class="flex items-center gap-3 mb-4">
45
- <div class="p-3 rounded-full bg-pink-100 text-pink-600">
46
- <i data-feather="droplet"></i>
47
- </div>
48
- <h3 class="text-xl font-semibold text-gray-800">Ink Colors</h3>
49
- </div>
50
- <p class="text-gray-600">Customize with various ink colors and textures</p>
51
- <div class="mt-4 flex gap-2 flex-wrap">
52
- <div class="w-8 h-8 rounded-full bg-black cursor-pointer border-2 border-gray-200"></div>
53
- <div class="w-8 h-8 rounded-full bg-blue-600 cursor-pointer"></div>
54
- <div class="w-8 h-8 rounded-full bg-red-600 cursor-pointer"></div>
55
- <div class="w-8 h-8 rounded-full bg-green-600 cursor-pointer"></div>
56
- <div class="w-8 h-8 rounded-full bg-yellow-500 cursor-pointer"></div>
57
- </div>
58
  </div>
59
- </div>
60
 
61
- <!-- Feature 3 -->
62
- <div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition">
63
- <div class="p-6">
64
- <div class="flex items-center gap-3 mb-4">
65
- <div class="p-3 rounded-full bg-purple-100 text-purple-600">
66
- <i data-feather="paperclip"></i>
67
- </div>
68
- <h3 class="text-xl font-semibold text-gray-800">Paper Styles</h3>
69
- </div>
70
- <p class="text-gray-600">Select different paper backgrounds and textures</p>
71
- <div class="mt-4 grid grid-cols-3 gap-2">
72
- <div class="h-12 bg-white border cursor-pointer"></div>
73
- <div class="h-12 bg-gray-50 border cursor-pointer"></div>
74
- <div class="h-12 bg-amber-50 border cursor-pointer"></div>
75
- </div>
76
  </div>
77
- </div>
78
 
79
- <!-- Feature 4 -->
80
- <div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition">
81
- <div class="p-6">
82
- <div class="flex items-center gap-3 mb-4">
83
- <div class="p-3 rounded-full bg-blue-100 text-blue-600">
84
- <i data-feather="download-cloud"></i>
85
- </div>
86
- <h3 class="text-xl font-semibold text-gray-800">Export Options</h3>
87
- </div>
88
- <p class="text-gray-600">Save your work in multiple formats</p>
89
- <div class="mt-4 flex gap-3">
90
- <button class="px-4 py-2 bg-blue-100 text-blue-600 rounded-lg text-sm font-medium">PNG</button>
91
- <button class="px-4 py-2 bg-blue-100 text-blue-600 rounded-lg text-sm font-medium">PDF</button>
92
- <button class="px-4 py-2 bg-blue-100 text-blue-600 rounded-lg text-sm font-medium">SVG</button>
93
- </div>
94
  </div>
95
- </div>
96
 
97
- <!-- Feature 5 -->
98
- <div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition">
99
- <div class="p-6">
100
- <div class="flex items-center gap-3 mb-4">
101
- <div class="p-3 rounded-full bg-green-100 text-green-600">
102
- <i data-feather="share-2"></i>
103
- </div>
104
- <h3 class="text-xl font-semibold text-gray-800">Sharing</h3>
 
 
105
  </div>
106
- <p class="text-gray-600">Share directly to social media or generate a link</p>
107
- <div class="mt-4 flex gap-3">
108
- <button class="px-4 py-2 bg-green-100 text-green-600 rounded-lg text-sm font-medium flex items-center gap-1">
109
- <i data-feather="twitter" class="w-4 h-4"></i> Tweet
110
- </button>
111
- <button class="px-4 py-2 bg-green-100 text-green-600 rounded-lg text-sm font-medium">Copy Link</button>
112
  </div>
113
  </div>
114
- </div>
115
 
116
- <!-- Feature 6 -->
117
- <div class="bg-white rounded-xl shadow-md overflow-hidden hover:shadow-lg transition">
118
- <div class="p-6">
119
- <div class="flex items-center gap-3 mb-4">
120
- <div class="p-3 rounded-full bg-yellow-100 text-yellow-600">
121
- <i data-feather="settings"></i>
122
- </div>
123
- <h3 class="text-xl font-semibold text-gray-800">Advanced Settings</h3>
 
 
124
  </div>
125
- <p class="text-gray-600">Fine-tune your handwriting appearance</p>
126
- <div class="mt-4 space-y-3">
127
- <div class="flex items-center justify-between">
128
- <span class="text-sm text-gray-600">Letter Spacing</span>
129
- <input type="range" class="w-24">
130
- </div>
131
- <div class="flex items-center justify-between">
132
- <span class="text-sm text-gray-600">Line Height</span>
133
- <input type="range" class="w-24">
134
- </div>
135
  </div>
136
  </div>
137
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  </div>
139
- </div>
140
  </main>
141
 
142
  <custom-footer></custom-footer>
 
15
  <div class="max-w-6xl mx-auto">
16
  <h1 class="text-4xl font-bold text-gray-800 mb-4 text-center">Advanced Features</h1>
17
  <p class="text-xl text-gray-600 mb-12 text-center max-w-3xl mx-auto">Explore all the powerful tools to customize your handwriting experience</p>
 
18
  <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
19
+ <feature-card
20
+ icon="type"
21
+ title="Multiple Fonts"
22
+ description="Choose from 10+ realistic handwriting styles"
23
+ icon-color="#6366f1"
24
+ icon-bg="#e0e7ff">
25
+ <select class="w-full border border-gray-300 rounded-lg px-4 py-2 mt-2">
26
+ <option>Standard Handwriting</option>
27
+ <option>Neat Print</option>
28
+ <option>Casual Script</option>
29
+ <option>Formal Cursive</option>
30
+ </select>
31
+ </feature-card>
32
+
33
+ <feature-card
34
+ icon="droplet"
35
+ title="Ink Colors"
36
+ description="Customize with various ink colors and textures"
37
+ icon-color="#ec4899"
38
+ icon-bg="#fce7f3">
39
+ <div class="mt-2 flex gap-2 flex-wrap">
40
+ <div class="w-8 h-8 rounded-full bg-black cursor-pointer border-2 border-gray-200"></div>
41
+ <div class="w-8 h-8 rounded-full bg-blue-600 cursor-pointer"></div>
42
+ <div class="w-8 h-8 rounded-full bg-red-600 cursor-pointer"></div>
43
+ <div class="w-8 h-8 rounded-full bg-green-600 cursor-pointer"></div>
44
+ <div class="w-8 h-8 rounded-full bg-yellow-500 cursor-pointer"></div>
45
  </div>
46
+ </feature-card>
47
 
48
+ <feature-card
49
+ icon="paperclip"
50
+ title="Paper Styles"
51
+ description="Select different paper backgrounds and textures"
52
+ icon-color="#8b5cf6"
53
+ icon-bg="#ede9fe">
54
+ <div class="mt-2 grid grid-cols-3 gap-2">
55
+ <div class="h-12 bg-white border cursor-pointer"></div>
56
+ <div class="h-12 bg-gray-50 border cursor-pointer"></div>
57
+ <div class="h-12 bg-amber-50 border cursor-pointer"></div>
 
 
 
 
 
 
 
58
  </div>
59
+ </feature-card>
60
 
61
+ <feature-card
62
+ icon="download-cloud"
63
+ title="Export Options"
64
+ description="Save your work in multiple formats"
65
+ icon-color="#3b82f6"
66
+ icon-bg="#dbeafe">
67
+ <div class="mt-2 flex gap-3">
68
+ <button class="px-4 py-2 bg-blue-100 text-blue-600 rounded-lg text-sm font-medium">PNG</button>
69
+ <button class="px-4 py-2 bg-blue-100 text-blue-600 rounded-lg text-sm font-medium">PDF</button>
70
+ <button class="px-4 py-2 bg-blue-100 text-blue-600 rounded-lg text-sm font-medium">SVG</button>
 
 
 
 
 
71
  </div>
72
+ </feature-card>
73
 
74
+ <feature-card
75
+ icon="share-2"
76
+ title="Sharing"
77
+ description="Share directly to social media or generate a link"
78
+ icon-color="#10b981"
79
+ icon-bg="#d1fae5">
80
+ <div class="mt-2 flex gap-3">
81
+ <button class="px-4 py-2 bg-green-100 text-green-600 rounded-lg text-sm font-medium flex items-center gap-1">
82
+ <i data-feather="twitter" class="w-4 h-4"></i> Tweet
83
+ </button>
84
+ <button class="px-4 py-2 bg-green-100 text-green-600 rounded-lg text-sm font-medium">Copy Link</button>
 
 
 
 
85
  </div>
86
+ </feature-card>
87
 
88
+ <feature-card
89
+ icon="settings"
90
+ title="Advanced Settings"
91
+ description="Fine-tune your handwriting appearance"
92
+ icon-color="#f59e0b"
93
+ icon-bg="#fef3c7">
94
+ <div class="mt-2 space-y-3">
95
+ <div class="flex items-center justify-between">
96
+ <span class="text-sm text-gray-600">Letter Spacing</span>
97
+ <input type="range" class="w-24">
98
  </div>
99
+ <div class="flex items-center justify-between">
100
+ <span class="text-sm text-gray-600">Line Height</span>
101
+ <input type="range" class="w-24">
 
 
 
102
  </div>
103
  </div>
104
+ </feature-card>
105
 
106
+ <feature-card
107
+ icon="bold"
108
+ title="Pen Pressure"
109
+ description="Simulate natural pen pressure variations"
110
+ icon-color="#ef4444"
111
+ icon-bg="#fee2e2">
112
+ <div class="mt-2 space-y-3">
113
+ <div class="flex items-center justify-between">
114
+ <span class="text-sm text-gray-600">Pressure Variance</span>
115
+ <input type="range" class="w-24">
116
  </div>
117
+ <div class="flex items-center gap-2">
118
+ <input type="checkbox" id="randomPressure" class="rounded text-red-500">
119
+ <label for="randomPressure" class="text-sm text-gray-600">Random variation</label>
 
 
 
 
 
 
 
120
  </div>
121
  </div>
122
+ </feature-card>
123
+
124
+ <feature-card
125
+ icon="layers"
126
+ title="Multilingual Support"
127
+ description="Supports multiple languages and scripts"
128
+ icon-color="#14b8a6"
129
+ icon-bg="#ccfbf1">
130
+ <div class="mt-2">
131
+ <select class="w-full border border-gray-300 rounded-lg px-4 py-2">
132
+ <option>English</option>
133
+ <option>Spanish</option>
134
+ <option>French</option>
135
+ <option>German</option>
136
+ <option>Japanese</option>
137
+ </select>
138
+ </div>
139
+ </feature-card>
140
+
141
+ <feature-card
142
+ icon="bookmark"
143
+ title="Templates"
144
+ description="Save and reuse your favorite settings"
145
+ icon-color="#8b5cf6"
146
+ icon-bg="#ede9fe">
147
+ <div class="mt-2 space-y-2">
148
+ <button class="w-full px-4 py-2 bg-purple-100 text-purple-600 rounded-lg text-sm font-medium">
149
+ Save Current Settings
150
+ </button>
151
+ <button class="w-full px-4 py-2 bg-white border border-purple-200 text-purple-600 rounded-lg text-sm font-medium">
152
+ Load Template
153
+ </button>
154
+ </div>
155
+ </feature-card>
156
  </div>
157
+ </div>
158
  </main>
159
 
160
  <custom-footer></custom-footer>
index.html CHANGED
@@ -63,6 +63,7 @@
63
 
64
  <script src="components/navbar.js"></script>
65
  <script src="components/footer.js"></script>
 
66
  <script src="script.js"></script>
67
  <script>
68
  feather.replace();
 
63
 
64
  <script src="components/navbar.js"></script>
65
  <script src="components/footer.js"></script>
66
+ <script src="components/feature-card.js"></script>
67
  <script src="script.js"></script>
68
  <script>
69
  feather.replace();
script.js CHANGED
@@ -1,12 +1,32 @@
 
1
  document.addEventListener('DOMContentLoaded', function() {
 
 
 
 
 
2
  const inputText = document.getElementById('inputText');
3
  const generateBtn = document.getElementById('generateBtn');
4
  const downloadBtn = document.getElementById('downloadBtn');
5
  const outputCanvas = document.getElementById('outputCanvas');
6
  const showLines = document.getElementById('showLines');
 
 
 
7
 
 
 
 
 
 
 
 
 
 
 
 
8
  generateBtn.addEventListener('click', function() {
9
- const text = inputText.value.trim();
10
  if (!text) {
11
  outputCanvas.innerHTML = '<p class="text-gray-400">Please enter some text first</p>';
12
  return;
 
1
+
2
  document.addEventListener('DOMContentLoaded', function() {
3
+ // Initialize all feature cards
4
+ document.querySelectorAll('feature-card').forEach(card => {
5
+ feather.replace({ 'data-feather': card.shadowRoot.querySelector('[data-feather]') });
6
+ });
7
+
8
  const inputText = document.getElementById('inputText');
9
  const generateBtn = document.getElementById('generateBtn');
10
  const downloadBtn = document.getElementById('downloadBtn');
11
  const outputCanvas = document.getElementById('outputCanvas');
12
  const showLines = document.getElementById('showLines');
13
+ const fontSizeInput = document.getElementById('fontSize');
14
+ const lineHeightInput = document.getElementById('lineHeight');
15
+ const letterSpacingInput = document.getElementById('letterSpacing');
16
 
17
+ // Initialize range inputs
18
+ if (fontSizeInput) {
19
+ fontSizeInput.addEventListener('input', updatePreview);
20
+ }
21
+ if (lineHeightInput) {
22
+ lineHeightInput.addEventListener('input', updatePreview);
23
+ }
24
+ if (letterSpacingInput) {
25
+ letterSpacingInput.addEventListener('input', updatePreview);
26
+ }
27
+
28
  generateBtn.addEventListener('click', function() {
29
+ const text = inputText.value.trim();
30
  if (!text) {
31
  outputCanvas.innerHTML = '<p class="text-gray-400">Please enter some text first</p>';
32
  return;
style.css CHANGED
@@ -10,10 +10,38 @@ body {
10
  font-family: 'Handwriting';
11
  src: url('https://fonts.gstatic.com/s/indieflower/v12/m8JVjfNVeKWVnh3QMuKkFcZVaUuH99GUDg.woff2') format('woff2');
12
  }
13
-
14
  .handwriting {
15
  font-family: 'Handwriting', cursive;
 
 
 
 
 
 
 
 
16
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  /* Feature cards animation */
18
  @keyframes fadeInUp {
19
  from { opacity: 0; transform: translateY(20px); }
 
10
  font-family: 'Handwriting';
11
  src: url('https://fonts.gstatic.com/s/indieflower/v12/m8JVjfNVeKWVnh3QMuKkFcZVaUuH99GUDg.woff2') format('woff2');
12
  }
 
13
  .handwriting {
14
  font-family: 'Handwriting', cursive;
15
+ transition: all 0.3s ease;
16
+ }
17
+
18
+ /* Responsive adjustments */
19
+ @media (max-width: 640px) {
20
+ .handwriting {
21
+ font-size: 1.2rem !important;
22
+ }
23
  }
24
+
25
+ /* Animation for new features */
26
+ @keyframes featureReveal {
27
+ from { opacity: 0; transform: translateY(20px); }
28
+ to { opacity: 1; transform: translateY(0); }
29
+ }
30
+
31
+ feature-card {
32
+ animation: featureReveal 0.5s ease-out forwards;
33
+ opacity: 0;
34
+ }
35
+
36
+ feature-card:nth-child(1) { animation-delay: 0.1s; }
37
+ feature-card:nth-child(2) { animation-delay: 0.2s; }
38
+ feature-card:nth-child(3) { animation-delay: 0.3s; }
39
+ feature-card:nth-child(4) { animation-delay: 0.4s; }
40
+ feature-card:nth-child(5) { animation-delay: 0.5s; }
41
+ feature-card:nth-child(6) { animation-delay: 0.6s; }
42
+ feature-card:nth-child(7) { animation-delay: 0.7s; }
43
+ feature-card:nth-child(8) { animation-delay: 0.8s; }
44
+ feature-card:nth-child(9) { animation-delay: 0.9s; }
45
  /* Feature cards animation */
46
  @keyframes fadeInUp {
47
  from { opacity: 0; transform: translateY(20px); }