Skip to content

Instantly share code, notes, and snippets.

@mohamma548
Created April 26, 2016 14:02
Show Gist options
  • Save mohamma548/8e214083bd3a210200fd20629ecceff1 to your computer and use it in GitHub Desktop.
Save mohamma548/8e214083bd3a210200fd20629ecceff1 to your computer and use it in GitHub Desktop.
Quote Generator
<!--Random qoute generater-->
<!DOCTYPE html>
<html>
<body>
<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<div class="block">
<h1>Random Qoute Generator</h1>
<div class="quoteArea">
<span class="quotes"> Here you start to read!!</span><br>
<span class="authName">-mohamma</span>
</div>
<button class="btn btn-primary">Generate A quoate</button></div>
</body>
</html>
$(document).ready(function(){
function generateQuote(){
var arrayOfQuetes=[
{quote: "When things are hard to handle,retreat & count your blessings instead.",
name:""
},
{quote: "When we repair our relationship with Allah, He repairs everything else for us.",
name:"-Dr. Bilal phlips"
},
{quote: " No matter what your physical appearance, when you have kindness in your heart, You’re the most beautiful person in the world.",
name:"– Mufti Ismail Menk"
},
{quote: "Born from different mothers skins of all colours come together as brothers",
name:"-Islam"
},
{quote: "The Worst of our faults is our interest in other people’s Faults.",
name:"Ali Ibn Abitalib"
},
{quote: "The overly jealous seek to harm and hurt other, but in the end only harm themselves.",
name:"-life quotes"
},
{quote: "If you want to destroy any nation without war, make adultery & nudity common in the next generation.",
name:"-Salahuddin Ayyubi"
},
{quote: "The world is not the resting place, it is the testing place.",
name:""
},
{quote: "We Worry About Tomorrow as if it’s Guaranteed.",
name:""
},
{quote: "Do not force the religion on your family. show them the beauty of the religion through your own practice.",
name:"-Nouman Ali khan"
},
{quote: "Kindness is a mark of faith. and whoever is not kind has no faith.",
name:"-Muslim"
},
{quote: "If you don’t want your kids to hurt others don’t show them how to do it.",
name:""
},
];
var randomIndex= Math.floor(Math.random()*arrayOfQuetes.length);
var randomQuotes= arrayOfQuetes[randomIndex].quote;
var randomAuthor= arrayOfQuetes[randomIndex].name;
if(randomAuthor==""){
randomAuthor="-unknown";
}
$(".quotes").text(randomQuotes);
$(".authName").text(randomAuthor);
}
$(".btn").on("click",function(){
generateQuote();
});
});
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
body{
background-image: url('https://www.dropbox.com/s/2mdj9jyjo8mgrya/qoute_backg.jpg?dl=1');
color: black;
}
.block{
background-color: #F4EAEA;
width: 50%;
text-align: center;
padding: 10px 20px 10px 20px;
margin-left: 30%;
margin-top: 10%;
line-spacing: 1.4;
text-shadow:2px 2px #FF0000;
}
#quote{
}
.quoteArea{
background-color:black;
color: white;
font-family: 'Dancing Script', cursive;
text-shadow: none;
font-size:20px;
margin-left: auto;
margin-right: auto;
margin-top:1px;
margin-bottom:10px;
padding: 20px 20px 20px 20px;
border:2px solid white;
color: white;
border-radius: 10px;
}
h1{
font-size: 50px;
font-style: italic;
}
.quotes{
font-size:30px;
}
.authName{
font-size:15px;
font-style:italic;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment