diff --git a/index.html b/index.html new file mode 100644 index 0000000..6f8b0be --- /dev/null +++ b/index.html @@ -0,0 +1,13 @@ + + + + Random Acts of Kindness Generator + + + +

Random Acts of Kindness

+ +

+ + + diff --git a/script.js b/script.js new file mode 100644 index 0000000..cdd0959 --- /dev/null +++ b/script.js @@ -0,0 +1,310 @@ +const generateButton = document.getElementById("generateButton"); +const kindnessSuggestion = document.getElementById("kindnessSuggestion"); +const kindnessSuggestions = [ + "Hold the door open for someone.", + "Pay for a stranger's coffee or meal.", + "Give a compliment to a colleague.", + "Donate clothes to a charity.", + "Visit a nursing home and spend time with the residents.", + "Help a neighbor with yard work.", + "Leave a positive note for someone to find.", + "Offer your seat to someone in need on public transportation.", + "Volunteer at a local animal shelter.", + "Plant a tree to help the environment.", + "Send a thank-you card to someone who has helped you.", + "Buy groceries for a family in need.", + "Support a small local business.", + "Bake cookies for your coworkers.", + "Clean up litter in your neighborhood.", + "Donate blood to save lives.", + "Send care packages to soldiers overseas.", + "Offer to babysit for a friend or family member.", + "Give a homeless person a warm meal.", + "Write a letter of appreciation to a teacher.", + "Share your knowledge by tutoring someone in need.", + "Donate books to a library or school.", + "Send flowers to someone who could use a pick-me-up.", + "Help a friend move or organize their home.", + "Leave a generous tip for a server at a restaurant.", + "Offer to drive a friend who doesn't have transportation.", + "Listen attentively when someone needs to talk.", + "Support a cause you're passionate about with a donation.", + "Offer to do grocery shopping for an elderly neighbor.", + "Sponsor a child in need through a charity.", + "Help a coworker with a challenging task.", + "Share your umbrella on a rainy day.", + "Give up your seat to someone on a crowded bus or train.", + "Send a care package to a college student.", + "Help a friend or family member with their homework.", + "Donate to a local food bank.", + "Offer to walk a neighbor's dog.", + "Leave a positive online review for a business.", + "Give a thoughtful and meaningful gift to a loved one.", + "Support a friend's creative or entrepreneurial project.", + "Write a thank-you note to your postal worker.", + "Volunteer at a local shelter or soup kitchen.", + "Help a coworker meet a deadline by offering assistance.", + "Offer to mow a neighbor's lawn.", + "Donate blankets or warm clothing to a homeless shelter.", + "Share inspiring and uplifting content on social media.", + "Hold a fundraiser for a charitable cause.", + "Teach someone a new skill or hobby.", + "Give blood or platelets to a blood bank.", + "Create handmade cards for hospitalized children.", + "Share your knowledge and expertise with others.", + "Help a friend or family member with a home improvement project.", + "Offer your time as a mentor to someone in need.", + "Participate in a charity run or walk.", + "Donate school supplies to a local school.", + "Leave kind and encouraging comments online.", + "Support a local arts organization or theater.", + "Volunteer at a local environmental cleanup event.", + "Help a friend or coworker prepare for an important presentation.", + "Send care packages to troops overseas.", + "Donate gently used toys to a children's hospital.", + "Offer to do household chores for an elderly relative.", + "Support a friend's charity fundraising campaign.", + "Lend a hand at a community garden.", + "Share extra produce from your garden with neighbors.", + "Donate your old electronics to a recycling program.", + "Offer your time to read books to children at a library.", + "Write positive notes and leave them in public places for others to find.", + "Volunteer at an animal rescue organization.", + "Support a friend's career by attending their work-related events.", + "Offer to carpool with coworkers to reduce emissions.", + "Create handmade gifts for loved ones during holidays.", + "Organize a neighborhood cleanup day.", + "Donate to a wildlife conservation organization.", + "Help a neighbor with home repairs or maintenance.", + "Share your talents by performing for a local charity event.", + "Support a friend's crowdfunding campaign.", + "Donate to a disaster relief organization.", + "Participate in a charity auction or fundraiser.", + "Offer to walk or run with a friend who's training for a charity race.", + "Help a friend or family member with their spring cleaning.", + "Share your unused frequent flyer miles with a charitable organization.", + "Donate art supplies to a local school or community center.", + "Support a friend's music or art show by attending and promoting it.", + "Offer to cook a meal for a friend or family member in need.", + "Participate in a beach or park cleanup event.", + "Share positive news stories with others to brighten their day.", + "Donate to a medical research charity.", + "Help a coworker with a computer or technical issue.", + "Offer your time to assist with an after-school program for children.", + "Create care packages for the homeless with essential items.", + "Support a friend's educational or scholarship fund.", + "Donate to a clean water or sanitation project.", + "Offer your time to coach or mentor a youth sports team.", + "Volunteer at a senior center and spend time with elderly residents.", + "Share your knowledge by teaching a free workshop or class.", + "Donate art to a charity auction or art show.", + "Help a friend or family member with their holiday decorations.", + "Participate in a charity bike ride or cycling event.", + "Support a friend's charity gala or fundraising event.", + "Offer to pet-sit for a friend or neighbor when they're away.", + "Donate to a literacy or reading program for children.", + "Help a friend or family member with gardening or landscaping.", + "Share your expertise by providing free consulting or advice.", + "Support a friend's efforts to raise awareness about a cause.", + "Donate to a mental health or counseling organization.", + "Offer to tutor a student who needs academic help.", + "Volunteer at a local community center or youth club.", + "Help a friend or family member with their home organization.", + "Participate in a charity walkathon or marathon.", + "Donate to a disaster preparedness or relief organization.", + "Offer your time to assist with a local theater production.", + "Create handmade blankets for homeless shelters.", + "Support a friend's campaign to provide clean energy solutions.", + "Donate to a children's hospital or medical research center.", + "Help a coworker with a professional development project.", + "Offer to babysit for a friend or family member in need of a break.", + "Volunteer at a wildlife conservation or animal rescue center.", + "Share your skills by offering free workshops or classes online.", + "Donate to a music or arts program for underprivileged youth.", + "Support a friend's effort to provide clean water in developing countries.", + "Offer your time to help a local nonprofit with their administrative tasks.", + "Create care packages for troops serving overseas.", + "Donate to a disaster recovery or rebuilding organization.", + "Participate in a charity auction or art show for a good cause.", + "Help a friend or family member with their pet care.", + "Share your knowledge by providing free online tutorials.", + "Support a friend's campaign to combat homelessness.", + "Donate to a charity that provides education and scholarships.", + "Offer your time to help an environmental organization with conservation efforts.", + "Volunteer at a community center or food bank to assist those in need.", + "Help a coworker with their job search or career development.", + "Create care packages for families in need during the holidays.", + "Support a friend's initiative to combat hunger in your community.", + "Donate to a charity that provides clean drinking water to communities.", + "Offer your time to help a local charity with their fundraising events.", + "Share your skills by volunteering to teach workshops at a community center.", + "Support a friend's efforts to promote equality and social justice.", + "Donate to a charity that supports individuals with disabilities.", + "Participate in a charity race or marathon to raise funds for a cause.", + "Help a friend or family member with their home renovation or repair project.", + "Volunteer at a local school or library to assist students with learning.", + "Offer your time to mentor and guide aspiring entrepreneurs.", + "Create care packages for families affected by natural disasters.", + "Support a friend's campaign to improve healthcare access for all.", + "Donate to a charity that supports veterans and their families.", + "Offer your time to help a local organization provide shelter for the homeless.", + "Share your expertise by speaking at community events or conferences.", + "Support a friend's efforts to promote environmental conservation.", + "Donate to a charity that provides educational resources to underserved communities.", + "Participate in a charity golf tournament to raise funds for a cause.", + "Help a friend or family member with their art or creative project.", + "Volunteer at a local hospital to bring comfort to patients.", + "Offer your time to help a nonprofit organization with their advocacy work.", + "Create care packages for elderly individuals in assisted living facilities.", + "Support a friend's campaign to empower women and girls.", + "Donate to a charity that provides support and resources for the homeless.", + "Offer your time to assist a local animal shelter in caring for animals.", + "Share your skills by providing free counseling or therapy services.", + "Support a friend's efforts to combat climate change and protect the environment.", + "Donate to a charity that promotes mental health awareness and support.", + "Participate in a charity swim or water event to raise funds for a cause.", + "Help a friend or family member with their technology or IT-related needs.", + "Volunteer at a local community garden to promote sustainable agriculture.", + "Offer your time to help a nonprofit organization with their community outreach.", + "Create care packages for individuals facing economic hardship.", + "Support a friend's campaign to provide education and opportunities for children.", + "Donate to a charity that works to end human trafficking and exploitation.", + "Offer your time to assist a local school with educational programs.", + "Share your expertise by mentoring young professionals in your field.", + "Support a friend's efforts to promote wildlife conservation and protection.", + "Donate to a charity that provides food and nutrition to those in need.", + "Participate in a charity car wash or vehicle-related event for a cause.", + "Help a friend or family member with their photography or creative projects.", + "Volunteer at a local shelter to provide assistance and support to homeless individuals.", + "Offer your time to help a nonprofit organization with their social justice initiatives.", + "Create care packages for families affected by emergencies and crises.", + "Support a friend's campaign to provide clean and accessible water sources.", + "Donate to a charity that supports LGBTQ+ rights and advocacy.", + "Offer your time to assist a local community center in serving residents.", + "Share your skills by volunteering as a mentor for aspiring artists and performers.", + "Support a friend's efforts to promote education and literacy for all.", + "Donate to a charity that works to end child labor and exploitation.", + "Participate in a charity art exhibition or cultural event to raise funds for a cause.", + "Help a friend or family member with their fitness or wellness goals.", + "Volunteer at a local organization dedicated to helping people with disabilities.", + "Offer your time to help a nonprofit organization with their humanitarian missions.", + "Create care packages for individuals facing medical challenges and illnesses.", + "Support a friend's campaign to provide shelter and support for homeless youth.", + "Donate to a charity that promotes and protects animal rights and welfare.", + "Offer your time to assist a local food bank in distributing food to those in need.", + "Share your expertise by volunteering as a career counselor or job coach.", + "Support a friend's efforts to promote affordable housing and homelessness solutions.", + "Donate to a charity that provides disaster relief and recovery assistance.", + "Participate in a charity music concert or performance event to raise funds for a cause.", + "Help a friend or family member with their writing or creative writing projects.", + "Volunteer at a local organization that supports individuals struggling with addiction.", + "Offer your time to help a nonprofit organization with their international aid projects.", + "Create care packages for individuals experiencing isolation and loneliness.", + "Support a friend's campaign to provide clean and safe energy solutions.", + "Donate to a charity that works to end poverty and inequality.", + "Offer your time to assist a local library with literacy and reading programs.", + "Share your skills by volunteering as a life coach or personal development mentor.", + "Support a friend's efforts to promote cultural diversity and inclusion.", + "Donate to a charity that provides assistance to refugees and displaced individuals.", + "Participate in a charity theater production or performing arts event to raise funds for a cause.", + "Help a friend or family member with their music or music-related projects.", + "Volunteer at a local organization that supports individuals facing mental health challenges.", + "Offer your time to help a nonprofit organization with their community development projects.", + "Create care packages for individuals experiencing economic hardship and job loss.", + "Support a friend's campaign to provide education and opportunities for disadvantaged youth.", + "Donate to a charity that supports human rights and social justice initiatives.", + "Offer your time to assist a local museum with educational programs and exhibitions.", + "Share your skills by volunteering as a mentor for aspiring entrepreneurs and innovators.", + "Support a friend's efforts to promote environmental sustainability and conservation.", + "Donate to a charity that works to end hunger and food insecurity.", + "Participate in a charity dance performance or dance-a-thon to raise funds for a cause.", + "Help a friend or family member with their cooking or culinary projects.", + "Volunteer at a local organization that provides support and resources to the elderly.", + "Offer your time to help a nonprofit organization with their disaster response efforts.", + "Create care packages for families facing financial difficulties and homelessness.", + "Support a friend's campaign to provide access to clean water and sanitation facilities.", + "Donate to a charity that advocates for gender equality and women's rights.", + "Offer your time to assist a local community center with programs for youth and families.", + "Share your skills by volunteering as a coding or technology mentor for young learners.", + "Support a friend's efforts to promote healthcare access and medical assistance for all.", + "Donate to a charity that supports veterans and their families with essential services.", + "Participate in a charity fashion show or clothing drive to raise funds for a cause.", + "Help a friend or family member with their fashion or design-related projects.", + "Volunteer at a local organization that provides support and care for individuals with disabilities.", + "Offer your time to help a nonprofit organization with their educational and youth development programs.", + "Create care packages for individuals experiencing homelessness and housing insecurity.", + "Support a friend's campaign to promote clean energy solutions and environmental protection.", + "Donate to a charity that works to end child exploitation and provide education opportunities.", + "Offer your time to assist a local school with extracurricular activities and enrichment programs.", + "Share your skills by volunteering as a mentor or tutor for students in need of academic support.", + "Support a friend's efforts to promote wildlife conservation and protect endangered species.", + "Donate to a charity that provides nutritious meals and food assistance to underserved communities.", + "Participate in a charity golf tournament or sports event to raise funds for a cause.", + "Help a friend or family member with their interior design or home improvement projects.", + "Volunteer at a local organization that offers support and companionship to elderly individuals.", + "Offer your time to help a nonprofit organization with their social services and community outreach initiatives.", + "Create care packages for individuals facing medical challenges and health conditions.", + "Support a friend's campaign to provide shelter and assistance for homeless individuals and families.", + "Donate to a charity that advocates for animal welfare and provides care for rescued animals.", + "Offer your time to assist a local food bank with food distribution and assistance programs.", + "Share your expertise by volunteering as a career counselor or job placement advisor.", + "Support a friend's efforts to promote affordable housing and homelessness prevention.", + "Donate to a charity that offers disaster relief and support for affected communities.", + "Participate in a charity art exhibition or cultural event to raise funds for a cause.", + "Help a friend or family member with their visual arts or creative projects.", + "Volunteer at a local organization that provides support and rehabilitation for individuals with addiction.", + "Offer your time to help a nonprofit organization with their international humanitarian projects.", + "Create care packages for individuals experiencing isolation and loneliness.", + "Support a friend's campaign to provide access to renewable energy and environmental conservation.", + "Donate to a charity that works to end poverty and promote economic opportunities for all.", + "Offer your time to assist a local library with literacy and reading programs.", + "Share your skills by volunteering as a mentor for aspiring entrepreneurs and innovators.", + "Support a friend's efforts to promote cultural diversity and inclusion in the community.", + "Donate to a charity that provides assistance to refugees and displaced individuals.", + "Participate in a charity theater production or performing arts event to raise funds for a cause.", + "Help a friend or family member with their music or music-related projects.", + "Volunteer at a local organization that supports individuals facing mental health challenges.", + "Offer your time to help a nonprofit organization with their community development projects.", + "Create care packages for individuals experiencing economic hardship and job loss.", + "Support a friend's campaign to provide education and opportunities for disadvantaged youth.", + "Donate to a charity that supports human rights and social justice initiatives.", + "Offer your time to assist a local museum with educational programs and exhibitions.", + "Share your skills by volunteering as a mentor for aspiring entrepreneurs and innovators.", + "Support a friend's efforts to promote environmental sustainability and conservation.", + "Donate to a charity that works to end hunger and food insecurity.", + "Participate in a charity dance performance or dance-a-thon to raise funds for a cause.", + "Help a friend or family member with their cooking or culinary projects.", + "Volunteer at a local organization that provides support and resources to the elderly.", + "Offer your time to help a nonprofit organization with their disaster response efforts.", + "Create care packages for families facing financial difficulties and homelessness.", + "Support a friend's campaign to provide access to clean water and sanitation facilities.", + "Donate to a charity that advocates for gender equality and women's rights.", + "Offer your time to assist a local community center with programs for youth and families.", +]; + +// Function to load random acts of kindness from the file +function loadRandomActsOfKindness(callback) { + fetch('raok.txt') + .then(response => response.text()) + .then(data => { + console.log('File content:', data); + const kindnessSuggestions = data.split('\n').filter(item => item.trim() !== ''); + console.log('Suggestions array:', kindnessSuggestions); + callback(kindnessSuggestions); + }) + .catch(error => { + console.error('Error loading random acts of kindness:', error); + callback([]); + }); +} + + +generateButton.addEventListener("click", () => { + if (kindnessSuggestions.length === 0) { + kindnessSuggestion.textContent = "Sorry, no suggestions available."; + } else { + const randomIndex = Math.floor(Math.random() * kindnessSuggestions.length); + kindnessSuggestion.textContent = kindnessSuggestions[randomIndex]; + } +}); + diff --git a/style.css b/style.css new file mode 100644 index 0000000..fe38ff7 --- /dev/null +++ b/style.css @@ -0,0 +1,49 @@ +/* Reset some default styles */ +body, h1, p { + margin: 0; + padding: 0; +} + +/* Style the body */ +body { + font-family: Arial, sans-serif; + background-color: #f2f2f2; + text-align: center; +} + +/* Style the header */ +h1 { + background-color: #4CAF50; + color: white; + padding: 20px; +} + +/* Style the button */ +#generateButton { + background-color: #4CAF50; + color: white; + border: none; + padding: 10px 20px; + font-size: 16px; + cursor: pointer; + margin-top: 20px; +} + +#generateButton:hover { + background-color: #45a049; +} + +/* Style the kindness suggestion text */ +#kindnessSuggestion { + font-size: 20px; + margin-top: 20px; +} + +/* Center elements horizontally */ +.center { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + height: 70vh; +}