From e72a9e5911b0fcfdaf8048400b055fe03391ad30 Mon Sep 17 00:00:00 2001 From: Mhykol Date: Sun, 16 Jun 2024 03:13:55 -0400 Subject: Added examples --- examples/index.js | 21 ------------------ examples/layouts/footer.html | 15 +++++++++++++ examples/layouts/header.html | 27 +++++++++++++++++++++++ examples/layouts/loading.html | 12 ++++++++++ examples/shop.js | 51 ------------------------------------------- 5 files changed, 54 insertions(+), 72 deletions(-) delete mode 100644 examples/index.js create mode 100644 examples/layouts/footer.html create mode 100644 examples/layouts/header.html create mode 100644 examples/layouts/loading.html delete mode 100644 examples/shop.js (limited to 'examples') diff --git a/examples/index.js b/examples/index.js deleted file mode 100644 index 64a619b..0000000 --- a/examples/index.js +++ /dev/null @@ -1,21 +0,0 @@ -class Index { - constructor() {} - - async Main() { - return { - html: ` -
-

Welcome to Cosmic!

-

Please read the README.md

-
- `, - meta: { - keywords: 'Cosmic', - description: 'Welcome to Cosmic!' - } - } - } -} - -module.exports = (x) => {return new Index(x)} - diff --git a/examples/layouts/footer.html b/examples/layouts/footer.html new file mode 100644 index 0000000..9b2c673 --- /dev/null +++ b/examples/layouts/footer.html @@ -0,0 +1,15 @@ + + + + + + diff --git a/examples/layouts/header.html b/examples/layouts/header.html new file mode 100644 index 0000000..165133b --- /dev/null +++ b/examples/layouts/header.html @@ -0,0 +1,27 @@ + + + + Welcome to my website! + + + + + + + +
diff --git a/examples/layouts/loading.html b/examples/layouts/loading.html new file mode 100644 index 0000000..e8157e7 --- /dev/null +++ b/examples/layouts/loading.html @@ -0,0 +1,12 @@ +
+
+
+
+
+
+
+
+
+
+
+
diff --git a/examples/shop.js b/examples/shop.js deleted file mode 100644 index e75d289..0000000 --- a/examples/shop.js +++ /dev/null @@ -1,51 +0,0 @@ -const database = require('../source/database') -const estore = database('EStore') - -class Shop { - constructor() {} - - async Main() { - return estore.Query('SELECT * FROM Products').then(output => { - const data = { - start: ` -
-
-

This is the Shop page

- `, - body: '', - end: ` -
-
- ` - } - if (output) { - for (let i = 0; i < output[0].length; i++) { - data.body += ` -
-

${output[0][i].ProductName}

-

ID: ${output[0][i].ID}

-
- ` - } - } else { - data.body = ` - There are no items in the database. - ` - } - return data.start + data.body + data.end - }) - } - Product() { - const data = ` -
-
-

This is the Product page

-

Description

-
-
- ` - return data - } -} - -module.exports = () => {return new Shop()} -- cgit v1.2.3-70-g09d2