Introduces a Christmas-themed UI to the homepage during December, including festive colors and a holiday footer message. Adds a collection of Christmas quotes and updates quote selection logic to use them in December, with new utility functions for date checks and quote retrieval.
194 lines
16 KiB
TypeScript
194 lines
16 KiB
TypeScript
export interface Quote {
|
||
text: string;
|
||
author: string;
|
||
}
|
||
|
||
export const christmasQuotes: Quote[] = [
|
||
{ text: 'Christmas waves a magic wand over this world, and behold, everything is softer and more beautiful.', author: 'Norman Vincent Peale' },
|
||
{ text: 'The best way to spread Christmas cheer is singing loud for all to hear.', author: 'Buddy the Elf' },
|
||
{ text: 'Christmas is not a time nor a season, but a state of mind. To cherish peace and goodwill, to be plenteous in mercy, is to have the real spirit of Christmas.', author: 'Calvin Coolidge' },
|
||
{ text: 'I will honor Christmas in my heart, and try to keep it all the year.', author: 'Charles Dickens' },
|
||
{ text: 'Christmas is doing a little something extra for someone.', author: 'Charles M. Schulz' },
|
||
{ text: 'The magic of Christmas is not in the presents, but in His presence.', author: 'Anonymous' },
|
||
{ text: 'Christmas is the season of joy, of gift-giving, and of families united.', author: 'Norman Vincent Peale' },
|
||
{ text: 'Peace on earth will come to stay, when we live Christmas every day.', author: 'Helen Steiner Rice' },
|
||
{ text: 'Christmas is most truly Christmas when we celebrate it by giving the light of love to those who need it most.', author: 'Ruth Carter Stapleton' },
|
||
{ text: 'The best of all gifts around any Christmas tree: the presence of a happy family all wrapped up in each other.', author: 'Burton Hillis' },
|
||
{ text: 'Christmas is a season not only of rejoicing but of reflection.', author: 'Winston Churchill' },
|
||
{ text: 'Christmas is the day that holds all time together.', author: 'Alexander Smith' },
|
||
{ text: 'Gifts of time and love are surely the basic ingredients of a truly merry Christmas.', author: 'Peg Bracken' },
|
||
{ text: 'Christmas, my child, is love in action.', author: 'Dale Evans' },
|
||
{ text: 'Christmas is the spirit of giving without a thought of getting.', author: 'Thomas S. Monson' },
|
||
{ text: 'The joy of brightening other lives, bearing each others\' burdens, easing other\'s loads and supplanting empty hearts and lives with generous gifts becomes for us the magic of Christmas.', author: 'W. C. Jones' },
|
||
{ text: 'Christmas is a time when you get homesick - even when you\'re home.', author: 'Carol Nelson' },
|
||
{ text: 'Christmas is the season for kindling the fire of hospitality in the hall, the genial flame of charity in the heart.', author: 'Washington Irving' },
|
||
{ text: 'A lovely thing about Christmas is that it\'s compulsory, like a thunderstorm, and we all go through it together.', author: 'Garrison Keillor' },
|
||
{ text: 'Christmas is the day that holds all time together.', author: 'Alexander Smith' },
|
||
{ text: 'The best Christmas trees come very close to exceeding nature.', author: 'Andy Rooney' },
|
||
{ text: 'Christmas is not as much about opening our presents as opening our hearts.', author: 'Janice Maeditere' },
|
||
{ text: 'Christmas is doing a little something extra for someone.', author: 'Charles M. Schulz' },
|
||
{ text: 'At Christmas, all roads lead home.', author: 'Marjorie Holmes' },
|
||
{ text: 'Christmas is the season of joy, of gift-giving, and of families united.', author: 'Norman Vincent Peale' },
|
||
{ text: 'Christmas is the spirit of giving without a thought of getting.', author: 'Thomas S. Monson' },
|
||
{ text: 'May you have the gladness of Christmas which is hope; The spirit of Christmas which is peace; The heart of Christmas which is love.', author: 'Ada V. Hendricks' },
|
||
{ text: 'Christmas is a time when everybody wants his past forgotten and his present remembered.', author: 'Phyllis Diller' },
|
||
{ text: 'The best way to spread Christmas cheer is singing loud for all to hear.', author: 'Buddy the Elf' },
|
||
{ text: 'Christmas waves a magic wand over this world, and behold, everything is softer and more beautiful.', author: 'Norman Vincent Peale' },
|
||
];
|
||
|
||
export const businessQuotes: Quote[] = [
|
||
{ text: 'Your work is going to fill a large part of your life, and the only way to be truly satisfied is to do what you believe is great work.', author: 'Steve Jobs' },
|
||
{ text: 'Innovation distinguishes between a leader and a follower.', author: 'Steve Jobs' },
|
||
{ text: 'If you really look closely, most overnight successes took a long time.', author: 'Steve Jobs' },
|
||
{ text: 'The only way to do great work is to love what you do.', author: 'Steve Jobs' },
|
||
{ text: 'Get closer than ever to your customers. So close that you tell them what they need well before they realize it themselves.', author: 'Steve Jobs' },
|
||
{ text: 'Innovation is the ability to see change as an opportunity – not a threat.', author: 'Steve Jobs' },
|
||
{ text: 'Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple.', author: 'Steve Jobs' },
|
||
{ text: 'Your most unhappy customers are your greatest source of learning.', author: 'Bill Gates' },
|
||
{ text: 'As we look ahead into the next century, leaders will be those who empower others.', author: 'Bill Gates' },
|
||
{ text: 'The way to get started is to quit talking and begin doing.', author: 'Walt Disney' },
|
||
{ text: 'Chase the vision, not the money; the money will end up following you.', author: 'Tony Hsieh' },
|
||
{ text: "Opportunities don't happen. You create them.", author: 'Chris Grosser' },
|
||
{ text: 'The best way to predict the future is to create it.', author: 'Peter Drucker' },
|
||
{ text: 'Culture eats strategy for breakfast.', author: 'Peter Drucker' },
|
||
{ text: 'Entrepreneurship is neither a science nor an art. It is a practice.', author: 'Peter Drucker' },
|
||
{ text: 'If you are not willing to risk the usual, you will have to settle for the ordinary.', author: 'Jim Rohn' },
|
||
{ text: "It's not about ideas. It's about making ideas happen.", author: 'Scott Belsky' },
|
||
{ text: 'If you do build a great experience, customers tell each other about that. Word of mouth is very powerful.', author: 'Jeff Bezos' },
|
||
{ text: 'Work like hell. I mean you just have to put in 80 to 100 hour weeks every week.', author: 'Elon Musk' },
|
||
{ text: 'When something is important enough, you do it even if the odds are not in your favor.', author: 'Elon Musk' },
|
||
{ text: 'The secret of getting ahead is getting started.', author: 'Mark Twain' },
|
||
{ text: 'Success is not final; failure is not fatal: It is the courage to continue that counts.', author: 'Winston Churchill' },
|
||
{ text: 'Success is walking from failure to failure with no loss of enthusiasm.', author: 'Winston Churchill' },
|
||
{ text: 'Don’t watch the clock; do what it does. Keep going.', author: 'Sam Levenson' },
|
||
{ text: 'The future belongs to those who believe in the beauty of their dreams.', author: 'Eleanor Roosevelt' },
|
||
{ text: "Believe you can and you're halfway there.", author: 'Theodore Roosevelt' },
|
||
{ text: "If you can't fly, then run. If you can't run, then walk. If you can't walk, then crawl. But whatever you do, you have to keep moving forward.", author: 'Martin Luther King Jr.' },
|
||
{ text: 'Strength and growth come only through continuous effort and struggle.', author: 'Napoleon Hill' },
|
||
{ text: 'The biggest risk is not taking any risk.', author: 'Mark Zuckerberg' },
|
||
{ text: 'Move fast and break things. Unless you are breaking stuff, you are not moving fast enough.', author: 'Mark Zuckerberg' },
|
||
{ text: "I have not failed. I've just found 10,000 ways that won't work.", author: 'Thomas Edison' },
|
||
{ text: 'Vision without execution is hallucination.', author: 'Thomas Edison' },
|
||
{ text: "What would you do if you weren't afraid?", author: 'Sheryl Sandberg' },
|
||
{ text: 'Done is better than perfect.', author: 'Sheryl Sandberg' },
|
||
{ text: 'When everything seems to be going against you, remember that the airplane takes off against the wind, not with it.', author: 'Henry Ford' },
|
||
{ text: 'Whether you think you can or you think you can’t, you’re right.', author: 'Henry Ford' },
|
||
{ text: "If you're not embarrassed by the first version of your product, you've launched too late.", author: 'Reid Hoffman' },
|
||
{ text: 'The only place where success comes before work is in the dictionary.', author: 'Vidal Sassoon' },
|
||
{ text: 'Make every detail perfect and limit the number of details to perfect.', author: 'Jack Dorsey' },
|
||
{ text: "There's no shortage of remarkable ideas, what's missing is the will to execute them.", author: 'Seth Godin' },
|
||
{ text: 'Always deliver more than expected.', author: 'Larry Page' },
|
||
{ text: 'Your reputation is more important than your paycheck.', author: 'Ryan Freitas' },
|
||
{ text: 'Ideas are easy. Implementation is hard.', author: 'Guy Kawasaki' },
|
||
{ text: 'Action is the foundational key to all success.', author: 'Pablo Picasso' },
|
||
{ text: 'Success usually comes to those who are too busy to be looking for it.', author: 'Henry David Thoreau' },
|
||
{ text: "No matter how brilliant your mind or strategy, if you're playing a solo game, you'll always lose out to a team.", author: 'Reid Hoffman' },
|
||
{ text: 'A leader is one who knows the way, goes the way, and shows the way.', author: 'John C. Maxwell' },
|
||
{ text: 'Leadership is the capacity to translate vision into reality.', author: 'Warren Bennis' },
|
||
{ text: 'Good business leaders create a vision, articulate the vision, passionately own the vision, and relentlessly drive it to completion.', author: 'Jack Welch' },
|
||
{ text: 'The function of leadership is to produce more leaders, not more followers.', author: 'Ralph Nader' },
|
||
{ text: 'A goal without a plan is just a wish.', author: 'Antoine de Saint-Exupéry' },
|
||
{ text: 'Be so good they can’t ignore you.', author: 'Steve Martin' },
|
||
{ text: 'Play long-term games with long-term people.', author: 'Naval Ravikant' },
|
||
{ text: 'Make something people want and sell that.', author: 'Paul Graham' },
|
||
{ text: 'It’s not whether you get knocked down, it’s whether you get up.', author: 'Vince Lombardi' },
|
||
{ text: 'Hardships often prepare ordinary people for an extraordinary destiny.', author: 'C.S. Lewis' },
|
||
{ text: 'Resilience is knowing that you are the only one that has the power and the responsibility to pick yourself up.', author: 'Mary Holloway' },
|
||
{ text: 'Success is how high you bounce when you hit bottom.', author: 'George S. Patton' },
|
||
{ text: "People don't buy what you do; they buy why you do it.", author: 'Simon Sinek' },
|
||
{ text: 'The customer is the most important part of the production line.', author: 'W. Edwards Deming' },
|
||
{ text: "Customers may forget what you said but they'll never forget how you made them feel.", author: 'Maya Angelou' },
|
||
{ text: 'The true entrepreneur is a doer, not a dreamer.', author: 'Nolan Bushnell' },
|
||
{ text: 'Entrepreneurs are willing to work 80 hours a week to avoid working 40 hours a week.', author: 'Lori Greiner' },
|
||
{ text: 'Build something 100 people love, not something 1 million people kind of like.', author: 'Brian Chesky' },
|
||
{ text: 'Risk more than others think is safe. Dream more than others think is practical.', author: 'Howard Schultz' },
|
||
{ text: 'Fail often so you can succeed sooner.', author: 'Tom Kelley' },
|
||
{ text: 'Don’t worry about failure; you only have to be right once.', author: 'Drew Houston' },
|
||
{ text: 'Try not to become a man of success, but rather try to become a man of value.', author: 'Albert Einstein' },
|
||
{ text: "Compound interest is the eighth wonder of the world. He who understands it, earns it; he who doesn't, pays it.", author: 'Albert Einstein' },
|
||
{ text: 'In the middle of difficulty lies opportunity.', author: 'Albert Einstein' },
|
||
{ text: 'Price is what you pay. Value is what you get.', author: 'Warren Buffett' },
|
||
{ text: 'The best way to predict the future is to invent it.', author: 'Alan Kay' },
|
||
{ text: "Strategy is about making choices, trade-offs; it's about deliberately choosing to be different.", author: 'Michael Porter' },
|
||
{ text: 'Growth and comfort do not coexist.', author: 'Ginni Rometty' },
|
||
{ text: 'Disruption is about risk-taking, trusting your intuition, and rejecting the way things are supposed to be.', author: 'Whitney Wolfe Herd' },
|
||
{ text: "Don't be afraid to give up the good to go for the great.", author: 'John D. Rockefeller' },
|
||
{ text: 'A goal is a dream with a deadline.', author: 'Napoleon Hill' },
|
||
{ text: 'The man who moves a mountain begins by carrying away small stones.', author: 'Confucius' },
|
||
{ text: 'Every strike brings me closer to the next home run.', author: 'Babe Ruth' },
|
||
{ text: 'Do not be embarrassed by your failures, learn from them and start again.', author: 'Richard Branson' },
|
||
{ text: "Business opportunities are like buses, there's always another one coming.", author: 'Richard Branson' },
|
||
{ text: 'The most dangerous poison is the feeling of achievement. The antidote is to every evening think what can be done better tomorrow.', author: 'Ingvar Kamprad' },
|
||
{ text: 'Don’t count the days, make the days count.', author: 'Muhammad Ali' },
|
||
{ text: 'To win big, you sometimes have to take big risks.', author: 'Bill Gates' },
|
||
{ text: "If everything seems under control, you're not going fast enough.", author: 'Mario Andretti' },
|
||
{ text: "If you really want to do something, you'll find a way. If you don't, you'll find an excuse.", author: 'Jim Rohn' },
|
||
{ text: 'One day or day one. You decide.', author: 'Anonymous' },
|
||
{ text: 'Don’t be busy. Be productive.', author: 'Anonymous' },
|
||
{ text: 'Success isn’t owned, it’s leased. And rent is due every day.', author: 'J.J. Watt' },
|
||
{ text: 'Never give up on a dream just because of the time it will take to accomplish it. The time will pass anyway.', author: 'Earl Nightingale' },
|
||
{ text: "If you don't build your dream, someone else will hire you to help them build theirs.", author: 'Tony Gaskins' },
|
||
{ text: 'The way to get ahead is to start now. The secret is to get started.', author: 'Mark Twain' },
|
||
{ text: 'Success is not in what you have, but who you are.', author: 'Bo Bennett' },
|
||
{ text: "It's fine to celebrate success but it is more important to heed the lessons of failure.", author: 'Bill Gates' },
|
||
{ text: 'Success is getting what you want. Happiness is wanting what you get.', author: 'Dale Carnegie' },
|
||
{ text: 'Work until you no longer have to introduce yourself.', author: 'Anonymous' },
|
||
{ text: 'Don’t limit your challenges. Challenge your limits.', author: 'Jerry Dunn' },
|
||
{ text: "Don't settle. Don't finish crappy books. If you don't like the menu, leave the restaurant. If you're not on the right path, get off it.", author: 'Chris Brogan' },
|
||
{ text: 'A person who never made a mistake never tried anything new.', author: 'Albert Einstein' },
|
||
{ text: 'Business has only two functions — marketing and innovation.', author: 'Peter Drucker' },
|
||
];
|
||
|
||
export const quotes = businessQuotes;
|
||
export default businessQuotes;
|
||
|
||
/**
|
||
* Check if the current date is in December
|
||
*/
|
||
function isDecember(): boolean {
|
||
const now = new Date();
|
||
return now.getMonth() === 11; // December is month 11 (0-indexed)
|
||
}
|
||
|
||
/**
|
||
* Returns a random quote - Christmas quotes during December, business quotes otherwise
|
||
*/
|
||
export function getRandomQuote(): Quote {
|
||
if (isDecember()) {
|
||
const randomIndex = Math.floor(Math.random() * christmasQuotes.length);
|
||
return christmasQuotes[randomIndex];
|
||
}
|
||
const randomIndex = Math.floor(Math.random() * businessQuotes.length);
|
||
return businessQuotes[randomIndex];
|
||
}
|
||
|
||
/**
|
||
* Returns a random quote by a specific author if available,
|
||
* otherwise returns a random quote from any author
|
||
*/
|
||
export function getRandomQuoteByAuthor(author: string): Quote {
|
||
const quotesToSearch = isDecember() ? christmasQuotes : businessQuotes;
|
||
const authorQuotes = quotesToSearch.filter(quote =>
|
||
quote.author.toLowerCase() === author.toLowerCase()
|
||
);
|
||
if (authorQuotes.length === 0) return getRandomQuote();
|
||
const randomIndex = Math.floor(Math.random() * authorQuotes.length);
|
||
return authorQuotes[randomIndex];
|
||
}
|
||
|
||
/**
|
||
* Returns quotes filtered by a theme or keyword in the text
|
||
*/
|
||
export function getQuotesByTheme(keyword: string): Quote[] {
|
||
const quotesToSearch = isDecember() ? christmasQuotes : businessQuotes;
|
||
return quotesToSearch.filter(quote =>
|
||
quote.text.toLowerCase().includes(keyword.toLowerCase())
|
||
);
|
||
}
|
||
|
||
/**
|
||
* Returns all available quotes (Christmas quotes in December, business quotes otherwise)
|
||
*/
|
||
export function getAllQuotes(): Quote[] {
|
||
return isDecember() ? christmasQuotes : businessQuotes;
|
||
} |