Skip to content
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@charset "UTF-8";
/* CSS Document */

#appframe {
background-image: url(resources/slotmachine.jpg);
background-repeat: no-repeat;
background-origin:content-box;
position:relative;
min-height: 1080px;
width: 1000px;
}

#slot_L {
position: absolute;
left: 354px;
top: 272px;
min-height: 199px;
width: 80px;
}

#slot_M {
position: absolute;
left: 482px;
top: 272px;
min-height: 199px;
width: 80px;
}

#slot_R {
position: absolute;
left: 606px;
top: 272px;
min-height: 199px;
width: 80px;
}

#slot_handle {
position: absolute;
left: 860px;
top: 10px;
min-height: 943px;
width: 114px;
}

#winner_light {
position: absolute;
left: 318px;
top: 540px;
min-height: 48px;
width: 247px;
visibility:hidden;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Card Slots</title>
<link href="cardslots.css" rel="stylesheet" type="text/css">

</head>

<body>
<div id="appframe">

<img id="slot_L" src="resources/hart_q.png" height="199" width="80" alt="slot wheel 1"/>
<img id="slot_M" src="resources/hart_q.png" height="199" width="80" alt="slot wheel 2"/>
<img id="slot_R" src="resources/hart_q.png" height="199" width="80" alt="slot wheel 3"/>
<img id="slot_handle" src="resources/lever-up.png" height="943" width="114"/>
<img id="winner_light" src="resources/winner.png" height="48" width="247" alt="winner indicator"/>

</div>
<script type="text/javascript" src="main.js"></script>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0

ABOUT THIS NODE.JS EXAMPLE: This example works with Version 3 (V3) of the AWS JavaScript SDK,
which is scheduled for release later in 2020. The prerelease version of the SDK is available
at https://github.com/aws/aws-sdk-js-v3. The 'SDK for JavaScript Developer Guide' for V3 is also
scheduled for release later in 2020, and the topic containing this example will be hosted at
https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/using-lambda-ddb-setup.html.

Purpose:
ddb-table-create.js demonstrates how to create a Amazon DynamoDB database table..

Inputs:
- REGION (into command line below)


Running the code:
node ddb-table-create.js REGION
*/
// snippet-start:[lambda.JavaScript.v3.CreateTable]
// Load the DynamoDB client
const { DynamoDBClient, CreateTableCommand } = require('@aws-sdk/client-dynamodb');
// Instantiate a DynamoDB client
const region = process.argv[2];
const ddb = new DynamoDBClient({region: region});
// Define the table schema
var tableParams = {
AttributeDefinitions: [
{
AttributeName: 'slotPosition',
AttributeType: 'N'
}
],
KeySchema: [
{
AttributeName: 'slotPosition',
KeyType: 'HASH'
}
],
ProvisionedThroughput: {
ReadCapacityUnits: 5,
WriteCapacityUnits: 5
},
//TODO: change back to TABLE_NAME
TableName: 'v3-lambda-tutorial-table',
StreamSpecification: {
StreamEnabled: false
}
};

async function run() {
try {
const data = await ddb.send(new CreateTableCommand(tableParams));
console.log('Success', data);
} catch(err) {
console.log('Error', err);
}
}

run();
// snippet-end:[lambda.JavaScript.v3.CreateTable]
exports.run = run; //for unit tests only
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
/* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0

ABOUT THIS NODE.JS EXAMPLE: This example works with Version 3 (V3) of the AWS JavaScript SDK,
which is scheduled for release later in 2020. The prerelease version of the SDK is available
at https://github.com/aws/aws-sdk-js-v3. The 'SDK for JavaScript Developer Guide' for V3 is also
scheduled for release later in 2020, and the topic containing this example will be hosted at
https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/using-lambda-ddb-setup.html.

Purpose:
ddb-table-populate.js demonstrates how to populate an Amazon DynamoDB table.

Inputs:
- REGION (into command line below)
- TABLE_NAME (into command line below)

Running the code:
node ddb-table-populate.js REGION TABLE_NAME
*/

// snippet-start:[lambda.JavaScript.v3.PopulateTable]
// Load the DynamoDB client
const { DynamoDBClient, PutItemCommand } = require('@aws-sdk/client-dynamodb');
// Instantiate a DynamoDB client
const region = process.argv[2]; //REGION
const ddb = new DynamoDBClient(region);

const myTable = process.argv[3]; //TABLE_NAME

