Advertisement
Guest User

Untitled

a guest
Feb 9th, 2025
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import React, { useState } from 'react';
  2.  
  3. const LoveQuotesApp = () => {
  4. const [quote, setQuote] = useState('');
  5.  
  6. const quotes = [
  7. enter quotes here
  8. ];
  9.  
  10. const getRandomQuote = () => {
  11. if (quotes.length > 0) {
  12. const randomIndex = Math.floor(Math.random() * quotes.length);
  13. setQuote(quotes[randomIndex]);
  14. } else {
  15. setQuote("No quotes available. Please add some quotes to the list.");
  16. }
  17. };
  18.  
  19. return (
  20. <div style={styles.container}>
  21. <h1 style={styles.title}>💘 Love Quotes 💘</h1>
  22. <div style={styles.quoteBox}>
  23. <p style={styles.quote}>{quote || "Click 'New Quote' to get inspired!"}</p>
  24. </div>
  25. <button style={styles.button} onClick={getRandomQuote}>💟 New Quote 💟</button>
  26. </div>
  27. );
  28. };
  29.  
  30. const styles = {
  31. container: {
  32. textAlign: 'center',
  33. fontFamily: 'Arial, sans-serif',
  34. padding: '40px',
  35. backgroundColor: '#ffe6ff',
  36. borderRadius: '20px',
  37. maxWidth: '600px',
  38. margin: 'auto',
  39. marginTop: '50px',
  40. boxShadow: '0 0 30px rgba(0, 0, 0, 0.2)',
  41. border: '5px solid #ffb3e6',
  42. },
  43. title: {
  44. fontSize: '3em',
  45. color: '#ff66b2',
  46. marginBottom: '20px',
  47. textShadow: '2px 2px #ffb3e6',
  48. },
  49. quoteBox: {
  50. backgroundColor: '#ffffff',
  51. borderRadius: '15px',
  52. padding: '20px',
  53. margin: '20px 0',
  54. border: '3px dashed #ffb3e6',
  55. boxShadow: '0 0 20px rgba(0, 0, 0, 0.1)',
  56. },
  57. quote: {
  58. fontSize: '1.8em',
  59. color: '#333',
  60. fontStyle: 'italic',
  61. },
  62. button: {
  63. backgroundColor: '#ff66b2',
  64. color: '#fff',
  65. border: 'none',
  66. borderRadius: '10px',
  67. padding: '15px 30px',
  68. fontSize: '1.2em',
  69. cursor: 'pointer',
  70. transition: 'background-color 0.3s, transform 0.3s',
  71. boxShadow: '0 5px 15px rgba(0, 0, 0, 0.3)',
  72. },
  73. };
  74.  
  75. export default LoveQuotesApp;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement