From 59ceabbd3cea29d81238c9be8c816e07eaf6c52d Mon Sep 17 00:00:00 2001 From: Son Nguyen Date: Wed, 24 Apr 2024 01:36:50 -0400 Subject: [PATCH 1/2] Update: Updated project utilities (#159) --- MovieVerse-Mobile/package-lock.json | 203 - MovieVerse-Mobile/package.json | 3 +- .../xcschemes/xcschememanagement.plist | 19 - .../ios/MovieVerse.xcodeproj/project.pbxproj | 12 +- .../UserInterfaceState.xcuserstate | Bin 10312 -> 0 bytes .../xcschemes/xcschememanagement.plist | 14 - MovieVerse-Mobile/platforms/ios/www/404.html | 7 - .../ios/www/MovieVerse-Backend/.dockerignore | 37 + .../ios/www/MovieVerse-Backend/.flake8 | 27 + .../ios/www/MovieVerse-Backend/Dockerfile | 41 + .../ios/www/MovieVerse-Backend/LICENSE | 2 +- .../ios/www/MovieVerse-Backend/Makefile | 15 + .../ios/www/MovieVerse-Backend/Pipfile | 5 + .../ios/www/MovieVerse-Backend/Pipfile.lock | 379 +- .../ios/www/MovieVerse-Backend/README.md | 6 +- .../MovieVerse-Backend/backend_django/.flake8 | 27 + .../MovieVerse-Backend/backend_django/Pipfile | 11 + .../backend_django/Pipfile.lock | 20 + .../backend_django/__init__.py | 0 .../MovieVerse-Backend/backend_django/asgi.py | 16 + .../backend_django/micro-services.py | 164 + .../backend_django/requirements.txt | 5 + .../backend_django/serializers.py | 19 + .../backend_django/settings.py | 117 + .../MovieVerse-Backend/backend_django/urls.py | 22 + .../MovieVerse-Backend/backend_django/wsgi.py | 16 + .../ios/www/MovieVerse-Backend/config.yml | 54 + .../MovieVerse-Backend/django_root/.flake8 | 27 + .../django_root/micro-services.py | 164 + .../www/MovieVerse-Backend/flask_root/.flake8 | 27 + .../flask_root/micro-services.py | 164 + .../machine-learning/micro-services.py | 164 + .../www/MovieVerse-Backend/package-lock.json | 1660 +- .../ios/www/MovieVerse-Backend/package.json | 5 +- .../www/MovieVerse-Backend/requirements.txt | 2 +- .../www/MovieVerse-Databases/.dockerignore | 37 + .../ios/www/MovieVerse-Databases/.flake8 | 27 + .../ios/www/MovieVerse-Databases/.gitignore | 7 + .../Data-Analysis}/LICENSE | 2 +- .../ios/www/MovieVerse-Databases/Dockerfile | 41 + .../ios/www/MovieVerse-Databases/LICENSE | 2 +- .../ios/www/MovieVerse-Databases/Makefile | 15 + .../ios/www/MovieVerse-Databases/Pipfile | 16 + .../ios/www/MovieVerse-Databases/Pipfile.lock | 393 + .../ios/www/MovieVerse-Databases/README.md | 8 +- .../ios/www/MovieVerse-Databases/config.yml | 54 + .../machine-learning/LICENSE | 21 + .../machine-learning/README.md | 57 + .../machine-learning/genre_classifier.py | 47 + .../machine-learning/micro-services.py | 164 + .../machine-learning/movie-recommendation.py | 55 + .../machine-learning/movie-reviews.py | 67 + .../machine-learning/plot-summarizer.py | 65 + .../machine-learning/sentiment_analysis.py | 80 + .../MovieVerse-Databases/package-lock.json | 16387 ++++++++++++++++ .../ios/www/MovieVerse-Databases/package.json | 83 + .../www/MovieVerse-Databases/requirements.txt | 5 + .../ios/www/MovieVerse-Frontend/LICENSE | 2 +- .../ios/www/MovieVerse-Frontend/css/LICENSE | 2 +- .../ios/www/MovieVerse-Frontend/css/style.css | 38 +- .../ios/www/MovieVerse-Frontend/html/LICENSE | 2 +- .../www/MovieVerse-Frontend/html/about.html | 8 - .../html/actor-details.html | 7 - .../MovieVerse-Frontend/html/analytics.html | 21 +- .../MovieVerse-Frontend/html/api_fails.html | 7 - .../www/MovieVerse-Frontend/html/chat.html | 7 - .../www/MovieVerse-Frontend/html/chatbot.html | 21 +- .../html/christopher-nolan.html | 7 - .../html/company-details.html | 7 - .../html/create-account.html | 7 - .../html/director-details.html | 7 - .../MovieVerse-Frontend/html/favorites.html | 9 +- .../MovieVerse-Frontend/html/feedback.html | 7 - .../MovieVerse-Frontend/html/inception.html | 7 - .../html/leonardo-dicaprio.html | 7 - .../html/movie-details.html | 7 - .../MovieVerse-Frontend/html/movie-match.html | 7 - .../html/movie-timeline.html | 25 +- .../html/notifications.html | 7 - .../www/MovieVerse-Frontend/html/offline.html | 8 +- .../html/privacy-policy.html | 7 - .../html/reset-password.html | 8 - .../www/MovieVerse-Frontend/html/search.html | 7 - .../MovieVerse-Frontend/html/settings.html | 7 - .../www/MovieVerse-Frontend/html/sign-in.html | 8 - .../www/MovieVerse-Frontend/html/support.html | 7 - .../html/terms-of-service.html | 8 +- .../www/MovieVerse-Frontend/html/trivia.html | 7 - .../MovieVerse-Frontend/html/tv-details.html | 8 - .../html/user-profile.html | 23 +- .../ios/www/MovieVerse-Frontend/js/LICENSE | 2 +- .../MovieVerse-Frontend/js/create-account.js | 18 +- .../MovieVerse-Frontend/js/user-profile.js | 42 +- .../ios/www/MovieVerse-Frontend/react/LICENSE | 2 +- .../ios/www/MovieVerse-Frontend/tests/LICENSE | 2 +- .../ios/www/MovieVerse-Middleware/.flake8 | 27 + .../ios/www/MovieVerse-Middleware/Pipfile | 16 + .../www/MovieVerse-Middleware/Pipfile.lock | 393 + .../ios/www/MovieVerse-Middleware/README.md | 2 +- .../ios/www/MovieVerse-Middleware/config.yml | 54 + .../MovieVerse-Middleware/package-lock.json | 16387 ++++++++++++++++ .../www/MovieVerse-Middleware/package.json | 83 + .../MovieVerse-Middleware/requirements.txt | 5 + .../platforms/ios/www/images/js/about.js | 306 - .../ios/www/images/js/actor-details.js | 508 - .../ios/www/images/js/add-to-favorites.js | 231 - .../ios/www/images/js/add-to-tv-favorites.js | 168 - .../platforms/ios/www/images/js/analytics.js | 733 - .../ios/www/images/js/chat-auxiliary.js | 292 - .../platforms/ios/www/images/js/chat.js | 408 - .../platforms/ios/www/images/js/chatbot.js | 824 - .../ios/www/images/js/christopher-nolan.js | 530 - .../platforms/ios/www/images/js/comments.js | 172 - .../ios/www/images/js/company-details.js | 799 - .../ios/www/images/js/create-account.js | 120 - .../ios/www/images/js/director-details.js | 437 - .../platforms/ios/www/images/js/favorites.js | 1823 -- .../platforms/ios/www/images/js/inception.js | 1250 -- .../platforms/ios/www/images/js/index.ejs | 93 - .../ios/www/images/js/leonardo-dicarprio.js | 493 - .../ios/www/images/js/movie-details.js | 1389 -- .../ios/www/images/js/movie-match.js | 593 - .../ios/www/images/js/movie-timeline.js | 472 - .../ios/www/images/js/notifications.js | 177 - .../platforms/ios/www/images/js/quiz.js | 431 - .../ios/www/images/js/reset-password.js | 131 - .../ios/www/images/js/root-config.js | 66 - .../platforms/ios/www/images/js/router.js | 51 - .../platforms/ios/www/images/js/search.js | 760 - .../ios/www/images/js/service-worker.js | 102 - .../platforms/ios/www/images/js/settings.js | 256 - .../platforms/ios/www/images/js/sign-in.js | 81 - .../ios/www/images/js/single-spa-config.js | 37 - .../ios/www/images/js/systemjs-importmap.js | 26 - .../platforms/ios/www/images/js/tv-details.js | 903 - .../ios/www/images/js/user-profile.js | 569 - .../platforms/ios/www/index.html | 30 +- .../platforms/ios/www/js/movie-match.js | 39 - 138 files changed, 36713 insertions(+), 17024 deletions(-) delete mode 100644 MovieVerse-Mobile/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/davidnguyen.xcuserdatad/xcschemes/xcschememanagement.plist delete mode 100644 MovieVerse-Mobile/platforms/ios/MovieVerse.xcworkspace/xcuserdata/davidnguyen.xcuserdatad/UserInterfaceState.xcuserstate delete mode 100644 MovieVerse-Mobile/platforms/ios/MovieVerse.xcworkspace/xcuserdata/davidnguyen.xcuserdatad/xcschemes/xcschememanagement.plist create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/.dockerignore create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/.flake8 create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/Dockerfile create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/Makefile create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/backend_django/.flake8 create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/backend_django/Pipfile create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/backend_django/Pipfile.lock create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/backend_django/__init__.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/backend_django/asgi.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/backend_django/micro-services.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/backend_django/requirements.txt create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/backend_django/serializers.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/backend_django/settings.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/backend_django/urls.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/backend_django/wsgi.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/config.yml create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/django_root/.flake8 create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/django_root/micro-services.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/flask_root/.flake8 create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/flask_root/micro-services.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Backend/machine-learning/micro-services.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/.dockerignore create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/.flake8 create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/.gitignore rename MovieVerse-Mobile/platforms/ios/www/{images/js => MovieVerse-Databases/Data-Analysis}/LICENSE (96%) create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/Dockerfile create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/Makefile create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/Pipfile create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/Pipfile.lock create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/config.yml create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/machine-learning/LICENSE create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/machine-learning/README.md create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/machine-learning/genre_classifier.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/machine-learning/micro-services.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/machine-learning/movie-recommendation.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/machine-learning/movie-reviews.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/machine-learning/plot-summarizer.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/machine-learning/sentiment_analysis.py create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/package-lock.json create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/package.json create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Databases/requirements.txt create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Middleware/.flake8 create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Middleware/Pipfile create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Middleware/Pipfile.lock create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Middleware/config.yml create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Middleware/package-lock.json create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Middleware/package.json create mode 100644 MovieVerse-Mobile/platforms/ios/www/MovieVerse-Middleware/requirements.txt delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/about.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/actor-details.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/add-to-favorites.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/add-to-tv-favorites.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/analytics.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/chat-auxiliary.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/chat.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/chatbot.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/christopher-nolan.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/comments.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/company-details.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/create-account.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/director-details.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/favorites.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/inception.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/index.ejs delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/leonardo-dicarprio.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/movie-details.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/movie-match.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/movie-timeline.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/notifications.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/quiz.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/reset-password.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/root-config.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/router.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/search.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/service-worker.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/settings.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/sign-in.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/single-spa-config.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/systemjs-importmap.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/tv-details.js delete mode 100644 MovieVerse-Mobile/platforms/ios/www/images/js/user-profile.js diff --git a/MovieVerse-Mobile/package-lock.json b/MovieVerse-Mobile/package-lock.json index d6ae25e0..5ed04b60 100644 --- a/MovieVerse-Mobile/package-lock.json +++ b/MovieVerse-Mobile/package-lock.json @@ -46,7 +46,6 @@ "@babel/preset-react": "^7.23.3", "babel-loader": "^9.1.3", "cordova-android": "^12.0.1", - "cordova-ios": "^7.0.1", "electron": "^29.1.0", "electron-builder": "^24.9.1", "eslint": "^8.56.0", @@ -5422,15 +5421,6 @@ "dev": true, "optional": true }, - "node_modules/bplist-creator": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz", - "integrity": "sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg==", - "dev": true, - "dependencies": { - "stream-buffers": "2.2.x" - } - }, "node_modules/bplist-parser": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.2.tgz", @@ -6289,28 +6279,6 @@ "node": ">=16.0.0" } }, - "node_modules/cordova-ios": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cordova-ios/-/cordova-ios-7.0.1.tgz", - "integrity": "sha512-WaG3bgOlIQukY8rOhTuA0p2PckBxogSCSOGfWamp4BnaWFoiVm65r4kFqr7PsPguVMbe0t4h4nQTpopxB2LTEQ==", - "dev": true, - "dependencies": { - "cordova-common": "^5.0.0", - "execa": "^5.1.1", - "fs-extra": "^11.1.1", - "ios-sim": "^8.0.2", - "nopt": "^7.1.0", - "plist": "^3.0.6", - "semver": "^7.4.0", - "unorm": "^1.6.0", - "which": "^3.0.0", - "xcode": "^3.0.1", - "xml-escape": "^1.1.0" - }, - "engines": { - "node": ">=16.13.0" - } - }, "node_modules/core-js-compat": { "version": "3.34.0", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.34.0.tgz", @@ -9310,60 +9278,6 @@ "node": ">= 0.4" } }, - "node_modules/interpret": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", - "dev": true, - "engines": { - "node": ">= 0.10" - } - }, - "node_modules/ios-sim": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/ios-sim/-/ios-sim-8.0.2.tgz", - "integrity": "sha512-P7nEG771bfd+JoMRjnis1gpZOkjTUUxu+4Ek1Z+eoaEEoT9byllU9pxfQ8Df7hL3gSkIQxNwTSLhos2I8tWUQA==", - "dev": true, - "dependencies": { - "bplist-parser": "^0.0.6", - "nopt": "1.0.9", - "plist": "^3.0.1", - "simctl": "^2" - }, - "bin": { - "ios-sim": "bin/ios-sim" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/ios-sim/node_modules/abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true - }, - "node_modules/ios-sim/node_modules/bplist-parser": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.0.6.tgz", - "integrity": "sha512-fGeghPEH4Eytvf+Mi446aKcDqvkA/+eh6r7QGiZWMQG6TzqrnsToLP379XFfqRSZ41+676hhGIm++maNST1Apw==", - "dev": true - }, - "node_modules/ios-sim/node_modules/nopt": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.9.tgz", - "integrity": "sha512-CmUZ3rzN0/4kRHum5pGRiGkhmBMzgtEDxrZVHqRJDSv8qK6s+wzaig/xeyB22Due5aZQeTiEZg/nrmMH2tapDQ==", - "dev": true, - "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": "*" - } - }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -13660,18 +13574,6 @@ "node": ">=8.10.0" } }, - "node_modules/rechoir": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", - "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", - "dev": true, - "dependencies": { - "resolve": "^1.1.6" - }, - "engines": { - "node": ">= 0.10" - } - }, "node_modules/redux": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/redux/-/redux-4.2.1.tgz", @@ -14362,23 +14264,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/shelljs": { - "version": "0.8.5", - "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", - "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", - "dev": true, - "dependencies": { - "glob": "^7.0.0", - "interpret": "^1.0.0", - "rechoir": "^0.6.2" - }, - "bin": { - "shjs": "bin/shjs" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/side-channel": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", @@ -14402,39 +14287,6 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, - "node_modules/simctl": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/simctl/-/simctl-2.0.3.tgz", - "integrity": "sha512-kKCak0yszxHae5eVWcmrjV3ouUGac3sjlhjdLWpyPu4eiQcWoHsCrqS34kkgzHN8Ystqkh/LFjzrldk/g3BYJg==", - "dev": true, - "dependencies": { - "shelljs": "^0.8.5", - "tail": "^0.4.0" - } - }, - "node_modules/simple-plist": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.1.tgz", - "integrity": "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw==", - "dev": true, - "dependencies": { - "bplist-creator": "0.1.0", - "bplist-parser": "0.3.1", - "plist": "^3.0.5" - } - }, - "node_modules/simple-plist/node_modules/bplist-parser": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.1.tgz", - "integrity": "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==", - "dev": true, - "dependencies": { - "big-integer": "1.6.x" - }, - "engines": { - "node": ">= 5.10.0" - } - }, "node_modules/simple-update-notifier": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", @@ -14702,15 +14554,6 @@ "node": ">= 0.4" } }, - "node_modules/stream-buffers": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz", - "integrity": "sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==", - "dev": true, - "engines": { - "node": ">= 0.10.0" - } - }, "node_modules/string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", @@ -14982,15 +14825,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tail": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/tail/-/tail-0.4.0.tgz", - "integrity": "sha512-i5rOhX0PwkFSbjID14mmuoqrLUIqpJeBwg0esugSbb+6Y+dzgN/O3YZXzzPL7dnQJGbQLs8cwM8Zsak5kFJGcA==", - "dev": true, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/tapable": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", @@ -15479,15 +15313,6 @@ "node": ">= 10.0.0" } }, - "node_modules/unorm": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/unorm/-/unorm-1.6.0.tgz", - "integrity": "sha512-b2/KCUlYZUeA7JFUuRJZPUtr4gZvBh7tavtv4fvk4+KV9pfGiR6CQAQAWl49ZpR3ts2dk4FYkP7EIgDJoiOLDA==", - "dev": true, - "engines": { - "node": ">= 0.4.0" - } - }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", @@ -15561,15 +15386,6 @@ "node": ">= 0.4.0" } }, - "node_modules/uuid": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", - "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, "node_modules/v8-to-istanbul": { "version": "9.2.0", "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz", @@ -16252,25 +16068,6 @@ } } }, - "node_modules/xcode": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/xcode/-/xcode-3.0.1.tgz", - "integrity": "sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA==", - "dev": true, - "dependencies": { - "simple-plist": "^1.1.0", - "uuid": "^7.0.3" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/xml-escape": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/xml-escape/-/xml-escape-1.1.0.tgz", - "integrity": "sha512-B/T4sDK8Z6aUh/qNr7mjKAwwncIljFuUP+DO/D5hloYFj+90O88z8Wf7oSucZTHxBAsC1/CTP4rtx/x1Uf72Mg==", - "dev": true - }, "node_modules/xmlbuilder": { "version": "15.1.1", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", diff --git a/MovieVerse-Mobile/package.json b/MovieVerse-Mobile/package.json index 2d330466..92921289 100644 --- a/MovieVerse-Mobile/package.json +++ b/MovieVerse-Mobile/package.json @@ -30,7 +30,6 @@ "@babel/preset-react": "^7.23.3", "babel-loader": "^9.1.3", "cordova-android": "^12.0.1", - "cordova-ios": "^7.0.1", "electron": "^29.1.0", "electron-builder": "^24.9.1", "eslint": "^8.56.0", @@ -81,4 +80,4 @@ "vuex": "^4.1.0", "webpack-dev-server": "^4.7.3" } -} +} \ No newline at end of file diff --git a/MovieVerse-Mobile/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/davidnguyen.xcuserdatad/xcschemes/xcschememanagement.plist b/MovieVerse-Mobile/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/davidnguyen.xcuserdatad/xcschemes/xcschememanagement.plist deleted file mode 100644 index 33ba33c2..00000000 --- a/MovieVerse-Mobile/platforms/ios/CordovaLib/CordovaLib.xcodeproj/xcuserdata/davidnguyen.xcuserdatad/xcschemes/xcschememanagement.plist +++ /dev/null @@ -1,19 +0,0 @@ - - - - - SchemeUserState - - Cordova.xcscheme_^#shared#^_ - - orderHint - 2 - - CordovaLib.xcscheme_^#shared#^_ - - orderHint - 1 - - - - diff --git a/MovieVerse-Mobile/platforms/ios/MovieVerse.xcodeproj/project.pbxproj b/MovieVerse-Mobile/platforms/ios/MovieVerse.xcodeproj/project.pbxproj index 3747ec32..73ab7042 100755 --- a/MovieVerse-Mobile/platforms/ios/MovieVerse.xcodeproj/project.pbxproj +++ b/MovieVerse-Mobile/platforms/ios/MovieVerse.xcodeproj/project.pbxproj @@ -16,7 +16,7 @@ 4E7CA2B6272ABB0D00177EF9 /* config.xml in Copy Staging Resources */ = {isa = PBXBuildFile; fileRef = F840E1F0165FE0F500CFE078 /* config.xml */; }; 4E7CA2B7272ABB0D00177EF9 /* www in Copy Staging Resources */ = {isa = PBXBuildFile; fileRef = 301BF56E109A69640062928A /* www */; }; 6AFF5BF91D6E424B00AB3073 /* CDVLaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6AFF5BF81D6E424B00AB3073 /* CDVLaunchScreen.storyboard */; }; - 1E03F3B4592E4A0DB1C54B9E /* CDVStatusBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 393671C5DA994913964647CD /* CDVStatusBar.m */; }; + 8E99558E769D4CE0BA8520C8 /* CDVStatusBar.m in Sources */ = {isa = PBXBuildFile; fileRef = 5941DB76F3CB4687B3688492 /* CDVStatusBar.m */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -79,8 +79,8 @@ EB87FDF41871DAF40020F90C /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = ../../config.xml; sourceTree = ""; }; ED33DF2A687741AEAF9F8254 /* Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "Bridging-Header.h"; sourceTree = ""; }; F840E1F0165FE0F500CFE078 /* config.xml */ = {isa = PBXFileReference; lastKnownFileType = text.xml; name = config.xml; path = "MovieVerse/config.xml"; sourceTree = ""; }; - 393671C5DA994913964647CD /* CDVStatusBar.m */ = {isa = PBXFileReference; name = "CDVStatusBar.m"; path = "cordova-plugin-statusbar/CDVStatusBar.m"; sourceTree = ""; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; }; - 9B471334C38D41DAB37B1660 /* CDVStatusBar.h */ = {isa = PBXFileReference; name = "CDVStatusBar.h"; path = "cordova-plugin-statusbar/CDVStatusBar.h"; sourceTree = ""; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; }; + 5941DB76F3CB4687B3688492 /* CDVStatusBar.m */ = {isa = PBXFileReference; name = "CDVStatusBar.m"; path = "cordova-plugin-statusbar/CDVStatusBar.m"; sourceTree = ""; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; explicitFileType = undefined; includeInIndex = 0; }; + BD95148F9E3E4760A4475514 /* CDVStatusBar.h */ = {isa = PBXFileReference; name = "CDVStatusBar.h"; path = "cordova-plugin-statusbar/CDVStatusBar.h"; sourceTree = ""; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -176,8 +176,8 @@ 307C750510C5A3420062BCA9 /* Plugins */ = { isa = PBXGroup; children = ( - 393671C5DA994913964647CD /* CDVStatusBar.m */, - 9B471334C38D41DAB37B1660 /* CDVStatusBar.h */, + 5941DB76F3CB4687B3688492 /* CDVStatusBar.m */, + BD95148F9E3E4760A4475514 /* CDVStatusBar.h */, ); name = Plugins; path = "MovieVerse/Plugins"; @@ -289,7 +289,7 @@ 1D60589B0D05DD56006BFB54 /* main.m in Sources */, 1D3623260D0F684500981E51 /* AppDelegate.m in Sources */, 302D95F114D2391D003F00A1 /* MainViewController.m in Sources */, - 1E03F3B4592E4A0DB1C54B9E /* CDVStatusBar.m in Sources */, + 8E99558E769D4CE0BA8520C8 /* CDVStatusBar.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/MovieVerse-Mobile/platforms/ios/MovieVerse.xcworkspace/xcuserdata/davidnguyen.xcuserdatad/UserInterfaceState.xcuserstate b/MovieVerse-Mobile/platforms/ios/MovieVerse.xcworkspace/xcuserdata/davidnguyen.xcuserdatad/UserInterfaceState.xcuserstate deleted file mode 100644 index 3c018171869b36bb4df5dfba85f996112035341a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10312 zcmbta34Bvk)<5^ANwWZbSqjbGq-CejmaeSbq0pAvbfIMlY4d0UX;PDvQrxb9D&$oFdrjH`I{v<|`Ss#e6UCEgo!i43wa1a78>3o{@XG_dx@rU>u}?5%Qq`3Skz^hB+`7=D~a@f?_Cv zQYeE3Pz`5611y8(umarR0Wa|2gCK-q9Wb~MHo_*j3@(Q&VLMz0*Tc=Q3+{xyun+db zAK)c;8D4=ya2Q^NBk&p=g<~)P$KeFL4kzIacoW`&x8WUlAHIOU!r$Oa_&aVj@$>R5FcZkm+Ow$s{vL4p~Sl$s)3tRFP^@Lza+Qau#VP z9mGf0khR25I!S;8Nf+5b&LQWL^T=i7aFWE=#BKMK| z$wTB}@&tL3JWpOAFOm<)pU8*g&*UTWG5LgiNlfRHJ$v?`QsVGJYz2YMLW zRO6bymhTO>;P;>*G^V%tJ>hT^w4h^@$)aF@WR}3Z%;@F}m1X5k!O+@pm#2*{3$}H4 z@_~q(OD`zT%g)To%g)Fy&dbTjDJ?I~D9$RZ$SAD9PhnW(Mp{^?I=1gV$YEQR+ zuue4ea78dAR4y-Wi{L?VwRP~FyqmL1kF}woa9~_~q|%EreXD(Z2#*XdLS1*Dj1NbA z0Z#-Ens|aD*s?psH~PZ9R-fM&!DdM@{Y}1rH`pT#LAomrg*<_FR27Jn@vYtMm4Vek zH>X9ZrNKaiUmuYsfgKFeNJi>&bK_1OV2!7f7l)SQ;{7-h-W%7MS>*{wN`swUejbZ! z1#AdMP_s1I5>FT*K$txaxsLA&hH#S&B_ZCkwkzlhM8aYnVuE)-w54*W*v0e%un;O? z5iD+zOelcrmrA#M7%fehU~d!~R4uJ>EfHZSW)n5A1oC$6V#$(>I&ir;eT}QSJK|~e z^JP99N-*FF_4Y#@)I-(s8rM)+OhzLtg|U6m#K!eOGfQE{6==L#lyC5VrOqJwCpnGL}9^wM@Lqu4Dn4BIs2gdfpdgz4>%*oPNdOw^C=fU}G zJe$lighOY;d7Nei(nf{F?ae(?17U+3a2rQjNlCBNQS3M2O#Mc-7Zk*Xx*0AOrhE~b z&85&I#whhhyYPd!a zx`R#WgPm;ZDMFLr2DlM!YDS@9aTnP%H#e&wH>b3qyr3+jxFBz4Mow9NNk&OoF5*sJ zd0|0mNq$LYS+U#K)e#KvVP9vr--D;#?Fn_}pA|3b(@^mdUaNSowbp1UqMC7iVS_W@l#PW#<*+*t7C83Mz`TGAgq3 z3$n_}3kqhI6#m*QgvGuKwhD{fp-8#vD`Am^vU{X5TzGbZO^Qw7K6nDg?t}Z`0eBD| zf`{P|cohB!kHO~weyHw>wIl|EiU@%V5rm0jU8TG8AdE?3nAv5 zR?*}OAxMQ0-Z-g;t88(jC*<=84rYYxs$iRlux?H#wHyw$&GF9hYH36jo=%@1@i%$+ zc&dY5-d~Cr6&l1T7Nb19$j#03u8VlZ8D^Z){C62cgJ^|_ZKrh3%AcOo=&Kbhwnh5N z%A1xgLCU)j+Qm|1d-(x;40*fZPw*l989rhQStVP<7Vm~n;8XYvK4(>|n$@r+f_aX` z<2@3@>wOVnr&3O<5MU7z_Doevx&-XSZOJ^X*P#EvYFBq>C&IIIa$J17;KafWCEY&1 zw<#;PJUcVT!+jx5=bsSjhi~9p_>R@GMz(BdYTv`pkk=1Cz>n|~JB!sZS3mp$|AtRk zJ!`;;;gkf#8absADr-Z&U`X_`Q-8Z*iKlI?i|_J;L}=h9|8{FhN2ABz&8HQC^mkTl zM@S;koH}eWii{>>SQA^ynptw%{I8`xZIC*iLh1m~LlQBNWC1I^o``3OHbK)GWA22? z66A`+|2tz>s_H|*U__wnM$IU_!D5{}C3Dv7Ical?D;F)Us&+LkUG5&_f}_VIaatX^ zN1(4j z&T`UbPjxuQq@|CaFmV!=xqKUV)U~?8?`aPUKAaD?g?wFz&d5I(dcsXUZ=^$Tzv#5n ziY7>lroEJ7iAtn|1?PJbd&`B-s5AYPRp1+0~wH{cSvsBcul9) z44dFs9V43)m{OQoR<5}}duEQrJ^Sr7N^1bd3s*2UQv_NZ?-m9Eq`*5O`@)CB=i znyawr;#9Cla|jxB+ew-S}RNAsnwaB2OS-eva|szljQ? zLL;#d8?h4yNh5PeDOrJ0-nryLvI%3nE6G(D-(7qS zRDn^O1|v3(>ZpN^r8%^Q*3vqR%v$MMx*j93&Ga&iz;4Fq>tXshJwlJskLh3N*Yq3u zy==6MlkA!j=^NSxzX!i$<5`PHQ^+`yvLenMkvMt!vB(HjxPrpdphqBP;)J|C@B^_D z8~j94i37oNIa|S8Y$bE=!5OBL@niyC)7dKKVXdqUuO0zToxhEHf=&I`MmQ8~H1W43 z35{HlUcveNmzMR&9mSSuMM`N!I3jWzk~PS85}$ebCpKwiebDRaP4z@lvu4i9j0Kk@ zm&}8_J4qhNCk3RC%p$XKf9Eout!C}4gZbDRwwC$t6zB~pCM9?+6z)Z8)5!uza5}_$ zT$~J?5`t2-uN}Pv?-k)cToDR(*0}00%nOEu&_oOvh2216f$gREsxn-G0fY;A4j)(< zFRch6tRaIC3SuF2y{Az~Jnq1Hb~)R^u4LQTc6_=*@&h)OgnU z+9kg&6vZElF+9b18H*YsLagn>pi^)tQqRgjxJ!i3p=R-(VzcFqKE6i`yxVarIDIwW z84UF<2zk0XhDu{&h-(mHOew7($c@eZY|@RCfP_exL|8A|z|QF>>+o?sI~N}>6=svV zv<+$JbnL#^7nvR(%JleF;Z$N#d%P9_ctI%G-6d5Bv@E9ae6k5?A-RAsM6r$RJa#_2 zfU(_VGr5RdOg6I%*+#Yruc+Bj;qyoMkZ8Fjy#fOkgF&qjFvc|r#prJv0;|v1I7O1d zdmAc8%88BVO0o^cVnC1KtH3r#$aMvAcaSZ{+U_7bF>oi>u+4qsT6WQI_8CCtbR)Tm z+>B`xTtMLn)(R<4Oj3mSFtScDGGLdmix|V->Ml@skFcD2SeH>0ZCmYDhp830lITtBVSZ+ZyFMpUYS5Hq5M+cDb{(eCV-WArq zBmcac?vKtdi53;7#e8zwfpqB>nOR!V+0uPl(dCzlce_MFV#Z|TTv&|hrxlnp@*^GD zfMnznq$9UsK>i3u+D~C9eHhc%uVd2sOZXX6(`pP5QqWgB$wYKgm81?KvYB`>`Ft)W znXkd*^3CK9axbQpA0{u8H!+d?DJG9GX-s}Z3ZkP9It3HNd9;w0(8WkVn&>KNY;jsq zAw9>g)FY9K+X!a)CzP-6@=FeENq5BW3t)zl?~!u;!jT$0)%~Q8M4{?;w|8@`?)u1r z(#EX3vc~!$9f)w*c|(uGR0<3uoIj|}-RN@9%o=JZ9tszteV~1a*}7w>v779{#1Xlj zUDiiJh^mNe_wOA#E}(HWGl#}uh>Tr11MVlYb{5M%SWVZOd2fk7*tQmfa{JP{ zc#W7Q#y|uqO5BUYM)VRn4te{~lwKi+$YJs-IYM3|N69fVz;?20*>&uCb_2VS-NbHY zx3F9HkrR+XPLem!^4=nElXu9w=Dc_z0OVwLraahsUbh;!eBO1 zDIjAlVx*g!Qo>_0h!^q&n9&Ib1EPDu>||(gF{G}N(@7e179uPnWo#KKBp^Ri55pH|C0xPZ@`3Mz~aZ^h1Nme$k;zL?CsrXeb3f(v^f)R(sa_Ix*Ntc6#0Y|?XuhN6|A!s*>D|yb~mzSGyyR;#334r@1bZC z)gxEJXi7_UY(Kk)-P=zM_<|>c{Q>RGB3PJCn0;}0P_^ie(VNE14lBjwMsifvi|-tK zZLtz@WvE5S-A}{ULHL3KQ}i?ySBg5={Va8WrsMN?Isr*aTQ{Ec*ejx8n%D#Ep%Zix zolK`-+o|GbI__~mWTA+a!f=Fy1*#7V1~T+w!p#}IgRjUWlOEQZ;Y(2bJSZ9g&7@h# z%i>gWnEEKq76AB+byD9Pnk&T~r|(ac<_VpJz~uBw9B*vD+){09M+zy%P`l|YI-Aa+ zbJ?TpkL)q__-;C%7LjyX!k%CUF?@W5B`+1MP&fe1q9F=*Es}joCs|M&KP2%p7gJM7 zYXmim(0^6YYW5_1iapH^>_*hf!1z8FEzyE05D7fRL@+KNh9`WF2zYg#9w{P2A~>>k zkhQtmfJ6wn$!Lf%~bh{!!3$1foGAc_lF$+#c#B3_4seqO+#Dqm{|A*?(g zc;6V%2m$CBTMIEV+FEDV$o5lyt$l4}Sv}T`5I*hK8dviXj~4^lke%Csde~HB+t^Ke&?nP%>`)(F&khT?qD7Vx zw@(pPB!oB@LQ#4iJ)gbG2I6>1FQgaYn>xCYZlasn5%wB8+D~UeF1-{_$Xs>|-#4PT zA)>Necp3_)IeZkXuiDcd@I|`4nBZK$YB&v{+vtwd6ZCG;%n!k;>{;F()VyD^!zmp(^dpfAx^=wVE$9i;>G1U*UL zq;J!A>HG8t`V;+y{zpb+GMQYKC{xKam}*OsX=Qp@vMf_pEo+f&koCzPkR6qMEc+=T zIbmW#OTyU+8xqb*I4|MigzX78CPWkNNccm-lL=2HJe_bb;gy6xC483ft(?d)9WPhO zHS*DNvwVVlhCD}JD4#7alP{Ln%IoCIibQv!CvkORN8*}9 zf8yT6PZPgN{66tVrA#?WIYwz#W-7ClIm$d`fpV5|j&h!|NLivRQ#LD?DOV`nN{_Nl z$t&BHKIK|vr!uJApxmz9r+ijO{3ltx>0|=c`-PTh%+%H>qz??@{kp->be){eb!* z^)u?1)rZuts$Wx|RKKZyTm7#3eNCb!SL4yF(fBpJ8m8H(*{r!(vsJTAvt6@8vr}`c z=620Jnun8~PkJ%wXwv&hpCtV)=?6~1DLFMaiW|dmoQ|_|4la!w&rReeb5pqtu8!;B z`nW^f3GO8K0rxrg1^0tip&h3+YRy`!)~iTs3y4!Vk==SRF((TvXtGiG4fbIp|OS)HdhjmAE zM|A_b6S|YSH+668zSM)>pr5FptzW2LsXtqPf&L2p4*gF3b^06hyYx~0Zv7tpo%%!i z5A^@g|J#sgP#H9a(S{^Lios;C7;J`AgVRuGs5Y!NTxht`u+4Cl;cCNv!()ag4Nn`M zF+68@!SJEsi{!*)Rk9|{O><52O~s~CQ@Lq@X}M{oX_cwf#0G(BTFVfw&K z%_eiE*=24uuQP8lUuWKDzT5ne`Jnj)^MLt1^9SZ{&A(W{LM;gvt;J?ZwKy&5mI;diOn`>KSbJ-efO}1v+GMm@7+SXxPWAobrwjSGswkvGAZTHz8vpr#Z%67o^ zjO~!^RoiQ}W47bA*KOa}Ir~g|mA%=%#_qQV>|OSdJz`&HUvJ-F-(uft-)7%#-(lZr zzs`Px{U-Y@_CxlcQYWQ0rEW~UKlNjW-jV7^bBuRPa!heda}+r$9W{dJ&WoIvI4^T - - - - SchemeUserState - - MovieVerse.xcscheme_^#shared#^_ - - orderHint - 0 - - - - diff --git a/MovieVerse-Mobile/platforms/ios/www/404.html b/MovieVerse-Mobile/platforms/ios/www/404.html index 83b60cf9..5b02dad8 100644 --- a/MovieVerse-Mobile/platforms/ios/www/404.html +++ b/MovieVerse-Mobile/platforms/ios/www/404.html @@ -36,13 +36,6 @@ - - - - - - - - - - - - - - - - - - - - -
- - -
- - - - - -
-
-
-

The MovieVerse Database

-
-
-
- - - - - - - - - \ No newline at end of file diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/leonardo-dicarprio.js b/MovieVerse-Mobile/platforms/ios/www/images/js/leonardo-dicarprio.js deleted file mode 100644 index 3057460f..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/leonardo-dicarprio.js +++ /dev/null @@ -1,493 +0,0 @@ -const search = document.getElementById("search"); -const searchButton = document.getElementById("button-search"); - -const movieCode = { - part1: 'YzVhMjBjODY=', - part2: 'MWFjZjdiYjg=', - part3: 'ZDllOTg3ZGNjN2YxYjU1OA==' -}; - -function getMovieCode() { - return atob(movieCode.part1) + atob(movieCode.part2) + atob(movieCode.part3); -} - -function generateMovieNames(input) { - return String.fromCharCode(97, 112, 105, 95, 107, 101, 121, 61); -} - -const form = document.getElementById("form1"); -const SEARCHPATH = `https://${getMovieVerseData()}/3/search/movie?&${generateMovieNames()}${getMovieCode()}&query=`; -const main = document.getElementById("main"); -const IMGPATH = "https://image.tmdb.org/t/p/w1280"; -const searchTitle = document.getElementById("search-title"); - -function updateBrowserURL(name) { - const nameSlug = createNameSlug(name); - const newURL = window.location.protocol + "//" + window.location.host + window.location.pathname + '?' + nameSlug; - window.history.replaceState({ path: newURL }, '', newURL); -} - -function createNameSlug(name) { - return name.toLowerCase().replace(/ /g, '-').replace(/[^\w-]/g, ''); -} - -document.getElementById('clear-search-btn').addEventListener('click', () => { - location.reload(); -}); - -form.addEventListener('submit', (e) => { - e.preventDefault(); - const searchQuery = document.getElementById('search').value; - localStorage.setItem('searchQuery', searchQuery); - window.location.href = 'search.html'; -}); - -function handleSearch() { - const searchQuery = document.getElementById('search').value; - localStorage.setItem('searchQuery', searchQuery); - window.location.href = 'search.html'; -} - -function calculateMoviesToDisplay() { - const screenWidth = window.innerWidth; - if (screenWidth <= 689.9) return 10; - if (screenWidth <= 1021.24) return 20; - if (screenWidth <= 1353.74) return 21; - if (screenWidth <= 1684.9) return 20; - if (screenWidth <= 2017.49) return 20; - if (screenWidth <= 2349.99) return 18; - if (screenWidth <= 2681.99) return 21; - if (screenWidth <= 3014.49) return 24; - if (screenWidth <= 3345.99) return 27; - if (screenWidth <= 3677.99) return 20; - if (screenWidth <= 4009.99) return 22; - if (screenWidth <= 4340.99) return 24; - if (screenWidth <= 4673.49) return 26; - if (screenWidth <= 5005.99) return 28; - if (screenWidth <= 5337.99) return 30; - if (screenWidth <= 5669.99) return 32; - if (screenWidth <= 6001.99) return 34; - if (screenWidth <= 6333.99) return 36; - if (screenWidth <= 6665.99) return 38; - if (screenWidth <= 6997.99) return 40; - if (screenWidth <= 7329.99) return 42; - if (screenWidth <= 7661.99) return 44; - if (screenWidth <= 7993.99) return 46; - if (screenWidth <= 8325.99) return 48; - return 20; -} - -let initialMainContent = ''; - -document.addEventListener('DOMContentLoaded', () => { - initialMainContent = document.getElementById('main').innerHTML; - - const actorId = 6193; - if (actorId) { - fetchActorDetails(actorId); - } - else { - document.getElementById('actor-details-container').innerHTML = ` -
-

Actor details not found.

-
`; - } - - document.getElementById('clear-search-btn').style.display = 'none'; -}); - -async function fetchActorDetails(actorId) { - const actorUrl = `https://${getMovieVerseData()}/3/person/6193?${generateMovieNames()}${getMovieCode()}`; - const creditsUrl = `https://${getMovieVerseData()}/3/person/6193/movie_credits?${generateMovieNames()}${getMovieCode()}`; - try { - const [actorResponse, creditsResponse] = await Promise.all([ - fetch(actorUrl), - fetch(creditsUrl) - ]); - - const actor = await actorResponse.json(); - const credits = await creditsResponse.json(); - if (actor.success === false) { - document.getElementById('actor-details-container').innerHTML = '

No Information is Available for this Actor

'; - } - else { - updateBrowserURL(actor.name); - populateActorDetails(actor, credits); - } - } - catch (error) { - console.log('Error fetching actor details:', error); - document.getElementById('actor-details-container').innerHTML = '

Error fetching actor details

'; - } -} - -function populateActorDetails(actor, credits) { - const actorImage = document.getElementById('actor-image'); - const actorName = document.getElementById('actor-name'); - const actorDescription = document.getElementById('actor-description'); - - if (actor.profile_path) { - actorImage.src = `https://image.tmdb.org/t/p/w1280${actor.profile_path}`; - actorName.textContent = actor.name; - document.title = `${actor.name} - Actor's Details`; - } - else { - actorImage.style.display = 'none'; - actorName.textContent = actor.name; - const noImageText = document.createElement('h2'); - noImageText.textContent = 'Image Not Available'; - noImageText.style.textAlign = 'center'; - document.querySelector('.actor-left').appendChild(noImageText); - } - - let ageOrStatus; - if (actor.birthday) { - if (actor.deathday) { - ageOrStatus = calculateAge(actor.birthday, actor.deathday) + ' (Deceased)'; - } - else { - ageOrStatus = calculateAge(actor.birthday) + ' (Alive)'; - } - } - else { - ageOrStatus = 'Unknown'; - } - - actorDescription.innerHTML = ` -

Biography: ${actor.biography || 'N/A'}

-

Date of Birth: ${actor.birthday || 'N/A'}

-

Date of Death: ${actor.deathday || 'N/A'}

-

Age: ${ageOrStatus}

-

Place of Birth: ${actor.place_of_birth || 'N/A'}

-

Known For: ${actor.known_for_department || 'N/A'}

-

Height: ${actor.height || 'N/A'}

- `; - - const gender = document.createElement('div'); - gender.innerHTML = `

Gender: ${actor.gender === 1 ? 'Female' : actor.gender === 2 ? 'Male' : 'N/A'}

`; - actorDescription.appendChild(gender); - - const popularity = document.createElement('div'); - popularity.innerHTML = `

Popularity Score: ${actor.popularity.toFixed(2)}

`; - actorDescription.appendChild(popularity); - - const filmographyHeading = document.createElement('p'); - filmographyHeading.innerHTML = 'Filmography: '; - actorDescription.appendChild(filmographyHeading); - - const movieList = document.createElement('div'); - movieList.classList.add('movie-list'); - credits.cast.forEach(movie => { - const movieLink = document.createElement('span'); - movieLink.textContent = movie.title; - movieLink.classList.add('movie-link'); - movieLink.addEventListener('click', () => { - localStorage.setItem('selectedMovieId', movie.id); - window.location.href = 'movie-details.html'; - }); - movieList.appendChild(movieLink); - movieList.appendChild(document.createTextNode(', ')); - }); - - filmographyHeading.appendChild(movieList); - applySettings(); -} - -function calculateAge(birthday, deathday = null) { - const birthDate = new Date(birthday); - const referenceDate = deathday ? new Date(deathday) : new Date(); - const diff = referenceDate - birthDate.getTime(); - const ageDate = new Date(diff); - return Math.abs(ageDate.getUTCFullYear() - 1970); -} - -async function ensureGenreMapIsAvailable() { - if (!localStorage.getItem('genreMap')) { - await fetchGenreMap(); - } -} - -async function fetchGenreMap() { - const url = `https://${getMovieVerseData()}/3/genre/movie/list?${generateMovieNames()}${getMovieCode()}`; - try { - const response = await fetch(url); - const data = await response.json(); - const genreMap = data.genres.reduce((map, genre) => { - map[genre.id] = genre.name; - return map; - }, {}); - localStorage.setItem('genreMap', JSON.stringify(genreMap)); - } - catch (error) { - console.log('Error fetching genre map:', error); - } -} - -async function rotateUserStats() { - await ensureGenreMapIsAvailable(); - - const stats = [ - { - label: "Your Current Time", - getValue: () => { - const now = new Date(); - let hours = now.getHours(); - let minutes = now.getMinutes(); - hours = hours < 10 ? '0' + hours : hours; - minutes = minutes < 10 ? '0' + minutes : minutes; - return `${hours}:${minutes}`; - } - }, - { label: "Most Visited Movie", getValue: getMostVisitedMovie }, - { label: "Most Visited Director", getValue: getMostVisitedDirector }, - { label: "Most Visited Actor", getValue: getMostVisitedActor }, - { - label: "Movies Discovered", - getValue: () => { - const viewedMovies = JSON.parse(localStorage.getItem('uniqueMoviesViewed')) || []; - return viewedMovies.length; - } - }, - { - label: "Favorite Movies", - getValue: () => { - const favoritedMovies = JSON.parse(localStorage.getItem('favoritesMovies')) || []; - return favoritedMovies.length; - } - }, - { - label: "Favorite Genre", - getValue: () => { - const mostCommonGenreCode = getMostCommonGenre(); - const genreArray = JSON.parse(localStorage.getItem('genreMap')) || []; - const genreObject = genreArray.reduce((acc, genre) => { - acc[genre.id] = genre.name; - return acc; - }, {}); - return genreObject[mostCommonGenreCode] || 'Not Available'; - } - }, - { label: "Watchlists Created", getValue: () => localStorage.getItem('watchlistsCreated') || 0 }, - { label: "Average Movie Rating", getValue: () => localStorage.getItem('averageMovieRating') || 'Not Rated' }, - { - label: "Directors Discovered", - getValue: () => { - const viewedDirectors = JSON.parse(localStorage.getItem('uniqueDirectorsViewed')) || []; - return viewedDirectors.length; - } - }, - { - label: "Actors Discovered", - getValue: () => { - const viewedActors = JSON.parse(localStorage.getItem('uniqueActorsViewed')) || []; - return viewedActors.length; - } - }, - { label: "Your Trivia Accuracy", getValue: getTriviaAccuracy }, - ]; - - let currentStatIndex = 0; - - function updateStatDisplay() { - const currentStat = stats[currentStatIndex]; - document.getElementById('stats-label').textContent = currentStat.label + ':'; - document.getElementById('stats-display').textContent = currentStat.getValue(); - currentStatIndex = (currentStatIndex + 1) % stats.length; - } - - updateStatDisplay(); - - const localTimeDiv = document.getElementById('local-time'); - let statRotationInterval = setInterval(updateStatDisplay, 3000); - - localTimeDiv.addEventListener('click', () => { - clearInterval(statRotationInterval); - updateStatDisplay(); - statRotationInterval = setInterval(updateStatDisplay, 3000); - }); -} - -function updateMovieVisitCount(movieId, movieTitle) { - let movieVisits = JSON.parse(localStorage.getItem('movieVisits')) || {}; - if (!movieVisits[movieId]) { - movieVisits[movieId] = { count: 0, title: movieTitle }; - } - movieVisits[movieId].count += 1; - localStorage.setItem('movieVisits', JSON.stringify(movieVisits)); -} - -function getMostVisitedMovie() { - const movieVisits = JSON.parse(localStorage.getItem('movieVisits')) || {}; - let mostVisitedMovie = ''; - let maxVisits = 0; - - for (const movieId in movieVisits) { - if (movieVisits[movieId].count > maxVisits) { - mostVisitedMovie = movieVisits[movieId].title; - maxVisits = movieVisits[movieId].count; - } - } - - return mostVisitedMovie || 'Not Available'; -} - -function getMostVisitedActor() { - const actorVisits = JSON.parse(localStorage.getItem('actorVisits')) || {}; - let mostVisitedActor = ''; - let maxVisits = 0; - - for (const actorId in actorVisits) { - if (actorVisits[actorId].count > maxVisits) { - mostVisitedActor = actorVisits[actorId].name; - maxVisits = actorVisits[actorId].count; - } - } - - return mostVisitedActor || 'Not Available'; -} - -function getMostVisitedDirector() { - const directorVisits = JSON.parse(localStorage.getItem('directorVisits')) || {}; - - let mostVisitedDirector = ''; - let maxVisits = 0; - - for (const directorId in directorVisits) { - if (directorVisits[directorId].count > maxVisits) { - mostVisitedDirector = directorVisits[directorId].name; - maxVisits = directorVisits[directorId].count; - } - } - - return mostVisitedDirector || 'Not Available'; -} - -function getTriviaAccuracy() { - let triviaStats = JSON.parse(localStorage.getItem('triviaStats')) || { totalCorrect: 0, totalAttempted: 0 }; - if (triviaStats.totalAttempted === 0) { - return 'No trivia attempted'; - } - let accuracy = (triviaStats.totalCorrect / triviaStats.totalAttempted) * 100; - return `${accuracy.toFixed(1)}% accuracy`; -} - -function getMostCommonGenre() { - const favoriteGenresArray = JSON.parse(localStorage.getItem('favoriteGenres')) || []; - const genreCounts = favoriteGenresArray.reduce((acc, genre) => { - acc[genre] = (acc[genre] || 0) + 1; - return acc; - }, {}); - - let mostCommonGenre = ''; - let maxCount = 0; - - for (const genre in genreCounts) { - if (genreCounts[genre] > maxCount) { - mostCommonGenre = genre; - maxCount = genreCounts[genre]; - } - } - - return mostCommonGenre || 'Not Available'; -} - -document.addEventListener('DOMContentLoaded', rotateUserStats); - -function handleSignInOut() { - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - - if (isSignedIn) { - localStorage.setItem('isSignedIn', JSON.stringify(false)); - alert('You have been signed out.'); - } - else { - window.location.href = 'sign-in.html'; - return; - } - - updateSignInButtonState(); -} - -function getMovieVerseData(input) { - return String.fromCharCode(97, 112, 105, 46, 116, 104, 101, 109, 111, 118, 105, 101, 100, 98, 46, 111, 114, 103); -} - -function updateSignInButtonState() { - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - const signInText = document.getElementById('signInOutText'); - - const signInIcon = document.getElementById('signInIcon'); - const signOutIcon = document.getElementById('signOutIcon'); - - if (isSignedIn) { - signInText.textContent = 'Sign Out'; - signInIcon.style.display = 'none'; - signOutIcon.style.display = 'inline-block'; - } - else { - signInText.textContent = 'Sign In'; - signInIcon.style.display = 'inline-block'; - signOutIcon.style.display = 'none'; - } -} - -document.addEventListener("DOMContentLoaded", function() { - updateSignInButtonState(); - applySettings(); - document.getElementById('googleSignInBtn').addEventListener('click', handleSignInOut); -}); - -async function showMovieOfTheDay() { - const year = new Date().getFullYear(); - const url = `https://${getMovieVerseData()}/3/discover/movie?${generateMovieNames()}${getMovieCode()}&sort_by=vote_average.desc&vote_count.gte=100&primary_release_year=${year}&vote_average.gte=7`; - - try { - const response = await fetch(url); - const data = await response.json(); - const movies = data.results; - - if (movies.length > 0) { - const randomMovie = movies[Math.floor(Math.random() * movies.length)]; - localStorage.setItem('selectedMovieId', randomMovie.id); - window.location.href = 'movie-details.html'; - } - else { - fallbackMovieSelection(); - } - } - catch (error) { - console.log('Error fetching movie:', error); - fallbackMovieSelection(); - } -} - -function fallbackMovieSelection() { - const fallbackMovies = [432413, 299534, 1726, 562, 118340, 455207, 493922, 447332, 22970, 530385, 27205, 264660, 120467, 603, 577922, 76341, 539, 419704, 515001, 118340, 424, 98]; - const randomFallbackMovie = fallbackMovies[Math.floor(Math.random() * fallbackMovies.length)]; - localStorage.setItem('selectedMovieId', randomFallbackMovie); - window.location.href = 'movie-details.html'; -} - -function applySettings() { - const savedBg = localStorage.getItem('backgroundImage'); - const savedTextColor = localStorage.getItem('textColor'); - const savedFontSize = localStorage.getItem('fontSize'); - - if (savedBg) { - document.body.style.backgroundImage = `url('${savedBg}')`; - } - if (savedTextColor) { - applyTextColor(savedTextColor); - } - if (savedFontSize) { - const size = savedFontSize === 'small' ? '12px' : savedFontSize === 'medium' ? '16px' : '20px'; - document.body.style.fontSize = size; - } -} - -function applyTextColor(color) { - document.querySelectorAll('h1, h2, h3, p, a, span, div, button, input, select, textarea, label, li') - .forEach(element => { - element.style.color = color; - }); -} \ No newline at end of file diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/movie-details.js b/MovieVerse-Mobile/platforms/ios/www/images/js/movie-details.js deleted file mode 100644 index a0b3d038..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/movie-details.js +++ /dev/null @@ -1,1389 +0,0 @@ -const search = document.getElementById("search"); -const searchButton = document.getElementById("button-search"); - -function showSpinner() { - document.getElementById('myModal').classList.add('modal-visible'); -} - -function hideSpinner() { - document.getElementById('myModal').classList.remove('modal-visible'); -} - -const movieCode = { - part1: 'YzVhMjBjODY=', - part2: 'MWFjZjdiYjg=', - part3: 'ZDllOTg3ZGNjN2YxYjU1OA==' -}; - -function getMovieCode() { - return atob(movieCode.part1) + atob(movieCode.part2) + atob(movieCode.part3); -} - -function generateMovieNames(input) { - return String.fromCharCode(97, 112, 105, 95, 107, 101, 121, 61); -} - -const form = document.getElementById("form1"); -const SEARCHPATH = `https://${getMovieVerseData()}/3/search/movie?&${generateMovieNames()}${getMovieCode()}&query=`; - -const main = document.getElementById("main"); -const IMGPATH = "https://image.tmdb.org/t/p/w1280"; -const favoriteButton = document.getElementById("favorite-btn"); -const searchTitle = document.getElementById("search-title"); - -let trailerUrlGlobal; -let initialMainContent; - -function getClassByRate(vote){ - if (vote >= 8) { - return 'green'; - } - else if (vote >= 5) { - return 'orange'; - } - else { - return 'red'; - } -} - -form.addEventListener('submit', (e) => { - e.preventDefault(); - const searchQuery = document.getElementById('search').value; - localStorage.setItem('searchQuery', searchQuery); - window.location.href = 'search.html'; -}); - -function handleSearch() { - const searchQuery = document.getElementById('search').value; - localStorage.setItem('searchQuery', searchQuery); - window.location.href = 'search.html'; -} - -function calculateMoviesToDisplay() { - const screenWidth = window.innerWidth; - if (screenWidth <= 689.9) return 10; - if (screenWidth <= 1021.24) return 20; - if (screenWidth <= 1353.74) return 21; - if (screenWidth <= 1684.9) return 20; - if (screenWidth <= 2017.49) return 20; - if (screenWidth <= 2349.99) return 18; - if (screenWidth <= 2681.99) return 21; - if (screenWidth <= 3014.49) return 24; - if (screenWidth <= 3345.99) return 27; - if (screenWidth <= 3677.99) return 20; - if (screenWidth <= 4009.99) return 22; - if (screenWidth <= 4340.99) return 24; - if (screenWidth <= 4673.49) return 26; - if (screenWidth <= 5005.99) return 28; - if (screenWidth <= 5337.99) return 30; - if (screenWidth <= 5669.99) return 32; - if (screenWidth <= 6001.99) return 34; - if (screenWidth <= 6333.99) return 36; - if (screenWidth <= 6665.99) return 38; - if (screenWidth <= 6997.99) return 40; - if (screenWidth <= 7329.99) return 42; - if (screenWidth <= 7661.99) return 44; - if (screenWidth <= 7993.99) return 46; - if (screenWidth <= 8325.99) return 48; - return 20; -} - -async function getMovies(url) { - clearMovieDetails(); - const numberOfMovies = calculateMoviesToDisplay(); - const pagesToFetch = numberOfMovies <= 20 ? 1 : 2; - let allMovies = []; - - for (let page = 1; page <= pagesToFetch; page++) { - const response = await fetch(`${url}&page=${page}`); - const data = await response.json(); - allMovies = allMovies.concat(data.results); - } - - const popularityThreshold = 0.5; - - allMovies.sort((a, b) => { - const popularityDifference = Math.abs(a.popularity - b.popularity); - if (popularityDifference < popularityThreshold) { - return b.vote_average - a.vote_average; - } - return b.popularity - a.popularity; - }); - - if (allMovies.length > 0) { - showMovies(allMovies.slice(0, numberOfMovies)); - document.getElementById('clear-search-btn').style.display = 'block'; - } - else { - main.innerHTML = `

No movie with the specified search term found. Please try again.

`; - document.getElementById('clear-search-btn').style.display = 'none'; - } -} - -function clearMovieDetails() { - const movieDetailsContainer = document.getElementById('movie-details-container'); - if (movieDetailsContainer) { - movieDetailsContainer.innerHTML = ''; - } -} - -function showMovies(movies){ - main.innerHTML = ''; - movies.forEach((movie) => { - const { id, poster_path, title, vote_average, overview } = movie; - const movieE1 = document.createElement('div'); - const voteAverage = vote_average.toFixed(1); - movieE1.classList.add('movie'); - - const movieImage = poster_path - ? `${title}` - : `
Movie Image Not Available
`; - - movieE1.innerHTML = ` - ${movieImage} -
-

${title}

- ${voteAverage} -
-
-

Movie Overview:

- ${overview} -
`; - - movieE1.addEventListener('click', () => { - localStorage.setItem('selectedMovieId', id); - window.location.href = 'movie-details.html'; - updateMovieVisitCount(id, title); - }); - - main.appendChild(movieE1); - }); - applySettings(); -} - -async function ensureGenreMapIsAvailable() { - if (!localStorage.getItem('genreMap')) { - await fetchGenreMap(); - } -} - -async function fetchGenreMap() { - const url = `https://${getMovieVerseData()}/3/genre/movie/list?${generateMovieNames()}${getMovieCode()}`; - try { - const response = await fetch(url); - const data = await response.json(); - const genreMap = data.genres.reduce((map, genre) => { - map[genre.id] = genre.name; - return map; - }, {}); - localStorage.setItem('genreMap', JSON.stringify(genreMap)); - } - catch (error) { - console.log('Error fetching genre map:', error); - } -} - -async function rotateUserStats() { - await ensureGenreMapIsAvailable(); - - const stats = [ - { - label: "Your Current Time", - getValue: () => { - const now = new Date(); - let hours = now.getHours(); - let minutes = now.getMinutes(); - hours = hours < 10 ? '0' + hours : hours; - minutes = minutes < 10 ? '0' + minutes : minutes; - return `${hours}:${minutes}`; - } - }, - { label: "Most Visited Movie", getValue: getMostVisitedMovie }, - { label: "Most Visited Director", getValue: getMostVisitedDirector }, - { label: "Most Visited Actor", getValue: getMostVisitedActor }, - { - label: "Movies Discovered", - getValue: () => { - const viewedMovies = JSON.parse(localStorage.getItem('uniqueMoviesViewed')) || []; - return viewedMovies.length; - } - }, - { - label: "Favorite Movies", - getValue: () => { - const favoritedMovies = JSON.parse(localStorage.getItem('favoritesMovies')) || []; - return favoritedMovies.length; - } - }, - { - label: "Favorite Genre", - getValue: () => { - const mostCommonGenreCode = getMostCommonGenre(); - const genreArray = JSON.parse(localStorage.getItem('genreMap')) || []; - const genreObject = genreArray.reduce((acc, genre) => { - acc[genre.id] = genre.name; - return acc; - }, {}); - return genreObject[mostCommonGenreCode] || 'Not Available'; - } - }, - { label: "Watchlists Created", getValue: () => localStorage.getItem('watchlistsCreated') || 0 }, - { label: "Average Movie Rating", getValue: () => localStorage.getItem('averageMovieRating') || 'Not Rated' }, - { - label: "Directors Discovered", - getValue: () => { - const viewedDirectors = JSON.parse(localStorage.getItem('uniqueDirectorsViewed')) || []; - return viewedDirectors.length; - } - }, - { - label: "Actors Discovered", - getValue: () => { - const viewedActors = JSON.parse(localStorage.getItem('uniqueActorsViewed')) || []; - return viewedActors.length; - } - }, - { label: "Your Trivia Accuracy", getValue: getTriviaAccuracy }, - ]; - - let currentStatIndex = 0; - - function updateStatDisplay() { - const currentStat = stats[currentStatIndex]; - document.getElementById('stats-label').textContent = currentStat.label + ':'; - document.getElementById('stats-display').textContent = currentStat.getValue(); - currentStatIndex = (currentStatIndex + 1) % stats.length; - } - - updateStatDisplay(); - - const localTimeDiv = document.getElementById('local-time'); - let statRotationInterval = setInterval(updateStatDisplay, 3000); - - localTimeDiv.addEventListener('click', () => { - clearInterval(statRotationInterval); - updateStatDisplay(); - statRotationInterval = setInterval(updateStatDisplay, 3000); - }); -} - -function updateMovieVisitCount(movieId, movieTitle) { - let movieVisits = JSON.parse(localStorage.getItem('movieVisits')) || {}; - - if (!movieVisits[movieId]) { - movieVisits[movieId] = { count: 0, title: movieTitle }; - } - movieVisits[movieId].count += 1; - localStorage.setItem('movieVisits', JSON.stringify(movieVisits)); -} - -function getMostVisitedDirector() { - const directorVisits = JSON.parse(localStorage.getItem('directorVisits')) || {}; - let mostVisitedDirector = ''; - let maxVisits = 0; - - for (const directorId in directorVisits) { - if (directorVisits[directorId].count > maxVisits) { - mostVisitedDirector = directorVisits[directorId].name; - maxVisits = directorVisits[directorId].count; - } - } - - return mostVisitedDirector || 'Not Available'; -} - -function getMostVisitedMovie() { - const movieVisits = JSON.parse(localStorage.getItem('movieVisits')) || {}; - let mostVisitedMovie = ''; - let maxVisits = 0; - - for (const movieId in movieVisits) { - if (movieVisits[movieId].count > maxVisits) { - mostVisitedMovie = movieVisits[movieId].title; - maxVisits = movieVisits[movieId].count; - } - } - - return mostVisitedMovie || 'Not Available'; -} - -function getMostVisitedActor() { - const actorVisits = JSON.parse(localStorage.getItem('actorVisits')) || {}; - let mostVisitedActor = ''; - let maxVisits = 0; - - for (const actorId in actorVisits) { - if (actorVisits[actorId].count > maxVisits) { - mostVisitedActor = actorVisits[actorId].name; - maxVisits = actorVisits[actorId].count; - } - } - - return mostVisitedActor || 'Not Available'; -} - -function getTriviaAccuracy() { - let triviaStats = JSON.parse(localStorage.getItem('triviaStats')) || { totalCorrect: 0, totalAttempted: 0 }; - if (triviaStats.totalAttempted === 0) { - return 'No trivia attempted'; - } - - let accuracy = (triviaStats.totalCorrect / triviaStats.totalAttempted) * 100; - return `${accuracy.toFixed(1)}% accuracy`; -} - -function getMostCommonGenre() { - const favoriteGenresArray = JSON.parse(localStorage.getItem('favoriteGenres')) || []; - const genreCounts = favoriteGenresArray.reduce((acc, genre) => { - acc[genre] = (acc[genre] || 0) + 1; - return acc; - }, {}); - - let mostCommonGenre = ''; - let maxCount = 0; - - for (const genre in genreCounts) { - if (genreCounts[genre] > maxCount) { - mostCommonGenre = genre; - maxCount = genreCounts[genre]; - } - } - - return mostCommonGenre || 'Not Available'; -} - -document.addEventListener('DOMContentLoaded', rotateUserStats); - -function setStarRating(rating) { - const stars = document.querySelectorAll('.rating .star'); - stars.forEach(star => { - star.style.color = star.dataset.value > rating ? 'white' : 'gold'; - }); - - document.getElementById('rating-value').textContent = `${rating}.0/5.0`; -} - -document.querySelectorAll('.rating .star').forEach(star => { - star.addEventListener('mouseover', (e) => { - setStarRating(e.target.dataset.value); - }); - - star.addEventListener('mouseout', () => { - const movieId = localStorage.getItem('selectedMovieId'); - const savedRatings = JSON.parse(localStorage.getItem('movieRatings')) || {}; - const movieRating = savedRatings[movieId] || 0; - setStarRating(movieRating); - }); - - star.addEventListener('click', (e) => { - const movieId = localStorage.getItem('selectedMovieId'); - const rating = e.target.dataset.value; - const savedRatings = JSON.parse(localStorage.getItem('movieRatings')) || {}; - savedRatings[movieId] = rating; - localStorage.setItem('movieRatings', JSON.stringify(savedRatings)); - setStarRating(rating); - updateAverageMovieRating(movieId, rating); - window.location.reload(); - }); -}); - -function updateUniqueDirectorsViewed(directorId) { - let viewedDirectors = JSON.parse(localStorage.getItem('uniqueDirectorsViewed')) || []; - if (!viewedDirectors.includes(directorId)) { - viewedDirectors.push(directorId); - localStorage.setItem('uniqueDirectorsViewed', JSON.stringify(viewedDirectors)); - } -} - -function updateActorVisitCount(actorId, actorName) { - let actorVisits = JSON.parse(localStorage.getItem('actorVisits')) || {}; - if (!actorVisits[actorId]) { - actorVisits[actorId] = { count: 0, name: actorName }; - } - - actorVisits[actorId].count += 1; - localStorage.setItem('actorVisits', JSON.stringify(actorVisits)); -} - -function updateDirectorVisitCount(directorId, directorName) { - let directorVisits = JSON.parse(localStorage.getItem('directorVisits')) || {}; - if (!directorVisits[directorId]) { - directorVisits[directorId] = { count: 0, name: directorName }; - } - - directorVisits[directorId].count += 1; - localStorage.setItem('directorVisits', JSON.stringify(directorVisits)); -} - -document.addEventListener('DOMContentLoaded', () => { - initialMainContent = document.getElementById('main').innerHTML; - - const movieId = localStorage.getItem('selectedMovieId'); - if (movieId) { - fetchMovieDetails(movieId); - } - else { - fetchMovieDetails(1011985) - } - - document.getElementById('clear-search-btn').style.display = 'none'; - - const savedRatings = JSON.parse(localStorage.getItem('movieRatings')) || {}; - const movieRating = savedRatings[movieId] || 0; - setStarRating(movieRating); -}); - -document.getElementById('clear-search-btn').addEventListener('click', () => { - location.reload(); -}); - -function handleSignInOut() { - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - - if (isSignedIn) { - localStorage.setItem('isSignedIn', JSON.stringify(false)); - alert('You have been signed out.'); - } - else { - window.location.href = 'sign-in.html'; - return; - } - - updateSignInButtonState(); -} - -function updateSignInButtonState() { - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - - const signInText = document.getElementById('signInOutText'); - const signInIcon = document.getElementById('signInIcon'); - const signOutIcon = document.getElementById('signOutIcon'); - - if (isSignedIn) { - signInText.textContent = 'Sign Out'; - signInIcon.style.display = 'none'; - signOutIcon.style.display = 'inline-block'; - } - else { - signInText.textContent = 'Sign In'; - signInIcon.style.display = 'inline-block'; - signOutIcon.style.display = 'none'; - } -} - -document.addEventListener("DOMContentLoaded", function() { - updateSignInButtonState(); - document.getElementById('googleSignInBtn').addEventListener('click', handleSignInOut); -}); - -const twoLetterLangCodes = [ - { "code": "aa", "name": "Afar" }, - { "code": "ab", "name": "Abkhazian" }, - { "code": "ae", "name": "Avestan" }, - { "code": "af", "name": "Afrikaans" }, - { "code": "ak", "name": "Akan" }, - { "code": "am", "name": "Amharic" }, - { "code": "an", "name": "Aragonese" }, - { "code": "ar", "name": "Arabic" }, - { "code": "as", "name": "Assamese" }, - { "code": "av", "name": "Avaric" }, - { "code": "ay", "name": "Aymara" }, - { "code": "az", "name": "Azerbaijani" }, - { "code": "ba", "name": "Bashkir" }, - { "code": "be", "name": "Belarusian" }, - { "code": "bg", "name": "Bulgarian" }, - { "code": "bh", "name": "Bihari languages" }, - { "code": "bi", "name": "Bislama" }, - { "code": "bm", "name": "Bambara" }, - { "code": "bn", "name": "Bengali" }, - { "code": "bo", "name": "Tibetan" }, - { "code": "br", "name": "Breton" }, - { "code": "bs", "name": "Bosnian" }, - { "code": "ca", "name": "Catalan; Valencian" }, - { "code": "ce", "name": "Chechen" }, - { "code": "ch", "name": "Chamorro" }, - { "code": "co", "name": "Corsican" }, - { "code": "cr", "name": "Cree" }, - { "code": "cs", "name": "Czech" }, - { - "code": "cu", - "name": "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic" - }, - { "code": "cv", "name": "Chuvash" }, - { "code": "cy", "name": "Welsh" }, - { "code": "da", "name": "Danish" }, - { "code": "de", "name": "German" }, - { "code": "dv", "name": "Divehi; Dhivehi; Maldivian" }, - { "code": "dz", "name": "Dzongkha" }, - { "code": "ee", "name": "Ewe" }, - { "code": "el", "name": "Greek, Modern (1453-)" }, - { "code": "en", "name": "English" }, - { "code": "eo", "name": "Esperanto" }, - { "code": "es", "name": "Spanish; Castilian" }, - { "code": "et", "name": "Estonian" }, - { "code": "eu", "name": "Basque" }, - { "code": "fa", "name": "Persian" }, - { "code": "ff", "name": "Fulah" }, - { "code": "fi", "name": "Finnish" }, - { "code": "fj", "name": "Fijian" }, - { "code": "fo", "name": "Faroese" }, - { "code": "fr", "name": "French" }, - { "code": "fy", "name": "Western Frisian" }, - { "code": "ga", "name": "Irish" }, - { "code": "gd", "name": "Gaelic; Scomttish Gaelic" }, - { "code": "gl", "name": "Galician" }, - { "code": "gn", "name": "Guarani" }, - { "code": "gu", "name": "Gujarati" }, - { "code": "gv", "name": "Manx" }, - { "code": "ha", "name": "Hausa" }, - { "code": "he", "name": "Hebrew" }, - { "code": "hi", "name": "Hindi" }, - { "code": "ho", "name": "Hiri Motu" }, - { "code": "hr", "name": "Croatian" }, - { "code": "ht", "name": "Haitian; Haitian Creole" }, - { "code": "hu", "name": "Hungarian" }, - { "code": "hy", "name": "Armenian" }, - { "code": "hz", "name": "Herero" }, - { - "code": "ia", - "name": "Interlingua (International Auxiliary Language Association)" - }, - { "code": "id", "name": "Indonesian" }, - { "code": "ie", "name": "Interlingue; Occidental" }, - { "code": "ig", "name": "Igbo" }, - { "code": "ii", "name": "Sichuan Yi; Nuosu" }, - { "code": "ik", "name": "Inupiaq" }, - { "code": "io", "name": "Ido" }, - { "code": "is", "name": "Icelandic" }, - { "code": "it", "name": "Italian" }, - { "code": "iu", "name": "Inuktitut" }, - { "code": "ja", "name": "Japanese" }, - { "code": "jv", "name": "Javanese" }, - { "code": "ka", "name": "Georgian" }, - { "code": "kg", "name": "Kongo" }, - { "code": "ki", "name": "Kikuyu; Gikuyu" }, - { "code": "kj", "name": "Kuanyama; Kwanyama" }, - { "code": "kk", "name": "Kazakh" }, - { "code": "kl", "name": "Kalaallisut; Greenlandic" }, - { "code": "km", "name": "Central Khmer" }, - { "code": "kn", "name": "Kannada" }, - { "code": "ko", "name": "Korean" }, - { "code": "kr", "name": "Kanuri" }, - { "code": "ks", "name": "Kashmiri" }, - { "code": "ku", "name": "Kurdish" }, - { "code": "kv", "name": "Komi" }, - { "code": "kw", "name": "Cornish" }, - { "code": "ky", "name": "Kirghiz; Kyrgyz" }, - { "code": "la", "name": "Latin" }, - { "code": "lb", "name": "Luxembourgish; Letzeburgesch" }, - { "code": "lg", "name": "Ganda" }, - { "code": "li", "name": "Limburgan; Limburger; Limburgish" }, - { "code": "ln", "name": "Lingala" }, - { "code": "lo", "name": "Lao" }, - { "code": "lt", "name": "Lithuanian" }, - { "code": "lu", "name": "Luba-Katanga" }, - { "code": "lv", "name": "Latvian" }, - { "code": "mg", "name": "Malagasy" }, - { "code": "mh", "name": "Marshallese" }, - { "code": "mi", "name": "Maori" }, - { "code": "mk", "name": "Macedonian" }, - { "code": "ml", "name": "Malayalam" }, - { "code": "mn", "name": "Mongolian" }, - { "code": "mr", "name": "Marathi" }, - { "code": "ms", "name": "Malay" }, - { "code": "mt", "name": "Maltese" }, - { "code": "my", "name": "Burmese" }, - { "code": "na", "name": "Nauru" }, - { - "code": "nb", - "name": "Bokmål, Norwegian; Norwegian Bokmål" - }, - { "code": "nd", "name": "Ndebele, North; North Ndebele" }, - { "code": "ne", "name": "Nepali" }, - { "code": "ng", "name": "Ndonga" }, - { "code": "nl", "name": "Dutch; Flemish" }, - { "code": "nn", "name": "Norwegian Nynorsk; Nynorsk, Norwegian" }, - { "code": "no", "name": "Norwegian" }, - { "code": "nr", "name": "Ndebele, South; South Ndebele" }, - { "code": "nv", "name": "Navajo; Navaho" }, - { "code": "ny", "name": "Chichewa; Chewa; Nyanja" }, - { "code": "oc", "name": "Occitan (post 1500)" }, - { "code": "oj", "name": "Ojibwa" }, - { "code": "om", "name": "Oromo" }, - { "code": "or", "name": "Oriya" }, - { "code": "os", "name": "Ossetian; Ossetic" }, - { "code": "pa", "name": "Panjabi; Punjabi" }, - { "code": "pi", "name": "Pali" }, - { "code": "pl", "name": "Polish" }, - { "code": "ps", "name": "Pushto; Pashto" }, - { "code": "pt", "name": "Portuguese" }, - { "code": "qu", "name": "Quechua" }, - { "code": "rm", "name": "Romansh" }, - { "code": "rn", "name": "Rundi" }, - { "code": "ro", "name": "Romanian; Moldavian; Moldovan" }, - { "code": "ru", "name": "Russian" }, - { "code": "rw", "name": "Kinyarwanda" }, - { "code": "sa", "name": "Sanskrit" }, - { "code": "sc", "name": "Sardinian" }, - { "code": "sd", "name": "Sindhi" }, - { "code": "se", "name": "Northern Sami" }, - { "code": "sg", "name": "Sango" }, - { "code": "si", "name": "Sinhala; Sinhalese" }, - { "code": "sk", "name": "Slovak" }, - { "code": "sl", "name": "Slovenian" }, - { "code": "sm", "name": "Samoan" }, - { "code": "sn", "name": "Shona" }, - { "code": "so", "name": "Somali" }, - { "code": "sq", "name": "Albanian" }, - { "code": "sr", "name": "Serbian" }, - { "code": "ss", "name": "Swati" }, - { "code": "st", "name": "Sotho, Southern" }, - { "code": "su", "name": "Sundanese" }, - { "code": "sv", "name": "Swedish" }, - { "code": "sw", "name": "Swahili" }, - { "code": "ta", "name": "Tamil" }, - { "code": "te", "name": "Telugu" }, - { "code": "tg", "name": "Tajik" }, - { "code": "th", "name": "Thai" }, - { "code": "ti", "name": "Tigrinya" }, - { "code": "tk", "name": "Turkmen" }, - { "code": "tl", "name": "Tagalog" }, - { "code": "tn", "name": "Tswana" }, - { "code": "to", "name": "Tonga (Tonga Islands)" }, - { "code": "tr", "name": "Turkish" }, - { "code": "ts", "name": "Tsonga" }, - { "code": "tt", "name": "Tatar" }, - { "code": "tw", "name": "Twi" }, - { "code": "ty", "name": "Tahitian" }, - { "code": "ug", "name": "Uighur; Uyghur" }, - { "code": "uk", "name": "Ukrainian" }, - { "code": "ur", "name": "Urdu" }, - { "code": "uz", "name": "Uzbek" }, - { "code": "ve", "name": "Venda" }, - { "code": "vi", "name": "Vietnamese" }, - { "code": "vo", "name": "Volapük" }, - { "code": "wa", "name": "Walloon" }, - { "code": "wo", "name": "Wolof" }, - { "code": "xh", "name": "Xhosa" }, - { "code": "yi", "name": "Yiddish" }, - { "code": "yo", "name": "Yoruba" }, - { "code": "za", "name": "Zhuang; Chuang" }, - { "code": "zh", "name": "Chinese" }, - { "code": "zu", "name": "Zulu" } -]; - -document.addEventListener("DOMContentLoaded", function() { - applySettings(); -}); - -async function fetchMovieDetails(movieId) { - showSpinner(); - const code = `${getMovieCode()}`; - const url = `https://${getMovieVerseData()}/3/movie/${movieId}?${generateMovieNames()}${code}&append_to_response=credits,keywords,similar`; - const url2 = `https://${getMovieVerseData()}/3/movie/${movieId}?${generateMovieNames()}${code}&append_to_response=videos`; - const imdbUrl = `https://${getMovieVerseData()}/3/movie/${movieId}?${generateMovieNames()}${code}&append_to_response=external_ids`; - - try { - const response = await fetch(url); - const movie = await response.json(); - const imdbId = movie.imdb_id; - - fetchMovieRatings(imdbId, movie); - - const response2 = await fetch(url2); - const movie2 = await response2.json(); - const trailers = movie2.videos.results.filter(video => video.type === 'Trailer'); - - if (trailers.length > 0) { - const trailerUrl = `https://www.youtube.com/watch?v=${trailers[0].key}`; - trailerButton = createTrailerButton(trailerUrl); - positionTrailerButton(); - } - updateBrowserURL(movie.title); - hideSpinner(); - } - catch (error) { - document.getElementById('movie-details-container').innerHTML = ` -
-

Movie details not found - Try again with a different movie

-
`; - console.log('Error fetching movie details:', error); - hideSpinner(); - } -} - -function getRatingDetails(rating) { - let details = { color: 'black', text: rating, description: '' }; - - switch (rating) { - case 'R': - details = { - color: 'red', - text: 'R (Restricted)', - description: ' - No one 17 and under admitted' - }; - break; - case 'PG-13': - details = { - color: 'yellow', - text: 'PG-13 (Parents Strongly Cautioned)', - description: ' - May be inappropriate for children under 13' - }; - break; - case 'PG': - details = { - color: 'orange', - text: 'PG (Parental Guidance Suggested)', - description: ' - May not be suitable for children' - }; - break; - case 'G': - details = { - color: 'green', - text: 'G (General Audiences)', - description: ' - All ages admitted' - }; - break; - case 'NC-17': - details = { - color: 'darkred', - text: 'NC-17 (Adults Only)', - description: ' - No one 17 and under admitted' - }; - break; - case 'TV-Y': - details = { - color: 'lightgreen', - text: 'TV-Y (All Children)', - description: ' - Appropriate for all children' - }; - break; - case 'TV-Y7': - details = { - color: 'lightblue', - text: 'TV-Y7 (Directed to Older Children)', - description: ' - Suitable for children ages 7 and up' - }; - break; - case 'TV-G': - details = { - color: 'green', - text: 'TV-G (General Audience)', - description: ' - Suitable for all ages' - }; - break; - case 'TV-PG': - details = { - color: 'orange', - text: 'TV-PG (Parental Guidance Suggested)', - description: ' - May not be suitable for younger children' - }; - break; - case 'TV-14': - details = { - color: 'yellow', - text: 'TV-14 (Parents Strongly Cautioned)', - description: ' - May be inappropriate for children under 14' - }; - break; - case 'TV-MA': - details = { - color: 'red', - text: 'TV-MA (Mature Audience Only)', - description: ' - Specifically designed to be viewed by adults' - }; - break; - case 'NR': - details = { - color: 'white', - text: 'NR (Not Rated)', - description: ' - Movie has not been officially rated' - }; - break; - case 'UR': - case 'Unrated': - details = { - color: 'white', - text: 'UR (Unrated)', - description: ' - Contains content not used in the rated version' - }; - break; - default: - details = { - color: 'white', - text: rating, - description: ' - Rating information not available' - }; - break; - } - - return details; -} - -async function fetchMovieRatings(imdbId, tmdbMovieData) { - const omdbCode = `${getMovieCode2()}`; - const omdb = `https://${getMovieActor()}/?i=${imdbId}&${getMovieName()}${omdbCode}`; - - try { - const response = await fetch(omdb); - const data = await response.json(); - - let imdbRating = data.imdbRating ? data.imdbRating : 'N/A'; - - if (imdbRating === 'N/A' && tmdbMovieData.vote_average) { - imdbRating = (tmdbMovieData.vote_average / 2).toFixed(1) * 2; - } - - const rtRatingObj = data.Ratings.find(rating => rating.Source === "Rotten Tomatoes"); - let rtRating = rtRatingObj ? rtRatingObj.Value : 'N/A'; - - let metascore = data.Metascore ? `${data.Metascore}/100` : 'N/A'; - let awards = data.Awards; - let rated = data.Rated ? data.Rated : 'Rating information unavailable'; - - if (awards === 'N/A') { - awards = 'No awards information available'; - } - - if (metascore === 'N/A/100') { - const metacriticsRatingValue = imdbRating !== 'N/A' ? parseFloat(imdbRating) : (tmdbMovieData.vote_average / 2); - metascore = calculateFallbackMetacriticsRating(metacriticsRatingValue, tmdbMovieData.vote_average) + '/100'; - } - - if (rtRating === 'N/A') { - const imdbRatingValue = imdbRating !== 'N/A' ? parseFloat(imdbRating) : (tmdbMovieData.vote_average / 2); - rtRating = calculateFallbackRTRating(imdbRatingValue, tmdbMovieData.vote_average) - } - populateMovieDetails(tmdbMovieData, imdbRating, rtRating, metascore, awards, rated); - } - catch (error) { - const fallbackImdbRating = (tmdbMovieData.vote_average / 2).toFixed(1) * 2; - populateMovieDetails(tmdbMovieData, fallbackImdbRating, 'N/A', 'No metascore information available', 'No awards information available'); - } -} - -function updateBrowserURL(title) { - const nameSlug = createNameSlug(title); - const newURL = window.location.protocol + "//" + window.location.host + window.location.pathname + '?' + nameSlug; - window.history.replaceState({ path: newURL }, '', newURL); -} - -function createNameSlug(title) { - return title.toLowerCase().replace(/ /g, '-').replace(/[^\w-]/g, ''); -} - -function calculateFallbackRTRating(imdbRating, tmdbRating) { - const normalizedImdbRating = imdbRating * 10; - const normalizedTmdbRating = tmdbRating * 10; - - const weightImdb = 0.8; - const weightTmdb = 0.1; - - return ((normalizedImdbRating * weightImdb) + (normalizedTmdbRating * weightTmdb)).toFixed(0) + '%'; -} - -function calculateFallbackMetacriticsRating(imdbRating, tmdbRating) { - const normalizedImdbRating = imdbRating * 10; - const normalizedTmdbRating = tmdbRating * 10; - - const weightImdb = 0.8; - const weightTmdb = 0.1; - - return ((normalizedImdbRating * weightImdb) + (normalizedTmdbRating * weightTmdb)).toFixed(0); -} - -let trailerIframeDisplayed = false; - -function createTrailerButton(trailerUrl) { - const trailerButton = document.createElement('button'); - trailerButton.textContent = 'Watch Trailer'; - trailerButton.title = 'Click to watch the trailer of this movie'; - trailerButton.id = 'trailerButton'; - - trailerButton.addEventListener('click', function() { - if (!trailerIframeDisplayed) { - showTrailerIframe(trailerUrl); - trailerButton.textContent = 'Close Trailer'; - trailerButton.title = 'Click to close the trailer'; - } - else { - closeTrailerIframe(); - trailerButton.textContent = 'Watch Trailer'; - trailerButton.title = 'Click to watch the trailer of this movie'; - } - }); - - trailerButton.classList.add('trailer-button'); - trailerButton.style.font = 'inherit'; - - return trailerButton; -} - -function closeTrailerIframe() { - const iframeContainer = document.querySelector('.trailer-button + div'); - - if (iframeContainer) { - iframeContainer.style.height = '0'; - setTimeout(() => iframeContainer.remove(), 500); - } - trailerIframeDisplayed = false; -} - -function getYouTubeVideoId(url) { - const urlObj = new URL(url); - return urlObj.searchParams.get('v'); -} - -function positionTrailerButton() { - if (!trailerButton) - return; - - if (window.innerWidth <= 900) { - const movieDescription = document.getElementById('movie-description'); - movieDescription.parentNode.insertBefore(trailerButton, movieDescription); - } - else { - const movieRating = document.getElementById('movie-rating'); - movieRating.parentNode.insertBefore(trailerButton, movieRating.nextSibling); - } -} - -document.addEventListener('DOMContentLoaded', positionTrailerButton); - -function showTrailerIframe(trailerUrl) { - trailerUrlGlobal = trailerUrl; - - const iframeContainer = document.createElement('div'); - iframeContainer.style.position = 'relative'; - iframeContainer.style.width = '400px'; - iframeContainer.style.margin = '0 auto'; - iframeContainer.style.overflow = 'hidden'; - iframeContainer.style.height = '0'; - iframeContainer.style.transition = 'height 0.5s ease-in-out'; - iframeContainer.style.borderRadius = '8px'; - - const iframe = document.createElement('iframe'); - iframe.setAttribute('src', `https://www.youtube.com/embed/${getYouTubeVideoId(trailerUrl)}?autoplay=1`); - iframe.setAttribute('width', '100%'); - iframe.setAttribute('height', '315'); - iframe.setAttribute('frameborder', '0'); - iframe.setAttribute('allow', 'accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture'); - iframe.setAttribute('allowfullscreen', true); - - iframeContainer.appendChild(iframe); - - const trailerButton = document.querySelector('.trailer-button'); - trailerButton.parentNode.insertBefore(iframeContainer, trailerButton.nextSibling); - trailerButton.id = 'trailerButton'; - - setTimeout(() => iframeContainer.style.height = '315px', 50); - - trailerIframeDisplayed = true; -} - -function getRtSlug(title) { - return title.toLowerCase() - .replace(/:/g, '') - .replace(/part one/g, 'part_1') - .replace(/-/g, '') - .replace(/&/g, 'and') - .replace(/ /g, '_') - .replace(/[^\w-]/g, ''); -} - -function createMetacriticSlug(title) { - return title.toLowerCase() - .replace(/part\sone/g, 'part-1') - .replace(/:|_|-|\s/g, '-') - .replace(/&/g, 'and') - .replace(/--+/g, '-') - .replace(/[^\w-]/g, ''); -} - -async function fetchStreamingLinks(movieId) { - const url = `https://${getMovieVerseData()}/3/movie/${movieId}/watch/providers?${generateMovieNames()}${getMovieCode()}`; - - console.log(url) - try { - const response = await fetch(url); - const data = await response.json(); - const results = data.results || {}; - let providersMap = {}; - - Object.values(results).forEach(region => { - if (region.flatrate) { - region.flatrate.forEach(provider => { - providersMap[provider.provider_id] = provider; - }); - } - }); - - return Object.values(providersMap).slice(0, 7); - } - catch (error) { - console.error('Error fetching streaming links:', error); - return []; - } -} - -async function populateMovieDetails(movie, imdbRating, rtRating, metascore, awards, rated) { - document.getElementById('movie-image').src = `https://image.tmdb.org/t/p/w1280${movie.poster_path}`; - document.getElementById('movie-title').textContent = movie.title; - - const movieRating = movie.vote_average.toFixed(1); - const imdbLink = `https://www.imdb.com/title/${movie.imdb_id}`; - - const streamingProviders = await fetchStreamingLinks(movie.id); - const movieTitleEncoded = encodeURIComponent(movie.title); - - const streamingHTML = streamingProviders.length > 0 ? streamingProviders.map(provider => { - let providerLink; - switch(provider.provider_name.toLowerCase()) { - case 'netflix': - providerLink = `https://www.netflix.com/search?q=${movieTitleEncoded}`; - break; - case 'disney plus': - providerLink = `https://www.disneyplus.com/search?q=${movieTitleEncoded}`; - break; - case 'hbo max': - providerLink = `https://www.hbomax.com/search?q=${movieTitleEncoded}`; - break; - case 'hulu': - providerLink = `https://www.hulu.com/search?q=${movieTitleEncoded}`; - break; - case 'amazon prime video': - providerLink = `https://www.amazon.com/s?k=${movieTitleEncoded}`; - break; - case 'apple tv plus': - providerLink = `https://tv.apple.com/search?term=${movieTitleEncoded}`; - break; - case 'stan': - providerLink = `https://www.stan.com.au/search?q=${movieTitleEncoded}`; - break; - case 'player': - providerLink = `https://player.pl/szukaj?search=${movieTitleEncoded}`; - break; - default: - providerLink = `https://www.google.com/search?q=watch+${movieTitleEncoded}+on+${encodeURIComponent(provider.provider_name)}`; - break; - } - - return ` - ${provider.provider_name} - `; - }).join('') + ` - JustWatch - ` : 'No streaming options available.'; - - const rtLink = rtRating !== 'N/A' ? `https://www.rottentomatoes.com/m/${getRtSlug(movie.title)}` : '#'; - const metaCriticsLink = metascore !== 'N/A' ? `https://www.metacritic.com/movie/${createMetacriticSlug(movie.title)}` : '#'; - - const ratingDetails = getRatingDetails(rated); - const ratedElement = rated ? `

Rated: ${ratingDetails.text}${ratingDetails.description}

` : ''; - - document.getElementById('movie-rating').innerHTML = ` - IMDB Rating: ${imdbRating} - `; - document.getElementById('movie-rating').style.marginTop = '129px'; - document.title = movie.title + " - Movie Details"; - - const movieImage = document.getElementById('movie-image'); - const movieDescription = document.getElementById('movie-description'); - - const metascoreElement = metascore ? `

Metascore: ${metascore}

` : ''; - const awardsElement = awards ? `

Awards: ${awards}

` : ''; - - if (movie.poster_path) { - movieImage.src = IMGPATH + movie.poster_path; - movieImage.alt = movie.title; - } - else { - movieImage.style.display = 'none'; - const noImageText = document.createElement('h2'); - noImageText.textContent = 'Movie Image Not Available'; - noImageText.style.textAlign = 'center'; - noImageText.style.height = '800px'; - document.querySelector('.movie-left').appendChild(noImageText); - } - - const fullLanguage = twoLetterLangCodes.find(lang => lang.code === movie.original_language).name; - const overview = movie.overview ? movie.overview : 'No overview available'; - const genres = movie.genres.map(genre => genre.name).join(', '); - const releaseDate = movie.release_date ? movie.release_date : 'Release date not available'; - - const budget = movie.budget === 0 ? 'Information Not Available' : `$${movie.budget.toLocaleString()}`; - const revenue = movie.revenue <= 1000 ? 'Information Not Available' : `$${movie.revenue.toLocaleString()}`; - const tagline = movie.tagline ? movie.tagline : 'No tagline found'; - const languages = movie.spoken_languages.map(lang => lang.name).join(', '); - - const countries = movie.production_countries.map(country => country.name).join(', '); - const originalLanguage = fullLanguage ? fullLanguage : 'Language Info Not Available'; - const popularityScore = movie.popularity.toFixed(0); - const status = movie.status ? movie.status : 'Status Info Not Available'; - - const voteCount = movie.vote_count.toLocaleString(); - let keywords = movie.keywords ? movie.keywords.keywords.map(kw => kw.name).join(', ') : 'None Available'; - const similarTitles = movie.similar ? movie.similar.results.map(m => m.title).join(', ') : 'None Available'; - const scaledRating = (movie.vote_average / 2).toFixed(1); - - if (keywords.length === 0) { - keywords = 'None Available'; - } - - const popularityThreshold = 80; - const isPopular = movie.popularity >= popularityThreshold; - const popularityText = isPopular ? `${popularityScore} (This movie is popular)` : `${popularityScore} (This movie is unpopular)`; - - const adultContentIndicator = movie.adult - ? `Adult Content` - : `General Audience`; - - const movieStatus = `

Status: ${movie.status}

`; - - const runtime = movie.runtime > 0 - ? movie.runtime + ' minutes' - : 'Runtime Info Not Available'; - - document.getElementById('movie-description').innerHTML += ` -

Description: ${overview}

-

Tagline: ${tagline}

-

Genres: ${genres}

- ${ratedElement} - ${movieStatus} -

Release Date: ${releaseDate}

-

Runtime: ${runtime}

-

Budget: ${budget}

-

Revenue: ${revenue}

-

Languages: ${languages}

-

Countries of Production: ${countries}

-

Popularity Score: ${popularityText}

-

MovieVerse User Ratings: ${scaledRating}/5.0 (based on ${movie.vote_count} votes)

- ${awardsElement} - ${metascoreElement} -

Rotten Tomatoes: ${rtRating}

- `; - - if (movie.credits && movie.credits.crew) { - const directors = movie.credits.crew.filter(member => member.job === 'Director'); - - if (directors.length > 0) { - const directorsLinks = directors.map(director => - `${director.name}` - ).join(', '); - - const directorsElement = document.createElement('p'); - directorsElement.innerHTML = `Director: ${directorsLinks}`; - document.getElementById('movie-description').appendChild(directorsElement); - } - else { - const noDirectorsElement = document.createElement('p'); - noDirectorsElement.innerHTML = `Director: Information not available`; - document.getElementById('movie-description').appendChild(noDirectorsElement); - } - } - - const castHeading = document.createElement('p'); - castHeading.innerHTML = 'Cast: '; - document.getElementById('movie-description').appendChild(castHeading); - - if (movie.credits && movie.credits.cast.length > 0) { - const topTenCast = movie.credits.cast.slice(0, 10); - topTenCast.forEach((actor, index) => { - const actorLink = document.createElement('a'); - actorLink.innerHTML = `${actor.name}`; - castHeading.appendChild(actorLink); - if (index < topTenCast.length - 1) { - castHeading.appendChild(document.createTextNode(', ')); - } - }); - } - else { - castHeading.appendChild(document.createTextNode('None available.')); - } - - if (movie.production_companies && movie.production_companies.length > 0) { - let companiesHTML = movie.production_companies.map(company => { - return `${company.name}`; - }).join(', '); - - const productionCompaniesElement = document.createElement('p'); - productionCompaniesElement.innerHTML = `Production Companies: ${companiesHTML}`; - document.getElementById('movie-description').appendChild(productionCompaniesElement); - } - else { - const noCompaniesElement = document.createElement('p'); - noCompaniesElement.innerHTML = `Production Companies: Information not available`; - document.getElementById('movie-description').appendChild(noCompaniesElement); - } - - if (movie.similar && movie.similar.results && movie.similar.results.length > 0) { - let similarMoviesHTML = movie.similar.results.map(similarMovie => { - return `${similarMovie.title}`; - }).join(', '); - - const similarMoviesElement = document.createElement('p'); - similarMoviesElement.innerHTML = `Similar Movies: ${similarMoviesHTML}`; - document.getElementById('movie-description').appendChild(similarMoviesElement); - } - else { - const noSimilarMoviesElement = document.createElement('p'); - noSimilarMoviesElement.innerHTML = `Similar Movies: None available`; - document.getElementById('movie-description').appendChild(noSimilarMoviesElement); - } - - document.getElementById('movie-description').innerHTML += ` -

Streaming Options: ${streamingHTML}

`; - - const keywordsElement = document.createElement('p'); - keywordsElement.innerHTML = `Keywords: ${keywords}`; - - movieDescription.appendChild(keywordsElement); - - updateMoviesFavorited(movie.id); - applySettings(); -} - -function getSavedTextColor() { - return localStorage.getItem('textColor') || 'white'; -} - -function handleDirectorClick(directorId, directorName) { - localStorage.setItem('selectedDirectorId', directorId); - document.title = `${directorName} - Director's Details`; - window.location.href = 'director-details.html'; - updateUniqueDirectorsViewed(directorId); - updateDirectorVisitCount(directorId, directorName); -} - -function selectActorId(actorId) { - localStorage.setItem('selectedActorId', actorId); - window.location.href = 'actor-details.html' -} - -function handleCompanyClick(companyId, companyName) { - localStorage.setItem('selectedCompanyId', companyId); - document.title = `${companyName} - Company Details`; - window.location.href = 'company-details.html'; - updateUniqueCompaniesViewed(companyId); -} - -function handleSimilarMovieClick(movieId, movieTitle) { - localStorage.setItem('selectedMovieId', movieId); - document.title = `${movieTitle} - Movie Details`; - window.location.href = 'movie-details.html'; - updateMovieVisitCount(movieId, movieTitle); -} - -function updateMoviesFavorited(movieId) { - let favoritedMovies = JSON.parse(localStorage.getItem('moviesFavorited')) || []; - if (!favoritedMovies.includes(movieId)) { - favoritedMovies.push(movieId); - localStorage.setItem('moviesFavorited', JSON.stringify(favoritedMovies)); - } -} - -function getMovieCode2() { - const codeOfMovie = "MmJhOGU1MzY="; - return atob(codeOfMovie); -} - -function getMovieName() { - const moviename = "YXBpa2V5PQ=="; - return atob(moviename); -} - -function getMovieActor() { - const actor = "d3d3Lm9tZGJhcGkuY29t"; - return atob(actor); -} - -function updateAverageMovieRating(movieId, newRating) { - const savedRatings = JSON.parse(localStorage.getItem('movieRatings')) || {}; - - savedRatings[movieId] = newRating; - localStorage.setItem('movieRatings', JSON.stringify(savedRatings)); - - let totalRating = 0; - let totalMoviesRated = 0; - - for (let id in savedRatings) { - totalRating += parseFloat(savedRatings[id]); - totalMoviesRated++; - } - let averageRating = totalMoviesRated > 0 ? (totalRating / totalMoviesRated) : 0; - localStorage.setItem('averageMovieRating', averageRating.toFixed(1).toString()); -} - -async function showMovieOfTheDay() { - const year = new Date().getFullYear(); - const url = `https://${getMovieVerseData()}/3/discover/movie?${generateMovieNames()}${getMovieCode()}&sort_by=vote_average.desc&vote_count.gte=100&primary_release_year=${year}&vote_average.gte=7`; - - try { - const response = await fetch(url); - const data = await response.json(); - const movies = data.results; - - if (movies.length > 0) { - const randomMovie = movies[Math.floor(Math.random() * movies.length)]; - localStorage.setItem('selectedMovieId', randomMovie.id); - window.location.href = 'movie-details.html'; - } - else { - fallbackMovieSelection(); - } - } - catch (error) { - fallbackMovieSelection(); - } -} - -function updateUniqueActorsViewed(actorId) { - let viewedActors = JSON.parse(localStorage.getItem('uniqueActorsViewed')) || []; - if (!viewedActors.includes(actorId)) { - viewedActors.push(actorId); - localStorage.setItem('uniqueActorsViewed', JSON.stringify(viewedActors)); - } -} - -function updateUniqueCompaniesViewed(companyId) { - let viewedCompanies = JSON.parse(localStorage.getItem('uniqueCompaniesViewed')) || []; - if (!viewedCompanies.includes(companyId)) { - viewedCompanies.push(companyId); - localStorage.setItem('uniqueCompaniesViewed', JSON.stringify(viewedCompanies)); - } -} - -function fallbackMovieSelection() { - const fallbackMovies = [432413, 299534, 1726, 562, 118340, 455207, 493922, 447332, 22970, 530385, 27205, 264660, 120467, 603, 577922, 76341, 539, 419704, 515001, 118340, 424, 98]; - const randomFallbackMovie = fallbackMovies[Math.floor(Math.random() * fallbackMovies.length)]; - localStorage.setItem('selectedMovieId', randomFallbackMovie); - window.location.href = 'movie-details.html'; -} - -function getMovieVerseData(input) { - return String.fromCharCode(97, 112, 105, 46, 116, 104, 101, 109, 111, 118, 105, 101, 100, 98, 46, 111, 114, 103); -} - -function applySettings() { - const savedBg = localStorage.getItem('backgroundImage'); - const savedTextColor = localStorage.getItem('textColor'); - const savedFontSize = localStorage.getItem('fontSize'); - - if (savedBg) { - document.body.style.backgroundImage = `url('${savedBg}')`; - } - if (savedTextColor) { - applyTextColor(savedTextColor); - } - if (savedFontSize) { - const size = savedFontSize === 'small' ? '12px' : savedFontSize === 'medium' ? '16px' : '20px'; - document.body.style.fontSize = size; - } -} - -function applyTextColor(color) { - document.querySelectorAll('h1, h2, h3, p, a, span, div, button, input, select, textarea, label, li') - .forEach(element => { - element.style.color = color; - }); -} \ No newline at end of file diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/movie-match.js b/MovieVerse-Mobile/platforms/ios/www/images/js/movie-match.js deleted file mode 100644 index 00b494b2..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/movie-match.js +++ /dev/null @@ -1,593 +0,0 @@ -const main = document.getElementById('movie-match-form'); -const search = document.getElementById("search"); -const searchButton = document.getElementById("button-search"); -const searchTitle = document.getElementById("search-title"); -const otherTitle = document.getElementById("other1"); - -document.getElementById('movie-match-form').addEventListener('submit', function(event) { - event.preventDefault(); - const mood = document.getElementById('mood').value; - const genre = document.getElementById('genre').value; - const period = document.getElementById('period').value; - - findMovieMatch(mood, genre, period); -}); - -async function ensureGenreMapIsAvailable() { - if (!localStorage.getItem('genreMap')) { - await fetchGenreMap(); - } -} - -async function showMovieOfTheDay() { - const year = new Date().getFullYear(); - const url = `https://api.themoviedb.org/3/discover/movie?${generateMovieNames()}${getMovieCode()}&sort_by=vote_average.desc&vote_count.gte=100&primary_release_year=${year}&vote_average.gte=7`; - - try { - const response = await fetch(url); - const data = await response.json(); - const movies = data.results; - - if (movies.length > 0) { - const randomMovie = movies[Math.floor(Math.random() * movies.length)]; - localStorage.setItem('selectedMovieId', randomMovie.id); - window.location.href = 'movie-details.html'; - } - else { - fallbackMovieSelection(); - } - } - catch (error) { - console.log('Error fetching movie:', error); - fallbackMovieSelection(); - } -} - -async function fetchGenreMap() { - const url = `https://${getMovieVerseData()}/3/genre/movie/list?${generateMovieNames()}${getMovieCode()}`; - try { - const response = await fetch(url); - const data = await response.json(); - const genreMap = data.genres.reduce((map, genre) => { - map[genre.id] = genre.name; - return map; - }, {}); - localStorage.setItem('genreMap', JSON.stringify(genreMap)); - } - catch (error) { - console.log('Error fetching genre map:', error); - } -} - -async function rotateUserStats() { - await ensureGenreMapIsAvailable(); - - const stats = [ - { - label: "Your Current Time", - getValue: () => { - const now = new Date(); - let hours = now.getHours(); - let minutes = now.getMinutes(); - hours = hours < 10 ? '0' + hours : hours; - minutes = minutes < 10 ? '0' + minutes : minutes; - return `${hours}:${minutes}`; - } - }, - { label: "Most Visited Movie", getValue: getMostVisitedMovie }, - { label: "Most Visited Director", getValue: getMostVisitedDirector }, - { label: "Most Visited Actor", getValue: getMostVisitedActor }, - { - label: "Movies Discovered", - getValue: () => { - const viewedMovies = JSON.parse(localStorage.getItem('uniqueMoviesViewed')) || []; - return viewedMovies.length; - } - }, - { - label: "Favorite Movies", - getValue: () => { - const favoritedMovies = JSON.parse(localStorage.getItem('favoritesMovies')) || []; - return favoritedMovies.length; - } - }, - { - label: "Favorite Genre", - getValue: () => { - const mostCommonGenreCode = getMostCommonGenre(); - const genreArray = JSON.parse(localStorage.getItem('genreMap')) || []; - const genreObject = genreArray.reduce((acc, genre) => { - acc[genre.id] = genre.name; - return acc; - }, {}); - return genreObject[mostCommonGenreCode] || 'Not Available'; - } - }, - { label: "Watchlists Created", getValue: () => localStorage.getItem('watchlistsCreated') || 0 }, - { label: "Average Movie Rating", getValue: () => localStorage.getItem('averageMovieRating') || 'Not Rated' }, - { - label: "Directors Discovered", - getValue: () => { - const viewedDirectors = JSON.parse(localStorage.getItem('uniqueDirectorsViewed')) || []; - return viewedDirectors.length; - } - }, - { - label: "Actors Discovered", - getValue: () => { - const viewedActors = JSON.parse(localStorage.getItem('uniqueActorsViewed')) || []; - return viewedActors.length; - } - }, - { label: "Your Trivia Accuracy", getValue: getTriviaAccuracy }, - ]; - - let currentStatIndex = 0; - - function updateStatDisplay() { - const currentStat = stats[currentStatIndex]; - document.getElementById('stats-label').textContent = currentStat.label + ':'; - document.getElementById('stats-display').textContent = currentStat.getValue(); - currentStatIndex = (currentStatIndex + 1) % stats.length; - } - - updateStatDisplay(); - - const localTimeDiv = document.getElementById('local-time'); - let statRotationInterval = setInterval(updateStatDisplay, 3000); - - localTimeDiv.addEventListener('click', () => { - clearInterval(statRotationInterval); - updateStatDisplay(); - statRotationInterval = setInterval(updateStatDisplay, 3000); - }); -} - -function updateMovieVisitCount(movieId, movieTitle) { - let movieVisits = JSON.parse(localStorage.getItem('movieVisits')) || {}; - if (!movieVisits[movieId]) { - movieVisits[movieId] = { count: 0, title: movieTitle }; - } - movieVisits[movieId].count += 1; - localStorage.setItem('movieVisits', JSON.stringify(movieVisits)); -} - -function getMostVisitedMovie() { - const movieVisits = JSON.parse(localStorage.getItem('movieVisits')) || {}; - let mostVisitedMovie = ''; - let maxVisits = 0; - - for (const movieId in movieVisits) { - if (movieVisits[movieId].count > maxVisits) { - mostVisitedMovie = movieVisits[movieId].title; - maxVisits = movieVisits[movieId].count; - } - } - - return mostVisitedMovie || 'Not Available'; -} - -function getMostVisitedActor() { - const actorVisits = JSON.parse(localStorage.getItem('actorVisits')) || {}; - let mostVisitedActor = ''; - let maxVisits = 0; - - for (const actorId in actorVisits) { - if (actorVisits[actorId].count > maxVisits) { - mostVisitedActor = actorVisits[actorId].name; - maxVisits = actorVisits[actorId].count; - } - } - - return mostVisitedActor || 'Not Available'; -} - -function getMostVisitedDirector() { - const directorVisits = JSON.parse(localStorage.getItem('directorVisits')) || {}; - let mostVisitedDirector = ''; - let maxVisits = 0; - - for (const directorId in directorVisits) { - if (directorVisits[directorId].count > maxVisits) { - mostVisitedDirector = directorVisits[directorId].name; - maxVisits = directorVisits[directorId].count; - } - } - - return mostVisitedDirector || 'Not Available'; -} - -function getTriviaAccuracy() { - let triviaStats = JSON.parse(localStorage.getItem('triviaStats')) || { totalCorrect: 0, totalAttempted: 0 }; - if (triviaStats.totalAttempted === 0) { - return 'No trivia attempted'; - } - let accuracy = (triviaStats.totalCorrect / triviaStats.totalAttempted) * 100; - return `${accuracy.toFixed(1)}% accuracy`; -} - -function getMostCommonGenre() { - const favoriteGenresArray = JSON.parse(localStorage.getItem('favoriteGenres')) || []; - const genreCounts = favoriteGenresArray.reduce((acc, genre) => { - acc[genre] = (acc[genre] || 0) + 1; - return acc; - }, {}); - - let mostCommonGenre = ''; - let maxCount = 0; - - for (const genre in genreCounts) { - if (genreCounts[genre] > maxCount) { - mostCommonGenre = genre; - maxCount = genreCounts[genre]; - } - } - - return mostCommonGenre || 'Not Available'; -} - -document.addEventListener('DOMContentLoaded', rotateUserStats); - -function findMovieMatch(mood, genre, period) { - const movieDatabase = [ - // Movies starting with the mood "happy" - { id: "432413", title: "The Avengers", mood: "happy", genre: "action", period: "2010s" }, - { id: "299534", title: "Avengers: Endgame", mood: "happy", genre: "action", period: "2020s" }, - { id: "1726", title: "Iron Man", mood: "happy", genre: "action", period: "2000s" }, - { id: "562", title: "Die Hard", mood: "happy", genre: "action", period: "90s" }, - { id: "89", title: "Indiana Jones and the Last Crusade", mood: "happy", genre: "action", period: "80s" }, - - { id: "620", title: "Ghostbusters", mood: "happy", genre: "comedy", period: "80s" }, - { id: "105", title: "Back to the Future", mood: "happy", genre: "comedy", period: "90s" }, - { id: "18785", title: "The Hangover", mood: "happy", genre: "comedy", period: "2000s" }, - { id: "284053", title: "Thor: Ragnarok", mood: "happy", genre: "comedy", period: "2010s" }, - { id: "515001", title: "Jojo Rabbit", mood: "happy", genre: "comedy", period: "2020s" }, - - { id: "773", title: "Little Miss Sunshine", mood: "happy", genre: "drama", period: "2000s" }, - { id: "1402", title: "The Pursuit of Happyness", mood: "happy", genre: "drama", period: "2010s" }, - { id: "508442", title: "Soul", mood: "happy", genre: "drama", period: "2020s" }, - { id: "489", title: "Good Will Hunting", mood: "happy", genre: "drama", period: "90s" }, - { id: "207", title: "Dead Poets Society", mood: "happy", genre: "drama", period: "80s" }, - - { id: "118340", title: "Guardians of the Galaxy", mood: "happy", genre: "sci-fi", period: "2010s" }, - { id: "607", title: "Men in Black", mood: "happy", genre: "sci-fi", period: "90s" }, - { id: "601", title: "E.T. the Extra-Terrestrial", mood: "happy", genre: "sci-fi", period: "80s" }, - { id: "333339", title: "Ready Player One", mood: "happy", genre: "sci-fi", period: "2000s" }, - { id: "438631", title: "Dune", mood: "happy", genre: "sci-fi", period: "2020s" }, - - { id: "50646", title: "Crazy Stupid Love", mood: "happy", genre: "romance", period: "2010s" }, - { id: "1581", title: "The Holiday", mood: "happy", genre: "romance", period: "2000s" }, - { id: "114", title: "Pretty Woman", mood: "happy", genre: "romance", period: "90s" }, - { id: "2028", title: "Say Anything...", mood: "happy", genre: "romance", period: "80s" }, - { id: "614409", title: "To All the Boys: Always and Forever", mood: "happy", genre: "romance", period: "2020s" }, - - // Movies starting with the mood "sad" - { id: "424", title: "Schindler's List", mood: "sad", genre: "drama", period: "90s" }, - { id: "334541", title: "Manchester by the Sea", mood: "sad", genre: "drama", period: "2010s" }, - { id: "4148", title: "Revolutionary Road", mood: "sad", genre: "drama", period: "2000s" }, - { id: "16619", title: "Ordinary People", mood: "sad", genre: "drama", period: "80s" }, - { id: "1135095", title: "Pieces of a Woman", mood: "sad", genre: "drama", period: "2020s" }, - - { id: "38", title: "Eternal Sunshine of the Spotless Mind", mood: "sad", genre: "romance", period: "2000s" }, - { id: "46705", title: "Blue Valentine", mood: "sad", genre: "romance", period: "2010s" }, - { id: "222935", title: "The Fault in Our Stars", mood: "sad", genre: "romance", period: "2010s" }, - { id: "142", title: "Brokeback Mountain", mood: "sad", genre: "romance", period: "2000s" }, - { id: "589049", title: "The Photograph", mood: "sad", genre: "romance", period: "2020s" }, - - { id: "335984", title: "Blade Runner 2049", mood: "sad", genre: "sci-fi", period: "2010s" }, - { id: "644", title: "A.I. Artificial Intelligence", mood: "sad", genre: "sci-fi", period: "2000s" }, - { id: "152601", title: "Her", mood: "sad", genre: "sci-fi", period: "2010s" }, - { id: "9426", title: "The Fly", mood: "sad", genre: "sci-fi", period: "80s" }, - { id: "419704", title: "Ad Astra", mood: "sad", genre: "sci-fi", period: "2020s" }, - - { id: "637", title: "Life Is Beautiful", mood: "sad", genre: "comedy", period: "90s" }, - { id: "9428", title: "The Royal Tenenbaums", mood: "sad", genre: "comedy", period: "2000s" }, - { id: "153", title: "Lost in Translation", mood: "sad", genre: "comedy", period: "2000s" }, - { id: "9675", title: "Sideways", mood: "sad", genre: "comedy", period: "2000s" }, - { id: "7326", title: "Juno", mood: "sad", genre: "comedy", period: "2000s" }, - - { id: "263115", title: "Logan", mood: "sad", genre: "action", period: "2010s" }, - { id: "70", title: "Million Dollar Baby", mood: "sad", genre: "action", period: "2000s" }, - { id: "49026", title: "The Dark Knight Rises", mood: "sad", genre: "action", period: "2010s" }, - { id: "475557", title: "Joker", mood: "sad", genre: "action", period: "2010s" }, - { id: "98", title: "Gladiator", mood: "sad", genre: "action", period: "2000s" }, - - // Movies starting with the mood "adventurous" - { id: "85", title: "Indiana Jones and the Raiders of the Lost Ark", mood: "adventurous", genre: "action", period: "80s" }, - { id: "76341", title: "Mad Max: Fury Road", mood: "adventurous", genre: "action", period: "2010s" }, - { id: "98", title: "Gladiator", mood: "adventurous", genre: "action", period: "2000s" }, - { id: "562", title: "Die Hard", mood: "adventurous", genre: "action", period: "90s" }, - { id: "438631", title: "Dune", mood: "adventurous", genre: "action", period: "2020s" }, - - { id: "620", title: "Ghostbusters", mood: "adventurous", genre: "comedy", period: "80s" }, - { id: "353486", title: "Jumanji: Welcome to the Jungle", mood: "adventurous", genre: "comedy", period: "2010s" }, - { id: "22", title: "Pirates of the Caribbean", mood: "adventurous", genre: "comedy", period: "2000s" }, - { id: "607", title: "Men in Black", mood: "adventurous", genre: "comedy", period: "90s" }, - { id: "550988", title: "Free Guy", mood: "adventurous", genre: "comedy", period: "2020s" }, - - { id: "281957", title: "The Revenant", mood: "adventurous", genre: "drama", period: "2010s" }, - { id: "8358", title: "Cast Away", mood: "adventurous", genre: "drama", period: "2000s" }, - { id: "947", title: "Lawrence of Arabia", mood: "adventurous", genre: "drama", period: "80s" }, - { id: "13", title: "Forrest Gump", mood: "adventurous", genre: "drama", period: "90s" }, - { id: "581734", title: "Nomadland", mood: "adventurous", genre: "drama", period: "2020s" }, - - { id: "11", title: "Star Wars", mood: "adventurous", genre: "sci-fi", period: "80s" }, - { id: "19995", title: "Avatar", mood: "adventurous", genre: "sci-fi", period: "2000s" }, - { id: "27205", title: "Inception", mood: "adventurous", genre: "sci-fi", period: "2010s" }, - { id: "335984", title: "Blade Runner", mood: "adventurous", genre: "sci-fi", period: "90s" }, - { id: "438631", title: "Dune", mood: "adventurous", genre: "sci-fi", period: "2020s" }, - - { id: "2493", title: "The Princess Bride", mood: "adventurous", genre: "romance", period: "80s" }, - { id: "313369", title: "La La Land", mood: "adventurous", genre: "romance", period: "2010s" }, - { id: "24420", title: "The Time Traveler's Wife", mood: "adventurous", genre: "romance", period: "2000s" }, - { id: "597", title: "Titanic", mood: "adventurous", genre: "romance", period: "90s" }, - { id: "672647", title: "The Map of Tiny Perfect Things", mood: "adventurous", genre: "romance", period: "2020s" }, - - // Movies starting with the mood "romantic" - { id: "11036", title: "The Notebook", mood: "romantic", genre: "drama", period: "2000s" }, - { id: "332562", title: "A Star is Born", mood: "romantic", genre: "drama", period: "2010s" }, - { id: "4348", title: "Pride and Prejudice", mood: "romantic", genre: "drama", period: "2000s" }, - { id: "289", title: "Casablanca", mood: "romantic", genre: "drama", period: "classic" }, - { id: "398818", title: "Call Me by Your Name", mood: "romantic", genre: "drama", period: "2010s" }, - - { id: "194", title: "Amélie", mood: "romantic", genre: "romance", period: "2000s" }, - { id: "313369", title: "La La Land", mood: "romantic", genre: "romance", period: "2010s" }, - { id: "76", title: "Before Sunrise", mood: "romantic", genre: "romance", period: "90s" }, - { id: "416477", title: "The Big Sick", mood: "romantic", genre: "romance", period: "2010s" }, - { id: "531428", title: "Portrait of a Lady on Fire", mood: "romantic", genre: "romance", period: "2020s" }, - - { id: "152601", title: "Her", mood: "romantic", genre: "sci-fi", period: "2010s" }, - { id: "38050", title: "The Adjustment Bureau", mood: "romantic", genre: "sci-fi", period: "2010s" }, - { id: "38", title: "Eternal Sunshine of the Spotless Mind", mood: "romantic", genre: "sci-fi", period: "2000s" }, - { id: "274870", title: "Passengers", mood: "romantic", genre: "sci-fi", period: "2010s" }, - { id: "122906", title: "About Time", mood: "romantic", genre: "sci-fi", period: "2010s" }, - - { id: "639", title: "When Harry Met Sally", mood: "romantic", genre: "comedy", period: "80s" }, - { id: "455207", title: "Crazy Rich Asians", mood: "romantic", genre: "comedy", period: "2010s" }, - { id: "509", title: "Notting Hill", mood: "romantic", genre: "comedy", period: "90s" }, - { id: "4951", title: "10 Things I Hate About You", mood: "romantic", genre: "comedy", period: "90s" }, - { id: "18240", title: "The Proposal", mood: "romantic", genre: "comedy", period: "2000s" }, - - { id: "787", title: "Mr. & Mrs. Smith", mood: "romantic", genre: "action", period: "2000s" }, - { id: "36955", title: "True Lies", mood: "romantic", genre: "action", period: "90s" }, - { id: "10529", title: "Outlander", mood: "romantic", genre: "action", period: "2000s" }, - { id: "2493", title: "The Princess Bride", mood: "romantic", genre: "action", period: "80s" }, - { id: "547016", title: "The Old Guard", mood: "romantic", genre: "action", period: "2020s" }, - - // Movies starting with the mood "scary" - { id: "493922", title: "Hereditary", mood: "scary", genre: "drama", period: "2010s" }, - { id: "274", title: "The Silence of the Lambs", mood: "scary", genre: "drama", period: "90s" }, - { id: "539", title: "Psycho", mood: "scary", genre: "drama", period: "classic" }, - { id: "44214", title: "Black Swan", mood: "scary", genre: "drama", period: "2000s" }, - { id: "503919", title: "The Lighthouse", mood: "scary", genre: "drama", period: "2020s" }, - - { id: "310131", title: "The Witch", mood: "scary", genre: "horror", period: "2010s" }, - { id: "694", title: "The Shining", mood: "scary", genre: "horror", period: "80s" }, - { id: "377", title: "A Nightmare on Elm Street", mood: "scary", genre: "horror", period: "80s" }, - { id: "419430", title: "Get Out", mood: "scary", genre: "horror", period: "2010s" }, - { id: "565", title: "The Ring", mood: "scary", genre: "horror", period: "2000s" }, - - { id: "8413", title: "Event Horizon", mood: "scary", genre: "sci-fi", period: "90s" }, - { id: "348", title: "Alien", mood: "scary", genre: "sci-fi", period: "80s" }, - { id: "300668", title: "Annihilation", mood: "scary", genre: "sci-fi", period: "2010s" }, - { id: "447332", title: "A Quiet Place", mood: "scary", genre: "sci-fi", period: "2010s" }, - { id: "443791", title: "Underwater", mood: "scary", genre: "sci-fi", period: "2020s" }, - - { id: "747", title: "Shaun of the Dead", mood: "scary", genre: "comedy", period: "2000s" }, - { id: "19908", title: "Zombieland", mood: "scary", genre: "comedy", period: "2000s" }, - { id: "4011", title: "Beetlejuice", mood: "scary", genre: "comedy", period: "80s" }, - { id: "22970", title: "The Cabin in the Woods", mood: "scary", genre: "comedy", period: "2010s" }, - { id: "425909", title: "Ghostbusters: Afterlife", mood: "scary", genre: "comedy", period: "2020s" }, - - { id: "72190", title: "World War Z", mood: "scary", genre: "action", period: "2010s" }, - { id: "6479", title: "I Am Legend", mood: "scary", genre: "action", period: "2000s" }, - { id: "106", title: "Predator", mood: "scary", genre: "action", period: "80s" }, - { id: "396535", title: "Train to Busan", mood: "scary", genre: "action", period: "2010s" }, - { id: "503736", title: "Army of the Dead", mood: "scary", genre: "action", period: "2020s" }, - - // Movies starting with the mood "thoughtful" - { id: "8967", title: "The Tree of Life", mood: "thoughtful", genre: "drama", period: "2010s" }, - { id: "14", title: "American Beauty", mood: "thoughtful", genre: "drama", period: "90s" }, - { id: "453", title: "A Beautiful Mind", mood: "thoughtful", genre: "drama", period: "2000s" }, - { id: "595", title: "To Kill a Mockingbird", mood: "thoughtful", genre: "drama", period: "classic" }, - { id: "581734", title: "Nomadland", mood: "thoughtful", genre: "drama", period: "2020s" }, - - { id: "419430", title: "Get Out", mood: "thoughtful", genre: "horror", period: "2010s" }, - { id: "1933", title: "The Others", mood: "thoughtful", genre: "horror", period: "2000s" }, - { id: "745", title: "The Sixth Sense", mood: "thoughtful", genre: "horror", period: "90s" }, - { id: "805", title: "Rosemary's Baby", mood: "thoughtful", genre: "horror", period: "classic" }, - { id: "530385", title: "Midsommar", mood: "thoughtful", genre: "horror", period: "2020s" }, - - { id: "335984", title: "Blade Runner 2049", mood: "thoughtful", genre: "sci-fi", period: "2010s" }, - { id: "27205", title: "Inception", mood: "thoughtful", genre: "sci-fi", period: "2010s" }, - { id: "141", title: "Donnie Darko", mood: "thoughtful", genre: "sci-fi", period: "2000s" }, - { id: "62", title: "2001: A Space Odyssey", mood: "thoughtful", genre: "sci-fi", period: "classic" }, - { id: "264660", title: "Ex Machina", mood: "thoughtful", genre: "sci-fi", period: "2020s" }, - - { id: "120467", title: "The Grand Budapest Hotel", mood: "thoughtful", genre: "comedy", period: "2010s" }, - { id: "153", title: "Lost in Translation", mood: "thoughtful", genre: "comedy", period: "2000s" }, - { id: "137", title: "Groundhog Day", mood: "thoughtful", genre: "comedy", period: "90s" }, - { id: "935", title: "Dr. Strangelove", mood: "thoughtful", genre: "comedy", period: "classic" }, - { id: "515001", title: "Jojo Rabbit", mood: "thoughtful", genre: "comedy", period: "2020s" }, - - { id: "603", title: "The Matrix", mood: "thoughtful", genre: "action", period: "90s" }, - { id: "76341", title: "Mad Max: Fury Road", mood: "thoughtful", genre: "action", period: "2010s" }, - { id: "9693", title: "Children of Men", mood: "thoughtful", genre: "action", period: "2000s" }, - { id: "577922", title: "Tenet", mood: "thoughtful", genre: "action", period: "2020s" }, - { id: "335984", title: "Blade Runner", mood: "thoughtful", genre: "action", period: "80s" }, - ]; - - const filteredMovies = movieDatabase.filter(movie => - movie.mood === mood && movie.genre === genre && movie.period === period); - - if (filteredMovies.length > 0) { - const randomIndex = Math.floor(Math.random() * filteredMovies.length); - const matchedMovie = filteredMovies[randomIndex]; - - localStorage.setItem('selectedMovieId', matchedMovie.id); - window.location.href = 'movie-details.html'; - } - else { - alert('No match found. Try different criteria.'); - } -} - -async function getMovies(url, mainElement) { - const numberOfMovies = calculateMoviesToDisplay(); - const pagesToFetch = numberOfMovies <= 20 ? 1 : 2; - let allMovies = []; - - for (let page = 1; page <= pagesToFetch; page++) { - const response = await fetch(`${url}&page=${page}`); - const data = await response.json(); - allMovies = allMovies.concat(data.results); - } - - const popularityThreshold = 0.5; - - allMovies.sort((a, b) => { - const popularityDifference = Math.abs(a.popularity - b.popularity); - if (popularityDifference < popularityThreshold) { - return b.vote_average - a.vote_average; - } - return b.popularity - a.popularity; - }); - - if (allMovies.length > 0) { - showMovies(allMovies.slice(0, numberOfMovies), mainElement); - } - else { - mainElement.innerHTML = `

No movie with the specified search term found. Please try again.

`; - } -} - -const form = document.getElementById('form1'); - -const IMGPATH = "https://image.tmdb.org/t/p/w1280"; -const SEARCHPATH = `https://${getMovieVerseData()}/3/search/movie?&${generateMovieNames()}${getMovieCode()}&query=`; - -form.addEventListener('submit', (e) => { - e.preventDefault(); - const searchQuery = document.getElementById('search').value; - localStorage.setItem('searchQuery', searchQuery); - window.location.href = 'search.html'; -}); - -function handleSearch() { - const searchQuery = document.getElementById('search').value; - localStorage.setItem('searchQuery', searchQuery); - window.location.href = 'search.html'; -} - -function handleSignInOut() { - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - - if (isSignedIn) { - localStorage.setItem('isSignedIn', JSON.stringify(false)); - alert('You have been signed out.'); - } - else { - window.location.href = 'sign-in.html'; - return; - } - - updateSignInButtonState(); -} - -function updateSignInButtonState() { - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - - const signInText = document.getElementById('signInOutText'); - const signInIcon = document.getElementById('signInIcon'); - const signOutIcon = document.getElementById('signOutIcon'); - - if (isSignedIn) { - signInText.textContent = 'Sign Out'; - signInIcon.style.display = 'none'; - signOutIcon.style.display = 'inline-block'; - } - else { - signInText.textContent = 'Sign In'; - signInIcon.style.display = 'inline-block'; - signOutIcon.style.display = 'none'; - } -} - -document.addEventListener("DOMContentLoaded", function() { - updateSignInButtonState(); - document.getElementById('googleSignInBtn').addEventListener('click', handleSignInOut); -}); - -function getClassByRate(vote){ - if (vote >= 8) { - return 'green'; - } - else if (vote >= 5) { - return 'orange'; - } - else { - return 'red'; - } -} - -function calculateMoviesToDisplay() { - const screenWidth = window.innerWidth; - if (screenWidth <= 689.9) return 10; // 1 movie per row - if (screenWidth <= 1021.24) return 20; // 2 movies per row - if (screenWidth <= 1353.74) return 21; // 3 movies per row - if (screenWidth <= 1684.9) return 20; // 4 movies per row - if (screenWidth <= 2017.49) return 20; // 5 movies per row - if (screenWidth <= 2349.99) return 18; // 6 movies per row - if (screenWidth <= 2681.99) return 21; // 7 movies per row - if (screenWidth <= 3014.49) return 24; // 8 movies per row - if (screenWidth <= 3345.99) return 27; // 9 movies per row - if (screenWidth <= 3677.99) return 20; // 10 movies per row - if (screenWidth <= 4009.99) return 22; // 11 movies per row - if (screenWidth <= 4340.99) return 24; // 12 movies per row - if (screenWidth <= 4673.49) return 26; // 13 movies per row - if (screenWidth <= 5005.99) return 28; // 14 movies per row - if (screenWidth <= 5337.99) return 30; // 15 movies per row - if (screenWidth <= 5669.99) return 32; // 16 movies per row - if (screenWidth <= 6001.99) return 34; // 17 movies per row - if (screenWidth <= 6333.99) return 36; // 18 movies per row - if (screenWidth <= 6665.99) return 38; // 19 movies per row - if (screenWidth <= 6997.99) return 40; // 20 movies per row - if (screenWidth <= 7329.99) return 42; // 21 movies per row - if (screenWidth <= 7661.99) return 44; // 22 movies per row - if (screenWidth <= 7993.99) return 46; // 23 movies per row - if (screenWidth <= 8325.99) return 48; // 24 movies per row - return 20; -} - -function showMovies(movies){ - main.innerHTML = ''; - movies.forEach((movie) => { - const { id, poster_path, title, vote_average, overview } = movie; - const movieE1 = document.createElement('div'); - const voteAverage = vote_average.toFixed(1); - movieE1.classList.add('movie'); - - const movieImage = poster_path - ? `${title}` - : `
Image Not Available
`; - - movieE1.innerHTML = ` - ${movieImage} -
-

${title}

- ${voteAverage} -
-
-

Movie Overview:

- ${overview} -
`; - - movieE1.addEventListener('click', () => { - localStorage.setItem('selectedMovieId', id); - window.location.href = 'movie-details.html'; - updateMovieVisitCount(id, title); - }); - - main.appendChild(movieE1); - }); -} \ No newline at end of file diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/movie-timeline.js b/MovieVerse-Mobile/platforms/ios/www/images/js/movie-timeline.js deleted file mode 100644 index d2563437..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/movie-timeline.js +++ /dev/null @@ -1,472 +0,0 @@ -let alertShown = false; - -function showSpinner() { - document.getElementById('myModal').classList.add('modal-visible'); -} - -function hideSpinner() { - document.getElementById('myModal').classList.remove('modal-visible'); -} - -document.getElementById('start-year').addEventListener('keydown', function(event) { - if (event.key === 'Enter') { - event.preventDefault(); - updateMovies(); - } -}); - -document.getElementById('end-year').addEventListener('keydown', function(event) { - if (event.key === 'Enter') { - event.preventDefault(); - updateMovies(); - } -}); - - -const movieCode = { - part1: 'YzVhMjBjODY=', - part2: 'MWFjZjdiYjg=', - part3: 'ZDllOTg3ZGNjN2YxYjU1OA==' -}; - -function getMovieCode() { - return atob(movieCode.part1) + atob(movieCode.part2) + atob(movieCode.part3); -} - -function generateMovieNames(input) { - return String.fromCharCode(97, 112, 105, 95, 107, 101, 121, 61); -} - -const IMGPATH = "https://image.tmdb.org/t/p/w500"; -const SEARCHPATH = `https://${getMovieVerseData()}/3/search/movie?&${generateMovieNames()}${getMovieCode()}&query=`; -const searchTitle = document.getElementById("select-text"); -const searchButton = document.getElementById("button-search"); -const search = document.getElementById("search"); -const main = document.getElementById("results"); - -async function ensureGenreMapIsAvailable() { - if (!localStorage.getItem('genreMap')) { - await fetchGenreMap(); - } -} - -async function fetchGenreMap() { - const url = `https://${getMovieVerseData()}/3/genre/movie/list?${generateMovieNames()}${getMovieCode()}`; - try { - const response = await fetch(url); - const data = await response.json(); - const genreMap = data.genres.reduce((map, genre) => { - map[genre.id] = genre.name; - return map; - }, {}); - localStorage.setItem('genreMap', JSON.stringify(genreMap)); - } - catch (error) { - console.log('Error fetching genre map:', error); - } -} - -async function rotateUserStats() { - await ensureGenreMapIsAvailable(); - - const stats = [ - { - label: "Your Current Time", - getValue: () => { - const now = new Date(); - let hours = now.getHours(); - let minutes = now.getMinutes(); - hours = hours < 10 ? '0' + hours : hours; - minutes = minutes < 10 ? '0' + minutes : minutes; - return `${hours}:${minutes}`; - } - }, - { label: "Most Visited Movie", getValue: getMostVisitedMovie }, - { label: "Most Visited Director", getValue: getMostVisitedDirector }, - { label: "Most Visited Actor", getValue: getMostVisitedActor }, - { - label: "Movies Discovered", - getValue: () => { - const viewedMovies = JSON.parse(localStorage.getItem('uniqueMoviesViewed')) || []; - return viewedMovies.length; - } - }, - { - label: "Favorite Movies", - getValue: () => { - const favoritedMovies = JSON.parse(localStorage.getItem('favoritesMovies')) || []; - return favoritedMovies.length; - } - }, - { - label: "Favorite Genre", - getValue: () => { - const mostCommonGenreCode = getMostCommonGenre(); - const genreArray = JSON.parse(localStorage.getItem('genreMap')) || []; - const genreObject = genreArray.reduce((acc, genre) => { - acc[genre.id] = genre.name; - return acc; - }, {}); - return genreObject[mostCommonGenreCode] || 'Not Available'; - } - }, - { label: "Watchlists Created", getValue: () => localStorage.getItem('watchlistsCreated') || 0 }, - { label: "Average Movie Rating", getValue: () => localStorage.getItem('averageMovieRating') || 'Not Rated' }, - { - label: "Directors Discovered", - getValue: () => { - const viewedDirectors = JSON.parse(localStorage.getItem('uniqueDirectorsViewed')) || []; - return viewedDirectors.length; - } - }, - { - label: "Actors Discovered", - getValue: () => { - const viewedActors = JSON.parse(localStorage.getItem('uniqueActorsViewed')) || []; - return viewedActors.length; - } - }, - { label: "Your Trivia Accuracy", getValue: getTriviaAccuracy }, - ]; - - let currentStatIndex = 0; - - function updateStatDisplay() { - const currentStat = stats[currentStatIndex]; - document.getElementById('stats-label').textContent = currentStat.label + ':'; - document.getElementById('stats-display').textContent = currentStat.getValue(); - currentStatIndex = (currentStatIndex + 1) % stats.length; - } - - updateStatDisplay(); - - const localTimeDiv = document.getElementById('local-time'); - let statRotationInterval = setInterval(updateStatDisplay, 3000); - - localTimeDiv.addEventListener('click', () => { - clearInterval(statRotationInterval); - updateStatDisplay(); - statRotationInterval = setInterval(updateStatDisplay, 3000); - }); -} - -function updateMovieVisitCount(movieId, movieTitle) { - let movieVisits = JSON.parse(localStorage.getItem('movieVisits')) || {}; - if (!movieVisits[movieId]) { - movieVisits[movieId] = { count: 0, title: movieTitle }; - } - movieVisits[movieId].count += 1; - localStorage.setItem('movieVisits', JSON.stringify(movieVisits)); -} - -function getMostVisitedMovie() { - const movieVisits = JSON.parse(localStorage.getItem('movieVisits')) || {}; - let mostVisitedMovie = ''; - let maxVisits = 0; - - for (const movieId in movieVisits) { - if (movieVisits[movieId].count > maxVisits) { - mostVisitedMovie = movieVisits[movieId].title; - maxVisits = movieVisits[movieId].count; - } - } - - return mostVisitedMovie || 'Not Available'; -} - -function getMostVisitedActor() { - const actorVisits = JSON.parse(localStorage.getItem('actorVisits')) || {}; - let mostVisitedActor = ''; - let maxVisits = 0; - - for (const actorId in actorVisits) { - if (actorVisits[actorId].count > maxVisits) { - mostVisitedActor = actorVisits[actorId].name; - maxVisits = actorVisits[actorId].count; - } - } - - return mostVisitedActor || 'Not Available'; -} - -function getMostVisitedDirector() { - const directorVisits = JSON.parse(localStorage.getItem('directorVisits')) || {}; - let mostVisitedDirector = ''; - let maxVisits = 0; - - for (const directorId in directorVisits) { - if (directorVisits[directorId].count > maxVisits) { - mostVisitedDirector = directorVisits[directorId].name; - maxVisits = directorVisits[directorId].count; - } - } - - return mostVisitedDirector || 'Not Available'; -} - -function getTriviaAccuracy() { - let triviaStats = JSON.parse(localStorage.getItem('triviaStats')) || { totalCorrect: 0, totalAttempted: 0 }; - if (triviaStats.totalAttempted === 0) { - return 'No trivia attempted'; - } - let accuracy = (triviaStats.totalCorrect / triviaStats.totalAttempted) * 100; - return `${accuracy.toFixed(1)}% accuracy`; -} - -function getMostCommonGenre() { - const favoriteGenresArray = JSON.parse(localStorage.getItem('favoriteGenres')) || []; - const genreCounts = favoriteGenresArray.reduce((acc, genre) => { - acc[genre] = (acc[genre] || 0) + 1; - return acc; - }, {}); - - let mostCommonGenre = ''; - let maxCount = 0; - - for (const genre in genreCounts) { - if (genreCounts[genre] > maxCount) { - mostCommonGenre = genre; - maxCount = genreCounts[genre]; - } - } - - return mostCommonGenre || 'Not Available'; -} - -document.addEventListener('DOMContentLoaded', rotateUserStats); - -async function getMovies(url) { - clearMovieDetails(); - const numberOfMovies = calculateMoviesToDisplay(); - const pagesToFetch = numberOfMovies <= 20 ? 1 : 2; - let allMovies = []; - - for (let page = 1; page <= pagesToFetch; page++) { - const response = await fetch(`${url}&page=${page}`); - const data = await response.json(); - allMovies = allMovies.concat(data.results); - } - - const popularityThreshold = 0.5; - - allMovies.sort((a, b) => { - const popularityDifference = Math.abs(a.popularity - b.popularity); - if (popularityDifference < popularityThreshold) { - return b.vote_average - a.vote_average; - } - return b.popularity - a.popularity; - }); - - if (allMovies.length > 0) { - showMovies(allMovies.slice(0, numberOfMovies), main); - } - else { - main.innerHTML = `

No movie with the specified search term found. Please try again.

`; - } -} - -function clearMovieDetails() { - const movieDetailsContainer = document.getElementById('movie-details-container'); - if (movieDetailsContainer) { - movieDetailsContainer.innerHTML = ''; - } -} - -const form = document.getElementById('form1'); - -form.addEventListener('submit', (e) => { - e.preventDefault(); - const searchQuery = document.getElementById('search').value; - localStorage.setItem('searchQuery', searchQuery); - window.location.href = 'search.html'; -}); - -function handleSearch() { - const searchQuery = document.getElementById('search').value; - localStorage.setItem('searchQuery', searchQuery); - window.location.href = 'search.html'; -} - -function updateMovies() { - showSpinner(); - let startYear = document.getElementById('start-year').value; - let endYear = document.getElementById('end-year').value; - let currentYear = new Date().getFullYear(); - if (startYear && endYear && startYear <= endYear && endYear <= currentYear && startYear >= 1900 && startYear <= currentYear) { - fetchMoviesByTimePeriod(startYear, endYear); - hideSpinner(); - alertShown = false; - } - else { - if (!alertShown) { - alert('Please ensure the start year is before the end year, the start year is later than the year 1900, and both are not later than the current year.'); - alertShown = true; - } - hideSpinner(); - } -} - -function showMovies(movies, mainElement) { - mainElement.innerHTML = ''; - movies.forEach(movie => { - const movieEl = document.createElement('div'); - movieEl.classList.add('movie'); - const movieImage = movie.poster_path - ? `${movie.title}` - : `
Image Not Available
`; - const voteAvg = movie.vote_average.toFixed(1); - const ratingClass = getClassByRate(movie.vote_average); - movieEl.innerHTML = ` - ${movieImage} -
-

${movie.title}

- ${voteAvg} -
-
-

Overview:

- ${movie.overview} -
`; - movieEl.addEventListener('click', () => { - localStorage.setItem('selectedMovieId', movie.id); - window.location.href = 'movie-details.html'; - updateMovieVisitCount(movie.id, movie.title); - }); - movieEl.style.cursor = 'pointer'; - mainElement.appendChild(movieEl); - }); -} - -document.getElementById('clear-search-btn').addEventListener('click', () => { - location.reload(); -}); - -async function fetchMoviesByTimePeriod(startYear, endYear) { - const url = `https://${getMovieVerseData()}/3/discover/movie?${generateMovieNames()}${getMovieCode()}&primary_release_date.gte=${startYear}-01-01&primary_release_date.lte=${endYear}-12-31`; - const response = await fetch(url); - const data = await response.json(); - const numberOfMovies = calculateMoviesToDisplay(); - const moviesToShow = data.results.slice(0, numberOfMovies); - showMovies(moviesToShow, document.getElementById('results')); -} - -document.getElementById('load-movies').addEventListener('click', () => { - showSpinner(); - updateMovies(); - alertShown = false; - hideSpinner(); -}); - -function calculateMoviesToDisplay() { - const screenWidth = window.innerWidth; - if (screenWidth <= 689.9) return 10; // 1 movie per row - if (screenWidth <= 1021.24) return 20; // 2 movies per row - if (screenWidth <= 1353.74) return 21; // 3 movies per row - if (screenWidth <= 1684.9) return 20; // 4 movies per row - if (screenWidth <= 2017.49) return 20; // 5 movies per row - if (screenWidth <= 2349.99) return 18; // 6 movies per row - if (screenWidth <= 2681.99) return 21; // 7 movies per row - if (screenWidth <= 3014.49) return 24; // 8 movies per row - if (screenWidth <= 3345.99) return 27; // 9 movies per row - if (screenWidth <= 3677.99) return 20; // 10 movies per row - if (screenWidth <= 4009.99) return 22; // 11 movies per row - if (screenWidth <= 4340.99) return 24; // 12 movies per row - if (screenWidth <= 4673.49) return 26; // 13 movies per row - if (screenWidth <= 5005.99) return 28; // 14 movies per row - if (screenWidth <= 5337.99) return 30; // 15 movies per row - if (screenWidth <= 5669.99) return 32; // 16 movies per row - if (screenWidth <= 6001.99) return 34; // 17 movies per row - if (screenWidth <= 6333.99) return 36; // 18 movies per row - if (screenWidth <= 6665.99) return 38; // 19 movies per row - if (screenWidth <= 6997.99) return 40; // 20 movies per row - if (screenWidth <= 7329.99) return 42; // 21 movies per row - if (screenWidth <= 7661.99) return 44; // 22 movies per row - if (screenWidth <= 7993.99) return 46; // 23 movies per row - if (screenWidth <= 8325.99) return 48; // 24 movies per row - return 20; -} - -function getClassByRate(vote) { - if (vote >= 8) { - return 'green'; - } - else if (vote >= 5) { - return 'orange'; - } - else { - return 'red'; - } -} - -async function showMovieOfTheDay() { - const year = new Date().getFullYear(); - const url = `https://${getMovieVerseData()}/3/discover/movie?${generateMovieNames()}${getMovieCode()}&sort_by=vote_average.desc&vote_count.gte=100&primary_release_year=${year}&vote_average.gte=7`; - - try { - const response = await fetch(url); - const data = await response.json(); - const movies = data.results; - - if (movies.length > 0) { - const randomMovie = movies[Math.floor(Math.random() * movies.length)]; - localStorage.setItem('selectedMovieId', randomMovie.id); - window.location.href = 'movie-details.html'; - } - else { - fallbackMovieSelection(); - } - } - catch (error) { - console.log('Error fetching movie:', error); - fallbackMovieSelection(); - } -} - -function handleSignInOut() { - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - - if (isSignedIn) { - localStorage.setItem('isSignedIn', JSON.stringify(false)); - alert('You have been signed out.'); - } - else { - window.location.href = 'sign-in.html'; - return; - } - - updateSignInButtonState(); -} - -function getMovieVerseData(input) { - return String.fromCharCode(97, 112, 105, 46, 116, 104, 101, 109, 111, 118, 105, 101, 100, 98, 46, 111, 114, 103); -} - -function updateSignInButtonState() { - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - - const signInText = document.getElementById('signInOutText'); - const signInIcon = document.getElementById('signInIcon'); - const signOutIcon = document.getElementById('signOutIcon'); - - if (isSignedIn) { - signInText.textContent = 'Sign Out'; - signInIcon.style.display = 'none'; - signOutIcon.style.display = 'inline-block'; - } - else { - signInText.textContent = 'Sign In'; - signInIcon.style.display = 'inline-block'; - signOutIcon.style.display = 'none'; - } -} - -document.addEventListener("DOMContentLoaded", function() { - updateSignInButtonState(); - document.getElementById('googleSignInBtn').addEventListener('click', handleSignInOut); -}); - -function fallbackMovieSelection() { - const fallbackMovies = [432413, 299534, 1726, 562, 118340, 455207, 493922, 447332, 22970, 530385, 27205, 264660, 120467, 603, 577922, 76341, 539, 419704, 515001, 118340, 424, 98]; - const randomFallbackMovie = fallbackMovies[Math.floor(Math.random() * fallbackMovies.length)]; - localStorage.setItem('selectedMovieId', randomFallbackMovie); - window.location.href = 'movie-details.html'; -} diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/notifications.js b/MovieVerse-Mobile/platforms/ios/www/images/js/notifications.js deleted file mode 100644 index 39223f01..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/notifications.js +++ /dev/null @@ -1,177 +0,0 @@ -const movieCode = { - part1: 'YzVhMjBjODY=', - part2: 'MWFjZjdiYjg=', - part3: 'ZDllOTg3ZGNjN2YxYjU1OA==' -}; - -function getMovieCode() { - return atob(movieCode.part1) + atob(movieCode.part2) + atob(movieCode.part3); -} - -document.addEventListener('DOMContentLoaded', () => { - const today = new Date(); - fetchReleasesByCategory('releasesSinceLastVisit', new Date(localStorage.getItem('lastVisit')), today, true); - fetchReleasesByCategory('releasesThisMonth', new Date(today.getFullYear(), today.getMonth(), 1), today, false); - fetchReleasesByCategory('releasesThisYear', new Date(today.getFullYear(), 0, 1), today, false); - fetchRecommendedReleases(); -}); - -async function fetchReleasesByCategory(elementId, startDate, endDate, isLastVisit) { - const list = document.getElementById(elementId); - list.innerHTML = ''; - - let movies = await fetchMovies(startDate, endDate); - - movies = movies.sort((a, b) => new Date(b.release_date) - new Date(a.release_date)); - - populateList(elementId, movies.slice(0, 5)); -} - -async function fetchMovies(startDate, endDate) { - const formattedStartDate = `${startDate.getFullYear()}-${(startDate.getMonth() + 1).toString().padStart(2, '0')}-${startDate.getDate().toString().padStart(2, '0')}`; - const formattedEndDate = `${endDate.getFullYear()}-${(endDate.getMonth() + 1).toString().padStart(2, '0')}-${endDate.getDate().toString().padStart(2, '0')}`; - - const url = `https://${getMovieVerseData()}/3/discover/movie?${generateMovieNames()}${getMovieCode()}&release_date.gte=${formattedStartDate}&release_date.lte=${formattedEndDate}`; - - try { - const response = await fetch(url); - const data = await response.json(); - return data.results; - } - catch (error) { - console.log('Failed to fetch movies for', elementId + ':', error); - return []; - } -} - -function generateMovieNames(input) { - return String.fromCharCode(97, 112, 105, 95, 107, 101, 121, 61); -} - -async function getMostVisitedMovieGenre() { - const movieVisits = JSON.parse(localStorage.getItem('movieVisits')) || {}; - let mostVisitedGenre = null; - let maxVisits = 0; - for (const movieId in movieVisits) { - const visits = movieVisits[movieId]; - if (visits.count > maxVisits) { - maxVisits = visits.count; - mostVisitedGenre = await fetchGenreForMovie(movieId); - } - } - return mostVisitedGenre; -} - -async function fetchGenreForMovie(movieId) { - const movieDetailsUrl = `https://${getMovieVerseData()}/3/movie/${movieId}?${generateMovieNames()}${getMovieCode()}`; - const response = await fetch(movieDetailsUrl); - const movieDetails = await response.json(); - return movieDetails.genres[0] ? movieDetails.genres[0].id : null; -} - -async function fetchRecommendedReleases() { - let url; - - const mostCommonGenre = getMostCommonGenre(); - const mostVisitedMovieGenre = await getMostVisitedMovieGenre(); - - try { - const genreId = mostVisitedMovieGenre || mostCommonGenre; - if (!genreId) { - throw new Error('Genre ID is not valid.'); - } - url = `https://${getMovieVerseData()}/3/discover/movie?${generateMovieNames()}${getMovieCode()}&with_genres=${genreId}`; - } - catch (error) { - console.log('Fetching recommended movies failed or data issues:', error); - url = `https://${getMovieVerseData()}/3/movie/popular?${generateMovieNames()}${getMovieCode()}&language=en-US&page=1`; - } - - try { - const response = await fetch(url); - const data = await response.json(); - populateList('recommendedReleases', data.results.slice(0, 5)); - } - catch (error) { - console.log('Failed to fetch movies:', error); - } -} - -function populateList(elementId, movies) { - const list = document.getElementById(elementId); - list.innerHTML = ''; - movies.forEach(movie => { - const li = document.createElement('li'); - li.style.cursor = 'pointer'; - li.addEventListener('click', () => { - localStorage.setItem('selectedMovieId', movie.id.toString()); - window.location.href = 'movie-details.html'; - }); - - const title = document.createElement('span'); - title.textContent = movie.title; - title.style.color = 'black'; - li.appendChild(title); - list.appendChild(li); - }); -} - -document.addEventListener('DOMContentLoaded', () => { - populateActors(); - populateDirectors(); -}); - -function populateActors() { - const actors = [ - { name: "Robert Downey Jr.", id: 3223 }, - { name: "Scarlett Johansson", id: 1245 }, - { name: "Denzel Washington", id: 5292 }, - { name: "Meryl Streep", id: 5064 }, - { name: "Leonardo DiCaprio", id: 6193 }, - { name: "Sandra Bullock", id: 18277 }, - { name: "Tom Hanks", id: 31 } - ]; - - const list = document.getElementById('popularActors').querySelector('ul'); - actors.forEach(actor => { - const li = document.createElement('li'); - li.style.cursor = 'pointer'; - li.addEventListener('click', () => { - localStorage.setItem('selectedActorId', actor.id.toString()); - window.location.href = 'actor-details.html'; - }); - - const name = document.createElement('span'); - name.textContent = actor.name; - li.appendChild(name); - list.appendChild(li); - }); -} - -function populateDirectors() { - const directors = [ - {name: "Steven Spielberg", id: 488}, - {name: "Martin Scorsese", id: 1032}, - {name: "Christopher Nolan", id: 525}, - {name: "Quentin Tarantino", id: 138}, - {name: "Kathryn Bigelow", id: 14392}, - {name: "James Cameron", id: 2710}, - {name: "Sofia Coppola", id: 1776} - ]; - - const list = document.getElementById('popularDirectors').querySelector('ul'); - directors.forEach(director => { - const li = document.createElement('li'); - li.style.cursor = 'pointer'; - li.addEventListener('click', () => { - localStorage.setItem('selectedDirectorId', director.id.toString()); - window.location.href = 'director-details.html'; - }); - - const name = document.createElement('span'); - name.textContent = director.name; - li.appendChild(name); - - list.appendChild(li); - }); -} diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/quiz.js b/MovieVerse-Mobile/platforms/ios/www/images/js/quiz.js deleted file mode 100644 index 539ddba3..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/quiz.js +++ /dev/null @@ -1,431 +0,0 @@ -const questionBank = [ - { question: "What movie won the Academy Award for Best Picture in 2020?", options: ["Joker", "1917", "Parasite"], answer: "Parasite" }, - { question: "Who directed the movie 'The Godfather'?", options: ["Steven Spielberg", "Francis Ford Coppola", "Martin Scorsese"], answer: "Francis Ford Coppola" }, - { question: "What was the first feature-length animated movie ever released?", options: ["Snow White and the Seven Dwarfs", "Bambi", "Pinocchio"], answer: "Snow White and the Seven Dwarfs" }, - { question: "What was the highest-grossing movie of all time before the release of 'Avatar'?", options: ["Titanic", "Star Wars: The Force Awakens", "Avengers: Endgame"], answer: "Titanic" }, - { question: "Who played the lead role in the movie 'Forrest Gump'?", options: ["Tom Hanks", "Brad Pitt", "Leonardo DiCaprio"], answer: "Tom Hanks" }, - { question: "What movie won the Academy Award for Best Picture in 2019?", options: ["Bohemian Rhapsody", "Green Book", "Roma"], answer: "Green Book" }, - { question: "Who played the character of John McClane in the Die Hard movie series?", options: ["Arnold Schwarzenegger", "Sylvester Stallone", "Bruce Willis"], answer: "Bruce Willis" }, - { question: "What movie is based on a novel by Stephen King and features a character named Jack Torrance?", options: ["Carrie", "The Shining", "Misery"], answer: "The Shining" }, - { question: "Who directed the movie 'Forrest Gump'?", options: ["Steven Spielberg", "Robert Zemeckis", "Martin Scorsese"], answer: "Robert Zemeckis" }, - { question: "What is the highest-grossing movie of all time (as of 2021)?", options: ["Avatar", "Avengers: Endgame", "Titanic"], answer: "Avatar" }, - { question: "What movie features the line 'You can't handle the truth!'?", options: ["The Shawshank Redemption", "A Few Good Men", "Goodfellas"], answer: "A Few Good Men" }, - { question: "Who played the character of Tony Stark/Iron Man in the Marvel Cinematic Universe?", options: ["Chris Hemsworth", "Mark Ruffalo", "Robert Downey Jr."], answer: "Robert Downey Jr." }, - { question: "In which movie did Tom Hanks say, 'Houston, we have a problem'?", options: ["Apollo 13", "Cast Away", "The Terminal"], answer: "Apollo 13" }, - { question: "What is the name of the hobbit played by Elijah Wood in the Lord of the Rings movies?", options: ["Frodo", "Sam", "Merry"], answer: "Frodo" }, - { question: "What is the name of the kingdom where the 2013 animated movie 'Frozen' is set?", options: ["Arendelle", "Genovia", "DunBroch"], answer: "Arendelle" }, - { question: "Which 1997 science fiction movie stars Will Smith and Tommy Lee Jones?", options: ["Independence Day", "Men in Black", "Wild Wild West"], answer: "Men in Black" }, - { question: "Which movie features Bruce Willis as a child psychologist?", options: ["Die Hard", "The Sixth Sense", "Unbreakable"], answer: "The Sixth Sense" }, - { question: "In 'The Matrix', does Neo take the blue pill or the red pill?", options: ["Blue", "Red", "Green"], answer: "Red" }, - { question: "Which actress played Katniss Everdeen in 'The Hunger Games' movies?", options: ["Jennifer Lawrence", "Emma Watson", "Shailene Woodley"], answer: "Jennifer Lawrence" }, - { question: "Who directed 'Jurassic Park'?", options: ["James Cameron", "Steven Spielberg", "George Lucas"], answer: "Steven Spielberg" }, - { question: "What 1980s movie was the highest grossing film of the decade?", options: ["E.T. the Extra-Terrestrial", "Star Wars: Episode V", "Back to the Future"], answer: "E.T. the Extra-Terrestrial" }, - { question: "Which movie features the song 'My Heart Will Go On'?", options: ["The Bodyguard", "Titanic", "Romeo + Juliet"], answer: "Titanic" }, - { question: "What was the first Pixar movie?", options: ["Toy Story", "A Bug's Life", "Monsters, Inc."], answer: "Toy Story" }, - { question: "Who played Wolverine in the X-Men movies?", options: ["Hugh Jackman", "Liam Hemsworth", "Chris Evans"], answer: "Hugh Jackman" }, - { question: "Which film did NOT win the Academy Award for Best Picture?", options: ["The Shawshank Redemption", "The Godfather", "Forrest Gump"], answer: "The Shawshank Redemption" }, - { question: "What is Indiana Jones' real first name?", options: ["Henry", "John", "Walter"], answer: "Henry" }, - { question: "In 'The Wizard of Oz', what did the Scarecrow want from the wizard?", options: ["Heart", "Brain", "Courage"], answer: "Brain" }, - { question: "Who is the only actor to receive an Oscar nomination for acting in a Lord of the Rings movie?", options: ["Viggo Mortensen", "Ian McKellen", "Elijah Wood"], answer: "Ian McKellen" }, - { question: "Which movie features an iconic dance scene between Uma Thurman and John Travolta?", options: ["Pulp Fiction", "Kill Bill", "Saturday Night Fever"], answer: "Pulp Fiction" }, - { question: "What is the highest-grossing R-rated movie of all time?", options: ["Deadpool", "Joker", "The Matrix"], answer: "Joker" }, - { question: "Which Alfred Hitchcock movie is notorious for its shower scene?", options: ["Vertigo", "Psycho", "Rear Window"], answer: "Psycho" }, - { question: "What is Darth Vader's real name?", options: ["Anakin Skywalker", "Luke Skywalker", "Obi-Wan Kenobi"], answer: "Anakin Skywalker" }, - { question: "Who directed 'Schindler's List'?", options: ["Martin Scorsese", "Steven Spielberg", "Ridley Scott"], answer: "Steven Spielberg" }, - { question: "In which movie does Tom Cruise perform his own stunts climbing the Burj Khalifa?", options: ["Mission: Impossible - Rogue Nation", "Mission: Impossible - Ghost Protocol", "Edge of Tomorrow"], answer: "Mission: Impossible - Ghost Protocol" }, - { question: "What is the name of the fictional African country where 'Black Panther' is set?", options: ["Wakanda", "Genovia", "Zamunda"], answer: "Wakanda" }, - { question: "Who directed 'Inception' and 'Interstellar'?", options: ["Christopher Nolan", "James Cameron", "Steven Spielberg"], answer: "Christopher Nolan" }, - { question: "In 'The Hunger Games', what district do Katniss and Peeta represent?", options: ["District 12", "District 9", "District 7"], answer: "District 12" }, - { question: "Which movie features a character named Tyler Durden?", options: ["Fight Club", "Gone Girl", "Seven"], answer: "Fight Club" }, - { question: "What is the name of the island in 'Jurassic Park'?", options: ["Isla Nublar", "Isla Sorna", "Skull Island"], answer: "Isla Nublar" }, - { question: "Who played the Joker in 'The Dark Knight'?", options: ["Heath Ledger", "Joaquin Phoenix", "Jared Leto"], answer: "Heath Ledger" }, - { question: "In which movie is the fictional company Initech featured?", options: ["Office Space", "The Social Network", "Wall Street"], answer: "Office Space" }, - { question: "What year was the first 'Harry Potter' movie released?", options: ["2001", "2003", "1999"], answer: "2001" }, - { question: "What fictional country is 'Wonder Woman' from?", options: ["Themyscira", "Asgard", "Genovia"], answer: "Themyscira" }, - { question: "Which movie is known for the quote 'Here's looking at you, kid'?", options: ["Casablanca", "Gone with the Wind", "The Maltese Falcon"], answer: "Casablanca" }, - { question: "In 'The Lion King', what is Simba's mother's name?", options: ["Nala", "Sarabi", "Shenzi"], answer: "Sarabi" }, - { question: "Who directed 'Avengers: Endgame'?", options: ["The Russo Brothers", "Joss Whedon", "Jon Favreau"], answer: "The Russo Brothers" }, - { question: "What is the name of the kingdom in 'Tangled'?", options: ["Corona", "Far Far Away", "Arendelle"], answer: "Corona" }, - { question: "Which film features a famous dance scene with Uma Thurman and John Travolta?", options: ["Pulp Fiction", "Saturday Night Fever", "Kill Bill"], answer: "Pulp Fiction" }, - { question: "Who played Jack Dawson in 'Titanic'?", options: ["Leonardo DiCaprio", "Brad Pitt", "Johnny Depp"], answer: "Leonardo DiCaprio" }, - { question: "What is the highest-grossing film of all time?", options: ["Avengers: Endgame", "Avatar", "Titanic"], answer: "Avatar" }, - { question: "In which movie does the character Neo appear?", options: ["The Matrix", "John Wick", "Speed"], answer: "The Matrix" }, - { question: "What is the real name of the Black Panther in the Marvel Cinematic Universe?", options: ["T'Challa", "M'Baku", "N'Jadaka"], answer: "T'Challa" }, - { question: "Who directed 'Mad Max: Fury Road'?", options: ["George Miller", "Ridley Scott", "Peter Jackson"], answer: "George Miller" }, - { question: "What animated film features a character named 'Hiccup'?", options: ["Brave", "How to Train Your Dragon", "Shrek"], answer: "How to Train Your Dragon" }, - { question: "In which film is the fictional mineral 'Unobtainium' sought after?", options: ["Avatar", "The Core", "Transformers"], answer: "Avatar" }, - { question: "What is the name of the fictional city where the Batman movies take place?", options: ["Gotham City", "Metropolis", "Star City"], answer: "Gotham City" }, - { question: "Who directed 'The Dark Knight'?", options: ["Christopher Nolan", "Martin Scorsese", "Steven Spielberg"], answer: "Christopher Nolan" }, - { question: "Who won the Best Actress award at the Oscars in 2021?", options: ["Viola Davis", "Frances McDormand", "Carey Mulligan"], answer: "Frances McDormand" }, - { question: "Which movie features a dystopian future divided into faction-based societies?", options: ["The Hunger Games", "Divergent", "The Maze Runner"], answer: "Divergent" }, - { question: "What is the name of the spaceship in 'Alien' (1979)?", options: ["Nostromo", "Serenity", "Millennium Falcon"], answer: "Nostromo" }, - { question: "Which director is known for the 'Dark Knight' trilogy?", options: ["Christopher Nolan", "Tim Burton", "Joel Schumacher"], answer: "Christopher Nolan" }, - { question: "In 'The Terminator', what is the name of the company that created Skynet?", options: ["Cyberdyne Systems", "Wayland Industries", "Oscorp"], answer: "Cyberdyne Systems" }, - { question: "What 1994 film revitalized John Travolta's career?", options: ["Get Shorty", "Pulp Fiction", "Face/Off"], answer: "Pulp Fiction" }, - { question: "Which movie was incorrectly announced as the Best Picture winner at the 2017 Academy Awards?", options: ["La La Land", "Moonlight", "Manchester by the Sea"], answer: "La La Land" }, - { question: "What animated film was Disney's first ever full-length feature?", options: ["Snow White and the Seven Dwarfs", "Cinderella", "The Little Mermaid"], answer: "Snow White and the Seven Dwarfs" }, - { question: "Who directed 'E.T. the Extra-Terrestrial'?", options: ["Steven Spielberg", "George Lucas", "Ridley Scott"], answer: "Steven Spielberg" }, - { question: "Which film contains the quote, 'There's no place like home'?", options: ["The Wizard of Oz", "Gone with the Wind", "Casablanca"], answer: "The Wizard of Oz" }, - { question: "What is the highest grossing film of all time (not adjusted for inflation) as of 2023?", options: ["Avengers: Endgame", "Avatar", "Titanic"], answer: "Avatar" }, - { question: "Who composed the score for 'The Lion King' (1994)?", options: ["John Williams", "Hans Zimmer", "Alan Menken"], answer: "Hans Zimmer" }, - { question: "Which movie did Leonardo DiCaprio win his first Oscar for Best Actor?", options: ["The Revenant", "The Wolf of Wall Street", "Inception"], answer: "The Revenant" }, - { question: "In which film does the character Maximus Decimus Meridius appear?", options: ["300", "Gladiator", "Troy"], answer: "Gladiator" }, - { question: "What is the name of the fictional British spy in the film series created by Ian Fleming?", options: ["James Bond", "Jason Bourne", "Jack Ryan"], answer: "James Bond" }, -]; - -const movieCode = { - part1: 'YzVhMjBjODY=', - part2: 'MWFjZjdiYjg=', - part3: 'ZDllOTg3ZGNjN2YxYjU1OA==' -}; - -function getMovieCode() { - return atob(movieCode.part1) + atob(movieCode.part2) + atob(movieCode.part3); -} - -function generateMovieNames(input) { - return String.fromCharCode(97, 112, 105, 95, 107, 101, 121, 61); -} - -const IMGPATH = "https://image.tmdb.org/t/p/w1280"; -const main = document.getElementById("main"); -const search = document.getElementById("search"); -const searchButton = document.getElementById("button-search"); -const SEARCHPATH = `https://${getMovieVerseData()}/3/search/movie?&${generateMovieNames()}${getMovieCode()}&query=`; -const searchTitle = document.getElementById("trivia-label"); - -function getClassByRate(vote){ - if (vote >= 8) { - return 'green'; - } - else if (vote >= 5) { - return 'orange'; - } - else { - return 'red'; - } -} - -const form = document.getElementById("form"); - -form.addEventListener('submit', (e) => { - e.preventDefault(); - const searchQuery = document.getElementById('search').value; - localStorage.setItem('searchQuery', searchQuery); - window.location.href = 'search.html'; -}); - -function handleSearch() { - const searchQuery = document.getElementById('search').value; - localStorage.setItem('searchQuery', searchQuery); - window.location.href = 'search.html'; -} - -async function getMovies(url) { - clearMovieDetails(); - const numberOfMovies = calculateMoviesToDisplay(); - const pagesToFetch = numberOfMovies <= 20 ? 1 : 2; - let allMovies = []; - - for (let page = 1; page <= pagesToFetch; page++) { - const response = await fetch(`${url}&page=${page}`); - const data = await response.json(); - allMovies = allMovies.concat(data.results); - } - - const popularityThreshold = 0.5; - - allMovies.sort((a, b) => { - const popularityDifference = Math.abs(a.popularity - b.popularity); - if (popularityDifference < popularityThreshold) { - return b.vote_average - a.vote_average; - } - return b.popularity - a.popularity; - }); - - document.getElementById('clear-search-btn').style.display = 'block'; - - if (allMovies.length > 0) { - showMovies(allMovies.slice(0, numberOfMovies)); - } - else { - main.innerHTML = `

No movie with the specified search term found. Please try again.

`; - document.getElementById('clear-search-btn').style.display = 'none'; - } -} - -document.getElementById('clear-search-btn').addEventListener('click', () => { - location.reload(); -}); - -function clearMovieDetails() { - const movieDetailsContainer = document.getElementById('quiz-container'); - if (movieDetailsContainer) { - movieDetailsContainer.innerHTML = ''; - } - document.getElementById('regenerate-questions').style.display = 'none'; - document.getElementById('submit').style.display = 'none'; -} - -function showMovies(movies){ - main.innerHTML = ''; - movies.forEach((movie) => { - const { id, poster_path, title, vote_average, overview } = movie; - const movieE1 = document.createElement('div'); - const voteAverage = vote_average.toFixed(1); - movieE1.classList.add('movie'); - - const movieImage = poster_path - ? `${title}` - : `
Image Not Available
`; - - movieE1.innerHTML = ` - ${movieImage} -
-

${title}

- ${voteAverage} -
-
-

Movie Overview:

- ${overview} -
`; - - movieE1.addEventListener('click', () => { - localStorage.setItem('selectedMovieId', id); - window.location.href = 'movie-details.html'; - updateMovieVisitCount(id, title); - }); - - main.appendChild(movieE1); - }); -} - -function calculateMoviesToDisplay() { - const screenWidth = window.innerWidth; - if (screenWidth <= 689.9) return 10; - if (screenWidth <= 1021.24) return 20; - if (screenWidth <= 1353.74) return 21; - if (screenWidth <= 1684.9) return 20; - if (screenWidth <= 2017.49) return 20; - if (screenWidth <= 2349.99) return 18; - if (screenWidth <= 2681.99) return 21; - if (screenWidth <= 3014.49) return 24; - if (screenWidth <= 3345.99) return 27; - if (screenWidth <= 3677.99) return 20; - if (screenWidth <= 4009.99) return 22; - if (screenWidth <= 4340.99) return 24; - if (screenWidth <= 4673.49) return 26; - if (screenWidth <= 5005.99) return 28; - if (screenWidth <= 5337.99) return 30; - if (screenWidth <= 5669.99) return 32; - if (screenWidth <= 6001.99) return 34; - if (screenWidth <= 6333.99) return 36; - if (screenWidth <= 6665.99) return 38; - if (screenWidth <= 6997.99) return 40; - if (screenWidth <= 7329.99) return 42; - if (screenWidth <= 7661.99) return 44; - if (screenWidth <= 7993.99) return 46; - if (screenWidth <= 8325.99) return 48; - return 20; -} - -document.addEventListener('DOMContentLoaded', () => { - document.getElementById('clear-search-btn').style.display = 'none'; -}); - -function generateRandomQuestions() { - const questionsToDisplay = 10; - const shuffledQuestions = questionBank.sort(() => 0.5 - Math.random()); - let selectedQuestions = shuffledQuestions.slice(0, questionsToDisplay); - - const quizContainer = document.getElementById('quiz-container'); - quizContainer.innerHTML = ''; - - selectedQuestions.forEach((question, index) => { - const questionElement = document.createElement('div'); - questionElement.innerHTML = ` -

Question ${index + 1}:

-

${question.question}

- ${question.options.map((option, i) => `
`).join('')} -
`; - quizContainer.appendChild(questionElement); - - const headerElement = questionElement.querySelector(`h2`); - - headerElement.addEventListener('click', function(e) { - e.preventDefault(); - - headerElement.scrollIntoView({ behavior: 'smooth' }); - }); - - headerElement.style.cursor = 'pointer'; - }); -} - -function updateTriviaStats(correctAnswers, totalQuestions) { - let triviaStats = JSON.parse(localStorage.getItem('triviaStats')) || { totalCorrect: 0, totalAttempted: 0 }; - - triviaStats.totalCorrect += correctAnswers; - triviaStats.totalAttempted += totalQuestions; - - localStorage.setItem('triviaStats', JSON.stringify(triviaStats)); -} - -function getTriviaAccuracy() { - let triviaStats = JSON.parse(localStorage.getItem('triviaStats')) || { totalCorrect: 0, totalAttempted: 0 }; - if (triviaStats.totalAttempted === 0) { - return 'No trivia attempted'; - } - let accuracy = (triviaStats.totalCorrect / triviaStats.totalAttempted) * 100; - return `${accuracy.toFixed(1)}% accuracy`; -} - -document.getElementById('regenerate-questions').addEventListener('click', generateRandomQuestions); -generateRandomQuestions(); - -async function showMovieOfTheDay() { - const year = new Date().getFullYear(); - const url = `https://${getMovieVerseData()}/3/discover/movie?${generateMovieNames()}${getMovieCode()}&sort_by=vote_average.desc&vote_count.gte=100&primary_release_year=${year}&vote_average.gte=7`; - - try { - const response = await fetch(url); - const data = await response.json(); - const movies = data.results; - - if (movies.length > 0) { - const randomMovie = movies[Math.floor(Math.random() * movies.length)]; - localStorage.setItem('selectedMovieId', randomMovie.id); - window.location.href = 'movie-details.html'; - } - else { - fallbackMovieSelection(); - } - } - catch (error) { - console.log('Error fetching movie:', error); - fallbackMovieSelection(); - } -} - -function getMovieVerseData(input) { - return String.fromCharCode(97, 112, 105, 46, 116, 104, 101, 109, 111, 118, 105, 101, 100, 98, 46, 111, 114, 103); -} - -function fallbackMovieSelection() { - const fallbackMovies = [432413, 299534, 1726, 562, 118340, 455207, 493922, 447332, 22970, 530385, 27205, 264660, 120467, 603, 577922, 76341, 539, 419704, 515001, 118340, 424, 98]; - const randomFallbackMovie = fallbackMovies[Math.floor(Math.random() * fallbackMovies.length)]; - localStorage.setItem('selectedMovieId', randomFallbackMovie); - window.location.href = 'movie-details.html'; -} - -function handleSignInOut() { - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - - if (isSignedIn) { - localStorage.setItem('isSignedIn', JSON.stringify(false)); - alert('You have been signed out.'); - } - else { - window.location.href = 'sign-in.html'; - return; - } - - updateSignInButtonState(); -} - -function updateSignInButtonState() { - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - - const signInText = document.getElementById('signInOutText'); - const signInIcon = document.getElementById('signInIcon'); - const signOutIcon = document.getElementById('signOutIcon'); - - if (isSignedIn) { - signInText.textContent = 'Sign Out'; - signInIcon.style.display = 'none'; - signOutIcon.style.display = 'inline-block'; - } - else { - signInText.textContent = 'Sign In'; - signInIcon.style.display = 'inline-block'; - signOutIcon.style.display = 'none'; - } -} - -document.addEventListener("DOMContentLoaded", function() { - updateSignInButtonState(); - document.getElementById('googleSignInBtn').addEventListener('click', handleSignInOut); -}); - -document.getElementById('quiz-form').addEventListener('submit', function(event) { - event.preventDefault(); - - let answeredQuestions = 0; - - for (let i = 0; i < 10; i++) { - if (document.querySelector(`input[name="q${i}"]:checked`)) { - answeredQuestions++; - } - } - - if (answeredQuestions < 10) { - const confirmSubmit = confirm(`You have only answered ${answeredQuestions} questions. Are you sure you want to submit?`); - if (!confirmSubmit) { - return; - } - } - - calculateAndDisplayResults(); -}); - -function calculateAndDisplayResults() { - let score = 0; - const totalQuestions = 10; - - questionBank.forEach((question, index) => { - const selectedAnswer = document.querySelector(`input[name="q${index}"]:checked`); - if (selectedAnswer && selectedAnswer.value === question.answer) { - score++; - } - }); - - updateTriviaStats(score, totalQuestions); - - displayResults(score); -} - -function displayResults(score) { - let accuracy = (score / 10) * 100; - let progress = 0; - - document.getElementById('progress-circle').style.setProperty('--progress', `${progress}%`); - document.getElementById('correct-answers').textContent = score; - document.getElementById('result-text').textContent = `Your score is ${score} out of 10 (${accuracy.toFixed(1)}% accuracy)`; - - const interval = setInterval(() => { - if (progress < accuracy) { - progress++; - document.getElementById('progress-circle').style.setProperty('--progress', `${progress}%`); - } - else { - clearInterval(interval); - } - }, 20); - - showModal(); -} - -function showModal() { - const modal = document.getElementById('result-modal'); - modal.style.display = "block"; - - modal.querySelector('.close-button').addEventListener('click', function() { - modal.style.display = "none"; - }); - - window.addEventListener('click', function(event) { - if (event.target == modal) { - modal.style.display = "none"; - } - }); -} \ No newline at end of file diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/reset-password.js b/MovieVerse-Mobile/platforms/ios/www/images/js/reset-password.js deleted file mode 100644 index d167c366..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/reset-password.js +++ /dev/null @@ -1,131 +0,0 @@ -import { initializeApp } from "https://www.gstatic.com/firebasejs/10.8.0/firebase-app.js"; -import { getFirestore, collection, query, where, getDocs, doc, updateDoc } from "https://www.gstatic.com/firebasejs/10.8.0/firebase-firestore.js"; - -function translateFBC(value) { - return atob(value); -} - -function getFBConfig1() { - const fbConfig1 = "QUl6YVN5REw2a1FuU2ZVZDhVdDhIRnJwS3VpdnF6MXhkWG03aw=="; - return translateFBC(fbConfig1); -} - -function getFBConfig2() { - const fbConfig2 = "bW92aWV2ZXJzZS1hcHAuZmlyZWJhc2VhcHAuY29t"; - return translateFBC(fbConfig2); -} - -function getFBConfig3() { - const fbConfig3 = "bW92aWV2ZXJzZS1hcHAuYXBwc3BvdC5jb20="; - return translateFBC(fbConfig3); -} - -function getFBConfig4() { - const fbConfig4 = "ODAyOTQzNzE4ODcx"; - return translateFBC(fbConfig4); -} - -function getFBConfig5() { - const fbConfig5 = "MTo4MDI5NDM3MTg4NzE6d2ViOjQ4YmM5MTZjYzk5ZTI3MjQyMTI3OTI="; - return translateFBC(fbConfig5); -} - -const firebaseConfig = { - apiKey: getFBConfig1(), - authDomain: getFBConfig2(), - projectId: "movieverse-app", - storageBucket: getFBConfig3(), - messagingSenderId: getFBConfig4(), - appId: getFBConfig5() -}; - -const app = initializeApp(firebaseConfig); -const db = getFirestore(app); - -document.getElementById('resetPasswordForm').addEventListener('submit', async function(event) { - try { - event.preventDefault(); - const resetEmail = document.getElementById('resetEmail').value; - - const q = query(collection(db, "MovieVerseUsers"), where("email", "==", resetEmail)); - const querySnapshot = await getDocs(q); - - if (querySnapshot.empty) { - alert("No account with such credentials exists in our database, or you might have mistyped something. Please try again."); - return; - } - - document.getElementById('newPasswordFields').style.display = 'block'; - } - catch (error) { - console.error("Error fetching user list: ", error); - if (error.code === 'resource-exhausted') { - const noUserSelected = document.getElementById('password-reset-form-container'); - if (noUserSelected) { - noUserSelected.innerHTML = "Sorry, our database is currently overloaded. Please try reloading once more, and if that still doesn't work, please try again in a couple hours. For full transparency, we are currently using a database that has a limited number of reads and writes per day due to lack of funding. Thank you for your patience as we work on scaling our services. At the mean time, feel free to use other MovieVerse features!"; - noUserSelected.style.height = '350px'; - } - hideSpinner(); - } - } -}); - -async function updatePassword() { - const resetEmail = document.getElementById('resetEmail').value; - const newPassword = document.getElementById('newPassword').value; - const confirmNewPassword = document.getElementById('confirmNewPassword').value; - - if (!isValidPassword(newPassword)) { - alert('New password does not meet the security requirements.\n\n' + - 'Your password must include:\n' + - '- At least 8 characters\n' + - '- At least one uppercase letter\n' + - '- At least one lowercase letter\n' + - '- At least one number\n' + - '- At least one special character (e.g., !@#$%^&*)'); - return; - } - - if (newPassword !== confirmNewPassword) { - alert("Passwords do not match."); - return; - } - - const q = query(collection(db, "MovieVerseUsers"), where("email", "==", resetEmail)); - const querySnapshot = await getDocs(q); - - if (!querySnapshot.empty) { - querySnapshot.forEach(async (docSnapshot) => { - await updateDoc(doc(db, "MovieVerseUsers", docSnapshot.id), { - password: newPassword - }).then(() => { - alert("Password updated successfully!"); - window.location.href = 'sign-in.html'; - }).catch((error) => { - console.log("Error updating password: ", error); - alert("Failed to update password. Please try again."); - }); - }); - } - else { - alert("Failed to find account. Please try again."); - } -} - -document.getElementById('updatePasswordButton').addEventListener('click', updatePassword); - -function isValidPassword(password) { - const minLength = 8; - const hasUppercase = /[A-Z]/.test(password); - const hasLowercase = /[a-z]/.test(password); - const hasNumbers = /\d/.test(password); - const hasSpecialChar = /[!@#$%^&*(),.?":{}|<>]/.test(password); - - return ( - password.length >= minLength && - hasUppercase && - hasLowercase && - hasNumbers && - hasSpecialChar - ); -} diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/root-config.js b/MovieVerse-Mobile/platforms/ios/www/images/js/root-config.js deleted file mode 100644 index e2755ba9..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/root-config.js +++ /dev/null @@ -1,66 +0,0 @@ -import { registerApplication, start } from 'single-spa'; - -// Defines a function that takes a location and returns true if the location should be active -function pathPrefix(prefix) { - return function(location) { - return location.pathname.startsWith(prefix); - } -} - -// Load React Microfrontend for the homepage -registerApplication( - 'home', - () => System.import('http://localhost:8080/home.js'), - pathPrefix('/home') -); - -// Load React Microfrontend for the about page -registerApplication( - 'about', - () => System.import('http://localhost:8083/about.js'), - pathPrefix('/about') -); - -// Load React Microfrontend for the trivia page -registerApplication( - 'quiz', - () => System.import('http://localhost:8084/quiz.js'), - pathPrefix('/contact') -); - -// Load React Microfrontend for the favorites / watchlist page -registerApplication( - 'favorites', - () => System.import('http://localhost:8085/favorites.js'), - pathPrefix('/favorites') -); - -// Load React Microfrontend for the movie match page -registerApplication( - 'movie-match', - () => System.import('http://localhost:8086/movie-match.js'), - pathPrefix('/movie-match') -); - -// Load React Microfrontend for the movie timeline page -registerApplication( - 'movie-timeline', - () => System.import('http://localhost:8087/movie-timeline.js'), - pathPrefix('/movie-details') -); - -// Load Vue Microfrontend for the movie listing -registerApplication( - 'movies', - () => System.import('http://localhost:8081/movies.js'), - pathPrefix('/movies') -); - -// Load Vue Microfrontend for the navbar -registerApplication( - 'navbar', - () => System.import('http://localhost:8082/navbar.js'), - pathPrefix('/navbar') - ); - -start(); diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/router.js b/MovieVerse-Mobile/platforms/ios/www/images/js/router.js deleted file mode 100644 index 54809074..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/router.js +++ /dev/null @@ -1,51 +0,0 @@ -import Vue from 'vue'; -import Router from 'vue-router'; - -import HomePage from './components/HomePage.vue'; -import MovieDetails from './components/MovieDetails.vue'; -import AboutPage from './components/AboutPage.vue'; -import MovieMatch from './components/MovieMatch.vue'; -import MovieTimeline from './components/MovieTimeline.vue'; -import MovieOfTheDay from './components/MovieOfTheDay.vue'; - -Vue.use(Router); - -export default new Router({ - mode: 'history', - routes: [ - { - path: '/', - name: 'Home', - component: HomePage - }, - { - path: '/movie/:id', - name: 'MovieDetails', - component: MovieDetails - }, - { - path: '/about', - name: 'About', - component: AboutPage - }, - { - path: '/movie-match', - name: 'MovieMatch', - component: MovieMatch - }, - { - path: '/movie-timeline', - name: 'MovieTimeline', - component: MovieTimeline - }, - { - path: '/movie-of-the-day', - name: 'MovieOfTheDay', - component: MovieOfTheDay - }, - { - path: '*', // This wildcard route is for 404 Not Found pages - redirect: '/' - } - ] -}); diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/search.js b/MovieVerse-Mobile/platforms/ios/www/images/js/search.js deleted file mode 100644 index b6ada7c1..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/search.js +++ /dev/null @@ -1,760 +0,0 @@ -const form = document.getElementById('form1'); -const IMGPATH = "https://image.tmdb.org/t/p/w500"; - -function showSpinner() { - document.getElementById('myModal').classList.add('modal-visible'); -} - -function hideSpinner() { - document.getElementById('myModal').classList.remove('modal-visible'); -} - -document.addEventListener('DOMContentLoaded', () => { - showResults('movie'); - updateCategoryButtonStyles('movie'); - attachEventListeners(); - attachArrowKeyNavigation(); - - document.getElementById('form1').addEventListener('submit', function(event) { - event.preventDefault(); - handleSearch(); - }); -}); - -async function ensureGenreMapIsAvailable() { - if (!localStorage.getItem('genreMap')) { - await fetchGenreMap(); - } -} - -document.addEventListener('DOMContentLoaded', () => { - showResults('movie'); - updateCategoryButtonStyles('movie'); - attachEventListeners(); - attachArrowKeyNavigation(); - fetchGenreMap(); - fetchTvGenreMap(); - - document.getElementById('form1').addEventListener('submit', function(event) { - event.preventDefault(); - handleSearch(); - }); -}); - -async function fetchGenreMap() { - const code = getMovieCode(); - const url = `https://${getMovieVerseData()}/3/genre/movie/list?${generateMovieNames()}${code}`; - - try { - const response = await fetch(url); - const data = await response.json(); - localStorage.setItem('genreMap', JSON.stringify(data.genres)); - populateGenreFilter(data.genres); - } - catch (error) { - console.log('Error fetching genre map:', error); - } -} - -async function fetchTvGenreMap() { - const code = getMovieCode(); - const url = `https://${getMovieVerseData()}/3/genre/tv/list?${generateMovieNames()}${code}`; - - try { - const response = await fetch(url); - const data = await response.json(); - localStorage.setItem('tvGenreMap', JSON.stringify(data.genres)); - populateTvGenreFilter(data.genres); - } - catch (error) { - console.log('Error fetching TV genre map:', error); - } -} - -function populateGenreFilter(genres) { - const genreFilter = document.getElementById('genre-filter'); - genreFilter.innerHTML = ''; - - genres.forEach(genre => { - const option = document.createElement('option'); - option.value = genre.id; - option.textContent = genre.name; - genreFilter.appendChild(option); - }); -} - -function populateTvGenreFilter(genres) { - const genreFilter = document.getElementById('genre-tv-filter'); - genreFilter.innerHTML = ''; - - genres.forEach(genre => { - const option = document.createElement('option'); - option.value = genre.id; - option.textContent = genre.name; - genreFilter.appendChild(option); - }); -} - -async function rotateUserStats() { - await ensureGenreMapIsAvailable(); - - const stats = [ - { - label: "Your Current Time", - getValue: () => { - const now = new Date(); - let hours = now.getHours(); - let minutes = now.getMinutes(); - hours = hours < 10 ? '0' + hours : hours; - minutes = minutes < 10 ? '0' + minutes : minutes; - return `${hours}:${minutes}`; - } - }, - { label: "Most Visited Movie", getValue: getMostVisitedMovie }, - { label: "Most Visited Director", getValue: getMostVisitedDirector }, - { label: "Most Visited Actor", getValue: getMostVisitedActor }, - { - label: "Movies Discovered", - getValue: () => { - const viewedMovies = JSON.parse(localStorage.getItem('uniqueMoviesViewed')) || []; - return viewedMovies.length; - } - }, - { - label: "Favorite Movies", - getValue: () => { - const favoritedMovies = JSON.parse(localStorage.getItem('favoritesMovies')) || []; - return favoritedMovies.length; - } - }, - { - label: "Favorite Genre", - getValue: () => { - const mostCommonGenreCode = getMostCommonGenre(); - const genreArray = JSON.parse(localStorage.getItem('genreMap')) || []; - const genreObject = genreArray.reduce((acc, genre) => { - acc[genre.id] = genre.name; - return acc; - }, {}); - return genreObject[mostCommonGenreCode] || 'Not Available'; - } - }, - { label: "Watchlists Created", getValue: () => localStorage.getItem('watchlistsCreated') || 0 }, - { label: "Average Movie Rating", getValue: () => localStorage.getItem('averageMovieRating') || 'Not Rated' }, - { - label: "Directors Discovered", - getValue: () => { - const viewedDirectors = JSON.parse(localStorage.getItem('uniqueDirectorsViewed')) || []; - return viewedDirectors.length; - } - }, - { - label: "Actors Discovered", - getValue: () => { - const viewedActors = JSON.parse(localStorage.getItem('uniqueActorsViewed')) || []; - return viewedActors.length; - } - }, - { label: "Your Trivia Accuracy", getValue: getTriviaAccuracy }, - ]; - - let currentStatIndex = 0; - - function updateStatDisplay() { - const currentStat = stats[currentStatIndex]; - document.getElementById('stats-label').textContent = currentStat.label + ':'; - document.getElementById('stats-display').textContent = currentStat.getValue(); - currentStatIndex = (currentStatIndex + 1) % stats.length; - } - - updateStatDisplay(); - - const localTimeDiv = document.getElementById('local-time'); - let statRotationInterval = setInterval(updateStatDisplay, 3000); - - localTimeDiv.addEventListener('click', () => { - clearInterval(statRotationInterval); - updateStatDisplay(); - statRotationInterval = setInterval(updateStatDisplay, 3000); - }); -} - -function updateMovieVisitCount(movieId, movieTitle) { - let movieVisits = JSON.parse(localStorage.getItem('movieVisits')) || {}; - if (!movieVisits[movieId]) { - movieVisits[movieId] = { count: 0, title: movieTitle }; - } - movieVisits[movieId].count += 1; - localStorage.setItem('movieVisits', JSON.stringify(movieVisits)); -} - -function getMostVisitedMovie() { - const movieVisits = JSON.parse(localStorage.getItem('movieVisits')) || {}; - let mostVisitedMovie = ''; - let maxVisits = 0; - - for (const movieId in movieVisits) { - if (movieVisits[movieId].count > maxVisits) { - mostVisitedMovie = movieVisits[movieId].title; - maxVisits = movieVisits[movieId].count; - } - } - - return mostVisitedMovie || 'Not Available'; -} - -function getMostVisitedActor() { - const actorVisits = JSON.parse(localStorage.getItem('actorVisits')) || {}; - let mostVisitedActor = ''; - let maxVisits = 0; - - for (const actorId in actorVisits) { - if (actorVisits[actorId].count > maxVisits) { - mostVisitedActor = actorVisits[actorId].name; - maxVisits = actorVisits[actorId].count; - } - } - - return mostVisitedActor || 'Not Available'; -} - -function getMostVisitedDirector() { - const directorVisits = JSON.parse(localStorage.getItem('directorVisits')) || {}; - let mostVisitedDirector = ''; - let maxVisits = 0; - - for (const directorId in directorVisits) { - if (directorVisits[directorId].count > maxVisits) { - mostVisitedDirector = directorVisits[directorId].name; - maxVisits = directorVisits[directorId].count; - } - } - - return mostVisitedDirector || 'Not Available'; -} - -function getTriviaAccuracy() { - let triviaStats = JSON.parse(localStorage.getItem('triviaStats')) || { totalCorrect: 0, totalAttempted: 0 }; - - if (triviaStats.totalAttempted === 0) { - return 'No trivia attempted'; - } - - let accuracy = (triviaStats.totalCorrect / triviaStats.totalAttempted) * 100; - return `${accuracy.toFixed(1)}% accuracy`; -} - -function getMostCommonGenre() { - const favoriteGenresArray = JSON.parse(localStorage.getItem('favoriteGenres')) || []; - const genreCounts = favoriteGenresArray.reduce((acc, genre) => { - acc[genre] = (acc[genre] || 0) + 1; - return acc; - }, {}); - - let mostCommonGenre = ''; - let maxCount = 0; - - for (const genre in genreCounts) { - if (genreCounts[genre] > maxCount) { - mostCommonGenre = genre; - maxCount = genreCounts[genre]; - } - } - - return mostCommonGenre || 'Not Available'; -} - -document.addEventListener('DOMContentLoaded', rotateUserStats); - -function attachEventListeners() { - const movieBtn = document.querySelector('[data-category="movie"]'); - const tvBtn = document.querySelector('[data-category="tv"]'); - const peopleBtn = document.querySelector('[data-category="person"]'); - const toggleFiltersBtn = document.getElementById('toggle-filters-btn'); - - const movieFilters = document.getElementById('movie-tv-filters'); - const tvFilters = document.getElementById('tv-filters'); - const peopleFilters = document.getElementById('people-filters'); - - const genreMovieFilter = document.getElementById('genre-filter'); - const yearMovieFilter = document.getElementById('year-filter'); - const ratingMovieFilter = document.getElementById('rating-filter'); - - const genreTvFilter = document.getElementById('genre-tv-filter'); - const yearTvFilter = document.getElementById('year-tv-filter'); - const ratingTvFilter = document.getElementById('rating-tv-filter'); - - const professionFilter = document.getElementById('profession-filter'); - const popularityFilter = document.getElementById('popularity-filter'); - - const ratingValueSpan = document.getElementById('rating-value'); - const ratingTvValueSpan = document.getElementById('rating-tv-value'); - const popularityValueSpan = document.getElementById('popularity-value'); - - movieFilters.style.display = 'none'; - tvFilters.style.display = 'none'; - peopleFilters.style.display = 'none'; - - function setFilterDisplayValues() { - ratingValueSpan.textContent = `Rating: ${ratingMovieFilter.value} and above`; - ratingTvValueSpan.textContent = `Rating: ${ratingTvFilter.value} and above`; - popularityValueSpan.textContent = `Popularity: ${popularityFilter.value} and above`; - } - - function showCorrectFilters(category) { - movieFilters.style.display = category === 'movie' ? 'block' : 'none'; - tvFilters.style.display = category === 'tv' ? 'block' : 'none'; - peopleFilters.style.display = category === 'person' ? 'block' : 'none'; - } - - movieBtn.addEventListener('click', () => { - showResults('movie'); - updateCategoryButtonStyles('movie'); - showCorrectFilters('movie'); - movieFilters.style.display = 'none'; - tvFilters.style.display = 'none'; - peopleFilters.style.display = 'none'; - toggleFiltersBtn.textContent = 'Filter Results'; - }); - - tvBtn.addEventListener('click', () => { - showResults('tv'); - updateCategoryButtonStyles('tv'); - showCorrectFilters('tv'); - movieFilters.style.display = 'none'; - tvFilters.style.display = 'none'; - peopleFilters.style.display = 'none'; - toggleFiltersBtn.textContent = 'Filter Results'; - }); - - peopleBtn.addEventListener('click', () => { - showResults('person'); - updateCategoryButtonStyles('person'); - showCorrectFilters('person'); - movieFilters.style.display = 'none'; - tvFilters.style.display = 'none'; - peopleFilters.style.display = 'none'; - toggleFiltersBtn.textContent = 'Filter Results'; - }); - - toggleFiltersBtn.addEventListener('click', () => { - if (currentCategory === 'movie') { - movieFilters.style.display = movieFilters.style.display === 'none' ? 'block' : 'none'; - } - else if (currentCategory === 'tv') { - tvFilters.style.display = tvFilters.style.display === 'none' ? 'block' : 'none'; - } - else if (currentCategory === 'person') { - peopleFilters.style.display = peopleFilters.style.display === 'none' ? 'block' : 'none'; - } - }); - - genreMovieFilter.addEventListener('change', () => showResults('movie')); - yearMovieFilter.addEventListener('change', () => showResults('movie')); - ratingMovieFilter.addEventListener('input', () => { - ratingValueSpan.textContent = `Rating: ${ratingMovieFilter.value} and above`; - showResults('movie'); - }); - - genreTvFilter.addEventListener('change', () => showResults('tv')); - yearTvFilter.addEventListener('change', () => showResults('tv')); - ratingTvFilter.addEventListener('input', () => { - ratingTvValueSpan.textContent = `Rating: ${ratingTvFilter.value} and above`; - showResults('tv'); - }); - - professionFilter.addEventListener('change', () => showResults('person')); - popularityFilter.addEventListener('input', () => { - popularityValueSpan.textContent = `Popularity: ${popularityFilter.value} and above`; - showResults('person'); - }); - - - const resetMovieFiltersBtn = movieFilters.querySelector('button[id="reset-filters"]'); - const resetTvFiltersBtn = tvFilters.querySelector('button[id="reset-filters"]'); - const resetPeopleFiltersBtn = peopleFilters.querySelector('button[id="reset-filters"]'); - - resetMovieFiltersBtn.addEventListener('click', () => { - genreMovieFilter.selectedIndex = 0; - yearMovieFilter.value = ''; - ratingMovieFilter.value = 5; - setFilterDisplayValues(); - showResults('movie'); - }); - - resetTvFiltersBtn.addEventListener('click', () => { - genreTvFilter.selectedIndex = 0; - yearTvFilter.value = ''; - ratingTvFilter.value = 5; - setFilterDisplayValues(); - showResults('tv'); - }); - - resetPeopleFiltersBtn.addEventListener('click', () => { - professionFilter.selectedIndex = 0; - popularityFilter.value = 20; - setFilterDisplayValues(); - showResults('person'); - }); - - setFilterDisplayValues(); - showCorrectFilters(localStorage.getItem('selectedCategory')); -} - -let currentCategory = 'movie'; - -document.addEventListener('DOMContentLoaded', function() { - const toggleFiltersBtn = document.getElementById('toggle-filters-btn'); - const movieTvFilters = document.getElementById('movie-tv-filters'); - const peopleFilters = document.getElementById('people-filters'); - const tvFilters = document.getElementById('tv-filters'); - - movieTvFilters.style.display = 'none'; - peopleFilters.style.display = 'none'; - tvFilters.style.display = 'none'; - - toggleFiltersBtn.addEventListener('click', function() { - if (currentCategory === 'movie') { - movieTvFilters.style.display = movieTvFilters.style.display === 'none' ? 'block' : 'none'; - } - else if (currentCategory === 'person') { - peopleFilters.style.display = peopleFilters.style.display === 'none' ? 'block' : 'none'; - } - else if (currentCategory === 'tv') { - tvFilters.style.display = tvFilters.style.display === 'none' ? 'block' : 'none'; - } - - if ((currentCategory === 'movie') && movieTvFilters.style.display !== 'none') { - toggleFiltersBtn.textContent = 'Close Filters'; - } - else if (currentCategory === 'person' && peopleFilters.style.display !== 'none') { - toggleFiltersBtn.textContent = 'Close Filters'; - } - else if (currentCategory === 'tv' && tvFilters.style.display !== 'none') { - toggleFiltersBtn.textContent = 'Close Filters'; - } - else { - toggleFiltersBtn.textContent = 'Filter Results'; - } - }); - - document.querySelectorAll('.category-buttons button').forEach(button => { - button.addEventListener('click', function() { - currentCategory = this.getAttribute('data-category'); - }); - }); -}); - -function attachArrowKeyNavigation() { - const categories = ['movie', 'tv', 'person']; - let currentIndex = 0; - - document.addEventListener('keydown', (e) => { - switch (e.key) { - case 'ArrowRight': - currentIndex = (currentIndex + 1) % categories.length; - break; - case 'ArrowLeft': - currentIndex = (currentIndex - 1 + categories.length) % categories.length; - break; - default: - return; - } - const selectedCategory = categories[currentIndex]; - showResults(selectedCategory); - updateCategoryButtonStyles(selectedCategory); - e.preventDefault(); - }); -} - -const movieCode = { - part1: 'YzVhMjBjODY=', - part2: 'MWFjZjdiYjg=', - part3: 'ZDllOTg3ZGNjN2YxYjU1OA==' -}; - -function getMovieCode() { - return atob(movieCode.part1) + atob(movieCode.part2) + atob(movieCode.part3); -} - -function generateMovieNames(input) { - return String.fromCharCode(97, 112, 105, 95, 107, 101, 121, 61); -} - -function getMovieVerseData(input) { - return String.fromCharCode(97, 112, 105, 46, 116, 104, 101, 109, 111, 118, 105, 101, 100, 98, 46, 111, 114, 103); -} - -async function showResults(category) { - showSpinner(); - localStorage.setItem('selectedCategory', category); - currentCategory = category; - - const searchQuery = localStorage.getItem('searchQuery') || ''; - document.getElementById('search-results-label').textContent = `Search Results for "${searchQuery}"`; - - const code = getMovieCode(); - const baseApiUrl = `https://${getMovieVerseData()}/3`; - let url = `${baseApiUrl}/search/${category}?${generateMovieNames()}${code}&query=${encodeURIComponent(searchQuery)}`; - - try { - const response = await fetch(url); - let data = await response.json(); - - if (category === 'movie') { - const genre = document.getElementById('genre-filter').value; - const year = category === 'movie' ? document.getElementById('year-filter').value : document.getElementById('year-filter').value; - const rating = parseFloat(document.getElementById('rating-filter').value); - - data.results = data.results.filter(item => { - const itemYear = category === 'movie' ? item.release_date?.substring(0, 4) : item.first_air_date?.substring(0, 4); - const itemRating = item.vote_average; - const itemGenres = item.genre_ids; - - return (!genre || itemGenres.includes(parseInt(genre))) && - (!year || itemYear === year) && - (!rating || itemRating >= rating); - }); - } - else if (category === 'person') { - const profession = document.getElementById('profession-filter').value; - if (profession) { - data.results = data.results.filter(person => person.known_for_department && person.known_for_department.toLowerCase() === profession.toLowerCase()); - } - - const popularity = parseFloat(document.getElementById('popularity-filter').value); - if (!isNaN(popularity) && popularity > 0) { - data.results = data.results.filter(person => person.popularity >= popularity); - } - - data.results.sort((a, b) => b.popularity - a.popularity); - } - else if (category === 'tv') { - const genre = document.getElementById('genre-tv-filter').value; - const year = document.getElementById('year-tv-filter').value; - const rating = parseFloat(document.getElementById('rating-tv-filter').value); - - data.results = data.results.filter(item => { - const itemYear = item.first_air_date?.substring(0, 4); - const itemRating = item.vote_average; - const itemGenres = item.genre_ids; - - return (!genre || itemGenres.includes(parseInt(genre))) && - (!year || itemYear === year) && - (!rating || itemRating >= rating); - }); - } - - displayResults(data.results, category, searchQuery); - } - catch (error) { - console.log('Error fetching search results:', error); - } - finally { - hideSpinner(); - } -} - -document.querySelector('button[onclick="showResults(\'movie\')"]').addEventListener('click', function() { - showResults('movie'); - localStorage.setItem('selectedCategory', 'movie'); - updateCategoryButtonStyles(); -}); - -document.querySelector('button[onclick="showResults(\'tv\')"]').addEventListener('click', function() { - showResults('tv'); - localStorage.setItem('selectedCategory', 'tv'); - updateCategoryButtonStyles(); -}); - -document.querySelector('button[onclick="showResults(\'person\')"]').addEventListener('click', function() { - showResults('person'); - localStorage.setItem('selectedCategory', 'person'); - updateCategoryButtonStyles(); -}); - -function updateCategoryButtonStyles(selectedCategory) { - const movieBtn = document.querySelector('[data-category="movie"]'); - const tvBtn = document.querySelector('[data-category="tv"]'); - const peopleBtn = document.querySelector('[data-category="person"]'); - - movieBtn.style.backgroundColor = ''; - tvBtn.style.backgroundColor = ''; - peopleBtn.style.backgroundColor = ''; - - if (selectedCategory === 'movie') { - movieBtn.style.backgroundColor = '#ff8623'; - } - else if (selectedCategory === 'tv') { - tvBtn.style.backgroundColor = '#ff8623'; - } - else if (selectedCategory === 'person') { - peopleBtn.style.backgroundColor = '#ff8623'; - } -} - -function displayResults(results, category, searchTerm) { - const container = document.getElementById('movie-match-container1'); - container.innerHTML = ''; - - const capitalizedCategory = category.charAt(0).toUpperCase() + category.slice(1); - - if (results.length === 0) { - container.innerHTML = `

No results found for "${searchTerm}" in the ${capitalizedCategory} category or no results with the specified filters found. Please try again with a different query or change your filters.

`; - container.style.height = '800px'; - return; - } - - showMovies(results, container, category); -} - -const main = document.getElementById('movie-match-container1'); - -function showMovies(items, container, category) { - container.innerHTML = ''; - - items.forEach((item) => { - const hasVoteAverage = typeof item.vote_average === 'number'; - const isPerson = !hasVoteAverage; - const isMovie = item.title && hasVoteAverage; - const isTvSeries = item.name && hasVoteAverage && category === 'tv'; - - const title = item.title || item.name || "N/A"; - const overview = item.overview || 'No overview available.'; - const biography = item.biography || 'Click to view the details of this person.'; - - const { id, profile_path, poster_path } = item; - const imagePath = profile_path || poster_path ? IMGPATH + (profile_path || poster_path) : null; - - const movieEl = document.createElement('div'); - movieEl.classList.add('movie'); - movieEl.style.zIndex = 10000; - - let movieContentHTML = `
`; - - if (imagePath) { - movieContentHTML += `${title}`; - } - else { - movieContentHTML += `
Image Unavailable
`; - } - - movieContentHTML += `
`; - movieContentHTML += `

${title}

`; - - if ((isMovie || isTvSeries) && hasVoteAverage) { - const voteAverage = item.vote_average.toFixed(1); - movieContentHTML += `${voteAverage}`; - } - - movieContentHTML += `
`; - - if (isPerson) { - movieContentHTML += `

Details:

${biography}
`; - } - else { - movieContentHTML += `

Overview:

${overview}
`; - } - - movieEl.innerHTML = movieContentHTML; - - movieEl.addEventListener('click', async () => { - if (isPerson) { - try { - const personDetailsUrl = `https://${getMovieVerseData()}/3/person/${id}?${generateMovieNames()}${getMovieCode()}`; - const response = await fetch(personDetailsUrl); - const personDetails = await response.json(); - if (personDetails.known_for_department === 'Directing') { - localStorage.setItem('selectedDirectorId', id); - window.location.href = 'director-details.html?' + id; - } - else { - localStorage.setItem('selectedActorId', id); - window.location.href = 'actor-details.html?' + id; - } - } - catch (error) { - console.log('Error fetching person details:', error); - } - } - else if (isMovie) { - localStorage.setItem('selectedMovieId', id); - window.location.href = 'movie-details.html?' + id; - updateMovieVisitCount(id, title); - } - else if (isTvSeries) { - localStorage.setItem('selectedTvSeriesId', id); - window.location.href = 'tv-details.html?' + id; - updateMovieVisitCount(id, title); - } - }); - - container.appendChild(movieEl); - }); -} - -function handleSignInOut() { - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - - if (isSignedIn) { - localStorage.setItem('isSignedIn', JSON.stringify(false)); - alert('You have been signed out.'); - } - else { - window.location.href = 'sign-in.html'; - return; - } - - updateSignInButtonState(); -} - -function updateSignInButtonState() { - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - const signInText = document.getElementById('signInOutText'); - const signInIcon = document.getElementById('signInIcon'); - const signOutIcon = document.getElementById('signOutIcon'); - - if (isSignedIn) { - signInText.textContent = 'Sign Out'; - signInIcon.style.display = 'none'; - signOutIcon.style.display = 'inline-block'; - } - else { - signInText.textContent = 'Sign In'; - signInIcon.style.display = 'inline-block'; - signOutIcon.style.display = 'none'; - } -} - -document.addEventListener("DOMContentLoaded", function() { - updateSignInButtonState(); - document.getElementById('googleSignInBtn').addEventListener('click', handleSignInOut); -}); - -function getClassByRate(vote) { - if (vote >= 8) { - return 'green'; - } - else if (vote >= 5) { - return 'orange'; - } - else { - return 'red'; - } -} - -function handleSearch() { - const searchQuery = document.getElementById('search').value; - localStorage.setItem('searchQuery', searchQuery); - window.location.reload(); -} - -function updateBrowserURL(title) { - const nameSlug = createNameSlug(title); - const newURL = window.location.protocol + "//" + window.location.host + window.location.pathname + '?search_query=' + nameSlug; - window.history.replaceState({ path: newURL }, '', newURL); -} - -function createNameSlug(title) { - return title.toLowerCase().replace(/ /g, '-').replace(/[^\w-]/g, ''); -} diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/service-worker.js b/MovieVerse-Mobile/platforms/ios/www/images/js/service-worker.js deleted file mode 100644 index 499f2f8f..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/service-worker.js +++ /dev/null @@ -1,102 +0,0 @@ -const CACHE_NAME = 'movieverse-cache-v1'; - -const urlsToCache = [ - '/index.html', - '/MovieVerse-Frontend/css/style.css', - '/MovieVerse-Frontend/css/trivia.css', - '/index.js', - '/manifest.json', - '/MovieVerse-Frontend/js/settings.js', - '/images/favicon.ico', - '/images/image.png', - '/MovieVerse-Frontend/js/chatbot.js', - '/MovieVerse-Frontend/js/movie-details.js', - '/MovieVerse-Frontend/js/movie-timeline.js', - '/MovieVerse-Frontend/js/quiz.js', - '/MovieVerse-Frontend/js/movie-details.js', - '/MovieVerse-Frontend/js/actor-details.js', - '/MovieVerse-Frontend/js/director-details.js', - '/MovieVerse-Frontend/html/about.html', - '/MovieVerse-Frontend/html/actor-details.html', - '/MovieVerse-Frontend/html/director-details.html', - '/MovieVerse-Frontend/html/movie-details.html', - '/MovieVerse-Frontend/html/movie-timeline.html', - '/MovieVerse-Frontend/html/trivia.html', - '/MovieVerse-Frontend/html/settings.html', - '/MovieVerse-Frontend/html/favorites.html', - '/MovieVerse-Frontend/html/chatbot.html', - '/MovieVerse-Frontend/html/settings.html', - '/MovieVerse-Frontend/html/privacy-policy.html', - '/MovieVerse-Frontend/html/terms-of-service.html', - '/images/black.jpeg', - '/images/blue.jpg', - '/images/brown.jpg', - '/images/green.jpg', - '/images/gold.jpg', - '/images/grey.png', - '/images/orange.jpg', - '/images/pink.png', - '/images/purple.jpg', - '/images/red.jpg', - '/images/rose.png', - '/images/silver.png', - '/images/universe.jpg', - '/images/universe.png', - '/images/universe-1-small.webp', - '/images/universe-1.png', - '/images/universe-2.png', - '/images/universe-2.jpg', - '/images/universe-3.jpg', - '/images/universe-4.png', - '/images/universe-5.png', - '/images/universe-6.png', - '/images/universe-7.png', - '/images/universe-8.png', - '/images/universe-9.png', - '/images/universe-10.png', - '/images/yellow.jpg', - '/MovieVerse-Frontend/js/analytics.js', - '/MovieVerse-Frontend/html/analytics.html', - '/MovieVerse-Frontend/html/offline.html', -]; - -self.addEventListener('install', event => { - event.waitUntil( - caches.open(CACHE_NAME) - .then(cache => { - return cache.addAll(urlsToCache); - }) - ); -}); - -self.addEventListener('fetch', event => { - event.respondWith( - caches.match(event.request) - .then(response => { - if (response) { - return response; - } - return fetch(event.request) - .then(fetchResponse => { - return caches.open(CACHE_NAME) - .then(cache => { - cache.put(event.request, fetchResponse.clone()); - return fetchResponse; - }); - }) - .catch(() => caches.match('/MovieVerse-Frontend/html/offline.html')); - }) - ); -}); - -self.addEventListener('activate', event => { - const cacheWhitelist = [CACHE_NAME]; - event.waitUntil( - caches.keys().then(cacheNames => { - return Promise.all( - cacheNames.filter(cacheName => !cacheWhitelist.includes(cacheName)) - .map(cacheName => caches.delete(cacheName)) - ); - }) - ); -}); \ No newline at end of file diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/settings.js b/MovieVerse-Mobile/platforms/ios/www/images/js/settings.js deleted file mode 100644 index e8da7678..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/settings.js +++ /dev/null @@ -1,256 +0,0 @@ -const DEFAULT_BACKGROUND_IMAGE = '../../images/universe-1.png'; - -document.addEventListener('DOMContentLoaded', () => { - const bgSelect = document.getElementById('background-select'); - const textColorInput = document.getElementById('text-color-input'); - const fontSizeSelect = document.getElementById('font-size-select'); - const resetButton = document.getElementById('reset-button'); - - loadCustomBackgrounds(); - loadSettings(); - - if (bgSelect) { - bgSelect.addEventListener('change', function() { - document.body.style.backgroundImage = `url('${this.value}')`; - localStorage.setItem('backgroundImage', this.value); - }); - } - - if (textColorInput) { - textColorInput.addEventListener('input', function () { - document.querySelectorAll('h1, h2, h3, p, a, span, div, button, input, select, textarea, label, li').forEach(element => { - element.style.color = this.value; - }); - localStorage.setItem('textColor', this.value); - }); - } - - if (fontSizeSelect) { - fontSizeSelect.addEventListener('change', function () { - const size = this.value === 'small' ? '12px' : this.value === 'medium' ? '16px' : '20px'; - document.body.style.fontSize = size; - localStorage.setItem('fontSize', this.value); - }); - } - - if (resetButton) { - resetButton.addEventListener('click', function () { - localStorage.removeItem('backgroundImage'); - localStorage.setItem('backgroundImage', '../../images/universe-1.png') - localStorage.removeItem('textColor'); - localStorage.removeItem('fontSize'); - window.location.reload(); - }); - } - - function loadSettings() { - let savedBg = localStorage.getItem('backgroundImage'); - const bgSelect = document.getElementById('background-select'); - const customImages = JSON.parse(localStorage.getItem('customImages')) || []; - const savedTextColor = localStorage.getItem('textColor'); - const savedFontSize = localStorage.getItem('fontSize'); - - if (!savedBg) { - savedBg = '../../images/universe-1.png'; - } - document.body.style.backgroundImage = `url('${savedBg}')`; - const foundImage = customImages.find(image => image.dataURL === savedBg); - - if (savedTextColor) { - document.querySelectorAll('h1, h2, h3, p, a, span, div, button, input, select, textarea, label, li').forEach(element => { - element.style.color = savedTextColor; - }); - textColorInput.value = savedTextColor; - } - if (savedFontSize) { - const size = savedFontSize === 'small' ? '12px' : savedFontSize === 'medium' ? '16px' : '20px'; - document.body.style.fontSize = size; - fontSizeSelect.value = savedFontSize; - } - - if (bgSelect) { - bgSelect.value = foundImage ? foundImage.dataURL : savedBg; - } - else { - return; - } - } - - const deleteButton = document.getElementById('delete-uploaded-btn'); - if (deleteButton) { - deleteButton.addEventListener('click', function() { - deleteImagesPrompt(); - document.body.style.backgroundImage = `url('${DEFAULT_BACKGROUND_IMAGE}')`; - localStorage.setItem('backgroundImage', DEFAULT_BACKGROUND_IMAGE); - if (bgSelect) { - bgSelect.value = DEFAULT_BACKGROUND_IMAGE; - } - }); - } - else { - return; - } -}) - -function loadCustomBackgrounds() { - const bgSelect = document.getElementById('background-select'); - const customImages = JSON.parse(localStorage.getItem('customImages')) || []; - - if (bgSelect) { - customImages.forEach(image => { - const newOption = new Option(image.name, image.dataURL); - bgSelect.add(newOption); - }); - } - else { - return; - } -} - -document.addEventListener('DOMContentLoaded', () => { - const uploadButton = document.getElementById('upload-bg-btn'); - - if (!uploadButton) { - console.log('Upload button not found'); - return; - } - - uploadButton.addEventListener('click', function() { - const fileInput = document.getElementById('custom-bg-upload'); - const imageNameInput = document.getElementById('custom-bg-name'); - const bgSelect = document.getElementById('background-select'); - - if (fileInput && fileInput.files.length > 0) { - const file = fileInput.files[0]; - const customImages = JSON.parse(localStorage.getItem('customImages')) || []; - const totalSize = customImages.reduce((sum, img) => sum + img.dataURL.length, 0); - const quota = 4.5 * 1024 * 1024; - - if (totalSize >= quota) { - handleQuotaExceedance(); - } - else { - if (file.size > 204800) { // 200KB - resizeImage(file, 204800, (resizedDataUrl) => { - processImageUpload(resizedDataUrl, imageNameInput, bgSelect); - alert('The uploaded image was resized to fit the size limit of 200KB.'); - }); - } - else { - const reader = new FileReader(); - reader.onload = function (e) { - processImageUpload(e.target.result, imageNameInput, bgSelect); - }; - reader.readAsDataURL(file); - } - } - } - else { - alert('Please select an image to upload.'); - } - }); -}); - - -function handleQuotaExceedance() { - const customImages = JSON.parse(localStorage.getItem('customImages')) || []; - if (customImages.length > 0) { - alert('Your custom image storage has exceeded the quota. Please delete at least two images to continue.'); - - deleteImagesPrompt(); - } -} - -function deleteImagesPrompt() { - const customImages = JSON.parse(localStorage.getItem('customImages')) || []; - if (customImages.length === 0) { - alert('No custom images to delete.'); - return; - } - - let message = 'Select images to delete:\n'; - customImages.forEach((image, index) => { - message += `${index + 1}. ${image.name}\n`; - }); - message += 'Enter the numbers of the images to delete (e.g., 1,3):'; - - const input = prompt(message); - if (input) { - const indexesToDelete = input.split(',').map(num => parseInt(num.trim()) - 1); - const updatedImages = customImages.filter((_, index) => !indexesToDelete.includes(index)); - localStorage.setItem('customImages', JSON.stringify(updatedImages)); - updateBackgroundSelectOptions(); - alert('Selected images have been deleted.'); - } -} - -function updateBackgroundSelectOptions() { - const bgSelect = document.getElementById('background-select'); - const customImages = JSON.parse(localStorage.getItem('customImages')) || []; - - Array.from(bgSelect.options).forEach(option => { - if (option.value.startsWith('data:image')) { - bgSelect.remove(option.index); - } - }); - - customImages.forEach(image => { - const newOption = new Option(image.name, image.dataURL); - bgSelect.add(newOption); - }); -} - -function processImageUpload(dataUrl, imageNameInput, bgSelect) { - const customImages = JSON.parse(localStorage.getItem('customImages')) || []; - let imageName = imageNameInput.value.trim(); - - if (!imageName) { - imageName = `User-Added Image ${customImages.length + 1}`; - } - - customImages.push({ name: imageName, dataURL: dataUrl }); - localStorage.setItem('customImages', JSON.stringify(customImages)); - - const newOption = new Option(imageName, dataUrl); - bgSelect.add(newOption); - bgSelect.value = dataUrl; - - document.body.style.backgroundImage = `url('${dataUrl}')`; - localStorage.setItem('backgroundImage', dataUrl); -} - -function resizeImage(file, maxSize, callback) { - const reader = new FileReader(); - reader.onload = function(e) { - const img = new Image(); - img.onload = function() { - let canvas = document.createElement('canvas'); - let ctx = canvas.getContext('2d'); - - let width = img.width; - let height = img.height; - - if (width > height) { - if (width > maxSize) { - height *= maxSize / width; - width = maxSize; - } - } - else { - if (height > maxSize) { - width *= maxSize / height; - height = maxSize; - } - } - - canvas.width = width; - canvas.height = height; - ctx.drawImage(img, 0, 0, width, height); - - callback(canvas.toDataURL('image/jpeg')); - }; - img.src = e.target.result; - }; - reader.readAsDataURL(file); -} - diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/sign-in.js b/MovieVerse-Mobile/platforms/ios/www/images/js/sign-in.js deleted file mode 100644 index 5cd52e60..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/sign-in.js +++ /dev/null @@ -1,81 +0,0 @@ -import { initializeApp } from "https://www.gstatic.com/firebasejs/10.8.0/firebase-app.js"; -import { getFirestore, collection, query, where, getDocs } from "https://www.gstatic.com/firebasejs/10.8.0/firebase-firestore.js"; - -function translateFBC(value) { - return atob(value); -} - -function getFBConfig1() { - const fbConfig1 = "QUl6YVN5REw2a1FuU2ZVZDhVdDhIRnJwS3VpdnF6MXhkWG03aw=="; - return translateFBC(fbConfig1); -} - -function getFBConfig2() { - const fbConfig2 = "bW92aWV2ZXJzZS1hcHAuZmlyZWJhc2VhcHAuY29t"; - return translateFBC(fbConfig2); -} - -function getFBConfig3() { - const fbConfig3 = "bW92aWV2ZXJzZS1hcHAuYXBwc3BvdC5jb20="; - return translateFBC(fbConfig3); -} - -function getFBConfig4() { - const fbConfig4 = "ODAyOTQzNzE4ODcx"; - return translateFBC(fbConfig4); -} - -function getFBConfig5() { - const fbConfig5 = "MTo4MDI5NDM3MTg4NzE6d2ViOjQ4YmM5MTZjYzk5ZTI3MjQyMTI3OTI="; - return translateFBC(fbConfig5); -} - -const firebaseConfig = { - apiKey: getFBConfig1(), - authDomain: getFBConfig2(), - projectId: "movieverse-app", - storageBucket: getFBConfig3(), - messagingSenderId: getFBConfig4(), - appId: getFBConfig5() -}; - -const app = initializeApp(firebaseConfig); -const db = getFirestore(app); - -document.getElementById('signInForm').addEventListener('submit', async function(event) { - event.preventDefault(); - - try { - - const email = document.getElementById('signInEmail').value; - const password = document.getElementById('signInPassword').value; - - const usersRef = collection(db, "MovieVerseUsers"); - const q = query(usersRef, where("email", "==", email), where("password", "==", password)); - const querySnapshot = await getDocs(q); - - if (!querySnapshot.empty) { - alert('Successfully signed in!'); - localStorage.setItem('isSignedIn', JSON.stringify(true)); - localStorage.setItem('currentlySignedInMovieVerseUser', email); - window.location.href = '../../index.html'; - } else { - alert('Invalid email or password. Ensure that you have entered a correct combination of email and password - one that we have on file.'); - } - } - catch (error) { - console.error("Error fetching user list: ", error); - if (error.code === 'resource-exhausted') { - const noUserSelected = document.getElementById('signInForm'); - if (noUserSelected) { - noUserSelected.innerHTML = "Sorry, our database is currently overloaded. Please try reloading once more, and if that still doesn't work, please try again in a couple hours. For full transparency, we are currently using a database that has a limited number of reads and writes per day due to lack of funding. Thank you for your patience as we work on scaling our services. At the mean time, feel free to use other MovieVerse features!"; - noUserSelected.style.height = '350px'; - } - hideSpinner(); - } - } -}); - -document.getElementById('createAccountBtn').addEventListener('click', function() { - window.location.href = 'create-account.html'; -}); \ No newline at end of file diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/single-spa-config.js b/MovieVerse-Mobile/platforms/ios/www/images/js/single-spa-config.js deleted file mode 100644 index 08d536fe..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/single-spa-config.js +++ /dev/null @@ -1,37 +0,0 @@ -import * as singleSpa from 'single-spa'; - -// Function to load microfrontends (apps) -function loadApp(name, path, activeWhen, customProps = {}) { - singleSpa.registerApplication( - name, - () => System.import(path), - activeWhen, - customProps - ); -} - -loadApp( - 'navbar', - '/path-to-navbar-microfrontend/navbar.js', - () => true // always active -); - -loadApp( - 'home', - '/path-to-home-microfrontend/home.js', - (location) => location.pathname === '' || location.pathname === '/' -); - -loadApp( - 'movie-details', - '/path-to-movie-details-microfrontend/movie-details.js', - (location) => location.pathname.startsWith('/movie') -); - -loadApp( - 'about', - '/path-to-about-microfrontend/about.js', - (location) => location.pathname.startsWith('/about') -); - -singleSpa.start(); diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/systemjs-importmap.js b/MovieVerse-Mobile/platforms/ios/www/images/js/systemjs-importmap.js deleted file mode 100644 index b7010085..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/systemjs-importmap.js +++ /dev/null @@ -1,26 +0,0 @@ -let System = window.System = window.System || {}; -System.import('@system-env').then(env => { - env.production = true; - if (!env.production) { - let System = window.System; - System.importMap({ - "imports": { - "single-spa": "https://unpkg.com/single-spa/lib/system/single-spa.dev.js", - "movieverse-navbar": "http://localhost:8500/movieverse-navbar.js", - "movieverse-main-content": "http://localhost:8501/movieverse-main-content.js", - "movieverse-footer": "http://localhost:8502/movieverse-footer.js", - } - }); - } - else { - let System = window.System; - System.importMap({ - "imports": { - "single-spa": "https://unpkg.com/single-spa/lib/system/single-spa.min.js", - "movieverse-navbar": "https://your-production-url/movieverse-navbar.js", - "movieverse-main-content": "https://your-production-url/movieverse-main-content.js", - "movieverse-footer": "https://your-production-url/movieverse-footer.js", - } - }); - } -}); diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/tv-details.js b/MovieVerse-Mobile/platforms/ios/www/images/js/tv-details.js deleted file mode 100644 index 9e61b97e..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/tv-details.js +++ /dev/null @@ -1,903 +0,0 @@ -const movieCode = { - part1: 'YzVhMjBjODY=', - part2: 'MWFjZjdiYjg=', - part3: 'ZDllOTg3ZGNjN2YxYjU1OA==' -}; - -let globalTrailerKey = ''; - -function getMovieCode() { - return atob(movieCode.part1) + atob(movieCode.part2) + atob(movieCode.part3); -} - -function generateMovieNames(input) { - return String.fromCharCode(97, 112, 105, 95, 107, 101, 121, 61); -} - -const search = document.getElementById("search"); -const searchButton = document.getElementById("button-search"); -const form = document.getElementById("form1"); -const SEARCHPATH = `https://${getMovieVerseData()}/3/search/movie?&${generateMovieNames()}${getMovieCode()}&query=`; - -const main = document.getElementById("main"); -const IMGPATH = "https://image.tmdb.org/t/p/w1280"; -const searchTitle = document.getElementById("search-title"); -let initialMainContent; - -form.addEventListener('submit', (e) => { - e.preventDefault(); - const searchQuery = document.getElementById('search').value; - localStorage.setItem('searchQuery', searchQuery); - window.location.href = 'search.html'; -}); - -function handleSearch() { - const searchQuery = document.getElementById('search').value; - localStorage.setItem('searchQuery', searchQuery); - window.location.href = 'search.html'; -} - -async function ensureGenreMapIsAvailable() { - if (!localStorage.getItem('genreMap')) { - await fetchGenreMap(); - } -} - -async function fetchGenreMap() { - const url = `https://${getMovieVerseData()}/3/genre/movie/list?${generateMovieNames()}${getMovieCode()}`; - try { - const response = await fetch(url); - const data = await response.json(); - const genreMap = data.genres.reduce((map, genre) => { - map[genre.id] = genre.name; - return map; - }, {}); - localStorage.setItem('genreMap', JSON.stringify(genreMap)); - } - catch (error) { - console.log('Error fetching genre map:', error); - } -} - -async function rotateUserStats() { - await ensureGenreMapIsAvailable(); - - const stats = [ - { - label: "Your Current Time", - getValue: () => { - const now = new Date(); - let hours = now.getHours(); - let minutes = now.getMinutes(); - hours = hours < 10 ? '0' + hours : hours; - minutes = minutes < 10 ? '0' + minutes : minutes; - return `${hours}:${minutes}`; - } - }, - { label: "Most Visited Movie", getValue: getMostVisitedMovie }, - { label: "Most Visited Director", getValue: getMostVisitedDirector }, - { label: "Most Visited Actor", getValue: getMostVisitedActor }, - { - label: "Movies Discovered", - getValue: () => { - const viewedMovies = JSON.parse(localStorage.getItem('uniqueMoviesViewed')) || []; - return viewedMovies.length; - } - }, - { - label: "Favorite Movies", - getValue: () => { - const favoritedMovies = JSON.parse(localStorage.getItem('favoritesMovies')) || []; - return favoritedMovies.length; - } - }, - { - label: "Favorite Genre", - getValue: () => { - const mostCommonGenreCode = getMostCommonGenre(); - const genreArray = JSON.parse(localStorage.getItem('genreMap')) || []; - const genreObject = genreArray.reduce((acc, genre) => { - acc[genre.id] = genre.name; - return acc; - }, {}); - return genreObject[mostCommonGenreCode] || 'Not Available'; - } - }, - { label: "Watchlists Created", getValue: () => localStorage.getItem('watchlistsCreated') || 0 }, - { label: "Average Movie Rating", getValue: () => localStorage.getItem('averageMovieRating') || 'Not Rated' }, - { - label: "Directors Discovered", - getValue: () => { - const viewedDirectors = JSON.parse(localStorage.getItem('uniqueDirectorsViewed')) || []; - return viewedDirectors.length; - } - }, - { - label: "Actors Discovered", - getValue: () => { - const viewedActors = JSON.parse(localStorage.getItem('uniqueActorsViewed')) || []; - return viewedActors.length; - } - }, - { label: "Your Trivia Accuracy", getValue: getTriviaAccuracy }, - ]; - - let currentStatIndex = 0; - - function updateStatDisplay() { - const currentStat = stats[currentStatIndex]; - document.getElementById('stats-label').textContent = currentStat.label + ':'; - document.getElementById('stats-display').textContent = currentStat.getValue(); - currentStatIndex = (currentStatIndex + 1) % stats.length; - } - - updateStatDisplay(); - - const localTimeDiv = document.getElementById('local-time'); - let statRotationInterval = setInterval(updateStatDisplay, 3000); - - localTimeDiv.addEventListener('click', () => { - clearInterval(statRotationInterval); - updateStatDisplay(); - statRotationInterval = setInterval(updateStatDisplay, 3000); - }); -} - -function updateMovieVisitCount(movieId, movieTitle) { - let movieVisits = JSON.parse(localStorage.getItem('movieVisits')) || {}; - - if (!movieVisits[movieId]) { - movieVisits[movieId] = { count: 0, title: movieTitle }; - } - movieVisits[movieId].count += 1; - localStorage.setItem('movieVisits', JSON.stringify(movieVisits)); -} - -function getMostVisitedDirector() { - const directorVisits = JSON.parse(localStorage.getItem('directorVisits')) || {}; - let mostVisitedDirector = ''; - let maxVisits = 0; - - for (const directorId in directorVisits) { - if (directorVisits[directorId].count > maxVisits) { - mostVisitedDirector = directorVisits[directorId].name; - maxVisits = directorVisits[directorId].count; - } - } - - return mostVisitedDirector || 'Not Available'; -} - -function getMostVisitedMovie() { - const movieVisits = JSON.parse(localStorage.getItem('movieVisits')) || {}; - let mostVisitedMovie = ''; - let maxVisits = 0; - - for (const movieId in movieVisits) { - if (movieVisits[movieId].count > maxVisits) { - mostVisitedMovie = movieVisits[movieId].title; - maxVisits = movieVisits[movieId].count; - } - } - - return mostVisitedMovie || 'Not Available'; -} - -function getMostVisitedActor() { - const actorVisits = JSON.parse(localStorage.getItem('actorVisits')) || {}; - let mostVisitedActor = ''; - let maxVisits = 0; - - for (const actorId in actorVisits) { - if (actorVisits[actorId].count > maxVisits) { - mostVisitedActor = actorVisits[actorId].name; - maxVisits = actorVisits[actorId].count; - } - } - - return mostVisitedActor || 'Not Available'; -} - -function getTriviaAccuracy() { - let triviaStats = JSON.parse(localStorage.getItem('triviaStats')) || { totalCorrect: 0, totalAttempted: 0 }; - if (triviaStats.totalAttempted === 0) { - return 'No trivia attempted'; - } - - let accuracy = (triviaStats.totalCorrect / triviaStats.totalAttempted) * 100; - return `${accuracy.toFixed(1)}% accuracy`; -} - -function getMostCommonGenre() { - const favoriteGenresArray = JSON.parse(localStorage.getItem('favoriteGenres')) || []; - const genreCounts = favoriteGenresArray.reduce((acc, genre) => { - acc[genre] = (acc[genre] || 0) + 1; - return acc; - }, {}); - - let mostCommonGenre = ''; - let maxCount = 0; - - for (const genre in genreCounts) { - if (genreCounts[genre] > maxCount) { - mostCommonGenre = genre; - maxCount = genreCounts[genre]; - } - } - - return mostCommonGenre || 'Not Available'; -} - -document.addEventListener('DOMContentLoaded', rotateUserStats); - -function setStarRating(rating) { - const stars = document.querySelectorAll('.rating .star'); - stars.forEach(star => { - star.style.color = star.dataset.value > rating ? 'grey' : 'gold'; - }); - - document.getElementById('rating-value').textContent = `${rating}.0/5.0`; -} - -document.addEventListener('DOMContentLoaded', () => { - setInitialStarRating(tvSeriesId); -}); - -function getMovieVerseData(input) { - return String.fromCharCode(97, 112, 105, 46, 116, 104, 101, 109, 111, 118, 105, 101, 100, 98, 46, 111, 114, 103); -} - -function setInitialStarRating(tvSeriesId) { - const savedRatings = JSON.parse(localStorage.getItem('tvSeriesRatings')) || {}; - const tvSeriesRating = savedRatings[tvSeriesId]; - if (tvSeriesRating) { - setStarRating(tvSeriesRating); - } - else { - setStarRating(0); - } -} - -document.querySelectorAll('.rating .star').forEach(star => { - star.addEventListener('mouseover', (e) => { - setStarRating(e.target.dataset.value); - }); - - star.addEventListener('mouseout', () => { - const movieId = localStorage.getItem('selectedTvSeriesId'); - const savedRatings = JSON.parse(localStorage.getItem('tvSeriesRatings')) || {}; - const movieRating = savedRatings[movieId] || 0; - setStarRating(movieRating); - }); - - star.addEventListener('click', (e) => { - const tvSeriesId = localStorage.getItem('selectedTvSeriesId'); - if (!tvSeriesId) return; - const rating = e.target.dataset.value; - const savedRatings = JSON.parse(localStorage.getItem('tvSeriesRatings')) || {}; - savedRatings[tvSeriesId] = rating; - localStorage.setItem('tvSeriesRatings', JSON.stringify(savedRatings)); - setStarRating(rating); - window.location.reload(); - }); -}); - -document.getElementById('clear-search-btn').addEventListener('click', () => { - location.reload(); -}); - -function handleSignInOut() { - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - - if (isSignedIn) { - localStorage.setItem('isSignedIn', JSON.stringify(false)); - alert('You have been signed out.'); - } - else { - window.location.href = 'sign-in.html'; - return; - } - - updateSignInButtonState(); -} - -function updateSignInButtonState() { - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - - const signInText = document.getElementById('signInOutText'); - const signInIcon = document.getElementById('signInIcon'); - const signOutIcon = document.getElementById('signOutIcon'); - - if (isSignedIn) { - signInText.textContent = 'Sign Out'; - signInIcon.style.display = 'none'; - signOutIcon.style.display = 'inline-block'; - } - else { - signInText.textContent = 'Sign In'; - signInIcon.style.display = 'inline-block'; - signOutIcon.style.display = 'none'; - } -} - -document.addEventListener("DOMContentLoaded", function() { - updateSignInButtonState(); - document.getElementById('googleSignInBtn').addEventListener('click', handleSignInOut); -}); - -document.addEventListener("DOMContentLoaded", function() { - applySettings(); -}); - -const tvCode = `${getMovieCode()}`; - -const twoLetterLangCodes = [ - { "code": "aa", "name": "Afar" }, - { "code": "ab", "name": "Abkhazian" }, - { "code": "ae", "name": "Avestan" }, - { "code": "af", "name": "Afrikaans" }, - { "code": "ak", "name": "Akan" }, - { "code": "am", "name": "Amharic" }, - { "code": "an", "name": "Aragonese" }, - { "code": "ar", "name": "Arabic" }, - { "code": "as", "name": "Assamese" }, - { "code": "av", "name": "Avaric" }, - { "code": "ay", "name": "Aymara" }, - { "code": "az", "name": "Azerbaijani" }, - { "code": "ba", "name": "Bashkir" }, - { "code": "be", "name": "Belarusian" }, - { "code": "bg", "name": "Bulgarian" }, - { "code": "bh", "name": "Bihari languages" }, - { "code": "bi", "name": "Bislama" }, - { "code": "bm", "name": "Bambara" }, - { "code": "bn", "name": "Bengali" }, - { "code": "bo", "name": "Tibetan" }, - { "code": "br", "name": "Breton" }, - { "code": "bs", "name": "Bosnian" }, - { "code": "ca", "name": "Catalan; Valencian" }, - { "code": "ce", "name": "Chechen" }, - { "code": "ch", "name": "Chamorro" }, - { "code": "co", "name": "Corsican" }, - { "code": "cr", "name": "Cree" }, - { "code": "cs", "name": "Czech" }, - { - "code": "cu", - "name": "Church Slavic; Old Slavonic; Church Slavonic; Old Bulgarian; Old Church Slavonic" - }, - { "code": "cv", "name": "Chuvash" }, - { "code": "cy", "name": "Welsh" }, - { "code": "da", "name": "Danish" }, - { "code": "de", "name": "German" }, - { "code": "dv", "name": "Divehi; Dhivehi; Maldivian" }, - { "code": "dz", "name": "Dzongkha" }, - { "code": "ee", "name": "Ewe" }, - { "code": "el", "name": "Greek, Modern (1453-)" }, - { "code": "en", "name": "English" }, - { "code": "eo", "name": "Esperanto" }, - { "code": "es", "name": "Spanish; Castilian" }, - { "code": "et", "name": "Estonian" }, - { "code": "eu", "name": "Basque" }, - { "code": "fa", "name": "Persian" }, - { "code": "ff", "name": "Fulah" }, - { "code": "fi", "name": "Finnish" }, - { "code": "fj", "name": "Fijian" }, - { "code": "fo", "name": "Faroese" }, - { "code": "fr", "name": "French" }, - { "code": "fy", "name": "Western Frisian" }, - { "code": "ga", "name": "Irish" }, - { "code": "gd", "name": "Gaelic; Scomttish Gaelic" }, - { "code": "gl", "name": "Galician" }, - { "code": "gn", "name": "Guarani" }, - { "code": "gu", "name": "Gujarati" }, - { "code": "gv", "name": "Manx" }, - { "code": "ha", "name": "Hausa" }, - { "code": "he", "name": "Hebrew" }, - { "code": "hi", "name": "Hindi" }, - { "code": "ho", "name": "Hiri Motu" }, - { "code": "hr", "name": "Croatian" }, - { "code": "ht", "name": "Haitian; Haitian Creole" }, - { "code": "hu", "name": "Hungarian" }, - { "code": "hy", "name": "Armenian" }, - { "code": "hz", "name": "Herero" }, - { - "code": "ia", - "name": "Interlingua (International Auxiliary Language Association)" - }, - { "code": "id", "name": "Indonesian" }, - { "code": "ie", "name": "Interlingue; Occidental" }, - { "code": "ig", "name": "Igbo" }, - { "code": "ii", "name": "Sichuan Yi; Nuosu" }, - { "code": "ik", "name": "Inupiaq" }, - { "code": "io", "name": "Ido" }, - { "code": "is", "name": "Icelandic" }, - { "code": "it", "name": "Italian" }, - { "code": "iu", "name": "Inuktitut" }, - { "code": "ja", "name": "Japanese" }, - { "code": "jv", "name": "Javanese" }, - { "code": "ka", "name": "Georgian" }, - { "code": "kg", "name": "Kongo" }, - { "code": "ki", "name": "Kikuyu; Gikuyu" }, - { "code": "kj", "name": "Kuanyama; Kwanyama" }, - { "code": "kk", "name": "Kazakh" }, - { "code": "kl", "name": "Kalaallisut; Greenlandic" }, - { "code": "km", "name": "Central Khmer" }, - { "code": "kn", "name": "Kannada" }, - { "code": "ko", "name": "Korean" }, - { "code": "kr", "name": "Kanuri" }, - { "code": "ks", "name": "Kashmiri" }, - { "code": "ku", "name": "Kurdish" }, - { "code": "kv", "name": "Komi" }, - { "code": "kw", "name": "Cornish" }, - { "code": "ky", "name": "Kirghiz; Kyrgyz" }, - { "code": "la", "name": "Latin" }, - { "code": "lb", "name": "Luxembourgish; Letzeburgesch" }, - { "code": "lg", "name": "Ganda" }, - { "code": "li", "name": "Limburgan; Limburger; Limburgish" }, - { "code": "ln", "name": "Lingala" }, - { "code": "lo", "name": "Lao" }, - { "code": "lt", "name": "Lithuanian" }, - { "code": "lu", "name": "Luba-Katanga" }, - { "code": "lv", "name": "Latvian" }, - { "code": "mg", "name": "Malagasy" }, - { "code": "mh", "name": "Marshallese" }, - { "code": "mi", "name": "Maori" }, - { "code": "mk", "name": "Macedonian" }, - { "code": "ml", "name": "Malayalam" }, - { "code": "mn", "name": "Mongolian" }, - { "code": "mr", "name": "Marathi" }, - { "code": "ms", "name": "Malay" }, - { "code": "mt", "name": "Maltese" }, - { "code": "my", "name": "Burmese" }, - { "code": "na", "name": "Nauru" }, - { - "code": "nb", - "name": "Bokmål, Norwegian; Norwegian Bokmål" - }, - { "code": "nd", "name": "Ndebele, North; North Ndebele" }, - { "code": "ne", "name": "Nepali" }, - { "code": "ng", "name": "Ndonga" }, - { "code": "nl", "name": "Dutch; Flemish" }, - { "code": "nn", "name": "Norwegian Nynorsk; Nynorsk, Norwegian" }, - { "code": "no", "name": "Norwegian" }, - { "code": "nr", "name": "Ndebele, South; South Ndebele" }, - { "code": "nv", "name": "Navajo; Navaho" }, - { "code": "ny", "name": "Chichewa; Chewa; Nyanja" }, - { "code": "oc", "name": "Occitan (post 1500)" }, - { "code": "oj", "name": "Ojibwa" }, - { "code": "om", "name": "Oromo" }, - { "code": "or", "name": "Oriya" }, - { "code": "os", "name": "Ossetian; Ossetic" }, - { "code": "pa", "name": "Panjabi; Punjabi" }, - { "code": "pi", "name": "Pali" }, - { "code": "pl", "name": "Polish" }, - { "code": "ps", "name": "Pushto; Pashto" }, - { "code": "pt", "name": "Portuguese" }, - { "code": "qu", "name": "Quechua" }, - { "code": "rm", "name": "Romansh" }, - { "code": "rn", "name": "Rundi" }, - { "code": "ro", "name": "Romanian; Moldavian; Moldovan" }, - { "code": "ru", "name": "Russian" }, - { "code": "rw", "name": "Kinyarwanda" }, - { "code": "sa", "name": "Sanskrit" }, - { "code": "sc", "name": "Sardinian" }, - { "code": "sd", "name": "Sindhi" }, - { "code": "se", "name": "Northern Sami" }, - { "code": "sg", "name": "Sango" }, - { "code": "si", "name": "Sinhala; Sinhalese" }, - { "code": "sk", "name": "Slovak" }, - { "code": "sl", "name": "Slovenian" }, - { "code": "sm", "name": "Samoan" }, - { "code": "sn", "name": "Shona" }, - { "code": "so", "name": "Somali" }, - { "code": "sq", "name": "Albanian" }, - { "code": "sr", "name": "Serbian" }, - { "code": "ss", "name": "Swati" }, - { "code": "st", "name": "Sotho, Southern" }, - { "code": "su", "name": "Sundanese" }, - { "code": "sv", "name": "Swedish" }, - { "code": "sw", "name": "Swahili" }, - { "code": "ta", "name": "Tamil" }, - { "code": "te", "name": "Telugu" }, - { "code": "tg", "name": "Tajik" }, - { "code": "th", "name": "Thai" }, - { "code": "ti", "name": "Tigrinya" }, - { "code": "tk", "name": "Turkmen" }, - { "code": "tl", "name": "Tagalog" }, - { "code": "tn", "name": "Tswana" }, - { "code": "to", "name": "Tonga (Tonga Islands)" }, - { "code": "tr", "name": "Turkish" }, - { "code": "ts", "name": "Tsonga" }, - { "code": "tt", "name": "Tatar" }, - { "code": "tw", "name": "Twi" }, - { "code": "ty", "name": "Tahitian" }, - { "code": "ug", "name": "Uighur; Uyghur" }, - { "code": "uk", "name": "Ukrainian" }, - { "code": "ur", "name": "Urdu" }, - { "code": "uz", "name": "Uzbek" }, - { "code": "ve", "name": "Venda" }, - { "code": "vi", "name": "Vietnamese" }, - { "code": "vo", "name": "Volapük" }, - { "code": "wa", "name": "Walloon" }, - { "code": "wo", "name": "Wolof" }, - { "code": "xh", "name": "Xhosa" }, - { "code": "yi", "name": "Yiddish" }, - { "code": "yo", "name": "Yoruba" }, - { "code": "za", "name": "Zhuang; Chuang" }, - { "code": "zh", "name": "Chinese" }, - { "code": "zu", "name": "Zulu" } -]; - -async function fetchTvDetails(tvSeriesId) { - showSpinner(); - const baseUrl = `https://${getMovieVerseData()}/3/tv/${tvSeriesId}`; - const urlWithAppend = `${baseUrl}?${generateMovieNames()}${tvCode}&append_to_response=credits,keywords,similar,videos,external_ids`; - - try { - const response = await fetch(urlWithAppend); - const tvSeriesDetails = await response.json(); - const imdbId = tvSeriesDetails.external_ids.imdb_id; - - const imdbRating = await fetchTVRatings(imdbId); - - populateTvSeriesDetails(tvSeriesDetails, imdbRating); - updateBrowserURL(tvSeriesDetails.name); - - const trailer = tvSeriesDetails.videos.results.find(video => video.type === 'Trailer' && video.site === 'YouTube'); - if (trailer) { - document.getElementById('trailerButton').style.display = 'block'; - globalTrailerKey = trailer.key; - } - - hideSpinner(); - } - catch (error) { - document.getElementById('movie-details-container').innerHTML = ` -
-

TV series details not found - Try again with another TV series

-
`; - console.log('Error fetching TV series details:', error); - hideSpinner(); - } -} - -async function fetchTVRatings(imdbId) { - const omdbCode = `${getMovieCode2()}`; - const omdb = `https://${getMovieActor()}/?i=${imdbId}&${getMovieName()}${omdbCode}`; - - try { - const response = await fetch(omdb); - const data = await response.json(); - - let imdbRating = data.imdbRating ? data.imdbRating : 'N/A'; - - return imdbRating; - } - catch (error) { - console.log('Error fetching TV series ratings:', error); - return 'N/A'; - } -} - -function getLanguageName(code) { - const language = twoLetterLangCodes.find(lang => lang.code === code); - return language ? language.name : 'Unknown Language'; -} - -function getCountryName(code) { - const regionNames = new Intl.DisplayNames(['en'], {type: 'region'}); - return regionNames.of(code); -} - -async function populateTvSeriesDetails(tvSeries, imdbRating) { - const title = tvSeries.name || 'Title not available'; - document.getElementById('movie-title').textContent = title; - document.title = tvSeries.name + " - TV Series Details"; - - const posterPath = tvSeries.poster_path ? `https://image.tmdb.org/t/p/w1280${tvSeries.poster_path}` : 'path/to/default/poster.jpg'; - document.getElementById('movie-image').src = posterPath; - document.getElementById('movie-image').alt = `Poster of ${title}`; - - let detailsHTML = `

Overview: ${tvSeries.overview || 'Overview not available.'}

`; - - detailsHTML += `

Tagline: ${tvSeries.tagline || 'Not available'}

`; - - const genres = tvSeries.genres && tvSeries.genres.length ? tvSeries.genres.map(genre => genre.name).join(', ') : 'Genres not available'; - detailsHTML += `

Genres: ${genres}

`; - - detailsHTML += `

First Air Date: ${tvSeries.first_air_date || 'Not available'}

`; - - detailsHTML += `

Last Air Date: ${tvSeries.last_air_date || 'Not available'}

`; - - detailsHTML += `

Status: ${tvSeries.status || 'Not available'}

`; - - const networks = tvSeries.networks && tvSeries.networks.length ? tvSeries.networks.map(network => network.name).join(', ') : 'Information not available'; - detailsHTML += `

Networks: ${networks}

`; - - const voteAverage = tvSeries.vote_average ? tvSeries.vote_average.toFixed(1) : 'N/A'; - const voteCount = tvSeries.vote_count ? tvSeries.vote_count.toLocaleString() : 'N/A'; - detailsHTML += `

User Rating: ${(voteAverage / 2).toFixed(1)}/5.0 (based on ${voteCount} votes)

`; - - if (tvSeries.external_ids && tvSeries.external_ids.imdb_id) { - const imdbId = tvSeries.external_ids.imdb_id; - const imdbUrl = `https://www.imdb.com/title/${imdbId}/`; - detailsHTML += `

IMDb Rating: ${imdbRating}

`; - } - else { - detailsHTML += `

IMDb Rating: N/A

`; - } - - const homepage = tvSeries.homepage ? `Visit` : 'Not available'; - detailsHTML += `

Homepage: ${homepage}

`; - - if (tvSeries.created_by && tvSeries.created_by.length) { - const creatorsLinks = tvSeries.created_by.map(creator => - `${creator.name}` - ).join(', '); - detailsHTML += `

Directors: ${creatorsLinks}

`; - } - else { - detailsHTML += `

Directors: Information not available

`; - } - - if (tvSeries.credits && tvSeries.credits.cast && tvSeries.credits.cast.length) { - let castHTML = tvSeries.credits.cast.slice(0, 100).map(castMember => { - return `${castMember.name}`; - }).join(', '); - detailsHTML += `

Cast: ${castHTML}

`; - } - else { - detailsHTML += `

Cast: Information not available

`; - } - - if (tvSeries.production_companies && tvSeries.production_companies.length) { - let companiesHTML = tvSeries.production_companies.map(company => { - return `${company.name}`; - }).join(', '); - detailsHTML += `

Production Companies: ${companiesHTML}

`; - } - else { - detailsHTML += `

Production Companies: Information not available

`; - } - - if (tvSeries.similar && tvSeries.similar.results && tvSeries.similar.results.length) { - let similarTVHTML = tvSeries.similar.results.slice(0, 5).map(similarTv => { - return `${similarTv.name}`; - }).join(', '); - detailsHTML += `

Similar TV Series: ${similarTVHTML}

`; - } - else { - detailsHTML += `

Similar TV Series: Information not available

`; - } - - detailsHTML += `

Seasons: ${tvSeries.number_of_seasons || 0}, Episodes: ${tvSeries.number_of_episodes || 0}

`; - - if (tvSeries.origin_country && tvSeries.origin_country.length > 0) { - const countryNames = tvSeries.origin_country.map(code => getCountryName(code)).join(', '); - detailsHTML += `

Country of Origin: ${countryNames}

`; - } - else { - detailsHTML += `

Country of Origin: Information not available

`; - } - - const languageName = getLanguageName(tvSeries.original_language); - detailsHTML += `

Original Language: ${languageName}

`; - - if (tvSeries.last_episode_to_air) { - detailsHTML += `

Last Episode: ${tvSeries.last_episode_to_air.name || 'Title not available'} - "${tvSeries.last_episode_to_air.overview || 'Overview not available.'}"

`; - } - - const tvSeriesTitleEncoded = encodeURIComponent(title); - const streamingProviders = await fetchTvSeriesStreamingLinks(tvSeries.id); - const streamingHTML = streamingProviders.length > 0 ? streamingProviders.map(provider => { - let providerLink = `https://www.google.com/search?q=watch+${tvSeriesTitleEncoded}+on+${encodeURIComponent(provider.provider_name)}`; - switch(provider.provider_name.toLowerCase()) { - case 'netflix': - providerLink = `https://www.netflix.com/search?q=${tvSeriesTitleEncoded}`; - break; - case 'disney plus': - providerLink = `https://www.disneyplus.com/search?q=${tvSeriesTitleEncoded}`; - break; - case 'hbo max': - providerLink = `https://www.hbomax.com/search?q=${tvSeriesTitleEncoded}`; - break; - case 'hulu': - providerLink = `https://www.hulu.com/search?q=${tvSeriesTitleEncoded}`; - break; - case 'amazon prime video': - providerLink = `https://www.amazon.com/s?k=${tvSeriesTitleEncoded}`; - break; - case 'apple tv plus': - providerLink = `https://tv.apple.com/search?term=${tvSeriesTitleEncoded}`; - break; - case 'stan': - providerLink = `https://www.stan.com.au/search?q=${tvSeriesTitleEncoded}`; - break; - case 'player': - providerLink = `https://player.pl/szukaj?search=${tvSeriesTitleEncoded}`; - break; - } - - return ` - ${provider.provider_name} - `; - }).join('') + ` - JustWatch - ` : 'No streaming options available.'; - - detailsHTML += `

Streaming Options: ${streamingHTML}

`; - - if (tvSeries.keywords && tvSeries.keywords.results && tvSeries.keywords.results.length) { - let keywordsHTML = tvSeries.keywords.results.map(keyword => keyword.name).join(', '); - detailsHTML += `

Keywords: ${keywordsHTML}

`; - } - else { - detailsHTML += `

Keywords: Information not available

`; - } - - document.getElementById('movie-description').innerHTML = detailsHTML; -} - -async function fetchTvSeriesStreamingLinks(tvSeriesId) { - const url = `https://${getMovieVerseData()}/3/tv/${tvSeriesId}/watch/providers?${generateMovieNames()}${getMovieCode()}`; - try { - const response = await fetch(url); - const data = await response.json(); - const results = data.results || {}; - let providersMap = {}; - - Object.values(results).forEach(region => { - if (region.flatrate) { - region.flatrate.forEach(provider => { - providersMap[provider.provider_id] = provider; - }); - } - }); - - return Object.values(providersMap).slice(0, 7); - } catch (error) { - console.error('Error fetching TV series streaming links:', error); - return []; - } -} - -function selectActorId(actorId) { - localStorage.setItem('selectedActorId', actorId); - window.location.href = 'actor-details.html' -} - -function selectTvSeriesId(tvSeriesId) { - localStorage.setItem('selectedTvSeriesId', tvSeriesId); - window.location.href = 'tv-details.html'; -} - -function selectCompanyId(companyId) { - localStorage.setItem('selectedCompanyId', companyId); - window.location.href = 'company-details.html'; -} - -function showSpinner() { - document.getElementById('myModal').classList.add('modal-visible'); -} - -function hideSpinner() { - document.getElementById('myModal').classList.remove('modal-visible'); -} - -function handleCreatorClick(creatorId) { - localStorage.setItem('selectedDirectorId', creatorId); - window.location.href = 'director-details.html'; -} - -document.addEventListener('DOMContentLoaded', () => { - const tvSeriesId = localStorage.getItem('selectedTvSeriesId'); - if (tvSeriesId) { - fetchTvDetails(tvSeriesId); - } - else { - fetchTvDetails(100088); - } - - document.getElementById('clear-search-btn').style.display = 'none'; - - const savedRatings = JSON.parse(localStorage.getItem('movieRatings')) || {}; - const movieRating = savedRatings[tvSeriesId] || 0; - setStarRating(movieRating); -}); - -document.addEventListener('DOMContentLoaded', () => { - document.getElementById('trailerButton').addEventListener('click', () => { - const trailerContainer = document.getElementById('trailerContainer'); - const isOpen = trailerContainer.style.maxHeight !== '0px'; - - if (isOpen) { - trailerContainer.style.maxHeight = '0'; - } - else { - const trailerIframe = ``; - trailerContainer.innerHTML = trailerIframe; - trailerContainer.style.maxWidth = '400px'; - trailerContainer.style.maxHeight = '315px'; - trailerContainer.style.borderRadius = '8px'; - } - }); -}); - -async function showMovieOfTheDay() { - const year = new Date().getFullYear(); - const url = `https://${getMovieVerseData()}/3/discover/movie?${generateMovieNames()}${getMovieCode()}&sort_by=vote_average.desc&vote_count.gte=100&primary_release_year=${year}&vote_average.gte=7`; - - try { - const response = await fetch(url); - const data = await response.json(); - const movies = data.results; - - if (movies.length > 0) { - const randomMovie = movies[Math.floor(Math.random() * movies.length)]; - localStorage.setItem('selectedMovieId', randomMovie.id); - window.location.href = 'movie-details.html'; - } - else { - fallbackMovieSelection(); - } - } - catch (error) { - console.log('Error fetching movie:', error); - fallbackMovieSelection(); - } -} - -function fallbackMovieSelection() { - const fallbackMovies = [432413, 299534, 1726, 562, 118340, 455207, 493922, 447332, 22970, 530385, 27205, 264660, 120467, 603, 577922, 76341, 539, 419704, 515001, 118340, 424, 98]; - const randomFallbackMovie = fallbackMovies[Math.floor(Math.random() * fallbackMovies.length)]; - localStorage.setItem('selectedMovieId', randomFallbackMovie); - window.location.href = 'movie-details.html'; -} - -function applySettings() { - const savedBg = localStorage.getItem('backgroundImage'); - const savedTextColor = localStorage.getItem('textColor'); - const savedFontSize = localStorage.getItem('fontSize'); - - if (savedBg) { - document.body.style.backgroundImage = `url('${savedBg}')`; - } - if (savedTextColor) { - applyTextColor(savedTextColor); - } - if (savedFontSize) { - const size = savedFontSize === 'small' ? '12px' : savedFontSize === 'medium' ? '16px' : '20px'; - document.body.style.fontSize = size; - } -} - -function getMovieCode2() { - const encodedKey = "MmJhOGU1MzY="; - return atob(encodedKey); -} - -function getMovieName() { - const moviename = "YXBpa2V5PQ=="; - return atob(moviename); -} - -function getMovieActor() { - const actor = "d3d3Lm9tZGJhcGkuY29t"; - return atob(actor); -} - -function applyTextColor(color) { - document.querySelectorAll('h1, h2, h3, p, a, span, div, button, input, select, textarea, label, li') - .forEach(element => { - element.style.color = color; - }); -} - -function updateBrowserURL(title) { - const nameSlug = createNameSlug(title); - const newURL = window.location.protocol + "//" + window.location.host + window.location.pathname + '?' + nameSlug; - window.history.replaceState({ path: newURL }, '', newURL); -} - -function createNameSlug(title) { - return title.toLowerCase().replace(/ /g, '-').replace(/[^\w-]/g, ''); -} \ No newline at end of file diff --git a/MovieVerse-Mobile/platforms/ios/www/images/js/user-profile.js b/MovieVerse-Mobile/platforms/ios/www/images/js/user-profile.js deleted file mode 100644 index e4b71556..00000000 --- a/MovieVerse-Mobile/platforms/ios/www/images/js/user-profile.js +++ /dev/null @@ -1,569 +0,0 @@ -import { initializeApp } from "https://www.gstatic.com/firebasejs/10.8.0/firebase-app.js"; -import { getFirestore, doc, getDoc, setDoc, query, collection, where, getDocs, serverTimestamp, deleteDoc } from "https://www.gstatic.com/firebasejs/10.8.0/firebase-firestore.js"; -import { getStorage, ref, uploadBytes, getDownloadURL, deleteObject } from "https://www.gstatic.com/firebasejs/10.8.0/firebase-storage.js"; - -function showSpinner() { - document.getElementById('myModal').classList.add('modal-visible'); -} - -function hideSpinner() { - document.getElementById('myModal').classList.remove('modal-visible'); -} - -function translateFBC(value) { - return atob(value); -} - -function getFBConfig1() { - const fbConfig1 = "QUl6YVN5REw2a1FuU2ZVZDhVdDhIRnJwS3VpdnF6MXhkWG03aw=="; - return translateFBC(fbConfig1); -} - -function getFBConfig2() { - const fbConfig2 = "bW92aWV2ZXJzZS1hcHAuZmlyZWJhc2VhcHAuY29t"; - return translateFBC(fbConfig2); -} - -function getFBConfig3() { - const fbConfig3 = "bW92aWV2ZXJzZS1hcHAuYXBwc3BvdC5jb20="; - return translateFBC(fbConfig3); -} - -function getFBConfig4() { - const fbConfig4 = "ODAyOTQzNzE4ODcx"; - return translateFBC(fbConfig4); -} - -function getFBConfig5() { - const fbConfig5 = "MTo4MDI5NDM3MTg4NzE6d2ViOjQ4YmM5MTZjYzk5ZTI3MjQyMTI3OTI="; - return translateFBC(fbConfig5); -} - -const firebaseConfig = { - apiKey: getFBConfig1(), - authDomain: getFBConfig2(), - projectId: "movieverse-app", - storageBucket: getFBConfig3(), - messagingSenderId: getFBConfig4(), - appId: getFBConfig5() -}; - -const app = initializeApp(firebaseConfig); -const db = getFirestore(app); - -document.addEventListener('DOMContentLoaded', function() { - handleProfileDisplay(); - setupEventListeners(); - setupSearchListeners(); -}); - -function handleProfileDisplay() { - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - const userEmail = localStorage.getItem('currentlySignedInMovieVerseUser'); - const welcomeMessage = document.getElementById('welcomeMessage'); - const signInPrompt = document.getElementById('signInPrompt'); - const viewMyProfileBtn = document.getElementById('viewMyProfileBtn'); - const profileContainer = document.getElementById('profileContainer'); - profileContainer.style.display = 'none'; - - showSpinner(); - - if (isSignedIn && userEmail) { - loadProfile(userEmail); - viewMyProfileBtn.disabled = false; - viewMyProfileBtn.style.display = 'block'; - } - else { - welcomeMessage.textContent = 'Please sign in to view your profile'; - signInPrompt.style.display = 'block'; - viewMyProfileBtn.disabled = true; - viewMyProfileBtn.style.display = 'none'; - } - - document.getElementById('viewMyProfileBtn').addEventListener('click', () => { - loadCurrentUserProfile(); - }); - - function loadCurrentUserProfile() { - const currentUserEmail = localStorage.getItem('currentlySignedInMovieVerseUser'); - if (currentUserEmail) { - loadProfile(currentUserEmail); - } - else { - console.error("No user is currently signed in"); - } - } - - hideSpinner(); -} - -function setupSearchListeners() { - try { - const searchUserInput = document.getElementById('searchUserInput'); - const searchUserResults = document.getElementById('searchUserResults'); - - searchUserInput.addEventListener('input', () => { - const searchText = searchUserInput.value.trim(); - if (searchText) { - performSearch(searchText); - } - else { - searchUserResults.innerHTML = ''; - searchUserResults.style.display = 'none'; - } - }); - } - catch (error) { - console.error("Error fetching user list: ", error); - if (error.code === 'resource-exhausted') { - const noUserSelected = document.getElementById('profileContainer'); - if (noUserSelected) { - noUserSelected.innerHTML = "Sorry, our database is currently overloaded. Please try reloading once more, and if that still doesn't work, please try again in a couple hours. For full transparency, we are currently using a database that has a limited number of reads and writes per day due to lack of funding. Thank you for your patience as we work on scaling our services. At the mean time, feel free to use other MovieVerse features!"; - noUserSelected.style.height = '350px'; - } - } - } -} - -async function performSearch(searchText) { - try { - const searchUserResults = document.getElementById('searchUserResults'); - showSpinner(); - - const userQuery = query(collection(db, 'profiles'), where('username', '>=', searchText)); - const querySnapshot = await getDocs(userQuery); - - searchUserResults.innerHTML = ''; - - if (querySnapshot.empty) { - searchUserResults.innerHTML = `
No User with Username "${searchText}" found
`; - searchUserResults.style.display = 'block'; - } else { - searchUserResults.style.display = 'block'; - querySnapshot.forEach((doc) => { - const user = doc.data(); - const userDiv = document.createElement('div'); - userDiv.className = 'user-search-result'; - userDiv.style.cursor = 'pointer'; - userDiv.addEventListener('click', () => loadProfile(doc.id)); - - const img = document.createElement('img'); - img.src = user.profileImage || '../../images/user-default.png'; - img.style.width = '33%'; - img.style.borderRadius = '8px'; - userDiv.appendChild(img); - - const textDiv = document.createElement('div'); - textDiv.style.width = '67%'; - textDiv.style.textAlign = 'left'; - textDiv.innerHTML = `${user.username}

${user.bio || ''}

`; - userDiv.appendChild(textDiv); - - searchUserResults.appendChild(userDiv); - }); - } - - hideSpinner(); - } - catch (error) { - console.error("Error fetching user list: ", error); - if (error.code === 'resource-exhausted') { - const noUserSelected = document.getElementById('search-users-container'); - if (noUserSelected) { - noUserSelected.innerHTML = "Sorry, our database is currently overloaded. Please try reloading once more, and if that still doesn't work, please try again in a couple hours. For full transparency, we are currently using a database that has a limited number of reads and writes per day due to lack of funding. Thank you for your patience as we work on scaling our services. At the mean time, feel free to use other MovieVerse features!"; - noUserSelected.style.height = '350px'; - } - hideSpinner(); - } - } -} - -async function loadProfile(userEmail = localStorage.getItem('currentlySignedInMovieVerseUser')) { - try { - showSpinner(); - - document.getElementById('viewMyProfileBtn').disabled = false; - - if (!userEmail) return; - - const welcomeMessage = document.getElementById('welcomeMessage'); - const profileContainer = document.getElementById('profileContainer'); - const changeProfileImageBtn = document.getElementById('changeProfileImageBtn'); - const editProfileBtn = document.getElementById('editProfileBtn'); - const removeProfileImageBtn = document.getElementById('removeProfileImage'); - const profileImage = document.getElementById('profileImage'); - - if (userEmail !== localStorage.getItem('currentlySignedInMovieVerseUser') || !localStorage.getItem('currentlySignedInMovieVerseUser') || !JSON.parse(localStorage.getItem('isSignedIn'))) { - changeProfileImageBtn.style.display = 'none'; - editProfileBtn.style.display = 'none'; - profileImage.removeAttribute('onclick'); - profileImage.style.cursor = 'default'; - profileImage.title = 'Sign in to change profile image'; - } else { - changeProfileImageBtn.style.display = ''; - editProfileBtn.style.display = ''; - profileImage.setAttribute('onclick', 'document.getElementById("imageUpload").click()'); - profileImage.style.cursor = 'pointer'; - profileImage.title = 'Click to change profile image'; - } - - profileContainer.style.display = 'block'; - - const docRef = doc(db, 'profiles', userEmail); - const isSignedIn = JSON.parse(localStorage.getItem('isSignedIn')) || false; - const currentUserEmail = localStorage.getItem('currentlySignedInMovieVerseUser'); - - let followUnfollowBtn = document.getElementById('followUnfollowBtn'); - if (!followUnfollowBtn) { - followUnfollowBtn = document.createElement('button'); - followUnfollowBtn.id = 'followUnfollowBtn'; - followUnfollowBtn.style.width = '100%'; - profileContainer.appendChild(followUnfollowBtn); - } - - if (currentUserEmail && userEmail !== currentUserEmail && isSignedIn) { - const followingRef = doc(db, 'profiles', currentUserEmail, 'following', userEmail); - const followersRef = doc(db, 'profiles', userEmail, 'followers', currentUserEmail); - - const followSnap = await getDoc(followingRef); - const isFollowing = followSnap.exists(); - - followUnfollowBtn.textContent = isFollowing ? 'Unfollow' : 'Follow'; - followUnfollowBtn.style.display = 'block'; - - followUnfollowBtn.onclick = async () => { - if (isFollowing) { - await deleteDoc(followingRef); - await deleteDoc(followersRef); - followUnfollowBtn.textContent = 'Follow'; - } else { - const timestamp = serverTimestamp(); - await setDoc(followingRef, {timestamp: timestamp}); - await setDoc(followersRef, {timestamp: timestamp}); - followUnfollowBtn.textContent = 'Unfollow'; - } - }; - } else { - followUnfollowBtn.style.display = 'none'; - } - - try { - const docSnap = await getDoc(docRef); - let profile = { - username: 'N/A', - dob: 'N/A', - bio: 'N/A', - favoriteGenres: 'N/A', - location: 'N/A', - favoriteMovie: 'N/A', - hobbies: 'N/A', - favoriteActor: 'N/A', - favoriteDirector: 'N/A', - personalQuote: 'N/A', - profileImage: '../../images/user-default.png' - }; - - if (docSnap.exists()) { - profile = {...profile, ...docSnap.data()}; - const imageUrl = profile.profileImage || '../../images/user-default.png'; - document.getElementById('profileImage').src = imageUrl; - - if (userEmail !== localStorage.getItem('currentlySignedInMovieVerseUser') || !localStorage.getItem('currentlySignedInMovieVerseUser') || !JSON.parse(localStorage.getItem('isSignedIn')) || profile.profileImage === '../../images/user-default.png') { - removeProfileImageBtn.style.display = 'none'; - } else { - removeProfileImageBtn.style.display = 'inline'; - } - - document.getElementById('usernameDisplay').innerHTML = `Username: ${profile.username}`; - document.getElementById('dobDisplay').innerHTML = `Date of Birth: ${profile.dob}`; - document.getElementById('bioDisplay').innerHTML = `Bio: ${profile.bio}`; - document.getElementById('favoriteGenresDisplay').innerHTML = `Favorite Genres: ${profile.favoriteGenres}`; - document.getElementById('locationDisplay').innerHTML = `Location: ${profile.location}`; - document.getElementById('favoriteMovieDisplay').innerHTML = `Favorite Movie: ${profile.favoriteMovie}`; - document.getElementById('hobbiesDisplay').innerHTML = `Hobbies: ${profile.hobbies}`; - document.getElementById('favoriteActorDisplay').innerHTML = `Favorite Actor: ${profile.favoriteActor}`; - document.getElementById('favoriteDirectorDisplay').innerHTML = `Favorite Director: ${profile.favoriteDirector}`; - document.getElementById('personalQuoteDisplay').innerHTML = `Personal Quote: ${profile.personalQuote}`; - window.document.title = `${profile.username !== 'N/A' ? profile.username : 'User'}'s Profile - The MovieVerse`; - - if (userEmail === localStorage.getItem('currentlySignedInMovieVerseUser')) { - welcomeMessage.textContent = `Welcome, ${profile.username}!`; - } else { - welcomeMessage.textContent = `Viewing ${profile.username}'s profile`; - } - - await displayUserList('following', userEmail); - await displayUserList('followers', userEmail); - } - else { - console.log("No such profile exists!"); - } - } - catch (error) { - if (error.code === 'resource-exhausted') { - const noUserSelected = document.getElementById('profileContainer'); - if (noUserSelected) { - noUserSelected.innerHTML = "Sorry, our database is currently overloaded. Please try reloading once more, and if that still doesn't work, please try again in a couple hours. For full transparency, we are currently using a database that has a limited number of reads and writes per day due to lack of funding. Thank you for your patience as we work on scaling our services. At the mean time, feel free to use other MovieVerse features!"; - noUserSelected.style.height = '350px'; - } - hideSpinner(); - } - - document.getElementById('viewMyProfileBtn').disabled = true; - } - - hideSpinner(); - } - catch (error) { - console.error("Error fetching user list: ", error); - if (error.code === 'resource-exhausted') { - const noUserSelected = document.getElementById('profileContainer'); - if (noUserSelected) { - noUserSelected.innerHTML = "Sorry, our database is currently overloaded. Please try reloading once more, and if that still doesn't work, please try again in a couple hours. For full transparency, we are currently using a database that has a limited number of reads and writes per day due to lack of funding. Thank you for your patience as we work on scaling our services. At the mean time, feel free to use other MovieVerse features!"; - noUserSelected.style.height = '350px'; - } - hideSpinner(); - } - - document.getElementById('viewMyProfileBtn').disabled = true; - } -} - -async function displayUserList(listType, userEmail) { - showSpinner(); - - const db = getFirestore(); - const listRef = collection(db, 'profiles', userEmail, listType); - const snapshot = await getDocs(listRef); - const userListSpan = document.getElementById(`${listType}List`); - - userListSpan.innerHTML = ''; - - if (snapshot.empty) { - userListSpan.textContent = 'N/A'; - } - else { - for (let docSnapshot of snapshot.docs) { - const userRef = doc(db, 'profiles', docSnapshot.id); - const userSnap = await getDoc(userRef); - if (userSnap.exists()) { - const userData = userSnap.data(); - - const userLink = document.createElement('a'); - userLink.textContent = userData.username; - userLink.href = '#'; - userLink.id = "userLink" - userLink.style.cursor = 'pointer'; - userLink.onclick = () => loadProfile(docSnapshot.id); - - userListSpan.appendChild(userLink); - userListSpan.appendChild(document.createTextNode(', ')); - } - } - - if (userListSpan.lastChild) { - userListSpan.removeChild(userListSpan.lastChild); - } - } - - hideSpinner(); -} - -async function saveProfileChanges() { - const userEmail = localStorage.getItem('currentlySignedInMovieVerseUser'); - if (!userEmail) return; - - const profileRef = doc(db, 'profiles', userEmail); - const currentDoc = await getDoc(profileRef); - const currentProfile = currentDoc.exists() ? currentDoc.data() : null; - - const newUsername = document.getElementById('editUsername').value.trim(); - - if (currentProfile && currentProfile.username && currentProfile.username !== 'N/A' && !newUsername) { - alert("You cannot delete your username. Please enter a valid username."); - document.getElementById('editUsername').value = currentProfile.username; - return; - } - - const profile = { - username: newUsername || currentProfile.username, - dob: document.getElementById('editDob').value, - bio: document.getElementById('editBio').value, - favoriteGenres: document.getElementById('editFavoriteGenres').value.split(',').map(genre => genre.trim()), - location: document.getElementById('editLocation').value, - favoriteMovie: document.getElementById('editFavoriteMovie').value, - hobbies: document.getElementById('editHobbies').value.split(',').map(hobby => hobby.trim()), - favoriteActor: document.getElementById('editFavoriteActor').value, - favoriteDirector: document.getElementById('editFavoriteDirector').value, - personalQuote: document.getElementById('editPersonalQuote').value, - }; - - try { - await setDoc(profileRef, profile, { merge: true }); - console.log("Profile updated successfully."); - closeModal(); - loadProfile(); - } - catch (error) { - console.log("Error updating profile: ", error); - } -} - -async function removeProfileImage() { - const userEmail = localStorage.getItem('currentlySignedInMovieVerseUser'); - if (!userEmail) return; - - const defaultImageUrl = '../../images/user-default.png'; - - try { - await setDoc(doc(db, 'profiles', userEmail), { profileImage: defaultImageUrl }, { merge: true }); - - document.getElementById('profileImage').src = defaultImageUrl; - document.getElementById('removeProfileImage').style.display = 'none'; - - console.log('Profile image reset to default successfully'); - } - catch (error) { - console.log("Error removing image: ", error); - } -} - -async function uploadImage() { - const userEmail = localStorage.getItem('currentlySignedInMovieVerseUser'); - if (!userEmail) { - alert("You're not signed in."); - return; - } - - const fileInput = document.getElementById('imageUpload'); - const file = fileInput.files[0]; - if (!file) { - alert('No file selected. Please choose an image.'); - return; - } - - try { - const base64Image = await resizeImageAndConvertToBase64(file, 1024, 1024); - - await setDoc(doc(db, 'profiles', userEmail), { profileImage: base64Image }, { merge: true }); - - document.getElementById('profileImage').src = base64Image; - console.log('Image processed and Firestore updated'); - window.location.reload(); - } - catch (error) { - console.log("Error during image processing:", error); - alert('Error during image processing: ' + error.message); - } -} - -function resizeImageAndConvertToBase64(file, maxWidth, maxHeight) { - return new Promise((resolve, reject) => { - const reader = new FileReader(); - reader.onload = (e) => { - const img = new Image(); - img.onload = () => { - const canvas = document.createElement('canvas'); - let width = img.width; - let height = img.height; - - if (width > height) { - if (width > maxWidth) { - height *= maxWidth / width; - width = maxWidth; - } - } - else { - if (height > maxHeight) { - width *= maxHeight / height; - height = maxHeight; - } - } - - canvas.width = width; - canvas.height = height; - const ctx = canvas.getContext('2d'); - ctx.drawImage(img, 0, 0, width, height); - const dataUrl = canvas.toDataURL('image/jpeg', 0.7); - resolve(dataUrl); - }; - img.src = e.target.result; - }; - reader.onerror = error => reject(error); - reader.readAsDataURL(file); - }); -} - -function setupEventListeners() { - document.getElementById('saveChanges').addEventListener('click', async () => { - await saveProfileChanges(); - }); - - document.getElementById('cancelEdit').addEventListener('click', () => { - closeModal(); - }); - - const imageUploadInput = document.getElementById('imageUpload'); - imageUploadInput.addEventListener('change', uploadImage); - - document.getElementById('editProfileBtn').addEventListener('click', async () => { - const userEmail = localStorage.getItem('currentlySignedInMovieVerseUser'); - if (!userEmail) { - alert("You're not signed in."); - return; - } - - try { - const docRef = doc(db, 'profiles', userEmail); - const docSnap = await getDoc(docRef); - - let profile = { - username: 'N/A', - dob: '', - bio: 'N/A', - favoriteGenres: [], - location: 'N/A', - favoriteMovie: 'N/A', - hobbies: ['N/A'], - favoriteActor: 'N/A', - favoriteDirector: 'N/A', - personalQuote: 'N/A', - profileImage: '../../images/user-default.png' - }; - - if (docSnap.exists()) { - profile = docSnap.data(); - profile.hobbies = profile.hobbies.length > 0 ? profile.hobbies : ['N/A']; - } - - document.getElementById('editUsername').value = profile.username; - document.getElementById('editDob').value = profile.dob; - const defaultDOB = new Date(); - defaultDOB.setFullYear(defaultDOB.getFullYear() - 18); - const defaultDOBString = defaultDOB.toISOString().split('T')[0]; - - document.getElementById('editDob').value = profile.dob || defaultDOBString; - document.getElementById('editBio').value = profile.bio; - document.getElementById('editFavoriteGenres').value = profile.favoriteGenres.join(', '); - document.getElementById('editLocation').value = profile.location; - document.getElementById('editFavoriteMovie').value = profile.favoriteMovie; - document.getElementById('editHobbies').value = profile.hobbies.join(', '); - document.getElementById('editFavoriteActor').value = profile.favoriteActor; - document.getElementById('editFavoriteDirector').value = profile.favoriteDirector; - document.getElementById('editPersonalQuote').value = profile.personalQuote; - document.getElementById('profileImage').src = profile.profileImage || '../../images/user-default.png'; - document.getElementById('editProfileModal').style.display = 'block'; - } - catch (error) { - console.log("Error accessing Firestore: ", error); - } - }); - - document.getElementById('imageUpload').addEventListener('change', async () => { - await uploadImage(); - }); - - document.getElementById('removeProfileImage').addEventListener('click', async () => { - await removeProfileImage(); - }); -} diff --git a/MovieVerse-Mobile/platforms/ios/www/index.html b/MovieVerse-Mobile/platforms/ios/www/index.html index d1fe300f..f6aaeae2 100644 --- a/MovieVerse-Mobile/platforms/ios/www/index.html +++ b/MovieVerse-Mobile/platforms/ios/www/index.html @@ -338,6 +338,11 @@ color: white !important; } + #githubLink:hover { + color: #ff8623 !important; + transition: 0.1s ease-in; + } + #githubLink7 { color: white !important; } @@ -584,7 +589,7 @@

Global Hits: Popular Movies Worldwide

-

Displaying ads helps us maintain our websites, servers, and databases to provide you with free services. Submit your feedback if you find the ad inappropriate or irrelevant.

+

Displaying ads helps us maintain our websites, servers, and databases to provide you with free services. Submit your feedback if you find the ad inappropriate or irrelevant.

+

Cinematic Excellence: Trending Vietnamese Movies

@@ -669,7 +687,7 @@

Cinematic Excellence: Trending Vietnamese data-ad-client="ca-pub-6608388491200814" data-ad-slot="4832732030" data-ad-format="auto"> -

Displaying ads helps us maintain our websites, servers, and databases to provide you with free services. Submit your feedback if you find the ad inappropriate or irrelevant.

+

Displaying ads helps us maintain our websites, servers, and databases to provide you with free services. Submit your feedback if you find the ad inappropriate or irrelevant.