Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,8 @@
},
"engines": {
"node": "20"
},
"dependencies": {
"dayjs": "1.11.7"
}
}
5 changes: 5 additions & 0 deletions src/const.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const POINT_COUNT = 5;

const POINT_TYPES = ['taxi','bus','train','ship','drive','flight','check-in','sightseeing','restaurant'];

export {POINT_COUNT, POINT_TYPES};
8 changes: 7 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@ import FilterView from './view/filter-view.js';
import HeaderInfoView from './view/header-info-view.js';
import {render} from './render.js';
import TripPresenter from './presenter/trip-presenter.js';
import PointsModel from './model/points-model.js';

const headerContainer = document.querySelector('.trip-main');
const filterContainer = headerContainer.querySelector('.trip-controls__filters');
const tripEventsContainer = document.querySelector('.trip-events');
const tripPresenter = new TripPresenter({container: tripEventsContainer});

const pointsModel = new PointsModel();
const tripPresenter = new TripPresenter({
container: tripEventsContainer,
pointsModel,
});

render (new FilterView(), filterContainer);
render (new HeaderInfoView(), headerContainer, 'afterbegin');
Expand Down
176 changes: 176 additions & 0 deletions src/mock/destinations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@

const mockDestinations = [
{
id: '54d2f62a-6862-45f7-a1da-331713ec17ce',
description: 'Saint Petersburg - full of of cozy canteens where you can try the best coffee in the Middle East',
name: 'Saint Petersburg',
pictures: []
},
{
id: 'dd43c534-f518-48c1-b3cd-fb4b7b2f787e',
description: 'Vien - in a middle of Europe',
name: 'Vien',
pictures: []
},
{
id: '4ab18ebc-63f5-487d-8957-b710a649ca50',
description: 'Rome - famous for its crowded street markets with the best street food in Asia',
name: 'Rome',
pictures: [
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/4.jpg',
description: 'Rome is a beautiful city'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/6.jpg',
description: 'Rome is a beautiful city'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/10.jpg',
description: 'Rome in a middle of Europe'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/16.jpg',
description: 'Rome is a beautiful city'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/4.jpg',
description: 'Rome middle-eastern paradise'
}
]
},
{
id: 'a30baa99-560e-499b-a722-064fdb220eb6',
description: 'Naples - with a beautiful old town',
name: 'Naples',
pictures: [
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/10.jpg',
description: 'Naples famous for its crowded street markets with the best street food in Asia'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/20.jpg',
description: 'Naples middle-eastern paradise'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/11.jpg',
description: 'Naples for those who value comfort and coziness'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/9.jpg',
description: 'Naples is a beautiful city'
}
]
},
{
id: '88aa152d-9bda-4d6c-b002-81a34dc7914e',
description: 'Tokio - with an embankment of a mighty river as a centre of attraction',
name: 'Tokio',
pictures: [
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/10.jpg',
description: 'Tokio middle-eastern paradise'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/18.jpg',
description: 'Tokio in a middle of Europe'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/11.jpg',
description: 'Tokio is a beautiful city'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/19.jpg',
description: 'Tokio a perfect place to stay with a family'
}
]
},
{
id: '2c2eeb4d-8fe2-4852-ba52-ad3afdf22ca1',
description: 'Valencia - with an embankment of a mighty river as a centre of attraction',
name: 'Valencia',
pictures: [
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/9.jpg',
description: 'Valencia a true asian pearl'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/16.jpg',
description: 'Valencia with a beautiful old town'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/14.jpg',
description: 'Valencia full of of cozy canteens where you can try the best coffee in the Middle East'
}
]
},
{
id: '22fdb8aa-6682-4f67-a2c4-3ba172eeede9',
description: '',
name: 'Oslo',
pictures: []
},
{
id: 'a8f0f30d-f243-45d0-af43-8d663a40712d',
description: 'Monaco - middle-eastern paradise',
name: 'Monaco',
pictures: [
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/12.jpg',
description: 'Monaco with crowded streets'
}
]
},
{
id: '4d516e51-d32e-4fee-9c3c-31024699e7c3',
description: 'Madrid - with an embankment of a mighty river as a centre of attraction',
name: 'Madrid',
pictures: [
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/9.jpg',
description: 'Madrid middle-eastern paradise'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/9.jpg',
description: 'Madrid in a middle of Europe'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/14.jpg',
description: 'Madrid is a beautiful city'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/1.jpg',
description: 'Madrid in a middle of Europe'
}
]
},
{
id: '24514db9-cd07-4129-a377-8c6bd73d2e99',
description: 'Rotterdam - for those who value comfort and coziness',
name: 'Rotterdam',
pictures: [
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/8.jpg',
description: 'Rotterdam with crowded streets'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/3.jpg',
description: 'Rotterdam full of of cozy canteens where you can try the best coffee in the Middle East'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/14.jpg',
description: 'Rotterdam for those who value comfort and coziness'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/20.jpg',
description: 'Rotterdam middle-eastern paradise'
},
{
src: 'https://22.objects.htmlacademy.pro/static/destinations/17.jpg',
description: 'Rotterdam a perfect place to stay with a family'
}
]
}
];

export {mockDestinations};
Loading