This commit is contained in:
Noah Pombas
2024-08-25 21:08:47 +02:00
commit fee043e269
4 changed files with 683 additions and 0 deletions

74
index.html Normal file
View File

@@ -0,0 +1,74 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Motivational Quotes</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<script src="https://cdn.jsdelivr.net/npm/html2canvas@1.4.1/dist/html2canvas.min.js"></script>
</head>
<body>
<!-- Wrapper to center the container -->
<div class="container-wrapper">
<div class="container text-center">
<div id="quote" class="my-4">Loading...</div>
<div id="author" class="mb-4"></div>
</div>
<!-- Button outside the container but inside the wrapper -->
<button id="new-quote" class="btn btn-primary btn-lg">New Quote</button>
<!-- Screenshot Button -->
<button id="screenshot-button" class="btn btn-secondary btn-lg">📷 Take Screenshot</button>
<button id="clipboard-button" class="btn btn-secondary btn-lg">📋 Copy to Clipboard</button>
</div>
<!-- Floating Settings Button -->
<button id="settings-button" class="btn btn-primary btn-circle">⚙️</button>
<!-- Settings Modal -->
<div id="settings-modal" class="modal fade" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Settings</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="form-group">
<label for="bg-color">Background Color:</label>
<input type="color" id="bg-color" class="form-control">
</div>
<div class="form-group">
<label for="text-color">Text Color:</label>
<input type="color" id="text-color" class="form-control">
</div>
<div class="form-group">
<label for="box-color">Box Color:</label>
<input type="color" id="box-color" class="form-control">
</div>
<div class="form-group">
<label for="font-size">Font Size:</label>
<input type="range" id="font-size" class="custom-range" min="16" max="36" value="24">
<small class="form-text text-muted">Current font size: <span id="font-size-value">24px</span></small>
</div>
<button id="toggle-dark-mode" class="btn btn-secondary btn-block">Toggle Dark Mode</button>
<button id="reset-settings" class="btn btn-danger btn-block mt-2">Reset</button>
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="footer fixed-bottom text-center py-3">
<p class="mb-0">© Noah Pombas | <a href="mailto:info@noahpombas.ch">info@noahpombas.ch</a> | <a href="https://noahpombas.ch" target="_blank">noahpombas.ch</a></p>
</footer>
<!-- Scripts -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.3/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<script src="script.js"></script>
</body>
</html>

252
quotes.json Normal file
View File

