gaptcha.html 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <!--
  2. Gaptcha is a libre captcha used to separate bots from humans.
  3. Copyright (C) 2020 Sagar Acharya <sagaracharya@tutanota.com>
  4. Licensed under the Apache License, Version 2.0 (the "License");
  5. you may not use this file except in compliance with the License.
  6. You may obtain a copy of the License at
  7. http://www.apache.org/licenses/LICENSE-2.0
  8. Unless required by applicable law or agreed to in writing, software
  9. distributed under the License is distributed on an "AS IS" BASIS,
  10. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  11. See the License for the specific language governing permissions and
  12. limitations under the License.
  13. -->
  14. <!doctype html>
  15. <html>
  16. <head>
  17. <!-- Copy this as it is to your site's head -->
  18. <link rel="stylesheet" href="jquery-ui.min.css">
  19. <style>
  20. #containment-wrapper{ width: 400px; height:300px; border:2px solid #ccc; padding: 2px; background : #9d9d9d;}
  21. .options { width: 60px; height: 60px; margin: 0 10px 10px 0; padding-left: 9px}
  22. #dragBox {width : 500 px; height : 500 px; float: right; padding: 10px}
  23. #gaptchaheader {text-align: center; font-size: 26px; font-style: bold; color: white;}
  24. #instruction {text-align: center; color: #050c49; padding: 7px;}
  25. #ques {padding-left: 10px;}
  26. </style>
  27. <script src="jquery.min.js"></script>
  28. <script src="jquery-ui.min.js"></script>
  29. <script>
  30. $(function() {
  31. $("#image1").draggable({ containment: "#containment-wrapper", scroll: false });
  32. $("#image2").draggable({ containment: "#containment-wrapper", scroll: false });
  33. $("#image3").draggable({ containment: "#containment-wrapper", scroll: false });
  34. $("#image4").draggable({ containment: "#containment-wrapper", scroll: false });
  35. $("#dragBox").droppable({ drop: function(event, ui) {
  36. $(this)
  37. .addClass("ui-state-highlight");
  38. $('#image1').draggable("destroy");
  39. $('#image2').draggable("destroy");
  40. $('#image3').draggable("destroy");
  41. $('#image4').draggable("destroy");
  42. $('#gaptcha').html("<input type='text' value='"+ ui.draggable.prop('id') +"' readonly>");
  43. }});
  44. });
  45. </script>
  46. <!-- Copy head till here -->
  47. </head>
  48. <body>
  49. <!-- Copy this as it is to your site's body -->
  50. <div id="containment-wrapper">
  51. <br>
  52. <div id="gaptchaheader">GAPTCHA</div>
  53. <div id="instruction"> Drag the answer to the box given below. </div><br>
  54. <div id ="ques">Virat Kohli is a ____man.</div><br>
  55. <img src="images/1.jpg" id="image1" class="options">
  56. <img src="images/2.jpg" id="image2" class="options">
  57. <img src="images/3.jpg" id="image3" class="options">
  58. <img src="images/4.jpg" id="image4" class="options">
  59. <br>
  60. <div id="dragBox" class="ui-widget-header">
  61. Drag<br>answer<br>here
  62. </div>
  63. </div>
  64. <!-- Copy body till here-->
  65. <div id="gaptcha"></div> <!-- Create this div in your html file. -->
  66. </body>
  67. </html>