├── README.md ├── css └── styles.css ├── js └── scripts.js └── index.html /README.md: -------------------------------------------------------------------------------- 1 | # Dev_Quotes 2 | Random quote generator using API in JS 3 | ## Demo 4 |  5 |  6 |  7 | -------------------------------------------------------------------------------- /css/styles.css: -------------------------------------------------------------------------------- 1 | body{ 2 | font-family: 'Acme', sans-serif; 3 | background:#34495e; 4 | color:#fff; 5 | } 6 | .title{ 7 | padding-top:40px; 8 | text-align: center; 9 | margin-bottom: 50px; 10 | } 11 | .quoteArea{ 12 | padding:40px; 13 | font-size: 30px; 14 | border:5px solid #fff; 15 | margin-bottom: 30px; 16 | color: #fff; 17 | } 18 | .fa-heart{ 19 | color:#ff1237; 20 | } 21 | .creator, .creator a{ 22 | text-align: center; 23 | padding-top: 20px; 24 | } -------------------------------------------------------------------------------- /js/scripts.js: -------------------------------------------------------------------------------- 1 | function randomQuote() { 2 | $.ajax({ 3 | url: "https://api.forismatic.com/api/1.0/?", 4 | dataType: "jsonp", 5 | data: "method=getQuote&format=jsonp&lang=en&jsonp=?", 6 | success: function (quoteData) { 7 | 8 | if (quoteData.quoteAuthor === '') { 9 | quoteData.quoteAuthor = 'Unknown'; 10 | }; 11 | 12 | $("#randomQuote").html("
" + quoteData.quoteText + "