Skip to content

Commit c0d1a86

Browse files
committed
Add website display options and update social links in signature creator
1 parent 3afc91e commit c0d1a86

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ <h3>Personal Information</h3>
5252
<input type="text" id="websiteLabel" placeholder="www.example.com">
5353
</div>
5454

55+
5556
<div class="social-section">
5657
<h4>Social Networks</h4>
5758
<div class="social-item">
@@ -105,6 +106,13 @@ <h3>Style</h3>
105106
<option value="right">Right</option>
106107
</select>
107108
</div>
109+
<div class="form-group" id="websiteDisplaySection" style="display: none;">
110+
<label for="websiteDisplay">Website Display:</label>
111+
<select id="websiteDisplay">
112+
<option value="icon">Show as icon in social links</option>
113+
<option value="bottom">Show as section at bottom</option>
114+
</select>
115+
</div>
108116
<div class="form-group">
109117
<label class="checkbox-label">
110118
<input type="checkbox" id="logoHyperlink" checked>

script.js

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ document.addEventListener('DOMContentLoaded', function() {
88
phone: document.getElementById('phone'),
99
websiteUrl: document.getElementById('websiteUrl'),
1010
websiteLabel: document.getElementById('websiteLabel'),
11+
websiteDisplay: document.getElementById('websiteDisplay'),
1112
logoHyperlink: document.getElementById('logoHyperlink'),
1213
logoUrl: document.getElementById('logoUrl'),
1314
template: document.getElementById('template'),
@@ -23,6 +24,7 @@ document.addEventListener('DOMContentLoaded', function() {
2324
const copyHTMLButton = document.getElementById('copyHTMLButton');
2425
const copySuccess = document.getElementById('copySuccess');
2526
const stylingSection = document.getElementById('stylingSection');
27+
const websiteDisplaySection = document.getElementById('websiteDisplaySection');
2628
const logoUrlGroup = document.getElementById('logoUrlGroup');
2729
const linkedinGroup = document.getElementById('linkedinGroup');
2830
const twitterGroup = document.getElementById('twitterGroup');
@@ -96,7 +98,7 @@ document.addEventListener('DOMContentLoaded', function() {
9698
${data.email ? `<div class="contact-item"><strong>Email:</strong> <a href="mailto:${data.email}" style="color: #000; text-decoration: none;">${data.email}</a></div>` : ''}
9799
${(data.showLinkedin && data.linkedin) ? `<div class="contact-item"><strong>Linkedin:</strong> <a href="https://linkedin.com/in/${data.linkedin}" style="color: #000; text-decoration: none;">${data.linkedin}</a></div>` : ''}
98100
${(data.showTwitter && data.twitter) ? `<div class="contact-item"><strong>X:</strong> <a href="https://x.com/${data.twitter}" style="color: #000; text-decoration: none;">@${data.twitter}</a></div>` : ''}
99-
${(data.websiteUrl && data.websiteLabel) ? `<div class="website"><a href="${data.websiteUrl}" style="color: #000; text-decoration: none; font-weight: bold;">${data.websiteLabel}</a></div>` : ''}
101+
${data.websiteUrl ? `<div class="website"><a href="${data.websiteUrl}" style="color: #000; text-decoration: none; font-weight: bold;"><img src="static/icons/global-line.png" alt="Website" style="width: 16px; height: 16px; vertical-align: middle; margin-right: 5px;" />${data.websiteLabel || data.websiteUrl}</a></div>` : ''}
100102
</div>
101103
`,
102104

@@ -107,18 +109,18 @@ document.addEventListener('DOMContentLoaded', function() {
107109
${data.fullName ? `<div class="name">${data.fullName}</div>` : ''}
108110
${data.jobTitle ? `<div class="title">${data.jobTitle}</div>` : ''}
109111
</div>
110-
${(data.showLinkedin && data.linkedin) || (data.showTwitter && data.twitter) ? `
111-
<div class="social-links">
112-
${(data.showLinkedin && data.linkedin) ? `<a href="https://linkedin.com/in/${data.linkedin}" class="social-icon" style="text-decoration: none;"><img src="static/socials/Linkedin-Logo--Streamline-Logos-Block.png" alt="LinkedIn" /></a>` : ''}
113-
${(data.showTwitter && data.twitter) ? `<a href="https://x.com/${data.twitter}" class="social-icon" style="text-decoration: none;"><img src="static/socials/X-Twitter-Logo--Streamline-Logos-Block.png" alt="X" /></a>` : ''}
114-
</div>
115-
` : ''}
112+
<div class="social-links">
113+
${(data.showLinkedin && data.linkedin) ? `<a href="https://linkedin.com/in/${data.linkedin}" class="social-icon" style="text-decoration: none;"><img src="static/socials/Linkedin-Logo--Streamline-Logos-Block.png" alt="LinkedIn" /></a>` : ''}
114+
${(data.showTwitter && data.twitter) ? `<a href="https://x.com/${data.twitter}" class="social-icon" style="text-decoration: none;"><img src="static/socials/X-Twitter-Logo--Streamline-Logos-Block.png" alt="X" /></a>` : ''}
115+
${(data.websiteUrl && data.websiteDisplay !== 'bottom') ? `<a href="${data.websiteUrl}" class="social-icon" style="text-decoration: none;"><img src="static/icons/global-line.png" alt="Website" /></a>` : ''}
116+
</div>
116117
</div>
117118
<div class="contact-info">
118119
${data.phone ? `<div class="contact-item"><strong>Mobile:</strong> ${data.phone}</div>` : ''}
119120
${data.email ? `<div class="contact-item"><strong>Email:</strong> <a href="mailto:${data.email}" style="color: #000; text-decoration: none;">${data.email}</a></div>` : ''}
120121
</div>
121122
${data.company ? `<div class="company-logo">${generateLogo(data, data.company)}</div>` : ''}
123+
${(data.websiteUrl && data.websiteDisplay === 'bottom') ? `<div class="website"><a href="${data.websiteUrl}" style="color: #000; text-decoration: none; font-weight: bold;">${data.websiteLabel || data.websiteUrl}</a></div>` : ''}
122124
</div>
123125
`
124126
};
@@ -133,6 +135,7 @@ document.addEventListener('DOMContentLoaded', function() {
133135
phone: form.phone.value.trim(),
134136
websiteUrl: form.websiteUrl.value.trim(),
135137
websiteLabel: form.websiteLabel.value.trim(),
138+
websiteDisplay: form.websiteDisplay.value,
136139
logoHyperlink: form.logoHyperlink.checked,
137140
logoUrl: form.logoUrl.value.trim(),
138141
template: form.template.value,
@@ -152,6 +155,13 @@ document.addEventListener('DOMContentLoaded', function() {
152155
} else {
153156
stylingSection.style.display = 'none';
154157
}
158+
159+
// Show website display option only for modern template
160+
if (selectedTemplate === 'modern') {
161+
websiteDisplaySection.style.display = 'block';
162+
} else {
163+
websiteDisplaySection.style.display = 'none';
164+
}
155165
}
156166

157167
// Show/hide logo URL field based on checkbox

static/icons/global-line.png

630 Bytes
Loading

0 commit comments

Comments
 (0)