Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Added a new game Gita_Shloka_Generator #4857

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions Games/Gita_Shloka_Generator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Gita Shlok Generator

## Overview
Bhagavad-gītā is also known as Gītopaniṣad. It is the essence of Vedic knowledge and one of the most important Upaniṣads in Vedic literature.The speaker of Bhagavad-gītā is Lord Śrī Kṛṣṇa. Lets dive into the spritual world with the help of shloka generator
The Gita Shlok Generator is an interactive web application that displays random shlokas (verses) from the Bhagavad Gita. Each shloka includes its original Sanskrit text, transliteration, translation, and an explanation to help users understand the profound teachings of the Gita.

## Features

- Generate random shlokas from the Bhagavad Gita
- Display shlokas with Sanskrit text, transliteration, translation, and explanation
- Light and modern UI for a pleasant user experience
- Responsive design that works on various devices

## Technologies Used

- HTML5
- CSS3
- Bootstrap 5
- TailwindCSS
- JavaScript
- jQuery

## Getting Started

### Prerequisites

To run this project locally, you need to have:

- A web browser (e.g., Chrome, Firefox, Safari)
- Internet connection (for Bootstrap and TailwindCSS CDN links)

### Installation

1. Clone the repository to your local machine:
```sh
git clone https://github.com/your-username/gita-shlok-generator.git
```
2. Navigate to the project directory:
```sh
cd gita-shlok-generator
```

### Usage

1. Open `index.html` in your web browser:
```sh
open index.html
```
2. Click on the "Generate Random Shlok" button to display a new shloka.

OR
1.Copy this project in your local system
2.go to the directory
Example D:\New folder (3)\GameZone\Games> cd Gita_Shloka_Generator
4. Type http-server
5. Click the link and run the project
25 changes: 25 additions & 0 deletions Games/Gita_Shloka_Generator/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
document.getElementById('generate-btn').addEventListener('click', generateRandomShlok);