@@ -0,0 +1,252 @@
[
{ "text": "The only way to do great work is to love what you do.", "author": "Steve Jobs" },
{ "text": "Believe you can and you're halfway there.", "author": "Theodore Roosevelt" },
{ "text": "It does not matter how slowly you go as long as you do not stop.", "author": "Confucius" },
{ "text": "You are never too old to set another goal or to dream a new dream.", "author": "C.S. Lewis" },
{ "text": "The future belongs to those who believe in the beauty of their dreams.", "author": "Eleanor Roosevelt" },
{ "text": "Success usually comes to those who are too busy to be looking for it.", "author": "Henry David Thoreau" },
{ "text": "Dont watch the clock; do what it does. Keep going.", "author": "Sam Levenson" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "The best way to predict the future is to invent it.", "author": "Alan Kay" },
{ "text": "You miss 100% of the shots you dont take.", "author": "Wayne Gretzky" },
{ "text": "The only limit to our realization of tomorrow is our doubts of today.", "author": "Franklin D. Roosevelt" },
{ "text": "Act as if what you do makes a difference. It does.", "author": "William James" },
{ "text": "Success is not in what you have, but who you are.", "author": "Bo Bennett" },
{ "text": "What lies behind us and what lies before us are tiny matters compared to what lies within us.", "author": "Ralph Waldo Emerson" },
{ "text": "The way to get started is to quit talking and begin doing.", "author": "Walt Disney" },
{ "text": "You do not find the happy life. You make it.", "author": "Camilla E. Kimball" },
{ "text": "The purpose of our lives is to be happy.", "author": "Dalai Lama" },
{ "text": "In the end, we will remember not the words of our enemies, but the silence of our friends.", "author": "Martin Luther King Jr." },
{ "text": "Keep your face always toward the sunshine—and shadows will fall behind you.", "author": "Walt Whitman" },
{ "text": "Opportunities don't happen. You create them.", "author": "Chris Grosser" },
{ "text": "The only person you are destined to become is the person you decide to be.", "author": "Ralph Waldo Emerson" },
{ "text": "The best revenge is massive success.", "author": "Frank Sinatra" },
{ "text": "Dream big and dare to fail.", "author": "Norman Vaughan" },
{ "text": "You are never too old to set another goal or to dream a new dream.", "author": "C.S. Lewis" },
{ "text": "Everything youve ever wanted is on the other side of fear.", "author": "George Addair" },
{ "text": "Success is not final, failure is not fatal: It is the courage to continue that counts.", "author": "Winston Churchill" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "Believe you can and you're halfway there.", "author": "Theodore Roosevelt" },
{ "text": "It does not matter how slowly you go as long as you do not stop.", "author": "Confucius" },
{ "text": "The future belongs to those who believe in the beauty of their dreams.", "author": "Eleanor Roosevelt" },
{ "text": "Success usually comes to those who are too busy to be looking for it.", "author": "Henry David Thoreau" },
{ "text": "Dont watch the clock; do what it does. Keep going.", "author": "Sam Levenson" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "The best way to predict the future is to invent it.", "author": "Alan Kay" },
{ "text": "You miss 100% of the shots you dont take.", "author": "Wayne Gretzky" },
{ "text": "The only limit to our realization of tomorrow is our doubts of today.", "author": "Franklin D. Roosevelt" },
{ "text": "Act as if what you do makes a difference. It does.", "author": "William James" },
{ "text": "Success is not in what you have, but who you are.", "author": "Bo Bennett" },
{ "text": "What lies behind us and what lies before us are tiny matters compared to what lies within us.", "author": "Ralph Waldo Emerson" },
{ "text": "The way to get started is to quit talking and begin doing.", "author": "Walt Disney" },
{ "text": "You do not find the happy life. You make it.", "author": "Camilla E. Kimball" },
{ "text": "The purpose of our lives is to be happy.", "author": "Dalai Lama" },
{ "text": "In the end, we will remember not the words of our enemies, but the silence of our friends.", "author": "Martin Luther King Jr." },
{ "text": "Keep your face always toward the sunshine—and shadows will fall behind you.", "author": "Walt Whitman" },
{ "text": "Opportunities don't happen. You create them.", "author": "Chris Grosser" },
{ "text": "The only person you are destined to become is the person you decide to be.", "author": "Ralph Waldo Emerson" },
{ "text": "The best revenge is massive success.", "author": "Frank Sinatra" },
{ "text": "Dream big and dare to fail.", "author": "Norman Vaughan" },
{ "text": "You are never too old to set another goal or to dream a new dream.", "author": "C.S. Lewis" },
{ "text": "Everything youve ever wanted is on the other side of fear.", "author": "George Addair" },
{ "text": "Success is not final, failure is not fatal: It is the courage to continue that counts.", "author": "Winston Churchill" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "Believe you can and you're halfway there.", "author": "Theodore Roosevelt" },
{ "text": "It does not matter how slowly you go as long as you do not stop.", "author": "Confucius" },
{ "text": "The future belongs to those who believe in the beauty of their dreams.", "author": "Eleanor Roosevelt" },
{ "text": "Success usually comes to those who are too busy to be looking for it.", "author": "Henry David Thoreau" },
{ "text": "Dont watch the clock; do what it does. Keep going.", "author": "Sam Levenson" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "The best way to predict the future is to invent it.", "author": "Alan Kay" },
{ "text": "You miss 100% of the shots you dont take.", "author": "Wayne Gretzky" },
{ "text": "The only limit to our realization of tomorrow is our doubts of today.", "author": "Franklin D. Roosevelt" },
{ "text": "Act as if what you do makes a difference. It does.", "author": "William James" },
{ "text": "Success is not in what you have, but who you are.", "author": "Bo Bennett" },
{ "text": "What lies behind us and what lies before us are tiny matters compared to what lies within us.", "author": "Ralph Waldo Emerson" },
{ "text": "The way to get started is to quit talking and begin doing.", "author": "Walt Disney" },
{ "text": "You do not find the happy life. You make it.", "author": "Camilla E. Kimball" },
{ "text": "The purpose of our lives is to be happy.", "author": "Dalai Lama" },
{ "text": "In the end, we will remember not the words of our enemies, but the silence of our friends.", "author": "Martin Luther King Jr." },
{ "text": "Keep your face always toward the sunshine—and shadows will fall behind you.", "author": "Walt Whitman" },
{ "text": "Opportunities don't happen. You create them.", "author": "Chris Grosser" },
{ "text": "The only person you are destined to become is the person you decide to be.", "author": "Ralph Waldo Emerson" },
{ "text": "The best revenge is massive success.", "author": "Frank Sinatra" },
{ "text": "Dream big and dare to fail.", "author": "Norman Vaughan" },
{ "text": "You are never too old to set another goal or to dream a new dream.", "author": "C.S. Lewis" },
{ "text": "Everything youve ever wanted is on the other side of fear.", "author": "George Addair" },
{ "text": "Success is not final, failure is not fatal: It is the courage to continue that counts.", "author": "Winston Churchill" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "Believe you can and you're halfway there.", "author": "Theodore Roosevelt" },
{ "text": "It does not matter how slowly you go as long as you do not stop.", "author": "Confucius" },
{ "text": "The future belongs to those who believe in the beauty of their dreams.", "author": "Eleanor Roosevelt" },
{ "text": "Success usually comes to those who are too busy to be looking for it.", "author": "Henry David Thoreau" },
{ "text": "Dont watch the clock; do what it does. Keep going.", "author": "Sam Levenson" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "The best way to predict the future is to invent it.", "author": "Alan Kay" },
{ "text": "You miss 100% of the shots you dont take.", "author": "Wayne Gretzky" },
{ "text": "The only limit to our realization of tomorrow is our doubts of today.", "author": "Franklin D. Roosevelt" },
{ "text": "Act as if what you do makes a difference. It does.", "author": "William James" },
{ "text": "Success is not in what you have, but who you are.", "author": "Bo Bennett" },
{ "text": "What lies behind us and what lies before us are tiny matters compared to what lies within us.", "author": "Ralph Waldo Emerson" },
{ "text": "The way to get started is to quit talking and begin doing.", "author": "Walt Disney" },
{ "text": "You do not find the happy life. You make it.", "author": "Camilla E. Kimball" },
{ "text": "The purpose of our lives is to be happy.", "author": "Dalai Lama" },
{ "text": "In the end, we will remember not the words of our enemies, but the silence of our friends.", "author": "Martin Luther King Jr." },
{ "text": "Keep your face always toward the sunshine—and shadows will fall behind you.", "author": "Walt Whitman" },
{ "text": "Opportunities don't happen. You create them.", "author": "Chris Grosser" },
{ "text": "The only person you are destined to become is the person you decide to be.", "author": "Ralph Waldo Emerson" },
{ "text": "The best revenge is massive success.", "author": "Frank Sinatra" },
{ "text": "Dream big and dare to fail.", "author": "Norman Vaughan" },
{ "text": "You are never too old to set another goal or to dream a new dream.", "author": "C.S. Lewis" },
{ "text": "Everything youve ever wanted is on the other side of fear.", "author": "George Addair" },
{ "text": "Success is not final, failure is not fatal: It is the courage to continue that counts.", "author": "Winston Churchill" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "Believe you can and you're halfway there.", "author": "Theodore Roosevelt" },
{ "text": "It does not matter how slowly you go as long as you do not stop.", "author": "Confucius" },
{ "text": "The future belongs to those who believe in the beauty of their dreams.", "author": "Eleanor Roosevelt" },
{ "text": "Success usually comes to those who are too busy to be looking for it.", "author": "Henry David Thoreau" },
{ "text": "Dont watch the clock; do what it does. Keep going.", "author": "Sam Levenson" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "The best way to predict the future is to invent it.", "author": "Alan Kay" },
{ "text": "You miss 100% of the shots you dont take.", "author": "Wayne Gretzky" },
{ "text": "The only limit to our realization of tomorrow is our doubts of today.", "author": "Franklin D. Roosevelt" },
{ "text": "Act as if what you do makes a difference. It does.", "author": "William James" },
{ "text": "Success is not in what you have, but who you are.", "author": "Bo Bennett" },
{ "text": "What lies behind us and what lies before us are tiny matters compared to what lies within us.", "author": "Ralph Waldo Emerson" },
{ "text": "The way to get started is to quit talking and begin doing.", "author": "Walt Disney" },
{ "text": "You do not find the happy life. You make it.", "author": "Camilla E. Kimball" },
{ "text": "The purpose of our lives is to be happy.", "author": "Dalai Lama" },
{ "text": "In the end, we will remember not the words of our enemies, but the silence of our friends.", "author": "Martin Luther King Jr." },
{ "text": "Keep your face always toward the sunshine—and shadows will fall behind you.", "author": "Walt Whitman" },
{ "text": "Opportunities don't happen. You create them.", "author": "Chris Grosser" },
{ "text": "The only person you are destined to become is the person you decide to be.", "author": "Ralph Waldo Emerson" },
{ "text": "The best revenge is massive success.", "author": "Frank Sinatra" },
{ "text": "Dream big and dare to fail.", "author": "Norman Vaughan" },
{ "text": "You are never too old to set another goal or to dream a new dream.", "author": "C.S. Lewis" },
{ "text": "Everything youve ever wanted is on the other side of fear.", "author": "George Addair" },
{ "text": "Success is not final, failure is not fatal: It is the courage to continue that counts.", "author": "Winston Churchill" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "Believe you can and you're halfway there.", "author": "Theodore Roosevelt" },
{ "text": "It does not matter how slowly you go as long as you do not stop.", "author": "Confucius" },
{ "text": "The future belongs to those who believe in the beauty of their dreams.", "author": "Eleanor Roosevelt" },
{ "text": "Success usually comes to those who are too busy to be looking for it.", "author": "Henry David Thoreau" },
{ "text": "Dont watch the clock; do what it does. Keep going.", "author": "Sam Levenson" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "The best way to predict the future is to invent it.", "author": "Alan Kay" },
{ "text": "You miss 100% of the shots you dont take.", "author": "Wayne Gretzky" },
{ "text": "The only limit to our realization of tomorrow is our doubts of today.", "author": "Franklin D. Roosevelt" },
{ "text": "Act as if what you do makes a difference. It does.", "author": "William James" },
{ "text": "Success is not in what you have, but who you are.", "author": "Bo Bennett" },
{ "text": "What lies behind us and what lies before us are tiny matters compared to what lies within us.", "author": "Ralph Waldo Emerson" },
{ "text": "The way to get started is to quit talking and begin doing.", "author": "Walt Disney" },
{ "text": "You do not find the happy life. You make it.", "author": "Camilla E. Kimball" },
{ "text": "The purpose of our lives is to be happy.", "author": "Dalai Lama" },
{ "text": "In the end, we will remember not the words of our enemies, but the silence of our friends.", "author": "Martin Luther King Jr." },
{ "text": "Keep your face always toward the sunshine—and shadows will fall behind you.", "author": "Walt Whitman" },
{ "text": "Opportunities don't happen. You create them.", "author": "Chris Grosser" },
{ "text": "The only person you are destined to become is the person you decide to be.", "author": "Ralph Waldo Emerson" },
{ "text": "The best revenge is massive success.", "author": "Frank Sinatra" },
{ "text": "Dream big and dare to fail.", "author": "Norman Vaughan" },
{ "text": "You are never too old to set another goal or to dream a new dream.", "author": "C.S. Lewis" },
{ "text": "Everything youve ever wanted is on the other side of fear.", "author": "George Addair" },
{ "text": "Success is not final, failure is not fatal: It is the courage to continue that counts.", "author": "Winston Churchill" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "Believe you can and you're halfway there.", "author": "Theodore Roosevelt" },
{ "text": "It does not matter how slowly you go as long as you do not stop.", "author": "Confucius" },
{ "text": "The future belongs to those who believe in the beauty of their dreams.", "author": "Eleanor Roosevelt" },
{ "text": "Success usually comes to those who are too busy to be looking for it.", "author": "Henry David Thoreau" },
{ "text": "Dont watch the clock; do what it does. Keep going.", "author": "Sam Levenson" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "The best way to predict the future is to invent it.", "author": "Alan Kay" },
{ "text": "You miss 100% of the shots you dont take.", "author": "Wayne Gretzky" },
{ "text": "The only limit to our realization of tomorrow is our doubts of today.", "author": "Franklin D. Roosevelt" },
{ "text": "Act as if what you do makes a difference. It does.", "author": "William James" },
{ "text": "Success is not in what you have, but who you are.", "author": "Bo Bennett" },
{ "text": "What lies behind us and what lies before us are tiny matters compared to what lies within us.", "author": "Ralph Waldo Emerson" },
{ "text": "The way to get started is to quit talking and begin doing.", "author": "Walt Disney" },
{ "text": "You do not find the happy life. You make it.", "author": "Camilla E. Kimball" },
{ "text": "The purpose of our lives is to be happy.", "author": "Dalai Lama" },
{ "text": "In the end, we will remember not the words of our enemies, but the silence of our friends.", "author": "Martin Luther King Jr." },
{ "text": "Keep your face always toward the sunshine—and shadows will fall behind you.", "author": "Walt Whitman" },
{ "text": "Opportunities don't happen. You create them.", "author": "Chris Grosser" },
{ "text": "The only person you are destined to become is the person you decide to be.", "author": "Ralph Waldo Emerson" },
{ "text": "The best revenge is massive success.", "author": "Frank Sinatra" },
{ "text": "Dream big and dare to fail.", "author": "Norman Vaughan" },
{ "text": "You are never too old to set another goal or to dream a new dream.", "author": "C.S. Lewis" },
{ "text": "Everything youve ever wanted is on the other side of fear.", "author": "George Addair" },
{ "text": "Success is not final, failure is not fatal: It is the courage to continue that counts.", "author": "Winston Churchill" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "Believe you can and you're halfway there.", "author": "Theodore Roosevelt" },
{ "text": "It does not matter how slowly you go as long as you do not stop.", "author": "Confucius" },
{ "text": "The future belongs to those who believe in the beauty of their dreams.", "author": "Eleanor Roosevelt" },
{ "text": "Success usually comes to those who are too busy to be looking for it.", "author": "Henry David Thoreau" },
{ "text": "Dont watch the clock; do what it does. Keep going.", "author": "Sam Levenson" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "The best way to predict the future is to invent it.", "author": "Alan Kay" },
{ "text": "You miss 100% of the shots you dont take.", "author": "Wayne Gretzky" },
{ "text": "The only limit to our realization of tomorrow is our doubts of today.", "author": "Franklin D. Roosevelt" },
{ "text": "Act as if what you do makes a difference. It does.", "author": "William James" },
{ "text": "Success is not in what you have, but who you are.", "author": "Bo Bennett" },
{ "text": "What lies behind us and what lies before us are tiny matters compared to what lies within us.", "author": "Ralph Waldo Emerson" },
{ "text": "The way to get started is to quit talking and begin doing.", "author": "Walt Disney" },
{ "text": "You do not find the happy life. You make it.", "author": "Camilla E. Kimball" },
{ "text": "The purpose of our lives is to be happy.", "author": "Dalai Lama" },
{ "text": "In the end, we will remember not the words of our enemies, but the silence of our friends.", "author": "Martin Luther King Jr." },
{ "text": "Keep your face always toward the sunshine—and shadows will fall behind you.", "author": "Walt Whitman" },
{ "text": "Opportunities don't happen. You create them.", "author": "Chris Grosser" },
{ "text": "The only person you are destined to become is the person you decide to be.", "author": "Ralph Waldo Emerson" },
{ "text": "The best revenge is massive success.", "author": "Frank Sinatra" },
{ "text": "Dream big and dare to fail.", "author": "Norman Vaughan" },
{ "text": "You are never too old to set another goal or to dream a new dream.", "author": "C.S. Lewis" },
{ "text": "Everything youve ever wanted is on the other side of fear.", "author": "George Addair" },
{ "text": "Success is not final, failure is not fatal: It is the courage to continue that counts.", "author": "Winston Churchill" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "Believe you can and you're halfway there.", "author": "Theodore Roosevelt" },
{ "text": "It does not matter how slowly you go as long as you do not stop.", "author": "Confucius" },
{ "text": "The future belongs to those who believe in the beauty of their dreams.", "author": "Eleanor Roosevelt" },
{ "text": "Success usually comes to those who are too busy to be looking for it.", "author": "Henry David Thoreau" },
{ "text": "Dont watch the clock; do what it does. Keep going.", "author": "Sam Levenson" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "The best way to predict the future is to invent it.", "author": "Alan Kay" },
{ "text": "You miss 100% of the shots you dont take.", "author": "Wayne Gretzky" },
{ "text": "The only limit to our realization of tomorrow is our doubts of today.", "author": "Franklin D. Roosevelt" },
{ "text": "Act as if what you do makes a difference. It does.", "author": "William James" },
{ "text": "Success is not in what you have, but who you are.", "author": "Bo Bennett" },
{ "text": "What lies behind us and what lies before us are tiny matters compared to what lies within us.", "author": "Ralph Waldo Emerson" },
{ "text": "The way to get started is to quit talking and begin doing.", "author": "Walt Disney" },
{ "text": "You do not find the happy life. You make it.", "author": "Camilla E. Kimball" },
{ "text": "The purpose of our lives is to be happy.", "author": "Dalai Lama" },
{ "text": "In the end, we will remember not the words of our enemies, but the silence of our friends.", "author": "Martin Luther King Jr." },
{ "text": "Keep your face always toward the sunshine—and shadows will fall behind you.", "author": "Walt Whitman" },
{ "text": "Opportunities don't happen. You create them.", "author": "Chris Grosser" },
{ "text": "The only person you are destined to become is the person you decide to be.", "author": "Ralph Waldo Emerson" },
{ "text": "The best revenge is massive success.", "author": "Frank Sinatra" },
{ "text": "Dream big and dare to fail.", "author": "Norman Vaughan" },
{ "text": "You are never too old to set another goal or to dream a new dream.", "author": "C.S. Lewis" },
{ "text": "Everything youve ever wanted is on the other side of fear.", "author": "George Addair" },
{ "text": "Success is not final, failure is not fatal: It is the courage to continue that counts.", "author": "Winston Churchill" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "Believe you can and you're halfway there.", "author": "Theodore Roosevelt" },
{ "text": "It does not matter how slowly you go as long as you do not stop.", "author": "Confucius" },
{ "text": "The future belongs to those who believe in the beauty of their dreams.", "author": "Eleanor Roosevelt" },
{ "text": "Success usually comes to those who are too busy to be looking for it.", "author": "Henry David Thoreau" },
{ "text": "Dont watch the clock; do what it does. Keep going.", "author": "Sam Levenson" },
{ "text": "Hardships often prepare ordinary people for an extraordinary destiny.", "author": "C.S. Lewis" },
{ "text": "The best way to predict the future is to invent it.", "author": "Alan Kay" },
{ "text": "You miss 100% of the shots you dont take.", "author": "Wayne Gretzky" },
{ "text": "The only limit to our realization of tomorrow is our doubts of today.", "author": "Franklin D. Roosevelt" },
{ "text": "Act as if what you do makes a difference. It does.", "author": "William James" },
{ "text": "Success is not in what you have, but who you are.", "author": "Bo Bennett" },
{ "text": "What lies behind us and what lies before us are tiny matters compared to what lies within us.", "author": "Ralph Waldo Emerson" },
{ "text": "The way to get started is to quit talking and begin doing.", "author": "Walt Disney" },
{ "text": "You do not find the happy life. You make it.", "author": "Camilla E. Kimball" },
{ "text": "The purpose of our lives is to be happy.", "author": "Dalai Lama" },
{ "text": "In the end, we will remember not the words of our enemies, but the silence of our friends.", "author": "Martin Luther King Jr." },
{ "text": "Keep your face always toward the sunshine—and shadows will fall behind you.", "author": "Walt Whitman" },
{ "text": "Opportunities don't happen. You create them.", "author": "Chris Grosser" },
{ "text": "The only person you are destined to become is the person you decide to be.", "author": "Ralph Waldo Emerson" },
{ "text": "The best revenge is massive success.", "author": "Frank Sinatra" },
{ "text": "Dream big and dare to fail.", "author": "Norman Vaughan" },
{ "text": "You are never too old to set another goal or to dream a new dream.", "author": "C.S. Lewis" },
{ "text": "Everything youve ever wanted is on the other side of fear.", "author": "George Addair" }
]

