-
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.
Merge pull request #4 from daniildevpro/module2-task1
- Loading branch information
Showing
23 changed files
with
1,467 additions
and
540 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -30,5 +30,8 @@ | |
}, | ||
"engines": { | ||
"node": "20" | ||
}, | ||
"dependencies": { | ||
"dayjs": "1.11.7" | ||
} | ||
} | ||
} |
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
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,17 @@ | ||
const POINT_COUNT = 3; | ||
|
||
|
||
const FormatDate = { | ||
DATE_TIME: 'YYYY-MM-DD', | ||
DATE_POINT: 'MMM D', | ||
DATE_SCHEDULE: 'HH:mm', | ||
DATE_SLASHED: 'YY/MM/DD' | ||
}; | ||
|
||
const MillisecondsInValue = { | ||
MILLISECONDS_IN_HOUR: 1000 * 60 * 60, | ||
MILLISECONDS_IN_DAY: 1000 * 60 * 60 * 24, | ||
}; | ||
|
||
|
||
export { POINT_COUNT, FormatDate, MillisecondsInValue }; |
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,17 +1,34 @@ | ||
import FilterView from './view/filter-view.js'; | ||
import NewEventButtonView from './view/new-event-button-view.js'; | ||
import NewPointButtonView from './view/new-point-button-view.js'; | ||
import BoardPresenter from './presenter/board-presenter.js'; | ||
import PointsModel from './model/points-model.js'; | ||
import { getRandomPoint } from './mock/points.js'; | ||
import { destinations } from './mock/destinations.js'; | ||
import { offers } from './mock/offers.js'; | ||
import { POINT_COUNT } from './const.js'; | ||
import { render } from './render.js'; | ||
import EventListPresenter from './presenter/event-list-presenter.js'; | ||
|
||
|
||
const siteTripMainElement = document.querySelector('.trip-main'); | ||
const siteFiltersElement = siteTripMainElement.querySelector('.trip-controls__filters'); | ||
const siteTripEventsElement = document.querySelector('.trip-events'); | ||
|
||
const eventsListPresenter = new EventListPresenter(siteTripEventsElement); | ||
|
||
const pointsModel = new PointsModel({ | ||
points: Array.from({ length: POINT_COUNT }, getRandomPoint), | ||
destinations: destinations, | ||
offers: offers | ||
}); | ||
|
||
|
||
const boardPresenter = new BoardPresenter({ | ||
pointListContainer: siteTripEventsElement, | ||
pointsModel, | ||
}); | ||
|
||
|
||
render(new FilterView(), siteFiltersElement); | ||
render(new NewEventButtonView(), siteTripMainElement); | ||
render(new NewPointButtonView(), siteTripMainElement); | ||
|
||
eventsListPresenter.init(); | ||
|
||
boardPresenter.init(); |
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,165 @@ | ||
export const destinations = [ | ||
{ | ||
'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 - a true asian pearl', | ||
'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' | ||
} | ||
] | ||
} | ||
]; |
Oops, something went wrong.