async function generateRandomShlok() {
try {
const response = await fetch('shloks.json');
if (!response.ok) {
throw new Error('Network response was not ok');
}
const shloks = await response.json();
console.log('Shloks fetched successfully:', shloks); // Debugging log

const randomIndex = Math.floor(Math.random() * shloks.length);
const shlok = shloks[randomIndex];
console.log('Random Shlok selected:', shlok); // Debugging log

document.getElementById('sanskrit').textContent = shlok.sanskrit;
document.getElementById('transliteration').textContent = shlok.transliteration;
document.getElementById('translation').textContent = shlok.translation;
document.getElementById('explanation').textContent = shlok.explanation;

document.getElementById('shlok-container').style.display = 'block';
} catch (error) {
console.error('Error fetching shlok data:', error);
}
}
Binary file added Games/Gita_Shloka_Generator/image.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Games/Gita_Shloka_Generator/images/krishna.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions Games/Gita_Shloka_Generator/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Gita Shlok Generator</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/tailwind.min.css" rel="stylesheet">
<link rel="stylesheet" href="styles.css">
</head>
<body class="bg-cover bg-center h-screen relative" style="background-image: url('images/krishna.jpg');">
<div class="overlay bg-black bg-opacity-50 h-full w-full absolute top-0 left-0"></div>
<div class="flex flex-col items-center justify-center h-full text-white text-center relative z-10 p-5">
<h1 class="text-4xl font-bold mb-8">Gita Shloka Generator</h1>
<button id="generate-btn" class="btn btn-primary mb-8 text-xl">Generate Random Shloka</button>
<div id="shlok-container" class="p-6 bg-white bg-opacity-75 text-black shadow rounded max-w-lg mx-auto">
<h2 id="sanskrit" class="text-2xl font-bold mb-2"></h2>
<p id="transliteration" class="italic mb-2"></p>
<p id="translation" class="mb-2"></p>
<p id="explanation" class="text-gray-700"></p>
</div>
</div>
<script src="app.js"></script>
</body>
</html>
131 changes: 131 additions & 0 deletions Games/Gita_Shloka_Generator/shloks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
[
{
"chapter": 2,
"verse": 20,
"sanskrit": "न जायते म्रियते वा कदाचि, नायं भूत्वा भविता वा न भूय: |अजो नित्य: शाश्वतोऽयं पुराणो न हन्यते हन्यमाने शरीरे",
"transliteration": "na jāyate mriyate vā kadāchin nāyaṁ bhūtvā bhavitā vā na bhūyaḥ ajo nityaḥ śhāśhvato ’yaṁ purāṇo na hanyate hanyamāne śharīre",
"translation": "The soul is neither born, nor does it ever die; nor having once existed, does it ever cease to be. The soul is without birth, eternal, immortal, and ageless. It is not destroyed when the body is destroyed.",
"explanation": "This verse explains the soul is not something that comes into being at one point in time and then ceases to exist. It is eternal and does not undergo creation or destruction."
},
{
"chapter": 2,
"verse": 47,
"sanskrit": "कर्मण्येवाधिकारस्ते मा फलेषु कदाचन मा कर्मफलहेतुर्भूर्मा ते सङ्गोऽस्त्वकर्मणि",
"transliteration": "karmanye vadhikaraste ma phaleshu kadachana mā karma-phala-hetur bhūr mā te saṅgo ’stvakarmaṇi",
"translation": "You have a right to perform your prescribed duties, but you are not entitled to the fruits of your actions...",
"explanation": "This verse emphasizes the importance of performing one's duties without attachment to results."
},
{
"chapter": 2,
"verse": 70,
"sanskrit": "आपूर्यमाणमचलप्रतिष्ठं, समुद्रमाप: प्रविशन्ति यद्वत् |तद्वत्कामा यं प्रविशन्ति सर्वे, स शान्तिमाप्नोति न कामकामी ||",
"transliteration": "āpūryamāṇam achala-pratiṣhṭhaṁ ,samudram āpaḥ praviśhanti yadvat ,tadvat kāmā yaṁ praviśhanti sarve ,sa śhāntim āpnoti na kāma-kāmī",
"translation": "One who is not disturbed by the incessant flow of desires that enter like rivers into the ocean, which is being filled but is always being still, can alone achieve peace.",
"explanation": "This verse describes the state of equanimity and peace achieved by one who remains unaffected by desires, similar to an ocean that remains calm despite the constant influx of water."
},
{
"chapter": 3,
"verse": 16,
"sanskrit": "एवं प्रवर्तितं चक्रं नानुवर्तयतीह य: |अघायुरिन्द्रियारामो मोघं पार्थ स जीवति",
"transliteration": "evaṁ pravartitaṁ chakraṁ nānuvartayatiha yaḥ,aghāyur indriyārāmo moghaṁ pārtha sa jīvati",
"translation": "He who does not follow the wheel of creation set of going in this world, sinful and sensual, lives in pain.",
"explanation": "This verse emphasizes the importance of following the divine order and participating in the cycle of creation to avoid suffering."
},
{
"chapter": 3,
"verse": 19,
"sanskrit": "तस्मादसक्त: सततं कार्यं कर्म समाचर | असक्तो ह्याचरन्कर्म परमाप्नोति पूरुष: ",
"transliteration": "tasmād asaktaḥ satataṁ kāryaṁ karma samāchara ,asakto hyācharan karma param āpnoti pūruṣhaḥ",
"translation": "Therefore, perform your duties and work for Me. By doing so, you will be freed from the bonds of karma and attain liberation.",
"explanation": "Lord Krishna advises to perform all duties as an offering to Him to transcend the cycle of karma and attain liberation."
},
{
"chapter": 4,
"verse": 7,
"sanskrit": "यदा यदा हि धर्मस्य ग्लानिर्भवति भारत | अभ्युत्थानमधर्मस्य तदात्मानं सृजाम्यहम्",
"transliteration": "yadā yadā hi dharmasya glānir bhavati bhārata, abhyutthānam adharmasya tadātmānaṁ sṛijāmyaham",
"translation": "Whenever there is a decline in righteousness and an increase in unrighteousness, O Arjuna, at that time I manifest myself on earth.",
"explanation": "Lord Krishna assures that He incarnates in various forms to protect the good, destroy the wicked, and establish righteousness."
},
{
"chapter": 5,
"verse": 10,
"sanskrit": "ब्रह्मण्याधाय कर्माणि सङ्गं त्यक्त्वा करोति य: | लिप्यते न स पापेन पद्मपत्रमिवाम्भसा",
"transliteration": "brahmaṇyādhāya karmāṇi saṅgaṁ tyaktvā karoti yaḥ, lipyate na sa pāpena padma-patram ivāmbhasā",
"translation": "He who performs his duties without attachment, surrendering the fruits to the Supreme, is not affected by sin and is always in union with Brahman.",
"explanation": "This verse describes the path of selfless action and its benefits in attaining spiritual union with the Supreme."
},
{
"chapter": 6,
"verse": 5,
"sanskrit": "उद्धरेदात्मनात्मानं नात्मानमवसादयेत् | आत्मैव ह्यात्मनो बन्धुरात्मैव रिपुरात्मन: ",
"transliteration": "uddhared ātmanātmānaṁ nātmānam avasādayet, ātmaiva hyātmano bandhur ātmaiva ripur ātmanaḥ",
"translation": "One must elevate, and not degrade, oneself by one's own mind. The mind is the friend of the conditioned soul, and its enemy as well.",
"explanation": "This verse emphasizes the role of the mind in one's spiritual progress and the need to master it to elevate oneself."
},
{
"chapter": 7,
"verse": 14,
"sanskrit": "दैवी ह्येषा गुणमयी मम माया दुरत्यया | मामेव ये प्रपद्यन्ते मायामेतां तरन्ति ते",
"transliteration": "daivī hyeṣhā guṇa-mayī mama māyā duratyayā mām eva ye prapadyante māyām etāṁ taranti te",
"translation": "This divine energy of Mine, consisting of the three modes of material nature, is difficult to overcome. But those who have surrendered unto Me can easily cross beyond it.",
"explanation": "Krishna explains that His divine energy, though difficult to transcend, can be overcome by those who surrender to Him."
},
{
"chapter": 8,
"verse": 7,
"sanskrit": "तस्मात्सर्वेषु कालेषु मामनुस्मर युध्य च | मय्यर्पितमनोबुद्धिर्मामेवैष्यस्यसंशयम् ",
"transliteration": "tasmāt sarveṣhu kāleṣhu mām anusmara yudhya cha, mayyarpita-mano-buddhir mām evaiṣhyasyasanśhayam",
"translation": "Therefore, always remember Me and perform your duties. With your mind and intellect fixed on Me, you will surely come to Me.",
"explanation": "Krishna instructs Arjuna to remember Him at all times and focus his mind and intellect on Him to attain spiritual realization."
},
{
"chapter": 9,
"verse": 10,
"sanskrit": "मयाध्यक्षेण प्रकृति: सूयते सचराचरम् | हेतुनानेन कौन्तेय जगद्विपरिवर्तते",
"transliteration": "mayādhyakṣheṇa prakṛitiḥ sūyate sa-charācharam, hetunānena kaunteya jagad viparivartate",
"translation": "This divine operation of the material world is governed by Me. I am the source of the entire creation.",
"explanation": "Krishna declares His supreme role in the creation and operation of the universe, reinforcing His divine nature."
},
{
"chapter": 9,
"verse": 22,
"sanskrit": "अनन्याश्चिन्तयन्तो मां ये जनाः पर्युपासते | तेषां नित्याभियुक्तानां योगक्षेमं वहाम्यहम्",
"transliteration": "ananyāś cintayanto māṁ ye janāḥ paryupāsate, teṣhāṁ nityābhiyuktānāṁ yoga-kṣhemaṁ vahāmyaham",
"translation": "To those who are constantly devoted and who worship Me with love, I give the understanding by which they can come to Me.",
"explanation": "Krishna promises to take care of the devotees who are devoted to Him, providing them with everything they need."
},
{
"chapter": 10,
"verse": 8,
"sanskrit": "अहं सर्वस्य प्रभवो मत्तः सर्वं प्रवर्तते | इति मत्वा भजन्ते मां बुधा भावसमन्विता:",
"transliteration": "ahaṁ sarvasya prabhavo mattaḥ sarvaṁ pravartate, iti matvā bhajante māṁ budhā bhāva-samanvitāḥ ",
"translation": "I am the source of all spiritual and material worlds. Everything emanates from Me.",
"explanation": "This verse signifies that Lord Krishna is the ultimate source and cause of all creation, maintenance, and destruction in the universe."
},
{
"chapter": 12,
"verse": 15,
"sanskrit": "यस्मान्नोद्विजते लोको लोकान्नोद्विजते च य: | हर्षामर्षभयोद्वेगैर्मुक्तो य: स च मे प्रिय:",
"transliteration": "yasmān nodvijate loko lokān nodvijate cha yaḥ, harṣhāmarṣha-bhayodvegair mukto yaḥ sa cha me priyaḥ",
"translation": "One who is not disturbed by the incessant flow of desires that enter like rivers into the ocean, which is being filled but is always being still, can alone achieve peace.",
"explanation": "This verse describes the nature of a peaceful person who remains unaffected by desires and remains calm like an ocean."
},
{
"chapter": 13,
"verse": 27,
"sanskrit": "यावत्सञ्जायते किञ्चित्सत्वं स्थावरजङ्गमम् | क्षेत्रक्षेत्रज्ञसंयोगात्तद्विद्धि भरतर्षभ",
"transliteration": "yāvat sañjāyate kiñchit sattvaṁ sthāvara-jaṅgamam, kṣhetra-kṣhetrajña-sanyogāt tad viddhi bharatarṣhabha",
"translation": "The knowledge of the field and the knower of the field, the knowledge of the Supreme Self, is revealed to those who are pure in heart and devoted to truth.",
"explanation": "This verse highlights the importance of purity of heart and devotion in understanding the Supreme Self and the nature of existence."

},
{
"chapter": 18,
"verse": 66,
"sanskrit": "सर्वधर्मान्परित्यज्य मामेकं शरणं व्रज | अहं त्वां सर्वपापेभ्यो मोक्षयिष्यामि मा शुच:",
"transliteration": "sarva-dharmān parityajya mām ekaṁ śaraṇaṁ vraja, ahaṁ tvāṁ sarva-pāpebhyo mokṣhayiṣhyāmi mā śhuchaḥ",
"translation": "Abandon all varieties of religion and just surrender unto Me. I shall deliver you from all sinful reactions. Do not fear.",
"explanation": "Krishna advises Arjuna to abandon all forms of dharma and surrender only to Him, promising liberation from all sins and fears."
}
]
39 changes: 39 additions & 0 deletions Games/Gita_Shloka_Generator/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
body {
font-family: 'Arial', sans-serif;
margin: 0;
padding: 0;
}

