Skip to content

Commit 429e320

Browse files
committed
typos+extension enhancements
1 parent 7ad8ddb commit 429e320

File tree

4 files changed

+30
-42
lines changed

4 files changed

+30
-42
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Gita Chrome Extension
2+
3+
4+
## About
5+
6+
Get the desired slok from Bhagwat Gita.
7+
8+
Use as a Chrome extension or just visit the [website](https://dhirajraut27.com.np/GitaChromeExtension/).
9+
10+
11+
## Contribute
12+
Feel free to contribute or let me know for the issues.
13+
14+
15+
## Shout-out
16+
Data Source: [Bhagavad Gita API](https://bhagavadgitaapi.in/)

hello.html

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,37 +7,30 @@
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88
<link rel="stylesheet" href="./styles/style.css">
99
<link rel="stylesheet" href="./styles/bootstrap.min.css">
10-
11-
<!-- Bootstrap CSS CDN -->
12-
<!-- <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
13-
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous"> -->
14-
15-
<title>Bhagawat Geeta Sloka</title>
10+
<title>Bhagawat Geeta Slok</title>
1611
</head>
1712

1813
<body>
1914
<div class="container-fluid text-center m-2">
20-
<h2 class="p-2">Bhagavad Gita Sloka Fetcher</h2>
15+
<h2 class="p-2">Bhagavad Gita Slok Fetcher</h2>
2116
<img src="https://bhagavadgitaapi.in/slok/krishna.png" alt="">
2217
<br>
23-
<p>Get the desired sloka from Gita </p>
18+
<p>Get the desired slok from Gita </p>
2419
<form>
2520
<div class="row">
2621
<div class="col">
27-
<!-- <label class = "form-label" for="chapter">Select Chapter </label> -->
2822
<select class="form-control" id="chapter" name="chapter" required>
2923
<option value="" selected="selected">Select a Chapter</option>
3024
</select>
3125
</div>
3226
<div class="col">
33-
<!-- <label class = "form-label" for="sloka">Select Sloka</label> -->
3427
<select class="form-control" id="sloka" min="1" required>
35-
<option value="" selected="selected">Select a Sloka</option>
28+
<option value="" selected="selected">Select a Slok</option>
3629
</select>
3730
</div>
3831
</div>
3932
<div class="pt-2 col-12 p-3">
40-
<button class="btn btn-danger" type="submit">Fetch Sloka</button>
33+
<button class="btn btn-danger" type="submit">Fetch Slok</button>
4134
</div>
4235

4336
</form>
@@ -52,11 +45,6 @@ <h2 class="p-2">Bhagavad Gita Sloka Fetcher</h2>
5245

5346
<script src="script.js"></script>
5447

55-
<!-- Bootstrap Bundle with Popper -->
56-
<!-- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"
57-
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
58-
crossorigin="anonymous"></script> -->
59-
6048
</body>
6149

6250
</html>

index.html

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,21 @@
66
<meta http-equiv="X-UA-Compatible" content="IE=edge">
77
<meta name="viewport" content="width=device-width, initial-scale=1.0">
88
<link rel="shortcut icon" href="https://cdn-icons-png.flaticon.com/512/4329/4329416.png" type="image/x-icon">
9-
<!-- <link rel="stylesheet" href="./styles/style.css"> -->
10-
<!-- <link rel="stylesheet" href="./styles/bootstrap.min.css"> -->
119

1210
<!-- Bootstrap CSS CDN -->
1311
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"
1412
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
1513

16-
<title>Bhagawat Geeta Sloka</title>
14+
<title>Bhagawat Geeta Slok</title>
1715

1816
<style>
19-
/* @import url('https://fonts.googleapis.com/css2?family=Yatra+One&display=swap'); */
20-
/* @import url('https://fonts.googleapis.com/css2?family=Eczar&display=swap'); */
2117
@import url('https://fonts.googleapis.com/css2?family=Eczar&family=Noto+Sans+Devanagari:wght@200;400;600&display=swap');
2218

2319

2420
body {
25-
/* width: 420px;
26-
height: 400px; */
2721
font-family: 'Noto Sans Devanagari', sans-serif;}
2822

2923
div.sloka-container {
30-
/* background:linear-gradient(189deg,#fff 19%,#f7fffa 50%);*/
3124
color: #4f4141;
3225
}
3326

@@ -36,13 +29,9 @@
3629
opacity: +.98
3730
}
3831

39-
/* h2 {
40-
font-family: 'Yatra One', cursive;
41-
} */
4232

4333
h3 {
4434
line-height: 23pt;
45-
/* font-family: 'Yatra One', cursive; */
4635
margin: 10px;
4736
color: #4f4141;
4837
font-weight: 600;
@@ -62,7 +51,7 @@
6251
</style>
6352
</head>
6453

65-
<body">
54+
<body>
6655
<div class="container text-center my-auto ">
6756
<div class="col-6 mx-auto">
6857
<h2 class="p-2">Bhagavad Gita Slok Fetcher</h2>
@@ -80,20 +69,20 @@ <h2 class="p-2">Bhagavad Gita Slok Fetcher</h2>
8069
<div class="col-4">
8170
<!-- <label class = "form-label" for="sloka">Select Sloka</label> -->
8271
<select class="form-control" id="sloka" min="1" required>
83-
<option value="" selected="selected">Select a Sloka</option>
72+
<option value="" selected="selected">Select a Slok</option>
8473
</select>
8574
</div>
8675
</div>
8776
<div class="pt-2 col-12 p-3">
88-
<button class="btn btn-danger" type="submit">Fetch Sloka</button>
77+
<button class="btn btn-danger" type="submit">Fetch Slok</button>
8978
</div>
9079

9180
</form>
9281
<div class="text-center p-2 sloka-container" id="sloka-container"></div>
9382

94-
<footer class="p-2">
83+
<footer class="footer mt-auto py-3">
9584
<p>Made with 🙏 by Dhiraj Raut. <br>
96-
Fetched from <a href="https://bhagavadgitaapi.in/" target="_blank">@BhagavadGitaApi</a> </p>
85+
Data Source: <a href="https://bhagavadgitaapi.in/" target="_blank">BhagavadGitaApi</a> </p>
9786
</footer>
9887
</div>
9988
</div>

script.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ form.addEventListener('submit', event => {
3838
// const url = `https://bhagavadgitaapi.in/slok/${chapter}/${sloka}`;
3939
const queryId = `BG${chapter}.${sloka}`;
4040

41-
41+
//using API CALL
42+
4243
// Check if data is already in local storage
4344
// const storedData = localStorage.getItem(`gita${chapter}-${sloka}`);
4445
// if (storedData) {
@@ -68,7 +69,6 @@ form.addEventListener('submit', event => {
6869
// .then(data => {
6970
// // Store data in local storage
7071
// localStorage.setItem(`gita${chapter}-${sloka}`, JSON.stringify(data));
71-
// // Use the data as needed
7272
// const slokaText = data.slok;
7373
// const formattedSloka = slokaText.replace(/\n/g, '<br>');
7474
// const translation = data.siva.et;
@@ -84,20 +84,15 @@ form.addEventListener('submit', event => {
8484

8585

8686

87-
// use the local json file
87+
// using the local json file
8888

8989
fetch('shlokas_limited.json')
9090
.then(response => response.json())
9191
.then(data => {
92-
// Store data in local storage
93-
// localStorage.setItem(`gita${chapter}-${sloka}`, JSON.stringify(data));
94-
9592
// Filter the data based on the user input
9693
const filteredData = data.filter(item => item.id === queryId);
9794
console.log(filteredData[0])
9895

99-
100-
// Use the data as needed
10196
const slokaText = filteredData[0].slok;
10297
const formattedSloka = slokaText.replace(/\n/g, '<br>');
10398
const translation = filteredData[0].siva.et;

0 commit comments

Comments
 (0)