| 1 |
<?php if ( ! defined( 'ABSPATH' ) ) exit; ?> |
| 2 |
<style> |
| 3 |
|
| 4 |
.fluent-cart-sandbox-connect-manually { |
| 5 |
max-width: 400px; |
| 6 |
width: 100%; |
| 7 |
padding: 24px; |
| 8 |
margin: 35px auto 0; |
| 9 |
border-radius: 7px; |
| 10 |
} |
| 11 |
form { |
| 12 |
max-width: 768px; |
| 13 |
width: 100%; |
| 14 |
} |
| 15 |
.header { |
| 16 |
display: flex; |
| 17 |
justify-content: space-between; |
| 18 |
align-items: flex-start; |
| 19 |
margin-bottom: 8px; |
| 20 |
} |
| 21 |
p { |
| 22 |
color: #6b7280; |
| 23 |
font-size: 16px; |
| 24 |
line-height: 24px; |
| 25 |
margin-top: 0; |
| 26 |
margin-bottom: 24px; |
| 27 |
max-width: 600px; |
| 28 |
} |
| 29 |
a { |
| 30 |
color: #2563eb; |
| 31 |
text-decoration: underline; |
| 32 |
} |
| 33 |
label { |
| 34 |
font-weight: 600; |
| 35 |
font-size: 16px; |
| 36 |
line-height: 24px; |
| 37 |
color: #111827; |
| 38 |
display: block; |
| 39 |
margin-bottom: 8px; |
| 40 |
} |
| 41 |
input[type="text"]{ |
| 42 |
min-width: 100% !important; |
| 43 |
border: 1px solid #6b7280; |
| 44 |
border-radius: 4px; |
| 45 |
padding: 8px 12px; |
| 46 |
font-size: 16px; |
| 47 |
line-height: 24px; |
| 48 |
color: #111827; |
| 49 |
box-sizing: border-box; |
| 50 |
font-family: 'Inter', sans-serif; |
| 51 |
resize: none; |
| 52 |
} |
| 53 |
input[type="text"]:focus{ |
| 54 |
outline: none; |
| 55 |
border-color: #2563eb; |
| 56 |
box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.5); |
| 57 |
} |
| 58 |
button { |
| 59 |
margin-top: 24px; |
| 60 |
font-size: 16px; |
| 61 |
font-weight: 500; |
| 62 |
color: #2563eb; |
| 63 |
background: transparent; |
| 64 |
border: 1px solid #2563eb; |
| 65 |
border-radius: 4px; |
| 66 |
padding: 4px 20px; |
| 67 |
cursor: pointer; |
| 68 |
font-family: 'Inter', sans-serif; |
| 69 |
transition: background-color 0.2s ease; |
| 70 |
display: flex; |
| 71 |
} |
| 72 |
button:hover { |
| 73 |
background-color: #e0e7ff; |
| 74 |
} |
| 75 |
/* Toggle switch */ |
| 76 |
.toggle-switch { |
| 77 |
position: relative; |
| 78 |
width: 42px; |
| 79 |
height: 20px; |
| 80 |
display: inline-block; |
| 81 |
} |
| 82 |
.toggle-switch input { |
| 83 |
opacity: 0; |
| 84 |
width: 0; |
| 85 |
height: 0; |
| 86 |
position: absolute; |
| 87 |
} |
| 88 |
.slider { |
| 89 |
position: absolute; |
| 90 |
cursor: pointer; |
| 91 |
top: 0; |
| 92 |
left: 4; |
| 93 |
right: 0; |
| 94 |
bottom: 0; |
| 95 |
background-color: #e5e7eb; |
| 96 |
border-radius: 9999px; |
| 97 |
transition: background-color 0.3s; |
| 98 |
} |
| 99 |
.slider::before { |
| 100 |
position: absolute; |
| 101 |
content: ""; |
| 102 |
height: 17px; |
| 103 |
width: 17px; |
| 104 |
left: -6px; |
| 105 |
bottom: 2px; |
| 106 |
background-color: white; |
| 107 |
border-radius: 50%; |
| 108 |
transition: transform 0.3s; |
| 109 |
box-shadow: 0 1px 3px rgb(0 0 0 / 0.1); |
| 110 |
} |
| 111 |
input:checked + .slider { |
| 112 |
background-color: #000304; |
| 113 |
} |
| 114 |
input:checked + .slider::before { |
| 115 |
transform: translateX(24px); |
| 116 |
} |
| 117 |
@media (max-width: 640px) { |
| 118 |
body { |
| 119 |
padding: 16px; |
| 120 |
} |
| 121 |
p { |
| 122 |
max-width: 100%; |
| 123 |
} |
| 124 |
} |
| 125 |
</style> |
| 126 |
<div class="fluent-cart-sandbox-connect-manually"> |
| 127 |
<form> |
| 128 |
<div class="header"> |
| 129 |
<p>Manually Connect sandbox</p> |
| 130 |
<label class="toggle-switch" for="toggle"> |
| 131 |
<input type="checkbox" id="toggle" /> |
| 132 |
<span class="slider"></span> |
| 133 |
</label> |
| 134 |
</div> |
| 135 |
<div class="fluent-cart-manual-section" style="display: none;"> |
| 136 |
<div style="text-align: left;"> |
| 137 |
<label for="sandbox-client-id">Sandbox Client ID</label> |
| 138 |
<input style="min-width: 100% !important;height: 32px;" type="text" id="sandbox-client-id" name="sandbox-client-id" /> |
| 139 |
</div> |
| 140 |
<div style="margin-top: 24px;text-align: left;"> |
| 141 |
<label for="sandbox-secret-key">Sandbox Secret Key</label> |
| 142 |
<input style="min-width: 100% !important;height: 32px;" id="sandbox-secret-key" name="sandbox-secret-key" type="password"></input> |
| 143 |
</div> |
| 144 |
<button type="button">Save Credentials</button> |
| 145 |
</div> |
| 146 |
</form> |
| 147 |
</div> |
| 148 |
<script> |
| 149 |
document.addEventListener('DOMContentLoaded', function() { |
| 150 |
const toggle = document.getElementById('toggle'); |
| 151 |
const manualSection = document.querySelector('.fluent-cart-manual-section'); |
| 152 |
// Set initial state based on toggle |
| 153 |
manualSection.style.display = toggle.checked ? 'block' : 'none'; |
| 154 |
// Add event listener for toggle changes |
| 155 |
toggle.addEventListener('change', function() { |
| 156 |
manualSection.style.display = this.checked ? 'block' : 'none'; |
| 157 |
}); |
| 158 |
}); |
| 159 |
</script> |
| 160 |
|