Refactor code structure for improved readability and maintainability
This commit is contained in:
@@ -112,6 +112,77 @@ defined(security_key) or exit;
|
||||
color: var(--color-dark-blue);
|
||||
}
|
||||
|
||||
/* Return Request Section Styling */
|
||||
.return-request-section {
|
||||
background-color: var(--color-lighter-gray);
|
||||
border: 2px solid var(--color-primary);
|
||||
border-radius: 8px;
|
||||
padding: 30px;
|
||||
margin: 40px 0;
|
||||
}
|
||||
|
||||
.copy-btn-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.copy-btn {
|
||||
background-color: var(--color-primary);
|
||||
color: var(--color-white);
|
||||
padding: 10px 24px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
font-weight: 600;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.3s ease, transform 0.2s ease;
|
||||
box-shadow: 0 2px 4px rgba(255, 111, 0, 0.25);
|
||||
}
|
||||
|
||||
.copy-btn:hover {
|
||||
background-color: var(--color-primary-dark);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 4px 8px rgba(255, 111, 0, 0.35);
|
||||
}
|
||||
|
||||
.copy-btn:active {
|
||||
transform: translateY(0);
|
||||
background-color: var(--color-primary-darker);
|
||||
}
|
||||
|
||||
.copy-success {
|
||||
color: var(--color-green);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
}
|
||||
|
||||
.copy-success.show {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.template-textarea {
|
||||
width: 100%;
|
||||
min-height: 350px;
|
||||
padding: 15px;
|
||||
border: 2px solid var(--color-gray);
|
||||
border-radius: 4px;
|
||||
font-family: 'Courier New', monospace;
|
||||
font-size: 14px;
|
||||
line-height: 1.6;
|
||||
resize: vertical;
|
||||
background-color: var(--color-white);
|
||||
color: var(--color-text-dark);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.template-textarea:focus {
|
||||
outline: none;
|
||||
border-color: var(--color-primary);
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.content-section {
|
||||
padding: 40px 0;
|
||||
@@ -157,6 +228,31 @@ defined(security_key) or exit;
|
||||
.content-section h2 + ul {
|
||||
margin-left: 25px;
|
||||
}
|
||||
|
||||
.return-request-section {
|
||||
padding: 20px;
|
||||
margin: 30px 0;
|
||||
}
|
||||
|
||||
.template-header {
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
.copy-btn-container {
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.copy-btn {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.template-textarea {
|
||||
min-height: 300px;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
@@ -207,6 +303,22 @@ defined(security_key) or exit;
|
||||
.content-section h2 + ul {
|
||||
margin-left: 15px;
|
||||
}
|
||||
|
||||
.return-request-section {
|
||||
padding: 15px;
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.copy-btn {
|
||||
padding: 10px 20px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.template-textarea {
|
||||
min-height: 280px;
|
||||
font-size: 12px;
|
||||
padding: 12px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -223,7 +335,86 @@ defined(security_key) or exit;
|
||||
|
||||
<h2>Register a Return</h2>
|
||||
<p>To exercise this right, you can contact us via <a href="mailto:info@morvalwatches.com">info@morvalwatches.com</a>. We will then refund the order amount within 14 days after registering your return, provided the product has been received back in good condition.</p>
|
||||
|
||||
<h2>Making a Return</h2>
|
||||
<p>Use the template below to register your return. Click the "Copy Template" button, insert in your email client, fill in your details and send it to <a href="mailto:info@morvalwatches.com">info@morvalwatches.com</a>.</p>
|
||||
|
||||
<!-- Return Request Section with Template Always Visible -->
|
||||
<div class="return-request-section">
|
||||
<textarea class="template-textarea" id="templateText" readonly>I would like to register a return for my recent order.
|
||||
|
||||
ORDER DETAILS:
|
||||
Order Number: [Please enter your order number]
|
||||
Order Date: [Please enter the date you placed your order]
|
||||
Product(s): [Please list the product(s) you wish to return]
|
||||
|
||||
REASON FOR RETURN:
|
||||
[Please explain your reason for returning the product(s)]
|
||||
|
||||
CUSTOMER INFORMATION:
|
||||
Name: [Your full name]
|
||||
Email: [Your email address]
|
||||
Phone: [Your phone number]
|
||||
Return Address: [Your full address where the product should be collected or returned to]
|
||||
|
||||
I confirm that I am returning the product(s) within 14 days of receipt, with all supplied accessories, in their original condition and packaging.
|
||||
|
||||
Please confirm receipt of this return request and provide instructions for the return shipping.
|
||||
|
||||
Best regards,
|
||||
[Your name]</textarea>
|
||||
</div>
|
||||
<div class="template-header">
|
||||
<div class="copy-btn-container">
|
||||
<button class="copy-btn" id="copyBtn">Copy Template</button>
|
||||
<span class="copy-success" id="copySuccess">✓ Copied!</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>Returnadres</h2>
|
||||
<p>
|
||||
<?php echo company_name; ?> <br>
|
||||
<?php echo company_adres; ?><br>
|
||||
<?php echo company_postal . ' ' . footer_city; ?><br>
|
||||
<?php echo footer_country; ?>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Get elements
|
||||
const copyBtn = document.getElementById('copyBtn');
|
||||
const templateText = document.getElementById('templateText');
|
||||
const copySuccess = document.getElementById('copySuccess');
|
||||
|
||||
// Copy template to clipboard
|
||||
copyBtn.addEventListener('click', function() {
|
||||
templateText.select();
|
||||
templateText.setSelectionRange(0, 99999); // For mobile devices
|
||||
|
||||
try {
|
||||
document.execCommand('copy');
|
||||
|
||||
// Show success message
|
||||
copySuccess.classList.add('show');
|
||||
|
||||
// Change button text temporarily
|
||||
const originalText = copyBtn.textContent;
|
||||
copyBtn.textContent = 'Copied!';
|
||||
|
||||
// Reset after 2 seconds
|
||||
setTimeout(function() {
|
||||
copySuccess.classList.remove('show');
|
||||
copyBtn.textContent = originalText;
|
||||
}, 2000);
|
||||
} catch (err) {
|
||||
console.error('Failed to copy text: ', err);
|
||||
alert('Failed to copy template. Please select and copy manually.');
|
||||
}
|
||||
|
||||
// Deselect text
|
||||
window.getSelection().removeAllRanges();
|
||||
});
|
||||
</script>
|
||||
|
||||
<?=template_footer()?>
|
||||
|
||||
Reference in New Issue
Block a user