From b5da6046cb6744c5e46e94e68def57f85514d6f3 Mon Sep 17 00:00:00 2001 From: Joshi Minh Date: Mon, 3 Jun 2024 16:24:11 +0700 Subject: [PATCH 1/4] Added JS --- fetchShowing.js | 28 ++++++ fetchUpcoming.js | 28 ++++++ movieinfopage/Phim1.html | 181 +++++++++++++++++++++++++++++++++++++++ movieinfopage/main.js | 19 ++++ movieinfopage/test.css | 95 ++++++++++++++++++++ 5 files changed, 351 insertions(+) create mode 100644 fetchShowing.js create mode 100644 fetchUpcoming.js create mode 100644 movieinfopage/Phim1.html create mode 100644 movieinfopage/main.js create mode 100644 movieinfopage/test.css diff --git a/fetchShowing.js b/fetchShowing.js new file mode 100644 index 0000000..624195a --- /dev/null +++ b/fetchShowing.js @@ -0,0 +1,28 @@ +const fs = require('fs'); +const path = require('path'); + +// Define the directory +const showingDirectory = path.join(__dirname, 'MoviesShowing'); + +// Function to get jpg files from a directory +const getJpgFiles = (directory) => { + return new Promise((resolve, reject) => { + fs.readdir(directory, (err, files) => { + if (err) { + return reject('Unable to scan directory: ' + err); + } + + const jpgFiles = files.filter(file => path.extname(file).toLowerCase() === '.jpg'); + resolve(jpgFiles); + }); + }); +}; + +// Get jpg files from the showing directory +getJpgFiles(showingDirectory) + .then((showingImages) => { + console.log('MoviesShowing images:', showingImages); + }) + .catch(err => { + console.error(err); + }); \ No newline at end of file diff --git a/fetchUpcoming.js b/fetchUpcoming.js new file mode 100644 index 0000000..bfaddda --- /dev/null +++ b/fetchUpcoming.js @@ -0,0 +1,28 @@ +const fs = require('fs'); +const path = require('path'); + +// Define the directory +const upcomingDirectory = path.join(__dirname, 'MoviesUpcoming'); + +// Function to get jpg files from a directory +const getJpgFiles = (directory) => { + return new Promise((resolve, reject) => { + fs.readdir(directory, (err, files) => { + if (err) { + return reject('Unable to scan directory: ' + err); + } + + const jpgFiles = files.filter(file => path.extname(file).toLowerCase() === '.jpg'); + resolve(jpgFiles); + }); + }); +}; + +// Get jpg files from the upcoming directory +getJpgFiles(upcomingDirectory) + .then((upcomingImages) => { + console.log('MoviesUpcoming images:', upcomingImages); + }) + .catch(err => { + console.error(err); + }); \ No newline at end of file diff --git a/movieinfopage/Phim1.html b/movieinfopage/Phim1.html new file mode 100644 index 0000000..77f2db7 --- /dev/null +++ b/movieinfopage/Phim1.html @@ -0,0 +1,181 @@ + + + + + + + Document + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+
+ +
+
+
+
+ Sunset Over the Sea +
+
+
+

Godzilla x Kong : The New Empire

+

+

    +
  • Thể loại: Hành động, kịch tính
  • +
  • Khởi chiếu : 2024
  • +
  • Thời lượng: 120 phút
  • +
  • Ngôn ngữ: Tiếng Anh - Phụ đề Tiếng việt
  • +
  • Phần mới về Godzilla, Kong lấy bối cảnh vài năm sau cuộc chiến của hai quái vật huyền thoại + trong tác phẩm Godzilla vs Kong (2021). Lúc này, Kong tìm về quê hương tại Trái đất rỗng, khám + phá tung tích về đồng loại, tiếp tục mối quan hệ hòa bình với loài người. Còn Godzilla bảo hộ + thế giới mặt đất trước sự tấn công của một số Titan (siêu quái vật). +
  • +
+

