Skip to content

Commit

Permalink
Quotes json added
Browse files Browse the repository at this point in the history
  • Loading branch information
vismitap committed Feb 27, 2021
1 parent 9d3d651 commit 8a80716
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/app/components/dashboard/dashboard.component.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!-- navbar -->
<app-navbar></app-navbar>
<!-- main -->
<div class="container">
<div class="container pb-3">
<div class="alert alert-warning alert-dismissible fade show" role="alert">
<h3 style="color: black;" class="block-with-username"><strong>Welcome {{Username}}!👋</strong></h3>
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
Expand Down
8 changes: 4 additions & 4 deletions src/app/components/dashboard/dashboard.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -144,24 +144,24 @@
}

.quoteText{
color: rgb(78, 4, 78);
color: black;
display: flex;
justify-content: center;
font-family: 'PT Serif', serif;
font-style: italic;
font-size: 16px;
font-weight: bold;
opacity: 80%;
opacity: 50%;
}

.quoteAuthor{
color: brown;
color: black;
display: flex;
justify-content: center;
font-family: 'PT Serif', serif;
font-style: italic;
font-size: 16px;
opacity: 80%;
opacity: 50%;
font-weight: bold;
}

Expand Down
10 changes: 2 additions & 8 deletions src/app/components/dashboard/dashboard.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {Router} from '@angular/router';
import { RestService } from 'src/app/services/rest.service';
import { DailyQuote } from 'src/interfaces/daily-quote';
import { FilterFolderPipe } from 'src/app/shared/filter-folder.pipe';
import quotes from 'src/interfaces/quotes';
declare var $: any;

@Component({
Expand Down Expand Up @@ -477,14 +478,7 @@ export class DashboardComponent implements OnInit {
}

getQuote() {
this.apiService.getDailyQuote()
.then((quote: DailyQuote) => {
this.quote = quote;
})
.catch((err) => {
// Here we store a random dummyQuote to the quote property.
this.quote = this.apiService.getDummyQuote();
});
this.quote = quotes[Math.floor(Math.random()*quotes.length)];
}

// Assign the selected colour to input value
Expand Down
98 changes: 98 additions & 0 deletions src/interfaces/quotes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
const quotes =
[
{
"text": "That is what learning is. You suddenly understand something you’ve understood all your life, but in a new way.",
"author": "Doris Lessing"
},
{
"text": "Live as if you were to die tomorrow. Learn as if you were to live forever.",
"author": "Mahatma Gandhi"
},
{
"text": "The more that you read, the more things you will know. The more that you learn, the more places you’ll go.",
"author": "Dr. Seus"
},
{
"text": "Tell me and I forget, teach me and I may remember, involve me and I learn.",
"author": "Benjamin Franklin"
},
{
"text": "Change is the end result of all true learning.",
"author": "Leo Buscaglia"
},
{
"text": "Learning never exhausts the mind.",
"author": "Leonardo da Vinci"
},
{
"text": "A wise man can learn more from a foolish question than a fool can learn from a wise answer.",
"author": "Bruce Lee"
},
{
"text": "Anyone who stops learning is old, whether at twenty or eighty. Anyone who keeps learning stays young.",
"author": "Henry Ford"
},
{
"text": "Try to learn something about everything and everything about something.",
"author": "Thomas H. Huxley"
},
{
"text": "Learning is not attained by chance. It must be sought for with ardor and attended with diligence.",
"author": "Abigail Adams"
},
{
"text": "Learn as though you would never be able to master it; hold it as though you would be in fear of losing it.",
"author": "Confucius"
},
{
"text": "The capacity to learn is a gift; the ability to learn is a skill; the willingness to learn is a choice!",
"author": "Brian Herbert"
},
{
"text": "There is no end to education. The whole of life, from the moment you are born to the moment you die, is a process of learning.",
"author": "Jiddu Krishnamurti"
},{
"text": "One learns from books and example only that certain things can be done. Actual learning requires that you do those things.",
"author": "Frank Herbert"
},{
"text": "You don’t understand anything until you learn it more than one way.",
"author": "Marvin Minsky"
},{
"text": "Spoon feeding in the long run teaches us nothing but the shape of the spoon.",
"author": "E. M. Forster"
},{
"text": "In the end we retain from our studies only that which we practically apply.",
"author": "Johann Wolfgang Von Goethe"
},{
"text": "Study hard what interests you the most in the most undisciplined, irreverent and original manner possible.",
"author": "Richard Feynman"
},{
"text": "Being a student is easy. Learning requires actual work.",
"author": "William Crawford"
},{
"text": "The great aim of education is not knowledge but action.",
"author": "Herbert Spencer"
},{
"text": "If you think education is expensive, try estimating the cost of ignorance.",
"author": "Howard Gardner"
},{
"text": "The ability to speak exactly is intimately related to the ability to know exactly.",
"author": "Wendell Berry"
},{
"text": "The illiterate of the 21st century will not be those who cannot read and write, but those who cannot learn, unlearn, and relearn.",
"author": "Alvin Toffler"
}
]

export default quotes;











0 comments on commit 8a80716

Please sign in to comment.