|
1 | | -<html> |
2 | | - <head> |
3 | | - <script src="script.js"></script> |
4 | | - <link rel="stylesheet" href="style.css"> |
5 | | - </head> |
6 | | - <body> |
7 | | - <h1>Simple Interest Calculator</h1> |
8 | | - |
9 | | - Amount <input type="number" id="principal"> <br/> |
10 | | - Rate <input type="number" id="rate"> <br/> |
11 | | - No. of Years <input type="number" id="years"> <br/> |
12 | | - Interest : <span id="result"></span><br> |
13 | | - |
14 | | - <button onclick="compute()">Compute</button> |
15 | | - </body> |
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | + <head> |
| 4 | + <meta charset="UTF-8" /> |
| 5 | + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
| 6 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 7 | + <title>Reverse and Capitalise with AWS Lambda</title> |
| 8 | + <style> |
| 9 | + body { font-family: Verdana; text-align: center; } |
| 10 | + form { max-width: 500px; margin: 50px auto; padding: 30px 20px; box-shadow: 2px 5px 10px rgba(0, 0, 0, 0.5); } |
| 11 | + .form-control { text-align: left; margin-bottom: 25px; } |
| 12 | + .form-control input { padding: 10px; display: block; width: 95%; } |
| 13 | + </style> |
| 14 | + </head> |
| 15 | + <body> |
| 16 | + <form id="form" onsubmit="callLambdaFunction(); return false;"> |
| 17 | + <div class="form-control"> |
| 18 | + <input type="text" id="inputText" placeholder="Enter some text here" /> |
| 19 | + </div> |
| 20 | + <div class="form-control"> |
| 21 | + <button type="submit" value="submit">Submit</button> |
| 22 | + </div> |
| 23 | + <div class="form-control"> |
| 24 | + <input type="text" readonly id="outputText" placeholder="Output will appear here" /> |
| 25 | + </div> |
| 26 | + </form> |
| 27 | + <script type="text/javascript" src="lib/axios/dist/axios.standalone.js"></script> |
| 28 | + <script type="text/javascript" src="lib/CryptoJS/rollups/hmac-sha256.js"></script> |
| 29 | + <script type="text/javascript" src="lib/CryptoJS/rollups/sha256.js"></script> |
| 30 | + <script type="text/javascript" src="lib/CryptoJS/components/hmac.js"></script> |
| 31 | + <script type="text/javascript" src="lib/CryptoJS/components/enc-base64.js"></script> |
| 32 | + <script type="text/javascript" src="lib/url-template/url-template.js"></script> |
| 33 | + <script type="text/javascript" src="lib/apiGatewayCore/sigV4Client.js"></script> |
| 34 | + <script type="text/javascript" src="lib/apiGatewayCore/apiGatewayClient.js"></script> |
| 35 | + <script type="text/javascript" src="lib/apiGatewayCore/simpleHttpClient.js"></script> |
| 36 | + <script type="text/javascript" src="lib/apiGatewayCore/utils.js"></script> |
| 37 | + <script type="text/javascript" src="apigClient.js"></script> |
| 38 | + <script type="text/javascript"> |
| 39 | + function callLambdaFunction() { |
| 40 | + try { |
| 41 | + var inputTextValue = document.getElementById("inputText").value; |
| 42 | + var apigClient = apigClientFactory.newClient(); |
| 43 | + var params = {}; |
| 44 | + var body = { inputText: inputTextValue }; |
| 45 | + apigClient.capitaliseandreversePost(params, body) |
| 46 | + .then(function (result) { |
| 47 | + document.getElementById("outputText").value = JSON.parse(result.data.output).inputText; |
| 48 | + }) |
| 49 | + .catch(function (result) { |
| 50 | + console.log(result); |
| 51 | + }); |
| 52 | + } catch (error) { |
| 53 | + console.log(error); |
| 54 | + } |
| 55 | + return false; |
| 56 | + } |
| 57 | + </script> |
| 58 | + </body> |
16 | 59 | </html> |
0 commit comments