Skip to content

Commit

Permalink
Merge pull request #1599 from Shobhit-Nagpal/fix/gita-tweet
Browse files Browse the repository at this point in the history
fix: initial tweet click contains quote and author
  • Loading branch information
akshitagupta15june authored Jun 1, 2024
2 parents cb592cf + 056babe commit d29363c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions shlok_page/motivation.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,19 @@ const authorBack = authors[1];

const buttonFront = button[0];
const buttonBack = button[1];
let quote = '';
let author = '';

//Initialize quote and author to be same as the one in html
let quote = 'For the soul there is neither birth nor death at any time. He has not come into being, does not come into being, and will not come into being. He is unborn, eternal, ever-existing, and primeval. He is not slain when the body is slain.';
let author = '- Lord Sri Krishna - Bhagavad-gita 2.20';

const genQuote = () => {
var randNum = Math.floor(Math.random() * quotes.length);

// Preventing repeating the same quote
while (quote === quotes[randNum].text) {
randNum = Math.floor(Math.random() * quotes.length);
}

// Stores the quote present at the randomly generated index
quote = quotes[randNum].text;

Expand Down

0 comments on commit d29363c

Please sign in to comment.