179
script.js Normal file
View File

@@ -0,0 +1,179 @@
document.addEventListener('DOMContentLoaded', () => {
const settingsButton = document.getElementById('settings-button');
const screenshotButton = document.getElementById('screenshot-button');
const copyScreenshotButton = document.getElementById('clipboard-button');
const quoteElement = document.getElementById('quote');
const authorElement = document.getElementById('author');
const button = document.getElementById('new-quote');
const bgColorInput = document.getElementById('bg-color');
const textColorInput = document.getElementById('text-color');
const boxColorInput = document.getElementById('box-color');
const fontSizeInput = document.getElementById('font-size');
const fontSizeValue = document.getElementById('font-size-value');
const darkModeButton = document.getElementById('toggle-dark-mode');
const resetButton = document.getElementById('reset-settings');
const container = document.querySelector('.container');
const body = document.body;
const footer = document.querySelector('footer');
const settingsModal = new bootstrap.Modal(document.getElementById('settings-modal'));
let quotes = [];
let isDarkMode = localStorage.getItem('darkMode') === 'true'; // Retrieve mode preference
async function fetchQuotes() {
try {
const response = await fetch('quotes.json');
if (!response.ok) throw new Error('Network response was not ok');
quotes = await response.json();
displayQuote(); // Display a quote when data is fetched
} catch (error) {
console.error('There was a problem with the fetch operation:', error);
quoteElement.textContent = "Failed to load quotes.";
}
}
function getRandomQuote() {
const randomIndex = Math.floor(Math.random() * quotes.length);
return quotes[randomIndex];
}
function displayQuote() {
if (quotes.length === 0) {
quoteElement.textContent = "No quotes available.";
authorElement.textContent = "";
return;
}
const { text, author } = getRandomQuote();
quoteElement.textContent = `"${text}"`;
authorElement.textContent = `${author}`;
}
function applyDarkMode() {
body.classList.add('dark-mode');
container.style.backgroundColor = '#444';
quoteElement.style.color = '#f0f0f0';
authorElement.style.color = '#ccc';
footer.style.backgroundColor = '#222';
footer.style.color = '#f0f0f0';
darkModeButton.textContent = 'Light Mode';
document.querySelectorAll('.modal-content').forEach(modal => {
modal.classList.add('dark-mode');
});
localStorage.setItem('darkMode', 'true'); // Save mode preference
}
function applyLightMode() {
body.classList.remove('dark-mode');
container.style.backgroundColor = '#fff';
quoteElement.style.color = '#333';
authorElement.style.color = '#555';
footer.style.backgroundColor = '#f8f9fa';
footer.style.color = '#333';
darkModeButton.textContent = 'Dark Mode';
document.querySelectorAll('.modal-content').forEach(modal => {
modal.classList.remove('dark-mode');
});
localStorage.setItem('darkMode', 'false'); // Save mode preference
}
function resetToDefault() {
// Reset to dark mode and set default values
applyDarkMode();
// Reset color and font size inputs to default dark mode settings
bgColorInput.value = '#333';
textColorInput.value = '#f0f0f0';
boxColorInput.value = '#444';
fontSizeInput.value = 24;
fontSizeValue.textContent = '24px';
// Apply reset values
body.style.backgroundColor = '#333';
quoteElement.style.color = '#f0f0f0';
authorElement.style.color = '#ccc';
container.style.backgroundColor = '#444';
quoteElement.style.fontSize = '24px';
authorElement.style.fontSize = '24px';
}
// Initialize with saved mode preference
if (isDarkMode) {
applyDarkMode();
} else {
applyLightMode();
}
button.addEventListener('click', displayQuote);
bgColorInput.addEventListener('input', (e) => {
body.style.backgroundColor = e.target.value;
});
textColorInput.addEventListener('input', (e) => {
quoteElement.style.color = e.target.value;
authorElement.style.color = e.target.value;
});
boxColorInput.addEventListener('input', (e) => {
container.style.backgroundColor = e.target.value;
});
fontSizeInput.addEventListener('input', (e) => {
const fontSize = `${e.target.value}px`;
fontSizeValue.textContent = fontSize;
quoteElement.style.fontSize = fontSize;
authorElement.style.fontSize = fontSize;
});
darkModeButton.addEventListener('click', () => {
isDarkMode = !isDarkMode;
if (isDarkMode) {
applyDarkMode();
} else {
applyLightMode();
}
});
settingsButton.addEventListener('click', () => {
settingsModal.show();
});
resetButton.addEventListener('click', () => {
resetToDefault();
});
function takeScreenshot() {
html2canvas(container).then(canvas => {
// Create a link element and set its href to the data URL of the canvas
const link = document.createElement('a');
link.href = canvas.toDataURL('image/png');
link.download = 'quote-screenshot.png';
link.click();
}).catch(error => {
console.error('Error taking screenshot:', error);
});
}
function copyScreenshotToClipboard() {
html2canvas(container).then(canvas => {
canvas.toBlob(blob => {
const item = new ClipboardItem({ 'image/png': blob });
navigator.clipboard.write([item]).then(() => {
alert('Screenshot copied to clipboard!');
}).catch(error => {
console.error('Error copying screenshot to clipboard:', error);
});
});
}).catch(error => {
console.error('Error taking screenshot:', error);
});
}
// Event listener for the screenshot button
screenshotButton.addEventListener('click', takeScreenshot);
copyScreenshotButton.addEventListener('click', copyScreenshotToClipboard);
// Fetch quotes and display a quote when the page loads
fetchQuotes();
});

