diff --git a/dirs/games_portal/html/games.html b/dirs/games_portal/html/games.html new file mode 100644 index 0000000..3b44828 --- /dev/null +++ b/dirs/games_portal/html/games.html @@ -0,0 +1,46 @@ + + + + + + Games Portal + + + + +
+
+ Game 1 +

Game 1

+

Description of Game 1.

+
+

BATTLEGROUNDS for free. Land on strategic locations, loot weapons and supplies, and survive to become the last team standing across various, diverse Battlegrounds. Squad up and join the Battlegrounds for the original Battle Royale experience that only PUBG: BATTLEGROUNDS can offer. + +6/10 (2.3M) +Publishers: KRAFTON, Inc. +Developer: KRAFTON, Inc. +ReleaseData: Dec 21, 2017

+
+
+ Game 1 +

Game 2

+

Description of Game 2.

+
+

Ludo ( / ˈljuːdoʊ /; from Latin ludo ' [I] play') is a strategy board game for two to four [a] players, in which the players race their four tokens from start to finish according to the rolls of a single die. Like other cross and circle games, Ludo is derived from the Indian game Pachisi.

+
+
+ Game 1 +

Game 3

+

Description of Game 3.

+
+

Battlegrounds (previously known as PlayerUnknown's Battlegrounds) is a battle royale game developed by PUBG Studios and published by Krafton.

+
+
+ + + diff --git a/dirs/games_portal/html/index.html b/dirs/games_portal/html/index.html new file mode 100644 index 0000000..391d3ca --- /dev/null +++ b/dirs/games_portal/html/index.html @@ -0,0 +1,28 @@ + + + + + + Games Portal + + + + + +
+

Last News

+ Game 1 + Game 2 + Game 3 +
+ + + diff --git a/dirs/games_portal/index.html b/dirs/games_portal/html/location.html similarity index 59% rename from dirs/games_portal/index.html rename to dirs/games_portal/html/location.html index feb8056..7e5eb48 100644 --- a/dirs/games_portal/index.html +++ b/dirs/games_portal/html/location.html @@ -5,14 +5,28 @@ Games Portal + + + + + + +

Last News

Game 1 Game 2 Game 3
- diff --git a/dirs/games_portal/html/news.html b/dirs/games_portal/html/news.html new file mode 100644 index 0000000..7585044 --- /dev/null +++ b/dirs/games_portal/html/news.html @@ -0,0 +1,30 @@ + + + + + + + +
+ +
+

News 1

+

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

+
+
+

News 2

+

Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

+
+ +
+ + + diff --git a/dirs/games_portal/html/reviews.html b/dirs/games_portal/html/reviews.html new file mode 100644 index 0000000..ccf4324 --- /dev/null +++ b/dirs/games_portal/html/reviews.html @@ -0,0 +1,36 @@ + + + + + + Games Portal + + + + +
+ +
+

Review 1

+

PUBG grows with our users and the great community so we have many channels to provide suggestions and feedback about the game. Along with our support center here, you can also voice your opinions on our official Twitter, Facebook, Discord and other community channels

+
+
+

Review 2

+

Ludo King Game Review Ludo King has become a trending game now, due to the lock down. Everyone are at home, and it’s interesting to note that things which were not so much of concern or interest to people are now becoming popular.

+
+
+

Review 2

+

The Star Ocean franchise has been an underappreciated one within the Japanese RPG genre. Despite being around for more than 25 years, it's never had the breakout success that elevated it to new heights, as something like Persona or Tales have had in more recent years. Many longtime fans consider 1999's Star Ocean: The Second Story to be the best entry, and now Square Enix has remade it for modern consoles. Star Ocean: The Second Story R is a remake that manages to not only have the retro feel of its older PS1 and PSP incarnations, but also make it feel fresh with new battle mechanics, as well as audio and visuals updates. It may not be the big break that’ll finally make the Star Ocean franchise explode in popularity, but it’s a fine Japanese RPG on its own terms.

+
+ +
+ + + diff --git a/dirs/games_portal/images/game1.jpg b/dirs/games_portal/images/game1.jpg new file mode 100644 index 0000000..77d8662 Binary files /dev/null and b/dirs/games_portal/images/game1.jpg differ diff --git a/dirs/games_portal/images/game2.jpg b/dirs/games_portal/images/game2.jpg new file mode 100644 index 0000000..c32c599 Binary files /dev/null and b/dirs/games_portal/images/game2.jpg differ diff --git a/dirs/games_portal/images/game3.jpg b/dirs/games_portal/images/game3.jpg new file mode 100644 index 0000000..2403491 Binary files /dev/null and b/dirs/games_portal/images/game3.jpg differ diff --git a/dirs/games_portal/js/javascript.js b/dirs/games_portal/js/javascript.js index 4455344..2a844fe 100644 --- a/dirs/games_portal/js/javascript.js +++ b/dirs/games_portal/js/javascript.js @@ -1,3 +1,16 @@ +// Function to highlight the active navigation link +function highlightNavLink(pageName) { + const navLinks = document.querySelectorAll('nav a'); + navLinks.forEach(link => { + if (link.getAttribute('href') === pageName) { + link.classList.add('active'); + } else { + link.classList.remove('active'); + } + }); +} + +// Function to handle common card highlighting function highlightCard(element) { element.style.boxShadow = "0 0 10px rgba(0, 0, 0, 0.1)"; } @@ -5,3 +18,50 @@ function highlightCard(element) { function unhighlightCard(element) { element.style.boxShadow = "none"; } +// Function to handle page-specific tasks +function handlePageTasks(locationData) { + const currentPath = window.location.pathname; + + // Highlight the active navigation link based on the current page + highlightNavLink(currentPath); + + if (locationData) { + personalizeContentWithLocation(locationData); + } +} + +// Call the function to handle page-specific tasks +handlePageTasks(); + +// Function to populate game listings +function populateGameList() { + const gameList = document.querySelector('.game-list'); + + const games = [ + { title: 'Game 1', description: 'Description of Game 1.', image: 'img/game1.jpg' }, + { title: 'Game 2', description: 'Description of Game 2.', image: 'img/game2.jpg' }, + { title: 'Game 3', description: 'Description of Game 3.', image: 'img/game3.jpg' }, + ]; + + games.forEach(game => { + const gameElement = document.createElement('div'); + gameElement.classList.add('game'); + gameElement.innerHTML = ` + ${game.title} +

${game.title}

+

${game.description}

+ `; + gameList.appendChild(gameElement); + }); +} + +// Function to handle page-specific tasks +function handlePageTasks() { + const currentPath = window.location.pathname; + + highlightNavLink(currentPath); + +} + +// Call the function to handle page-specific tasks +handlePageTasks(); diff --git a/dirs/games_portal/js/location.js b/dirs/games_portal/js/location.js new file mode 100644 index 0000000..cc1da89 --- /dev/null +++ b/dirs/games_portal/js/location.js @@ -0,0 +1,60 @@ +// location.js + +// Function to fetch user's IP address using ipify API +async function getUserIPAddress() { + try { + const response = await fetch('https://api.ipify.org?format=json'); + const data = await response.json(); + return data.ip; + } catch (error) { + console.error('Error fetching IP address:', error); + return null; + } + } + + // Function to fetch user's geographical coordinates using navigator.geolocation API + async function getUserGeolocation() { + return new Promise((resolve, reject) => { + if (navigator.geolocation) { + navigator.geolocation.getCurrentPosition( + position => { + const { latitude, longitude } = position.coords; + resolve({ latitude, longitude }); + }, + error => { + console.error('Error getting geolocation:', error); + reject(error); + } + ); + } else { + console.error('Geolocation is not supported by this browser.'); + reject('Geolocation not supported'); + } + }); + } + + // Function to handle the entire process of fetching IP and geolocation + async function getUserLocation() { + try { + const ipAddress = await getUserIPAddress(); + const geolocation = await getUserGeolocation(); + + if (ipAddress && geolocation) { + console.log('User IP Address:', ipAddress); + console.log('User Geographical Location:', geolocation); + + } else { + console.error('Unable to fetch user location.'); + } + } catch (error) { + console.error('Error:', error); + } + } + + // Call the function to initiate the process +getUserLocation().then(locationData => { + // After getting the location, call handlePageTasks with location data + handlePageTasks(locationData); + }); + + \ No newline at end of file