From a1a511babe0fcc1c93a9b8573d1bc17c72c42b9b Mon Sep 17 00:00:00 2001 From: dinhtuandev Date: Sun, 1 Feb 2026 21:57:23 +0700 Subject: [PATCH] feat: Add Save Configuration with persistent storage and 500 keywords --- css/custom.css | 63 ++++++++ data/words.js | 387 +++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 17 +++ js/config.js | 6 +- js/popup.js | 63 ++++++++ manifest.json | 2 +- 6 files changed, 535 insertions(+), 3 deletions(-) diff --git a/css/custom.css b/css/custom.css index 9672493..2479c55 100644 --- a/css/custom.css +++ b/css/custom.css @@ -149,6 +149,36 @@ body { color: white; } +/* ======================================== + SAVE CONFIGURATION BUTTON + ======================================== */ + +.btn-save-config { + background: linear-gradient(135deg, #f59e0b, #d97706); + color: white; + border: none; + padding: 10px 16px; + font-weight: 600; + transition: all 0.3s ease; + border-radius: var(--radius-md); + box-shadow: var(--shadow-md); +} + +.btn-save-config:hover { + box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4); + transform: translateY(-2px); + color: white; + background: linear-gradient(135deg, #f59e0b, #d97706); +} + +.btn-save-config:active { + transform: scale(0.95); +} + +.btn-save-config i { + margin-right: 6px; +} + .btn-action:disabled { opacity: 0.6; cursor: not-allowed; @@ -332,4 +362,37 @@ body { ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.5); +} + +/* ======================================== + NOTIFICATION + ======================================== */ + +.alert { + transition: opacity 0.3s ease, visibility 0.3s ease; + border-radius: var(--radius-md); + box-shadow: var(--shadow-md); +} + +.alert.show { + opacity: 1; + visibility: visible; +} + +.alert:not(.show) { + opacity: 0; + visibility: hidden; +} + +.alert-success { + background: linear-gradient(135deg, #10b981, #059669); + color: white; + border: none; + display: flex; + align-items: center; + gap: 10px; +} + +.alert-success .btn-close { + filter: brightness(0) invert(1); } \ No newline at end of file diff --git a/data/words.js b/data/words.js index b32d18c..aa7481d 100644 --- a/data/words.js +++ b/data/words.js @@ -1553,6 +1553,393 @@ let words = [ "game development events and expos 2023", "best gaming chairs for console gaming under $100 2023", "gaming laptops with AMD Radeon RX 6700M 2023", + // new words added below + "best productivity hacks for working from home", + "healthy breakfast smoothie recipes", + "machine learning basics for beginners", + "sustainable fashion brands 2023", + "home automation technology guide", + "best budget travel backpacks", + "interior design trends 2024", + "cryptocurrency investment tips", + "vegan protein sources guide", + "remote work productivity tips", + "best hiking trails near me", + "personal finance budgeting tips", + "web development beginner tutorial", + "organic skincare routine guide", + "best coffee brewing methods", + "fitness nutrition meal planning", + "solar energy for homes guide", + "minimalist lifestyle tips", + "creative business ideas 2024", + "eco-friendly household products", + "data science career guide", + "best meditation apps 2023", + "home gym equipment recommendations", + "learn digital marketing online", + "sustainable living tips", + "mental health awareness importance", + "AI technology future predictions", + "watercolor painting beginner tips", + "best productivity tools 2024", + "healthy work-life balance guide", + "renewable energy sources", + "language learning motivation tips", + "podcast creation beginner guide", + "plant-based diet benefits", + "cybersecurity basics important", + "smart home security systems", + "freelance writing job opportunities", + "electric scooter buying guide", + "zero waste lifestyle tips", + "startup business plan template", + "mental wellness daily habits", + "blockchain technology explained", + "micro-credential online courses", + "stress management techniques guide", + "sustainable fashion shopping guide", + "video production beginner tips", + "healthy sleep schedule tips", + "cloud computing career guide", + "graphic design beginner tutorial", + "emotional intelligence development", + "best podcast apps 2024", + "minimalist wardrobe essentials", + "home office organization hacks", + "social media marketing strategy", + "sustainable beauty products", + "career change guidance tips", + "virtual assistant job guide", + "home theater setup guide", + "personal branding tips", + "time management productivity", + "eco-friendly packaging solutions", + "creative writing online courses", + "cybersecurity career opportunities", + "best ergonomic office chairs", + "financial literacy importance", + "tech startup ideas 2024", + "meditation health benefits", + "sustainable food packaging", + "digital nomad lifestyle tips", + "furniture upcycling ideas", + "voice acting career guide", + "renewable energy technology", + "personal development books", + "best noise canceling headphones", + "sustainable fashion designers", + "content creation strategy tips", + "work from home job opportunities", + "eco-friendly laundry solutions", + "UI UX design beginners", + "healthy cooking techniques", + "blockchain development learning", + "minimalist home decoration", + "social entrepreneurship guide", + "best productivity apps 2024", + "sustainable transportation options", + "podcast marketing strategy", + "creative problem solving skills", + "healthy snacking ideas", + "business communication skills", + "energy efficient home upgrades", + "ethical fashion movements", + "learning programming languages", + "wellness retreat destinations", + "sustainable packaging materials", + "personal finance investment", + "email marketing best practices", + "eco-friendly cleaning supplies", + "artificial intelligence applications", + "healthy lifestyle changes", + "digital marketing certifications", + "sustainable agriculture methods", + "voice assistant technology", + "career development strategies", + "home organization systems", + "green living initiatives", + "online teaching opportunities", + "creative entrepreneurship tips", + "sustainable consumer habits", + "technology ethics importance", + "personal brand building", + "healthy aging tips", + "business growth strategies", + "eco-friendly gift ideas", + "data analysis career path", + "wellness coaching certification", + "sustainable travel destinations", + "mobile app development beginner", + "mental health support resources", + "creative industry careers", + "sustainable household tips", + "digital communication skills", + "healthy recipe collection", + "business ethics importance", + "green business ideas", + "personal finance security", + "online course creation guide", + "sustainable fashion shopping", + "productivity journal tips", + "career skills development", + "eco-friendly home upgrades", + "social media engagement tips", + "wellness technology devices", + "sustainable living checklist", + "business startup checklist", + "creative thinking techniques", + "healthy weight management", + "technology addiction prevention", + "green energy solutions", + "personal development coaching", + "sustainable beauty routine", + "digital literacy programs", + "business leadership skills", + "eco-conscious consumerism", + "learning new skills online", + "health and wellness goals", + "creative writing prompts", + "sustainable travel tips", + "productivity planning tools", + "career networking strategies", + "green marketing strategies", + "personal finance planning", + "online business ideas", + "sustainable fashion trends", + "wellness retreat planning", + "technology career paths", + "creative team management", + "healthy lifestyle motivation", + "business communication strategies", + "eco-friendly product reviews", + "personal growth resources", + "sustainable living community", + "digital marketing analytics", + "wellness podcasts recommendations", + "career exploration guide", + "green building materials", + "personal branding strategy", + "healthy cooking meal prep", + "business model innovation", + "sustainable fashion inspiration", + "learning digital skills", + "wellness routine development", + "social media growth hacks", + "career advancement tips", + "eco-friendly businesses", + "personal finance management", + "creative problem solving", + "sustainable product choices", + "technology trends 2024", + "wellness coaching business", + "career change planning", + "green renovation ideas", + "personal productivity system", + "healthy lifestyle hacks", + "business ethics training", + "creative entrepreneurship", + "sustainable living resources", + "digital transformation guide", + "career mentorship importance", + "eco-friendly fashion brands", + "personal development goals", + "business growth mindset", + "sustainable eating habits", + "technology learning resources", + "wellness journey documentation", + "creative industries careers", + "productivity time blocking", + "career path exploration", + "green technology solutions", + "personal finance basics", + "online community building", + "sustainable living challenges", + "business networking tips", + "creative writing resources", + "health and fitness motivation", + "eco-friendly lifestyle changes", + "career skills assessment", + "personal branding online", + "business management courses", + "sustainable fashion education", + "technology skill development", + "wellness motivation tips", + "career development resources", + "green business opportunities", + "personal finance software", + "creative project management", + "sustainable transportation", + "productivity optimization", + "business communication tools", + "career exploration resources", + "eco-friendly product alternatives", + "personal growth strategies", + "healthy lifestyle tracking", + "business strategy planning", + "sustainable gardening tips", + "technology certification programs", + "wellness app recommendations", + "career coaching services", + "green marketing examples", + "personal finance goals", + "creative team building", + "sustainable home living", + "digital marketing courses", + "wellness retreat reviews", + "career transition planning", + "eco-friendly office supplies", + "personal development books", + "business process improvement", + "creative writing techniques", + "sustainable lifestyle tips", + "technology industry trends", + "wellness challenge ideas", + "career skills training", + "green building certification", + "personal productivity hacks", + "healthy meal planning guide", + "business leadership training", + "sustainable consumption guide", + "digital skills training", + "wellness goals setting", + "career exploration websites", + "eco-friendly transportation", + "personal finance tracking", + "creative industries resources", + "sustainable fashion movement", + "technology career opportunities", + "wellness retreat programs", + "productivity apps comparison", + "career advancement resources", + "green marketing strategies", + "personal brand development", + "business plan templates", + "sustainable lifestyle movement", + "digital marketing strategies", + "wellness coaching certification", + "career networking events", + "eco-friendly cleaning products", + "personal growth coaching", + "business communication tips", + "healthy lifestyle guide", + "sustainable living podcast", + "technology learning paths", + "wellness lifestyle changes", + "career planning tools", + "green business solutions", + "personal finance security tips", + "creative writing communities", + "sustainable product sourcing", + "productivity management systems", + "career readiness assessment", + "eco-conscious shopping", + "personal development programs", + "business strategy examples", + "sustainable agriculture learning", + "technology skill assessment", + "wellness tracking apps", + "career skills development", + "green home solutions", + "personal finance advice", + "creative thinking training", + "sustainable consumption strategies", + "digital marketing tools", + "wellness community support", + "career exploration activities", + "eco-friendly fashion choices", + "personal productivity tips", + "business management training", + "sustainable living education", + "technology trend predictions", + "wellness challenge participation", + "career guidance resources", + "green technology implementation", + "personal finance planning guide", + "creative entrepreneurship guide", + "sustainable transportation methods", + "productivity tracking tools", + "career skills gap analysis", + "eco-friendly product selection", + "personal development resources", + "business growth strategies", + "sustainable fashion brands", + "technology career preparation", + "wellness retreat selection", + "productivity enhancement tips", + "career change strategies", + "green business models", + "personal branding resources", + "healthy eating guidelines", + "business ethics training", + "sustainable lifestyle journey", + "digital skills assessment", + "wellness routine tips", + "career mentorship programs", + "eco-friendly office setup", + "personal finance management", + "creative team collaboration", + "sustainable consumption practices", + "technology implementation guide", + "wellness goal tracking", + "career development programs", + "green home improvement", + "personal productivity systems", + "business communication training", + "sustainable living principles", + "digital marketing fundamentals", + "wellness app selection guide", + "career exploration interviews", + "eco-friendly product reviews", + "personal growth journeys", + "business planning guide", + "sustainable fashion education", + "technology skills training", + "wellness retreat benefits", + "career skills improvement", + "green technology adoption", + "personal finance optimization", + "creative writing workshops", + "sustainable lifestyle resources", + "productivity system setup", + "career advancement planning", + "eco-friendly business practices", + "personal development workshops", + "business strategy development", + "sustainable gardening methods", + "technology career guidance", + "wellness community groups", + "career development coaching", + "green energy technology", + "personal productivity journal", + "healthy lifestyle changes", + "business management skills", + "sustainable consumption guide", + "digital learning resources", + "wellness motivation strategies", + "career path planning", + "eco-friendly fashion industry", + "personal branding tips", + "business ethics importance", + "sustainable living communities", + "technology certification courses", + "wellness challenge success", + "career networking tips", + "green marketing solutions", + "personal finance goals", + "creative industries guide", + "sustainable product choices", + "productivity improvement ideas", + "career skills development", + "eco-friendly lifestyle choices", + "personal growth strategies", + "business growth planning", + "sustainable fashion choices", + "technology skill development", + "wellness coaching resources", + "career exploration guide", + "green business opportunities", + "personal finance management", ] export default words \ No newline at end of file diff --git a/index.html b/index.html index fd8332e..db3e58a 100644 --- a/index.html +++ b/index.html @@ -89,6 +89,23 @@

Rewards Automator

+ +
+
+ +
+
+ + + +
diff --git a/js/config.js b/js/config.js index fb92b42..da9f2a6 100644 --- a/js/config.js +++ b/js/config.js @@ -1,6 +1,6 @@ let config = { general: { - appVersion: "v2.1.0", + appVersion: "v2.1.1", authorWebsiteLink: "https://andreacorriga.com", authorWebsiteLinkThanks: [ "https://andreacorriga.com/rewards-search-automator/thanks", @@ -58,7 +58,9 @@ let config = { storeLink: "#storeLink", rewardsLink: "#rewardsLink", f1PromoLink: "#btn-f1-promo", - progressBar: ".progress-bar" + progressBar: ".progress-bar", + saveConfigButton: "#saveConfigButton", + saveNotification: "#saveNotification" } } diff --git a/js/popup.js b/js/popup.js index 9667e02..d1b4a24 100644 --- a/js/popup.js +++ b/js/popup.js @@ -7,6 +7,7 @@ var progressBar = document.querySelector(config.domElements.progressBar) setDefaultUI() checkRunningState() +loadConfigurationFromStorage() // Listen for messages from background script chrome.runtime.onMessage.addListener((message, sender, sendResponse) => { @@ -65,6 +66,11 @@ $(config.domElements.desktopMobileButton).on('click', async () => { startSearches('desktopMobile'); }) +// Save configuration button +$(config.domElements.saveConfigButton).on('click', async () => { + saveConfigurationToStorage(); +}) + /** * Start searches via background script */ @@ -147,4 +153,61 @@ function activateForms() { function setProgress(value) { progressBar.style.width = value + "%" progressBar.innerText = value + "%" +} + +/** + * Save configuration to Chrome Storage + */ +function saveConfigurationToStorage() { + const configData = { + desktop: parseInt($(config.domElements.totDesktopSearchesForm).val()), + mobile: parseInt($(config.domElements.totMobileSearchesForm).val()), + millisecondsMin: parseInt($(config.domElements.waitingBetweenSearchesFormMin).val()), + millisecondsMax: parseInt($(config.domElements.waitingBetweenSearchesFormMax).val()) + }; + + chrome.storage.local.set({ 'rewardsSearchConfig': configData }, () => { + // Update config object + config.searches = configData; + + // Show notification + const notification = $(config.domElements.saveNotification); + notification.css('display', 'block'); + notification.addClass('show'); + + // Auto-hide notification after 3 seconds + setTimeout(() => { + notification.removeClass('show'); + setTimeout(() => { + notification.css('display', 'none'); + }, 150); + }, 3000); + + console.log('Configuration saved:', configData); + }); +} + +/** + * Load configuration from Chrome Storage + */ +function loadConfigurationFromStorage() { + chrome.storage.local.get(['rewardsSearchConfig'], (result) => { + if (result.rewardsSearchConfig) { + const savedConfig = result.rewardsSearchConfig; + + // Update config object + config.searches.desktop = savedConfig.desktop; + config.searches.mobile = savedConfig.mobile; + config.searches.millisecondsMin = savedConfig.millisecondsMin; + config.searches.millisecondsMax = savedConfig.millisecondsMax; + + // Update form inputs + $(config.domElements.totDesktopSearchesForm).val(savedConfig.desktop); + $(config.domElements.totMobileSearchesForm).val(savedConfig.mobile); + $(config.domElements.waitingBetweenSearchesFormMin).val(savedConfig.millisecondsMin); + $(config.domElements.waitingBetweenSearchesFormMax).val(savedConfig.millisecondsMax); + + console.log('Configuration loaded from storage:', savedConfig); + } + }); } \ No newline at end of file diff --git a/manifest.json b/manifest.json index 821d69f..c36f17c 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name": "Rewards Search Automator", - "version": "2.1.0", + "version": "2.1.1", "description": "With this extension, you can automate searches on the Bing search engine to earn points for Microsoft Rewards.", "manifest_version": 3, "author": "Andrea Corriga - Strifelab",