Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
120 lines (112 sloc) 3.7 KB
---
layout: page
title: Scrivimi
date: 2006-01-11 00:01:00 +0100
url: /contact-me
menu:
main:
title: Scrivimi
weight: -70
---
<script
src="https://code.jquery.com/jquery-3.3.1.min.js"
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
crossorigin="anonymous"></script>
<script src='/assets/spin.js'></script>
<div id="disablingDiv" ></div>
<script>
$(function() {
$.get( "https://compute-standard.appspot.com/sendmail", function( data ) {
console.log("done!");
});
});
$(function() {
// this is the id of the form
$("#actualForm").submit(function(e) {
e.preventDefault(); // avoid to execute the actual submit of the form.
var form = $(this);
var url = form.attr('action');
var opts = {
lines: 13, // The number of lines to draw
length: 38, // The length of each line
width: 17, // The line thickness
radius: 45, // The radius of the inner circle
scale: 1, // Scales overall size of the spinner
corners: 1, // Corner roundness (0..1)
color: '#ffffff', // CSS color or array of colors
fadeColor: 'transparent', // CSS color or array of colors
speed: 1, // Rounds per second
rotate: 0, // The rotation offset
animation: 'spinner-line-fade-quick', // The CSS animation name for the lines
direction: 1, // 1: clockwise, -1: counterclockwise
zIndex: 2e9, // The z-index (defaults to 2000000000)
className: 'spinner', // The CSS class to assign to the spinner
top: '50%', // Top position relative to parent
left: '50%', // Left position relative to parent
shadow: '0 0 1px transparent', // Box-shadow for the lines
position: 'absolute' // Element positioning
};
var target = document.getElementById('contactForm');
var spinner = new Spinner(opts).spin(target);
$('#disablingDiv').show();
var serializedData = form.serialize();
$.ajax({
type: "POST",
url: 'https://compute-standard.appspot.com/sendmail',
data: serializedData, // serializes the form's elements.
success: function(data)
{
$('#disablingDiv').hide();
spinner.stop();
$('#actualForm').hide();
if (data == 'Email sent') {
$('#sent').show();
} else {
$("#errorMessageTxt").html(data);
$('#error').show();
}
},
error: function()
{
alert("error"); // show response from the php script.
}
});
});
});
</script>
<div id='contactForm'>
<div id="error" style="display: none;">
<h3>Ahiahiahi</h3>
Ops, qualcosa &egrave; andato storto. Prova a correggere il seguente errore e a ritentare:<br/><br/><br/>
<span id="errorMessageTxt">errorEmpty</span>
</div>
<div id="sent" style="display: none;">
<H3>Grazie!</H3>
Grazie per il tuo messaggio! Se non sei uno spammer robot ti arriver&agrave; una risposta in breve tempo!<br />
</div>
<form id='actualForm' method='post' action=''>
<ul>
<li id="form-to">
<label>Per:</label>
<span>Paperino.</span>
</li>
<li id="form-name">
<label>Da (email):</label>
<input type="text" name="email" />
</li>
<input type="text" name="name" style="display: none;"/>
<li id="form-message">
<label>Messaggio:</label>
<textarea name="message"></textarea>
</li>
<li id="form-notice">
<span></span>
<strong>&Egrave; OK:</strong> essere gentili, usare il proprio nome.<br />
<strong>Non &egrave; OK:</strong> essere cafoni, invare spam.
</li>
<li id="form-buttons">
<button type="submit">Invia</button>
</li>
</ul>
</form>
</div>