+
+ +
+
+ + + + + \ No newline at end of file diff --git a/movieinfopage/main.js b/movieinfopage/main.js new file mode 100644 index 0000000..9c68016 --- /dev/null +++ b/movieinfopage/main.js @@ -0,0 +1,19 @@ +document.addEventListener('DOMContentLoaded', (event) => { + const htmlElement = document.documentElement; + const switchElement = document.getElementById('flexSwitchCheckDefault'); + + // Set the default theme to dark if no setting is found in local storage + const currentTheme = localStorage.getItem('bsTheme') || 'dark'; + htmlElement.setAttribute('data-bs-theme', currentTheme); + switchElement.checked = currentTheme === 'dark'; + + switchElement.addEventListener('change', function () { + if (this.checked) { + htmlElement.setAttribute('data-bs-theme', 'dark'); + localStorage.setItem('bsTheme', 'dark'); + } else { + htmlElement.setAttribute('data-bs-theme', 'light'); + localStorage.setItem('bsTheme', 'light'); + } + }); +}); \ No newline at end of file diff --git a/movieinfopage/test.css b/movieinfopage/test.css new file mode 100644 index 0000000..5a3978d --- /dev/null +++ b/movieinfopage/test.css @@ -0,0 +1,95 @@ +body { + display: flex; + flex-direction: column; + min-height: 100%; + transition: .5; +} + +.header .login-button { + background-color: #0084ff; + color: aliceblue; + text-decoration: none; + font-size: 14px; + padding: 8px 20px; + border-radius: 50px 50px 50px; + transition: 0.3s background-color; +} + +.header .left-bt-login { + border-bottom-right-radius: 0px; + border-top-right-radius: 0px; +} + +.header .right-bt-sign { + border-bottom-left-radius: 0px; + border-top-left-radius: 0px; +} + +.header .login-button:hover { + background-color: #0f3cb0; +} + +.header .navbar { + height: 80px; + background-color: #1f1f1f; + /* margin: 20px; */ + transform: 0.3s color; + /* border-radius: 16px; */ + padding: 0.5rem; +} + +.header .navbar-toggler { + border: none; + font-size: 1.25rem; +} + + +.header .navbar-toggler:focus, +.header .btn-close:focus { + box-shadow: none; + outline: none; +} + +.header .nav-link, +.nav-item { + color: #0c76f7; + font-weight: 500; +} + +.header .nav-link:hover, +.nav-link.active, +.nav-link .active { + color: #fff; +} + +.header .dropdown:hover .dropdown-menu { + display: block; +} + +.header .member-dropdown { + display: none; +} + + +/* movies */ + +.movies ul { + display: inline-block; + list-style-type: none; + padding-left: 0; +} + +.movie .card { + width: 30vh; +} + +.movies ul li { + letter-spacing: 1px; + margin: 10px; +} + +@media (max-width: 1400px) { + .movies .card { + width: 25vh; + } +} \ No newline at end of file From b18436512e4f1f9a9ead7ec2ba3648dc6518756b Mon Sep 17 00:00:00 2001 From: Joshi Minh Date: Mon, 3 Jun 2024 22:37:44 +0700 Subject: [PATCH 2/4] Test Automation --- ShowingMovies.html | 176 +------------------------ UpcomingMovies.html | 149 ++------------------- fetchShowing.js | 46 +++---- fetchUpcoming.js | 47 ++++--- index.html | 315 ++------------------------------------------ 5 files changed, 65 insertions(+), 668 deletions(-) diff --git a/ShowingMovies.html b/ShowingMovies.html index 73a5898..ff0f7b4 100644 --- a/ShowingMovies.html +++ b/ShowingMovies.html @@ -41,10 +41,10 @@
-
- -
-
- -
-

Abigail

-
- -
-
-
-
-
-
- -
-

DUNE Phần Hai

-
- -
-
-
-
-
-
- -
-

Điềm Báo Của Quỷ

-
- -
-
-
-
-
-
- -
-

Đền Mạng

-
- -
-
-
-
-
-
- -
-

Exhuma Quật Mộ Trùng Ma

-
- -
-
-
-
-
-
- -
-

Godzilla X Kong Đế Chế Mới

-
- -
-
-
-
-
-
- -
-

Kung Fu Panda 4

-
- -
-
-
-
-
-
- -
-

Mai

-
- -
-
-
-
-
-
- -
-

Mobile Suit Gundam SEED FREEDOM

-
- -
-
-
-
-
-
- -
-

Monkey Man

-
- -
-
-
-
-
-
- -
-

Muôn Vị Nhân Gian

-
- -
-
-
-
-
-
- -
-

Người Chết Trở Về

-
- -
-
-
-
-
-
- -
-

Quỷ Thuật

-
- -
-
-
-
-
-
- -
-

Sáng Đèn

-
- -
-
-
-
-
-
- -
-

Thanh Xuân 18x2 Lữ Trình Hướng Về Em

-
- -
-
-
-
- + +
+ +