Skip to content

Commit

Permalink
Merge pull request #146 from AkierRaee/main
Browse files Browse the repository at this point in the history
Add Simplified Chinese as new multi-language support and fix missing green circles cursor
  • Loading branch information
Ctoic authored Nov 5, 2024
2 parents 0d0a627 + 685dc7d commit 350e770
Show file tree
Hide file tree
Showing 7 changed files with 183 additions and 10 deletions.
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,13 @@ MIT License
<sub><b>Aman Kumar</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/AkierRaee">
<img src="https://avatars.githubusercontent.com/u/151558456?v=4" width="100;" alt="AkierRaee"/>
<br />
<sub><b>Au Huishan</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/VaradJadhav">
<img src="https://avatars.githubusercontent.com/u/96735054?v=4" width="100;" alt="VaradJadhav"/>
Expand All @@ -151,15 +158,15 @@ MIT License
<sub><b>Siddharth Khandelwal</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/Tomkndn">
<img src="https://avatars.githubusercontent.com/u/105445488?v=4" width="100;" alt="Tomkndn"/>
<br />
<sub><b>Kundan Tamsoy</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/IngaleChinmay04">
<img src="https://avatars.githubusercontent.com/u/143017442?v=4" width="100;" alt="IngaleChinmay04"/>
Expand Down Expand Up @@ -195,15 +202,15 @@ MIT License
<sub><b>Prathmesh Modhe</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/Vedantjn">
<img src="https://avatars.githubusercontent.com/u/76029713?v=4" width="100;" alt="Vedantjn"/>
<br />
<sub><b>Nirmohi</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/aliabbasnagari">
<img src="https://avatars.githubusercontent.com/u/70366131?v=4" width="100;" alt="aliabbasnagari"/>
Expand Down
22 changes: 22 additions & 0 deletions adventures.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,28 @@
<body
class="bg-gray-900 text-gray-300 dark-theme d-flex flex-column min-vh-100"
>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div id="loader" class="spinner-container">
<div
class="spinner-border"
Expand Down
34 changes: 30 additions & 4 deletions fs.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,28 @@
<body
class="bg-gray-900 text-gray-300 dark-theme d-flex flex-column min-vh-100"
>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div id="loader" class="spinner-container">
<div
class="spinner-border"
Expand Down Expand Up @@ -129,6 +151,7 @@
<option value="en">English</option>
<option value="fr">Français</option>
<option value="es">Español</option>
<option value="zh">简体中文</option>
<!-- Ajoutez d'autres langues ici -->
</select>
</div>
Expand Down Expand Up @@ -252,12 +275,12 @@
/>
</div>
<!-- Book Details -->
<div class="mt-4">
<h1 class="text-2xl font-bold text-green-500">
<div class="mt-4" data-book="frankenstein">
<h1 class="text-2xl font-bold text-green-500" data-translate="title">
Frankestine
</h1>
<h3 class="text-lg mt-2">By Mary Shelby</h3>
<p class="text-sm mt-2">
<h3 class="text-lg mt-2" data-translate="author">By Mary Shelley</h3>
<p class="text-sm mt-2" data-translate="description">
Frankenstein tells the story of Victor
Frankenstein, a scientist who creates a
monstrous creature, leading to tragic
Expand Down Expand Up @@ -740,10 +763,13 @@ <h3 class="text-lg mt-2">By Mary Shelby</h3>

<!-- JavaScript -->
<script src="./script.js"></script>
<script src="./translation.js"></script>
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
crossorigin="anonymous"
></script>
</body>
</html>


22 changes: 22 additions & 0 deletions pbd.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,28 @@
<body
class="bg-gray-900 text-gray-300 dark-theme d-flex flex-column min-vh-100"
>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div id="loader" class="spinner-container">
<div
class="spinner-border"
Expand Down
22 changes: 22 additions & 0 deletions rdpd.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,28 @@
<body
class="bg-gray-900 text-gray-300 dark-theme d-flex flex-column min-vh-100"
>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
<div id="loader" class="spinner-container">
<div
class="spinner-border"
Expand Down
6 changes: 4 additions & 2 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,13 @@
z-index: 9999;
}
/* Hide the default cursor */
body,
body{
cursor: none;
}
a,
button,
li {
cursor: none;
cursor: pointer;
}
.hidden {
display: none;
Expand Down
72 changes: 72 additions & 0 deletions translation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
// translations.js

// Translation Script
const translations = {
en: {
books: {
frankenstein: {
title: "Frankenstein",
author: "By Mary Shelley",
description: "Frankenstein tells the story of Victor Frankenstein, a scientist who creates a monstrous creature, leading to tragic consequences."
}
}
},
fr: {
books: {
frankenstein: {
title: "Frankenstein",
author: "Par Mary Shelley",
description: "Frankenstein raconte l'histoire de Victor Frankenstein, un scientifique qui crée une créature monstrueuse, entraînant des conséquences tragiques."
}
}
},
es: {
books: {
frankenstein: {
title: "Frankenstein",
author: "Por Mary Shelley",
description: "Frankenstein cuenta la historia de Victor Frankenstein, un científico que crea una criatura monstruosa, lo que lleva a consecuencias trágicas."
}
}
},
zh: {
books: {
frankenstein: {
title: "弗兰肯斯坦",
author: "玛丽·雪莱",
description: "《弗兰肯斯坦》讲述了科学家维克多·弗兰肯斯坦创造了一个怪物,导致悲剧性后果的故事。"
}
}
}
};

console.log('Translations object:', translations);

function changeLanguage() {
const selectedLanguage = document.getElementById('language').value;
console.log('Selected language:', selectedLanguage);
applyTranslations(selectedLanguage);
}

function applyTranslations(language) {
const bookElements = document.querySelectorAll('[data-book]');
bookElements.forEach(bookElement => {
const bookKey = bookElement.getAttribute('data-book');
console.log('Book key:', bookKey);
if (translations[language] && translations[language].books && translations[language].books[bookKey]) {
const bookTranslations = translations[language].books[bookKey];
console.log('Applying translations for:', bookKey, bookTranslations);
bookElement.querySelector('[data-translate="title"]').innerText = bookTranslations.title;
bookElement.querySelector('[data-translate="author"]').innerText = bookTranslations.author;
bookElement.querySelector('[data-translate="description"]').innerText = bookTranslations.description;
} else {
console.error('Translation not found for:', language, bookKey);
}
});
}

document.addEventListener('DOMContentLoaded', function() {
const defaultLanguage = 'en';
console.log('Default language:', defaultLanguage);
applyTranslations(defaultLanguage);
});

0 comments on commit 350e770

Please sign in to comment.