#shlok-container {
display: none;
max-width: 90%;
}

.btn-primary {
background-color: #012246;
border-color: #000b17;
padding: 10px 20px;
font-size: 18px;
border-radius: 5px;
transition: background-color 0.3s, border-color 0.3s;
}

.btn-primary:hover {
background-color: #519cec;
border-color: #01244a;
}

.overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
background: rgba(0, 0, 0, 0.3); /* Lighter overlay with lower opacity */

}

.relative {
z-index: 2;
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ This repository also provides one such platforms where contributers come over an
| [IKnowYou-Mind-Reading-Game](https://github.com/kunjgit/GameZone/tree/main/Games/IKnowYou-Mind-Reading-Game) |
| [Single_Player_Solitaire](https://github.com/kunjgit/GameZone/tree/main/Games/Single_Player_Solitaire) |
| [Hover_Board_Effect](https://github.com/kunjgit/GameZone/tree/main/Games/Hover_Board_Effect) |

| [Gita_Shloka_Generator](https://github.com/kunjgit/GameZone/tree/main/Games/Gita_Shloka_Generator) |
| [namefate](https://github.com/kunjgit/GameZone/tree/main/Games/namefate) |
| [Fruit_Catching_Game](https://github.com/kunjgit/GameZone/tree/main/Games/Fruit_Catching_Game) |
| [color_matching_application](https://github.com/kunjgit/GameZone/tree/main/Games/color_matching_application) |
Expand Down
Binary file added assets/images/GIta_Shloka_Generator.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading