diff options
| author | Max | 2017-04-21 19:51:54 +0200 |
|---|---|---|
| committer | Max | 2017-04-21 19:51:54 +0200 |
| commit | 64f165f0cabd4d47e76a1832d7cf5cbfec8e4e83 (patch) | |
| tree | 9778d8a912d52180e688c88f6ac50904fdbb2181 | |
| parent | 5ed6ec5d6c42057c8dfef18d475a4eeb941fafc6 (diff) | |
| parent | 5e8053d9ee0535f72b452cce18d581c29a435656 (diff) | |
| download | iamfabulous.de-64f165f0cabd4d47e76a1832d7cf5cbfec8e4e83.tar.gz | |
Löst den Merge Konflikt auf.
| -rw-r--r-- | layouts/contact/single.html | 41 | ||||
| -rw-r--r-- | static/captcha.js | 31 | ||||
| -rw-r--r-- | static/custom.css | 18 |
3 files changed, 77 insertions, 13 deletions
diff --git a/layouts/contact/single.html b/layouts/contact/single.html index cca9ab9..852446c 100644 --- a/layouts/contact/single.html +++ b/layouts/contact/single.html @@ -4,34 +4,51 @@ </div> <div class="container content"> <div class="row"> - <form class="contactform" action="/submit/" method="POST"> + <form class="contactform" action="https://www.iamfabulous.de/submit/" method="POST"> <div class="row"> <div class="six columns"> <label for="from">your email</label> - <input class="u-full-width" placeholder="mail@domain.com" id="from" name="from" type="email" required> + <input class="u-full-width" placeholder="mail@domain.com" id="from" name="from" type="email"> </div> <div class="six columns"> <label for="subject">subject</label> - <input class="u-full-width" placeholder="hello" id="subject" name="subject" type="text" required> + <input class="u-full-width" placeholder="hello" id="subject" name="subject" type="text"> </div> </div> <input type="text" class="hp" value="" name="gotit"> - <label for="message">message</label> - <textarea class="u-full-width" placeholder="type your message here …" id="message" name="message" required></textarea> + <div class="row"> + <div class="twelve columns"> + <label for="message">message</label> + <textarea class="u-full-width" placeholder="type your message here …" id="message" name="message"></textarea> + </div> + </div> <!--label class="example-send-yourself-copy"> <input type="checkbox"> <span class="label-body">Send a copy to yourself</span> </label--> - <iframe src="https://www.iamfabulous.de/newcaptcha" border=0> - </iframe> - <input type="text" name="capanswer" required> - <input class="button-primary contactform-button" value="submit" type="submit"> - <a style="margin-left: 10px;" class="button" href="../" title="back to index">cancel</a> + <div class="row"> + <div class="six columns"> + <label>captcha</label> + <img id="captcha-img" src="#" alt="captcha image" width=240 height=80> + <input id="captcha-id" type="hidden" name="captchaid" required> + </div> + <div class="six columns"> + <label for="captcha-solution">verification</label> + <input class="u-full-width" id="captcha-solution" type="text" name="captchaanswer" placeholder="enter the code displayed in the image" required> + </div> + </div> + <div class="row margin-top"> + <div class="twelve columns"> + <input class="button-primary contactform-button" value="submit" type="submit"> + <a class="button margin-left-extra-small" href="../" title="back to index">cancel</a> + </div> + </div> </form> - <div/> -<div/> + </div> +</div> <div class="row center"> <p class="twelve columns"> </p> </div> +<script src="/captcha.js" defer async></script> {{partial "footer.tmpl" .}} diff --git a/static/captcha.js b/static/captcha.js new file mode 100644 index 0000000..7b16e7c --- /dev/null +++ b/static/captcha.js @@ -0,0 +1,31 @@ +function loadJSON(path, success, error) +{ + var xhr = new XMLHttpRequest(); + xhr.onreadystatechange = function() + { + if (xhr.readyState === XMLHttpRequest.DONE) { + if (xhr.status === 200) { + if (success) + success(JSON.parse(xhr.responseText)); + } else { + if (error) + error(xhr); + } + } + }; + xhr.open("GET", path, true); + xhr.send(); +}; +loadJSON('/json/newcaptcha', + function(data){ + console.log("success", data); + var captcha = document.getElementById('captcha-img'); + captcha.src = "/captcha/" + data.captcha_id + ".png"; + var captcha_input = document.getElementById('captcha-id'); + captcha_input.value = data.captcha_id; + }, + function(data) { + console.log("error", data); + console.log(data); + } +); diff --git a/static/custom.css b/static/custom.css index ec5f0b5..b3d3784 100644 --- a/static/custom.css +++ b/static/custom.css @@ -103,6 +103,15 @@ a:hover { .margin-top-small { margin-top: 10px; } +.margin-left{ + margin-left: 20px; +} +.margin-left-small { + margin-left: 10px; +} +.margin-left-extra-small { + margin-left: 5px; +} /* Für projects/, damit der Text nicht überlappt, aber nah beieinander steht. */ @media (min-width: 755px) { @@ -144,8 +153,9 @@ a:hover { color: #1f1f1f !important; text-shadow: 0 0 1px #1f1f1f; transition: text-shadow 1s; - */ color: #3f3f3f !important; + */ + color: #1f1f1f !important; } .contactform-button:hover { text-decoration: underline; @@ -177,3 +187,9 @@ select:focus { .header-link:hover { color: #171717; } +#captcha-img { + background-color: #efefef; + background: #efefef; + /*box-shadow: 0 0 2px #ddd !important;*/ + border-radius: 4px; +} |