// Add the four spade results
async function run() {
let params = {
TableName: myTable,
Item: {'slotPosition' : {N: '0'}, 'imageFile' : {S: 'spad_a.png'}
}
};
await post(params);

params = {
TableName: myTable,
Item: {'slotPosition' : {N: '1'}, 'imageFile' : {S: 'spad_k.png'}
}
};
await post(params);

params = {
TableName: myTable,
Item: {'slotPosition' : {N: '2'}, 'imageFile' : {S: 'spad_q.png'}
}
};
await post(params);

params = {
TableName: myTable,
Item: {'slotPosition' : {N: '3'}, 'imageFile' : {S: 'spad_j.png'}
}
};
await post(params);

// Add the four heart results
params = {
TableName: myTable,
Item: {'slotPosition' : {N: '4'}, 'imageFile' : {S: 'hart_a.png'}
}
};
await post(params);

params = {
TableName: myTable,
Item: {'slotPosition' : {N: '5'}, 'imageFile' : {S: 'hart_k.png'}
}
};
await post(params);

params = {
TableName: myTable,
Item: {'slotPosition' : {N: '6'}, 'imageFile' : {S: 'hart_q.png'}
}
};
await post(params);

params = {
TableName: myTable,
Item: {'slotPosition' : {N: '7'}, 'imageFile' : {S: 'hart_j.png'}
}
};
await post(params);

// Add the four diamonds results
params = {
TableName: myTable,
Item: {'slotPosition' : {N: '8'}, 'imageFile' : {S: 'diam_a.png'}
}
};
await post(params);

params = {
TableName: myTable,
Item: {'slotPosition' : {N: '9'}, 'imageFile' : {S: 'diam_k.png'}
}
};
await post(params);

params = {
TableName: myTable,
Item: {'slotPosition' : {N: '10'}, 'imageFile' : {S: 'diam_q.png'}
}
};
await post(params);

params = {
TableName: myTable,
Item: {'slotPosition' : {N: '11'}, 'imageFile' : {S: 'diam_j.png'}
}
};
await post(params);

params = {
TableName: myTable,
Item: {'slotPosition' : {N: '12'}, 'imageFile' : {S: 'club_a.png'}
}
};
await post(params);

params = {
TableName: myTable,
Item: {'slotPosition' : {N: '13'}, 'imageFile' : {S: 'club_k.png'}
}
};
await post(params);

params = {
TableName: myTable,
Item: {'slotPosition' : {N: '14'}, 'imageFile' : {S: 'club_q.png'}
}
};
await post(params);

params = {
TableName: myTable,
Item: {'slotPosition' : {N: '15'}, 'imageFile' : {S: 'club_j.png'}
}
};
await post(params);
}

run();

async function post (params) {
try {
const data = await ddb.send(new PutItemCommand(params));
console.log("Success", data);
} catch(err) {
console.log("Error", err);
}
}

// snippet-end:[lambda.JavaScript.v3.PopulateTable]
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0

ABOUT THIS NODE.JS EXAMPLE: This example works with Version 3 (V3) of the AWS JavaScript SDK,
which is scheduled for release later in 2020. The prerelease version of the SDK is available
at https://github.com/aws/aws-sdk-js-v3. The 'SDK for JavaScript Developer Guide' for V3 is also
scheduled for release later in 2020, and the topic containing this example will be hosted at
https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/using-lambda-function-prep.html.
Purpose:
lambda-function-setup.js demostrates how to create a lambda function.

Inputs:
- REGION (into command line below)
- BUCKET_NAME (in code)
- ZIP_FILE_NAME (in code)

Running the code:
node lambda-function-setup.js REGION ACCESS_KEY_ID
*/

// snippet-start:[lambda.JavaScript.v3.LambdaFunctionSetUp]
// Load the Lambda client
const { LambdaClient, CreateFunctionCommand } = require('@aws-sdk/client-lambda');
// Instantiate a Lambda client
const region = process.argv[2];
const lambda = new LambdaClient(region);

var params = {
Code: { /* required */
S3Bucket: 'BUCKET_NAME',
S3Key: 'ZIP_FILE_NAME'
},
FunctionName: 'slotpull', /* required */
Handler: 'index.handler', /* required */
Role: 'arn:aws:iam::650138640062:role/v3-lambda-tutorial-lambda-role', /* required */
Runtime: 'nodejs12.x', /* required */
Description: 'Slot machine game results generator',
};
lambda.send(new CreateFunctionCommand(params)).then(
data => { console.log(data) }, // successful response
err => {console.log(err)} // an error occurred
);

// snippet-end:[lambda.JavaScript.v3.LambdaFunctionSetUp]
Loading