diff --git a/conf.nix b/conf.nix index 1224b672..2d5db7a9 100644 --- a/conf.nix +++ b/conf.nix @@ -16,7 +16,6 @@ rec { lib.bootstrap = { enable = true; version = "3.3.7"; }; lib.font-awesome = { enable = true; version = "4.7.0"; }; lib.googlefonts = [ "Nunito+Sans:400,900" ]; - lib.jquery = { enable = true; version = "3.1.1"; }; lib.mathjax = { enable = true; version = "2.7.5"; }; }; } diff --git a/content/ico/details.md b/content/ico/details.md index 88137323..7ea26e52 100644 --- a/content/ico/details.md +++ b/content/ico/details.md @@ -158,13 +158,26 @@

+
+
+ +
+
+

+ I agree not to send ADA directly from a hardware wallet as I will not be able to extract the private key from the device and will never be able to clain my LUCEO. +

+
+
-

What is the ADA price (p) of 1 LUCEO at epoch (e)?

+

What is the ADA price (p) of 1 LUCEO at epoch (e)?

- +
@@ -172,7 +185,7 @@
-

+

Please make sure that you've checked all the checkboxes above and answered the challenge question correctly before submitting this form to get the ADA presale address.

@@ -180,7 +193,7 @@

- +

@@ -203,3 +216,5 @@
+ + diff --git a/themes/fractalide/files/css/custom.css b/themes/fractalide/files/css/custom.css index 7c44109c..57136665 100644 --- a/themes/fractalide/files/css/custom.css +++ b/themes/fractalide/files/css/custom.css @@ -942,7 +942,7 @@ section#ico-details .header_gradient { vertical-align: middle; } -.checklist input[type=checkbox].has-error ~ span { +.checklist input[type=checkbox].error ~ span { border: 1px solid #ed7a7f; } @@ -962,3 +962,8 @@ section#ico-details .header_gradient { content: '\f00c'; } */ +.sub_heading_blue val { + font-size: 24px; + color: #58b4cd; + margin-bottom: 20px; +} diff --git a/themes/fractalide/files/js/ico.js b/themes/fractalide/files/js/ico.js new file mode 100644 index 00000000..20dc49bb --- /dev/null +++ b/themes/fractalide/files/js/ico.js @@ -0,0 +1,43 @@ +$(document).ready(function(){ + + generateRandomEpoch(); + + $('#myModal').on('show.bs.modal', function (e) { + if(!isValidAnswer()) { + e.preventDefault(); + generateRandomEpoch(); + } + }); + +}); + +function generateRandomEpoch(){ + var e = Math.floor(Math.random() * 42); + $('#epoch').html(e); +} + +function calculateP(e) { + var x = 0.01; + var d = 75; + var n = 41; + var p = x * 0.01 * (100 - d + e / (n - 1) * d); + return p.toFixed(4); +} + +function isValidAnswer() { + var valid = true; + + $('.checklist input[type=checkbox]').each(function(i) { + valid &= $(this).is(':checked'); + $(this).toggleClass('error', $(this).is(':not(:checked)')); + }); + + var p = calculateP(parseInt($('#epoch').html())); + var answer = (parseFloat($('#answer').val()) || 0).toFixed(4); + valid &= answer === p + $('#answer').parents('div.form-group').toggleClass('has-error', answer !== p); + + $('#warning_message').toggleClass('text-danger', !valid); + + return valid; +} diff --git a/themes/fractalide/templates/partials/head/meta.nix b/themes/fractalide/templates/partials/head/meta.nix index f74c7b03..6459343f 100644 --- a/themes/fractalide/templates/partials/head/meta.nix +++ b/themes/fractalide/templates/partials/head/meta.nix @@ -14,6 +14,7 @@ in gtag('js', new Date()); gtag('config', 'UA-120734485-1'); +