178
style.css Normal file
View File

@@ -0,0 +1,178 @@
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
display: flex;
flex-direction: column;
min-height: 100vh;
margin: 0;
transition: background-color 0.3s ease, color 0.3s ease;
}
.container-wrapper {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
flex: 1;
padding: 20px;
}
.container {
background-color: #fff;
padding: 30px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
transition: background-color 0.3s ease, color 0.3s ease;
max-width: 800px; /* Adjust as needed */
width: 100%;
box-sizing: border-box; /* Ensure padding is included in width */
}
@media (max-width: 825px) {
.container {
padding: 20px;
width: 90%;
}
}
#quote {
font-size: 1.5em;
font-weight: bold;
margin-bottom: 20px;
color: #333;
transition: color 0.3s ease, font-size 0.3s ease;
}
#author {
font-size: 1.2em;
color: #555;
margin-bottom: 20px;
transition: color 0.3s ease;
}
button {
transition: background-color 0.3s ease, transform 0.2s ease;
}
button:hover {
background-color: #0056b3;
transform: scale(1.05);
}
button:active {
transform: scale(0.95);
}
/* Floating Settings Button */
#settings-button {
position: fixed;
bottom: 80px;
right: 20px;
border-radius: 50%;
padding: 15px;
font-size: 1.5em;
z-index: 1000;
}
/* Settings Modal */
.modal-content {
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.custom-range {
width: 100%;
}
.form-control {
margin-bottom: 10px;
}
.footer {
background-color: #f8f9fa;
border-top: 1px solid #dee2e6;
transition: background-color 0.3s ease, color 0.3s ease;
}
.footer a {
color: #007bff;
text-decoration: none;
}
.footer a:hover {
text-decoration: underline;
}
/* Dark mode styles */
.dark-mode {
background-color: #333;
color: #f0f0f0;
}
.dark-mode .container {
background-color: #444;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
.dark-mode #quote {
color: #f0f0f0;
}
.dark-mode #author {
color: #ccc;
}
.dark-mode button {
background-color: #0056b3;
color: #fff;
border-color: transparent;
}
.dark-mode #loading {
background-color: #000;
color: #fff;
}
.dark-mode .footer {
background-color: #222;
color: #f0f0f0;
}
.dark-mode .footer a {
color: #80bdff;
}
.dark-mode .footer a:hover {
text-decoration: underline;
}
/* Dark mode styles for the modal */
.dark-mode .modal-content {
background-color: #444;
color: #f0f0f0;
}
.dark-mode .modal-header {
border-bottom: 1px solid #555;
}
.dark-mode .modal-footer {
border-top: 1px solid #555;
}
/* Positioning the button correctly */
#new-quote {
margin-top: 20px;
padding: 10px 20px; /* Adjust button padding */
font-size: 1.1em; /* Adjust font size if needed */
width: auto; /* Ensure width is auto to avoid stretching */
max-width: 200px; /* Optional: Set a maximum width */
align-self: center; /* Center the button horizontally */
}
#screenshot-button,
#clipboard-button {
margin-top: 20px;
}