diff --git a/functions/views/css/style.css b/functions/views/css/style.css index b91fd4c..75020f7 100644 --- a/functions/views/css/style.css +++ b/functions/views/css/style.css @@ -482,7 +482,7 @@ input:focus, textarea:focus, select:focus{ } .space { - height: 15px; + height: 25px; } .welcome img { diff --git a/functions/views/home.ejs b/functions/views/home.ejs index 5010b8f..17aa793 100644 --- a/functions/views/home.ejs +++ b/functions/views/home.ejs @@ -6,85 +6,36 @@
-

Recent:

-
- <% var keys = Object.keys(products) %> - <% keys.forEach(function(key){ %> -
- - img - -

<%= products[key].name%>

-

£ <%= products[key].price%>

+

Recently Added:

+ + <% + let productKeys = Object.keys(products) + let p1 = productKeys.slice(0,5) + let p2 = productKeys.slice(5,10) + let p3 = productKeys.slice(10,15) + let p4 = productKeys.slice(15,20) + let p5 = productKeys.slice(20,25) + let productListArray = [p1, p2, p3, p4, p5] + %> + + <% productListArray.forEach(rowKeys=>{%> +
+ <% rowKeys.forEach(function(key){ %> +
+ + img + +

<%= products[key].name%>

+

£ <%= products[key].price%>

+
+ <% }) %>
+
<% }) %> -
-
-
-

Personalised 1:

-
-
- img -

<%= "Item name"%>

-

£ <%= "20.99"%>

-
-
- img -

<%= "Item name"%>

-

£ <%= "20.99"%>

-
-
- img -

<%= "Item name"%>

-

£ <%= "20.99"%>

-
-
- img -

<%= "Item name"%>

-

£ <%= "20.99"%>

-
-
- img -

<%= "Item name"%>

-

£ <%= "20.99"%>

-
-
-
-

Personalised 2:

-
-
- img -

<%= "Item name"%>

-

£ <%= "20.99"%>

-
-
-
-
-

Personalised 3:

-
-
- img -

<%= "Item name"%>

-

£ <%= "20.99"%>

-
-
-
-
-

Recent:

-
-
- img -

<%= "Item name"%>

-

£ <%= "20.99"%>

-
-
-
- -
diff --git a/server.js b/server.js index ccdf3de..1c826c3 100644 --- a/server.js +++ b/server.js @@ -39,7 +39,7 @@ app.get("/home", function(request, responce) { function homePage(request, responce) { var dbRef = database.ref("/products") - dbRef.orderByChild("status").equalTo("on-sale").limitToLast(5).once('value', function(snapshot){ + dbRef.orderByChild("status").equalTo("on-sale").limitToLast(25).once('value', function(snapshot){ var data = {} if (snapshot.val()) {data = snapshot.val()} responce.render('home.ejs', {products: data})