-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
246 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
|
||
.container { | ||
display: flex; | ||
flex-wrap: wrap; | ||
justify-content: flex-start; | ||
} | ||
|
||
.card { | ||
margin: 7px; | ||
border-radius: 10px; | ||
border: 2px solid #DCDCDC; | ||
position: relative; | ||
} | ||
|
||
|
||
|
||
.card:hover .overlay { | ||
position: absolute; | ||
width: 100%; | ||
height: 100%; | ||
top: 0; | ||
left: 0; | ||
right: 0; | ||
bottom: 0; | ||
background-color: rgba(0,0,0,0.5); | ||
z-index:100; | ||
cursor: pointer; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
flex-direction: column; | ||
border-radius: 10px; | ||
} | ||
|
||
.overlay .hidden { | ||
display: none; | ||
} | ||
|
||
.card:hover .hidden { | ||
display: flex; | ||
margin: 10px; | ||
width: 150px; | ||
height: 30px; | ||
color: #FFFFFF; | ||
border: 0; | ||
text-align: center; | ||
justify-content: center; | ||
|
||
} | ||
|
||
.image { | ||
border-radius: 10px 10px 0 0; | ||
border: 1px solid #DCDCDC; | ||
width: 300px; | ||
} | ||
|
||
.card:hover #book-btn { | ||
background-color: #00C2FF; | ||
} | ||
|
||
.card:hover #view-btn { | ||
background-color: #787878; | ||
} | ||
.info { | ||
display: flex; | ||
justify-content: space-between; | ||
} | ||
.search-view h2 { | ||
padding: 20px; | ||
padding-left: 35px; | ||
font-family: 'Lato', sans-serif; | ||
font-size: 30px; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,109 @@ | ||
const data = [ | ||
{ | ||
id: 1, | ||
room_num: 2, | ||
description: 'nice room', | ||
price: 500, | ||
imgs: 'room.jpg', | ||
services: 'some servieces', | ||
type: 'single', | ||
}, | ||
{ | ||
id: 1, | ||
room_num: 2, | ||
description: 'nice room', | ||
price: 500, | ||
imgs: 'room.jpg', | ||
services: 'some servieces', | ||
type: 'single', | ||
}, | ||
{ | ||
id: 1, | ||
room_num: 2, | ||
description: 'nice room', | ||
price: 500, | ||
imgs: 'room.jpg', | ||
services: 'some servieces', | ||
type: 'single', | ||
}, | ||
{ | ||
id: 1, | ||
room_num: 2, | ||
description: 'nice room', | ||
price: 500, | ||
imgs: 'room.jpg', | ||
services: 'some servieces', | ||
type: 'single', | ||
}, | ||
{ | ||
id: 1, | ||
room_num: 2, | ||
description: 'nice room', | ||
price: 500, | ||
imgs: 'room.jpg', | ||
services: 'some servieces', | ||
type: 'single', | ||
}, | ||
{ | ||
id: 1, | ||
room_num: 2, | ||
description: 'nice room', | ||
price: 500, | ||
imgs: 'room.jpg', | ||
services: 'some servieces', | ||
type: 'single', | ||
}, | ||
{ | ||
id: 1, | ||
room_num: 2, | ||
description: 'nice room', | ||
price: 500, | ||
imgs: 'room.jpg', | ||
services: 'some servieces', | ||
type: 'single', | ||
}, | ||
{ | ||
id: 2, | ||
room_num: 3, | ||
description: 'nice room', | ||
price: 500, | ||
imgs: 'room.jpg', | ||
services: 'some servieces', | ||
type: 'single', | ||
}, | ||
{ | ||
id: 3, | ||
room_num: 4, | ||
description: 'nice room', | ||
price: 500, | ||
imgs: 'room.jpg', | ||
services: 'some servieces', | ||
type: 'double', | ||
}, | ||
{ | ||
id: 4, | ||
room_num: 5, | ||
description: 'nice room', | ||
price: 500, | ||
imgs: 'room.jpg', | ||
services: 'some servieces', | ||
type: 'triple', | ||
}, | ||
]; | ||
|
||
exports.get = (req, res) => { | ||
// filter the data based on the room type | ||
const filteredData = { | ||
single: data.filter(room => room.type === 'single'), | ||
double: data.filter(room => room.type === 'double'), | ||
triple: data.filter(room => room.type === 'triple'), | ||
}; | ||
|
||
res.render('home', { | ||
style: 'style', | ||
style_special: 'home', | ||
title: 'Home', | ||
script: 'home', | ||
data: filteredData, | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,68 @@ | ||
<section> | ||
|
||
<section class="home-body"> | ||
{{#if data.single}} | ||
<div class="search-view"> | ||
<h2>Single :</h2> | ||
<div class="container"> | ||
{{#each data.single}} | ||
<div class="card"> | ||
<div class="img"> | ||
<div class="overlay"> | ||
<button class="hidden" id="book-btn" type="button" name="button">Book</button> | ||
<button class="hidden" id="view-btn" type="button" name="button">View more</button> | ||
</div> | ||
<img class="image" src="{{imgs}}" alt="room img"> | ||
</div> | ||
<div class="info"> | ||
<span>Price : {{price}}$</span> | ||
<span>Room No. : {{room_num}}</span> | ||
</div> | ||
</div> | ||
{{/each}} | ||
</div> | ||
</div> | ||
{{/if}} | ||
{{#if data.double}} | ||
<div class="search-view"> | ||
<h2>Double :</h2> | ||
<div class="container"> | ||
{{#each data.double}} | ||
<div class="card"> | ||
<div class="img"> | ||
<div class="overlay"> | ||
<button class="hidden" id="book-btn" type="button" name="button">Book</button> | ||
<button class="hidden" id="view-btn" type="button" name="button">View more</button> | ||
</div> | ||
<img class="image" src="{{imgs}}" alt="room img"> | ||
</div> | ||
<div class="info"> | ||
<span>Price : {{price}}$</span> | ||
<span>Room No. : {{room_num}}</span> | ||
</div> | ||
</div> | ||
{{/each}} | ||
</div> | ||
</div> | ||
{{/if}} | ||
{{#if data.triple}} | ||
<div class="search-view"> | ||
<h2>Trible :</h2> | ||
<div class="container"> | ||
{{#each data.triple}} | ||
<div class="card"> | ||
<div class="img"> | ||
<div class="overlay"> | ||
<button class="hidden" id="book-btn" type="button" name="button">Book</button> | ||
<button class="hidden" id="view-btn" type="button" name="button">View more</button> | ||
</div> | ||
<img class="image" src="{{imgs}}" alt="room img"> | ||
</div> | ||
<div class="info"> | ||
<span>Price : {{price}}$</span> | ||
<span>Room No. : {{room_num}}</span> | ||
</div> | ||
</div> | ||
{{/each}} | ||
</div> | ||
</div> | ||
{{/if}} | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters