{"version":3,"file":"news.js","sources":["../../src/scripts/pages/news.js"],"sourcesContent":["import \"@/styles/pages/news.scss\";\nimport \"paginationjs\";\n\n// check the screen size at first\nconst isLargeScreen = $(window).width() >= 1400;\n\n$(function () {\n newsInit();\n});\n\n/** pagination of articles */\n\nlet currentNewsData = [];\nlet limit = isLargeScreen ? 8 : 4;\nconst newsPagination = $(\"#sec-articles .cus__pagination\");\n\nconst newsInit = () => {\n newsPagination.pagination({\n dataSource: function (done) {\n $.ajax({\n type: \"GET\",\n url: \"data/news.json\",\n success: function (response) {\n done(response.data);\n currentNewsData = response.data;\n },\n });\n },\n callback: function (currentNewsData, pagination) {\n if (pagination.totalNumber <= limit) {\n newsPagination.hide();\n } else {\n newsPagination.show();\n }\n\n let html = templating(currentNewsData);\n $(\".news__card-wrapper\").html(html);\n },\n showNavigator: true,\n formatNavigator:\n \"