feat: Update quotes and quote logic (#17381)

This commit is contained in:
Quincy Larson
2018-06-01 17:02:37 -05:00
committed by mrugesh mohapatra
parent 20f5db58bd
commit bc0e213529
6 changed files with 628 additions and 150 deletions

View File

@ -1062,6 +1062,10 @@ and (max-width : 400px) {
width: 100%;
}
.quote-author {
font-style: normal;
}
// surrounding downstream import with &{}
// creates locally scoped imports
// and prevents vaiables from overwriting each other

View File

@ -1,10 +1,13 @@
import words from './words.json';
function randomItem(arr) {
return arr[ Math.floor(Math.random() * arr.length) ];
}
export function randomQuote() {
return randomItem(words.motivationalQuotes);
}
export function randomPhrase() {
return randomItem(words.phrases);
}

View File

@ -1,143 +0,0 @@
const quotes = [
{
quote: 'Never, never, never, never, never, never give up.',
author: 'Winston Churchill'
},
{
quote: 'The pessimist sees difficulty in every opportunity. ' +
'The optimist sees opportunity in every difficulty.',
author: 'Winston Churchill'
},
{
quote: 'Twenty years from now you you will be more disappointed by the ' +
'things that you didn\'t do than by the ones you did do. So throw ' +
'off the bowlines. Sail away from the safe harbor. Catch the trade ' +
'winds in your sails.',
author: 'Mark Twain'
},
{
quote: 'The secret of getting ahead is getting started.',
author: 'Mark Twain'
},
{
quote: 'Change your life today. Dont gamble on the future, act now, ' +
'without delay.',
author: 'Simone de Beauvoir'
},
{
quote: 'A person who never made a mistake never tried anything new.',
author: 'Albert Einstein'
},
{
quote: 'Life is like riding a bicycle. To keep your balance, you must ' +
'keep moving.',
author: 'Albert Einstein'
},
{
quote: 'Nothing will work unless you do.',
author: 'Maya Angelou'
},
{
quote: 'The most difficult thing is the decision to act, the rest is ' +
'merely tenacity.',
author: 'Amelia Earhart'
},
{
quote: 'When you reach for the stars, you may not quite get them, but ' +
'you won\'t come up with a handful of mud, either.',
author: 'Leo Burnett'
},
{
quote: 'The only person you are destined to become is the person you ' +
'decide to be.',
author: 'Ralph Waldo Emerson'
},
{
quote: 'You must do the things you think you cannot do.',
author: 'Eleanor Roosevelt'
},
{
quote:
'You are never too old to set another goal, or to dream a new dream.',
author: 'C.S. Lewis'
},
{
quote: 'Believe you can and you\'re halfway there.',
author: 'Theodore Roosevelt'
},
{
quote:
'I fear not the man who has practiced 10,000 ' +
'kicks once, but I fear the man who has practiced one kick 10,000 times.',
author: 'Bruce Lee'
},
{
quote: 'The way to get started is to quit talking and begin doing.',
author: 'Walt Disney'
},
{
quote: 'Dont let yesterday take up too much of today.',
author: 'Will Rodgers'
},
{
quote:
'You learn more from failure than from success. Dont let it stop you.' +
' Failure builds character.',
author: 'Annon'
},
{
quote: 'Its not whether you get knocked down, its whether you get up.',
author: 'Vince Lombardi'
},
{
quote:
'If you are working on something that you really care about, you ' +
'dont have to be pushed. The vision pulls you.',
author: 'Steve Jobs'
},
{
quote:
'People who are crazy enough to think they can change the world, are ' +
'the ones who do.',
author: 'Rob Siltanen'
},
{
quote:
'Failure will never overtake me if my determination to succeed is ' +
'strong enough.',
author: 'Og Mandino'
},
{
quote: 'We may encounter many defeats, but we must not be defeated.',
author: 'Maya Angelou'
},
{
quote:
'Knowing is not enough; we must apply. Wishing is not enough; we must ' +
'do.',
author: 'Johann Wolfgang von Goethe'
},
{
quote: 'Whether you think you can or think you cant, youre right.',
author: 'Henry Ford'
},
{
quote:
'The only limit to our realization of tomorrow, will be our doubts of ' +
'today.',
author: 'Franklin D. Roosevelt'
},
{
quote:
'You dont have to be great to start, but you have to start to be great.',
author: 'Zig Ziglar'
},
{
quote: 'Todays accomplishments were yesterdays impossibilities.',
author: 'Robert H. Schuller'
}
];
export function getRandomQuote() {
return quotes[Math.floor(Math.random() * quotes.length)];
}

View File

@ -140,5 +140,619 @@
"Prove to mom that computers aren't just for games",
"With coding power comes sharing responsibility",
"Have you told your friends of your coding powers?"
],
"motivationalQuotes": [
{
"quote": "Never, never, never, never, never, never give up.",
"author": "Winston Churchill"
},
{
"quote": "The pessimist sees difficulty in every opportunity. The optimist sees opportunity in every difficulty.",
"author": "Winston Churchill"
},
{
"quote": "Twenty years from now you you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails.",
"author": "Mark Twain"
},
{
"quote": "The secret of getting ahead is getting started.",
"author": "Mark Twain"
},
{
"quote": "A person who never made a mistake never tried anything new.",
"author": "Albert Einstein"
},
{
"quote": "Life is like riding a bicycle. To keep your balance, you must keep moving.",
"author": "Albert Einstein"
},
{
"quote": "Nothing will work unless you do.",
"author": "Maya Angelou"
},
{
"quote": "The most difficult thing is the decision to act, the rest is merely tenacity.",
"author": "Amelia Earhart"
},
{
"quote": "The only person you are destined to become is the person you decide to be.",
"author": "Ralph Waldo Emerson"
},
{
"quote": "You must do the things you think you cannot do.",
"author": "Eleanor Roosevelt"
},
{
"quote": "You are never too old to set another goal, or to dream a new dream.",
"author": "C.S. Lewis"
},
{
"quote": "Believe you can and you're halfway there.",
"author": "Theodore Roosevelt"
},
{
"quote": "I fear not the man who has practiced 10,000 kicks once, but I fear the man who has practiced one kick 10,000 times.",
"author": "Bruce Lee"
},
{
"quote": "The way to get started is to quit talking and begin doing.",
"author": "Walt Disney"
},
{
"quote": "Dont let yesterday take up too much of today.",
"author": "Will Rodgers"
},
{
"quote": "Its not whether you get knocked down, its whether you get up.",
"author": "Vince Lombardi"
},
{
"quote": "If you are working on something that you really care about, you dont have to be pushed. The vision pulls you.",
"author": "Steve Jobs"
},
{
"quote": "People who are crazy enough to think they can change the world, are the ones who do.",
"author": "Rob Siltanen"
},
{
"quote": "Failure will never overtake me if my determination to succeed is strong enough.",
"author": "Og Mandino"
},
{
"quote": "We may encounter many defeats, but we must not be defeated.",
"author": "Maya Angelou"
},
{
"quote": "Knowing is not enough; we must apply. Wishing is not enough; we must do.",
"author": "Johann Wolfgang von Goethe"
},
{
"quote": "Whether you think you can or think you cant, youre right.",
"author": "Henry Ford"
},
{
"quote": "The only limit to our realization of tomorrow, will be our doubts of today.",
"author": "Franklin D. Roosevelt"
},
{
"quote": "You dont have to be great to start, but you have to start to be great.",
"author": "Zig Ziglar"
},
{
"quote": "Todays accomplishments were yesterdays impossibilities.",
"author": "Robert H. Schuller"
},
{
"quote": "Life is 10% what happens to you and 90% how you react to it.",
"author": "Charles R. Swindoll"
},
{
"quote": "Optimism is the faith that leads to achievement. Nothing can be done without hope and confidence.",
"author": "Helen Keller"
},
{
"quote": "With the new day comes new strength and new thoughts.",
"author": "Eleanor Roosevelt"
},
{
"quote": "The past cannot be changed. The future is yet in your power.",
"author": "Confucius"
},
{
"quote": "It always seems impossible until it's done.",
"author": "Nelson Mandela"
},
{
"quote": "You can't cross the sea merely by standing and staring at the water.",
"author": "Rabindranath Tagore"
},
{
"quote": "Quality is not an act, it is a habit.",
"author": "Aristotle"
},
{
"quote": "Without hard work, nothing grows but weeds.",
"author": "Gordon B. Hinckley"
},
{
"quote": "If you're going through hell, keep going.",
"author": "Winston Churchill"
},
{
"quote": "Our greatest weakness lies in giving up. The most certain way to succeed is always to try just one more time.",
"author": "Thomas A. Edison"
},
{
"quote": "Do the difficult things while they are easy and do the great things while they are small. A journey of a thousand miles must begin with a single step.",
"author": "Lao Tzu"
},
{
"quote": "Well done is better than well said.",
"author": "Benjamin Franklin"
},
{
"quote": "There is only one corner of the universe you can be certain of improving, and that's your own self.",
"author": "Aldous Huxley"
},
{
"quote": "Aim for the moon. If you miss, you may hit a star.",
"author": "W. Clement Stone"
},
{
"quote": "Start where you are. Use what you have. Do what you can.",
"author": "Arthur Ashe"
},
{
"quote": "Don't watch the clock; do what it does. Keep going.",
"author": "Sam Levenson"
},
{
"quote": "The most effective way to do it, is to do it.",
"author": "Amelia Earhart"
},
{
"quote": "By failing to prepare, you are preparing to fail.",
"author": "Benjamin Franklin"
},
{
"quote": "Do not wait to strike till the iron is hot; but make it hot by striking.",
"author": "William Butler Yeats"
},
{
"quote": "The harder the conflict, the more glorious the triumph.",
"author": "Thomas Paine"
},
{
"quote": "Opportunity does not knock, it presents itself when you beat down the door.",
"author": "Kyle Chandler"
},
{
"quote": "Perseverance is failing 19 times and succeeding the 20th.",
"author": "Julie Andrews"
},
{
"quote": "I attribute my success to this - I never gave or took any excuse.",
"author": "Florence Nightingale"
},
{
"quote": "Even if you fall on your face, you're still moving forward.",
"author": "Victor Kiam"
},
{
"quote": "You can't wait for inspiration. You have to go after it with a club.",
"author": "Jack London"
},
{
"quote": "Live as if you were to die tomorrow. Learn as if you were to live forever. ",
"author": "Mahatma Gandhi"
},
{
"quote": "If you dont risk anything, you risk even more.",
"author": "Erica Jong"
},
{
"quote": "The work of today is the history of tomorrow, and we are its makers.",
"author": "Juliette Gordon Low"
},
{
"quote": "It is never too late to be what you might have been. ",
"author": "Mary Anne Evans"
},
{
"quote": "Nothing in life is to be feared, it is only to be understood. Now is the time to understand more, so that we may fear less. ",
"author": "Marie Curie"
},
{
"quote": "Life shrinks or expands in proportion with ones courage.",
"author": "Anaïs Nin"
},
{
"quote": "If youre not making mistakes, then youre not making decisions. ",
"author": "Catherine Cook"
},
{
"quote": "Whether you want to uncover the secrets of the universe, or you want to pursue a career in the 21st century, basic computer programming is an essential skill to learn.",
"author": "Stephen Hawking"
},
{
"quote": "I've missed more than 9,000 shots during my career. I've lost almost 300 games. 26 times, I've been trusted to take the game winning shot and missed. I've failed over and over and over again in my life. And that is why I succeed.",
"author": "Michael Jordan"
},
{
"quote": "You miss 100% of the shots you don't take.",
"author": "Wayne Gretzky"
},
{
"quote": "The two most important days in your life are the day you are born and the day you find out why.",
"author": "Mark Twain"
},
{
"quote": "The most common people give up their power is by thinking they don't have any.",
"author": "Alice Walker"
},
{
"quote": "The best revenge is massive success.",
"author": "Frank Sinatra"
},
{
"quote": "Giving up is the only sure way to fail.",
"author": "Gena Showalter"
},
{
"quote": "I have not failed. I've just found 10,000 ways that won't work.",
"author": "Thomas A. Edison"
},
{
"quote": "What you do speaks so loudly that I cannot hear what you say.",
"author": "Ralph Waldo Emerson"
},
{
"quote": "Tough times never last, but tough people do.",
"author": "Dr. Robert Schuller"
},
{
"quote": "The best way out is always through.",
"author": "Robert Frost"
},
{
"quote": "The power of imagination makes us infinite.",
"author": "John Muir"
},
{
"quote": "Light tomorrow with today.",
"author": "Elizabeth Barrett Browning"
},
{
"quote": "Even if youre on the right track, youll get run over if you just sit there.",
"author": "Will Rogers"
},
{
"quote": "Every strike brings me closer to the next home run.",
"author": "Babe Ruth"
},
{
"quote": "Your imagination is your preview of lifes coming attractions.",
"author": "Albert Einstein"
},
{
"quote": "The harder I work, the luckier I get.",
"author": "Gary Player"
},
{
"quote": "The price of anything is the amount of life you exchange for it.",
"author": "Henry David Thoreau"
},
{
"quote": "Someday is not a day of the week.",
"author": "Denise Brennan-Nelson"
},
{
"quote": "There are no short cuts to any place worth going.",
"author": "Beverly Sills"
},
{
"quote": "The best way to predict the future is to invent it.",
"author": "Alan Kay"
},
{
"quote": "If you have everything under control, youre not moving fast enough.",
"author": "Mario Andretti"
},
{
"quote": "Dont wish it were easier, wish you were better.",
"author": "Jim Rohn"
},
{
"quote": "Impossible is just a big word thrown around by small men who find it easier to live in the world they've been given than to explore the power they have to change it. Impossible is not a fact. It's an opinion. Impossible is not a declaration. It's a dare. Impossible is potential. Impossible is temporary. Impossible is nothing.",
"author": "Muhammad Ali"
},
{
"quote": "It had long since come to my attention that people of accomplishment rarely sat back and let things happen to them. They went out and happened to things.",
"author": "Leonardo da Vinci"
},
{
"quote": "It is not the strongest of the species that survive, nor the most intelligent, but the one most responsive to change.",
"author": "Charles Darwin"
},
{
"quote": "Whether you think you can, or think you can't, you're probably right.",
"author": "Henry Ford "
},
{
"quote": "Strength does not come from physical capacity. It comes from an indomitable will.",
"author": "Mahatma Gandhi"
},
{
"quote": "Those who says it cannot be done should not interrupt the person doing it.",
"author": "Unknown"
},
{
"quote": "It does not matter how slowly you go as long as you do not stop. ",
"author": "Confucius"
},
{
"quote": "An ant on the move does more than a dozing ox.",
"author": "Lao Tzu"
},
{
"quote": "Do the difficult things while they are easy and do the great things while they are small. A journey of a thousand miles must begin with a single step. ",
"author": "Lao Tzu"
},
{
"quote": "We are what we believe we are. ",
"author": "C. S. Lewis"
},
{
"quote": "With the possible exception of the equator, everything begins somewhere.",
"author": "C. S. Lewis"
},
{
"quote": "Arise, Awake and Stop not until the goal is reached.",
"author": "Swami Vivekananda"
},
{
"quote": "You only live once, but if you do it right, once is enough.",
"author": "Mae West"
},
{
"quote": "We delight in the beauty of the butterfly, but rarely admit the changes it has gone through to achieve that beauty.",
"author": "Maya Angelou"
},
{
"quote": "Sell your cleverness and buy bewilderment.",
"author": "Rumi"
},
{
"quote": "The cure for pain is in the pain.",
"author": "Rumi"
},
{
"quote": "May you live every day of your life.",
"author": "Jonathan Swift"
},
{
"quote": "Pain is inevitable. Suffering is optional.",
"author": "Haruki Murakami"
},
{
"quote": "Do one thing every day that scares you.",
"author": "Eleanor Roosevelt"
},
{
"quote": "Anyone who has never made a mistake has never tried anything new.",
"author": "Albert Einstein"
},
{
"quote": "Be not afraid of greatness. Some are born great, some achieve greatness, and others have greatness thrust upon them.",
"author": "William Shakespeare"
},
{
"quote": "Nothing is impossible, the word itself says \"I'm possible\"!",
"author": "Audrey Hepburn"
},
{
"quote": "There is only one thing that makes a dream impossible to achieve: the fear of failure.",
"author": "Paulo Coelho"
},
{
"quote": "Never memorize something that you can look up.",
"author": "Albert Einstein"
},
{
"quote": "Whatever you are, be a good one.",
"author": "Abraham Lincoln"
},
{
"quote": "In the depth of winter, I finally learned that within me there lay an invincible summer.",
"author": "Albert Camus"
},
{
"quote": "If youre any good at all, you know you can be better.",
"author": "Lindsay Buckingham"
},
{
"quote": "Failure is the condiment that gives success its flavor.",
"author": "Truman Capote"
},
{
"quote": "Success is stumbling from failure to failure with no loss of enthusiasm.",
"author": "Winston S. Churchill"
},
{
"quote": "Only those who dare to fail greatly can ever achieve greatly.",
"author": "Robert F. Kennedy"
},
{
"quote": "Never confuse a single defeat with a final defeat.",
"author": "F. Scott Fitzgerald"
},
{
"quote": "Have no fear of perfection - you'll never reach it.",
"author": "Salvador Dalí"
},
{
"quote": "Education: the path from cocky ignorance to miserable uncertainty.",
"author": "Mark Twain"
},
{
"quote": "Wisdom is not a product of schooling but of the lifelong attempt to acquire it.",
"author": "Albert Einstein"
},
{
"quote": "By seeking and blundering we learn.",
"author": "Johann Wolfgang von Goethe"
},
{
"quote": "Play is the highest form of research.",
"author": "Albert Einstein"
},
{
"quote": "There is nothing noble in being superior to your fellow man; true nobility is being superior to your former self.",
"author": "Ernest Hemingway"
},
{
"quote": "Once we accept our limits, we go beyond them.",
"author": "Albert Einstein"
},
{
"quote": "There is only one corner of the universe you can be certain of improving, and that's your own self.",
"author": "Aldous Huxley"
},
{
"quote": "Let us cultivate our garden.",
"author": "Voltaire"
},
{
"quote": "All we are not stares back at what we are.",
"author": "W.H. Auden"
},
{
"quote": "We first make our habits, then our habits make us.",
"author": "John Dryden"
},
{
"quote": "Everybody has talent, but ability takes hard work.",
"author": "Michael Jordan"
},
{
"quote": "We are all failures. At least the best of us are.",
"author": "J.M. Barrie"
},
{
"quote": "Never go to bed mad. Stay up and fight.",
"author": "Phyllis Diller"
},
{
"quote": "I have no special talents. I am only passionately curious.",
"author": "Albert Einstein"
},
{
"quote": "I am not young enough to know everything.",
"author": "Oscar Wilde"
},
{
"quote": "A life spent making mistakes is not only more honorable, but more useful than a life spent doing nothing.",
"author": "George Bernard Shaw"
},
{
"quote": "Somewhere, something incredible is waiting to be known.",
"author": "Carl Sagan"
},
{
"quote": "What matters most is how well you walk through the fire.",
"author": "Charles Bukowski"
},
{
"quote": "It is said that your life flashes before your eyes just before you die. That is true, it's called Life.",
"author": "Terry Pratchet"
},
{
"quote": "You cannot swim for new horizons until you have courage to lose sight of the shore.",
"author": "William Faulkner"
},
{
"quote": "I know, somehow, that only when it is dark enough can you see the stars.",
"author": "Martin Luther King Jr."
},
{
"quote": "Follow your inner moonlight; don't hide the madness.",
"author": "Allen Ginsberg"
},
{
"quote": "We know what we are, but not what we may be.",
"author": "William Shakespeare"
},
{
"quote": "The universe doesn't allow perfection.",
"author": "Stephen Hawking"
},
{
"quote": "The scariest moment is always just before you start.",
"author": "Stephen King"
},
{
"quote": "A winner is a dreamer who never gives up.",
"author": "Nelson Mandela"
},
{
"quote": "History will be kind to me for I intend to write it.",
"author": "Winston S. Churchill"
},
{
"quote": "There are far, far better things ahead than any we leave behind.",
"author": "C.S. Lewis"
},
{
"quote": "Forever is composed of nows.",
"author": "Emily Dickinson"
},
{
"quote": "Find what you love and let it kill you.",
"author": "Charles Bukowski"
},
{
"quote": "The world breaks everyone, and afterward, many are strong at the broken places.",
"author": "Ernest Hemingway"
},
{
"quote": "You will do foolish things, but do them with enthusiasm.",
"author": "Colette"
},
{
"quote": "I dream my painting and I paint my dream.",
"author": "Vincent van Gogh"
},
{
"quote": "You were born with wings, why prefer to crawl through life?",
"author": "Rumi"
},
{
"quote": "Forget safety. Live where you fear to live. Destroy your reputation. Be notorious.",
"author": "Rumi"
},
{
"quote": "Don't be satisfied with stories, how things have gone with others. Unfold your own myth.",
"author": "Rumi"
},
{
"quote": "If things start happening, don't worry, don't stew, just go right along and you'll start happening too.",
"author": "Dr. Seuss"
},
{
"quote": "Do not go gentle into that good night. Rage, rage against the dying of the light.",
"author": "Dylan Thomas"
},
{
"quote": "You can, you should, and if youre brave enough to start, you will.",
"author": "Stephen King"
},
{
"quote": "A good traveler has no fixed plans and is not intent on arriving.",
"author": "Lao Tzu"
},
{
"quote": "Creativity is intelligence having fun.",
"author": "Albert Einstein"
}
]
}

View File

@ -1,5 +1,5 @@
import { defaultProfileImage } from '../../common/utils/constantStrings.json';
import { getRandomQuote } from '../../common/app/utils/quotes';
import { randomQuote } from '../../common/app/utils/get-words';
import { cachedMap } from '../utils/map';
// import NewsFeed from '../rss';
@ -37,7 +37,7 @@ module.exports = function(app, done) {
function index(req, res) {
const { user } = req;
const homePage = user ? 'userHome' : 'noUserHome';
const { quote, author} = getRandomQuote();
const { quote, author} = randomQuote();
const title = user ?
`Welcome, ${user.name ? user.name : 'Camper'}!` :
'Learn to Code and Help Nonprofits';

View File

@ -1,7 +1,7 @@
.row.quote-partial
.col-xs-12.col-sm-8.col-sm-offset-2
.col-xs-12.col-sm-10.col-sm-offset-1
blockquote.blockquote
span
q #{quote}
footer
cite.blockquote-footer=author
q=quote
.spacer
footer.quote-author.blockquote-footer=author