Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Шаблонизируй это #4

Merged
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
2,355 changes: 1,495 additions & 860 deletions package-lock.json

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
},
"engines": {
"node": "20"
},
"dependencies": {
"dayjs": "1.11.13"
}
}
1 change: 0 additions & 1 deletion src/Readme.md

This file was deleted.

22 changes: 22 additions & 0 deletions src/const.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const DateFormat = {
DAY: 'MMM DD',
TIME: 'HH:mm',
DATE: 'DD/MM/YY HH:mm'
};

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

export {
DateFormat,
EVENT_TYPES,
};
9 changes: 9 additions & 0 deletions src/debug.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// import { mockPoints } from './mock/mock-points.js';

// console.log('START');


// console.log(mockPoints);


// console.log('END');
24 changes: 19 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import FilterView from './view/filter-view.js';
import BoardPresenter from './presenter/board-presenter.js';
import { render } from './render.js';
import DestinationsModel from './model/destinations-model.js';
import EventsModel from './model/events-model.js';
import OffersModel from './model/offers-model.js';
import FilterView from './view/filter-view.js';
import TripPresenter from './presenter/trip-presenter.js';


const pageHeaderElement = document.querySelector('.page-header');
Expand All @@ -9,10 +12,21 @@ const pageMainElement = document.querySelector('.page-main');
const pageBodyContainerElement = pageMainElement.querySelector('.page-body__container');


const boardPresenter = new BoardPresenter({boardContainer: pageBodyContainerElement});
render(new FilterView, filtersElement);


render(new FilterView, filtersElement);
const destinationsModel = new DestinationsModel();
const eventsModel = new EventsModel();
const offersModel = new OffersModel();
const tripPresenter = new TripPresenter({
tripContainer: pageBodyContainerElement,
destinationsModel,
eventsModel,
offersModel,
});


boardPresenter.init();
destinationsModel.init();
eventsModel.init();
offersModel.init();
tripPresenter.init();
165 changes: 165 additions & 0 deletions src/mock/mock-destinations.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
export const mockDestinations = [
{
'id': '2d1ec240-1e78-4183-b27e-7023f2ce9320',
'description': 'Kioto - famous for its crowded street markets with the best street food in Asia',
'name': 'Kioto',
'pictures': [
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/5.jpg',
'description': 'Kioto is a beautiful city'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/10.jpg',
'description': 'Kioto with an embankment of a mighty river as a centre of attraction'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/10.jpg',
'description': 'Kioto full of of cozy canteens where you can try the best coffee in the Middle East'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/20.jpg',
'description': 'Kioto in a middle of Europe'
}
]
},
{
'id': '496bf9c6-7644-4068-baa0-8b1577df8854',
'description': 'Amsterdam - middle-eastern paradise',
'name': 'Amsterdam',
'pictures': [
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/13.jpg',
'description': 'Amsterdam for those who value comfort and coziness'
}
]
},
{
'id': '97ba1bc6-b161-4015-b0a5-e1f31a3b972d',
'description': 'Venice - a true asian pearl',
'name': 'Venice',
'pictures': [
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/10.jpg',
'description': 'Venice famous for its crowded street markets with the best street food in Asia'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/12.jpg',
'description': 'Venice a true asian pearl'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/6.jpg',
'description': 'Venice in a middle of Europe'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/16.jpg',
'description': 'Venice in a middle of Europe'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/11.jpg',
'description': 'Venice a true asian pearl'
}
]
},
{
'id': '9bbe4200-020c-4f3c-9640-81648421f209',
'description': 'Berlin - famous for its crowded street markets with the best street food in Asia',
'name': 'Berlin',
'pictures': []
},
{
'id': 'c8eab9ce-c072-4114-9412-76f8023ba638',
'description': 'Helsinki - middle-eastern paradise',
'name': 'Helsinki',
'pictures': []
},
{
'id': '7d2cc347-4428-45cb-b406-ef07ed787acc',
'description': 'Sochi - with crowded streets',
'name': 'Sochi',
'pictures': [
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/3.jpg',
'description': 'Sochi with an embankment of a mighty river as a centre of attraction'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/18.jpg',
'description': 'Sochi a true asian pearl'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/13.jpg',
'description': 'Sochi a true asian pearl'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/9.jpg',
'description': 'Sochi with crowded streets'
}
]
},
{
'id': '21a059e3-af4a-4881-a3cc-40a381484c44',
'description': '',
'name': 'Vien',
'pictures': []
},
{
'id': '124c439f-1764-4bd2-917e-50973a77f227',
'description': 'Chamonix-Mont-Blanc (usually shortened to Chamonix) is a resort area near the junction of France, Switzerland and Italy. At the base of Mont Blanc, the highest summit in the Alps, its renowned for its skiing.',
'name': 'Chamonix',
'pictures': [
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/11.jpg',
'description': 'Chamonix a perfect place to stay with a family'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/2.jpg',
'description': 'Chamonix famous for its crowded street markets with the best street food in Asia'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/19.jpg',
'description': 'Chamonix full of of cozy canteens where you can try the best coffee in the Middle East'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/19.jpg',
'description': 'Chamonix in a middle of Europe'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/4.jpg',
'description': 'Chamonix famous for its crowded street markets with the best street food in Asia'
}
]
},
{
'id': '53b6b366-1de8-447a-93ae-e71dc7d59aa7',
'description': 'Rome - with a beautiful old town',
'name': 'Rome',
'pictures': [
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/17.jpg',
'description': 'Rome with a beautiful old town'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/18.jpg',
'description': 'Rome in a middle of Europe'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/5.jpg',
'description': 'Rome for those who value comfort and coziness'
},
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/8.jpg',
'description': 'Rome with crowded streets'
}
]
},
{
'id': '1b17f449-8447-46a0-934e-fc54af3dd4ca',
'description': 'Oslo - with an embankment of a mighty river as a centre of attraction',
'name': 'Oslo',
'pictures': [
{
'src': 'https://22.objects.htmlacademy.pro/static/destinations/19.jpg',
'description': 'Oslo is a beautiful city'
}
]
}
];
Loading
Loading