Last active
June 18, 2020 16:52
-
-
Save phuclh/6bf770e8aa9814c36bf92a0f93539d80 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Livewire; | |
use Livewire\Component; | |
class ESign extends Component | |
{ | |
public $signature; | |
public function render() | |
{ | |
return view('livewire.e-sign'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<fieldset class="Quiz--inputgroup Form--inputgroup Signature"> | |
<div class="flex justify-between"> | |
<label class="Quiz--label Form--label Signature--label">Signature</label> | |
</div> | |
<div> | |
<div class="Quiz--input Form--input Signature--input w-auto inline-block"> | |
<canvas contenteditable="" width="400" height="200" id="signature-pad" | |
style="touch-action: none;" spellcheck="false"></canvas> | |
</div> | |
<button id="save" type="button">Save</button> | |
</div> | |
<div>Signature Data: {{ $signature }}</div> | |
<script> | |
window.signaturePad = new SignaturePad(document.getElementById('signature-pad')) | |
document.getElementById('signature-pad').addEventListener('blur', function (event) { | |
@this.set('signature', signaturePad.toDataURL('image/png')); | |
}); | |
</script> | |
</fieldset> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment