Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
philffm committed Nov 2, 2024
1 parent 558f75d commit 5be6ea2
Show file tree
Hide file tree
Showing 11 changed files with 696 additions and 1 deletion.
33 changes: 33 additions & 0 deletions .github/workflows/translate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Translate JSON

on:
push:
paths:
- 'page/translations.json'

jobs:
translate:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'

- name: Install dependencies
run: npm install openai

- name: Translate JSON
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: node translate.js

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 'Automated translation update'
branch: main
47 changes: 47 additions & 0 deletions chrome-extension/_locales/de/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"extensionName": {
"message": "AI Summary Helper"
},
"fetchSummary": {
"message": "Zusammenfassung abrufen"
},
"settings": {
"message": "Einstellungen"
},
"saved": {
"message": "Gespeichert! 🎉"
},
"donate": {
"message": "Spenden"
},
"apiKey": {
"message": "API-Schlüssel"
},
"model": {
"message": "Sprachmodell"
},
"modelIdentifier": {
"message": "Modellkennung: (Leer lassen, um Standardmodellkennungen zu verwenden)"
},
"localEndpoint": {
"message": "Lokale Endpunkt-URL"
},
"prompt": {
"message": "Benutzerdefinierte Eingabeaufforderung"
},
"additionalQuestions": {
"message": "Zusätzliche Fragen zum Artikel eingeben (optional)"
},
"save": {
"message": "Speichern 💾"
},
"toggleScreen": {
"message": "Bildschirm umschalten"
},
"mainScreen": {
"message": "Hauptbildschirm"
},
"settingsScreen": {
"message": "Einstellungen"
}
}
17 changes: 17 additions & 0 deletions chrome-extension/_locales/en/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extensionName": {
"message": "AI Summary Helper"
},
"fetchSummary": {
"message": "Fetch Summary"
},
"settings": {
"message": "Settings"
},
"saved": {
"message": "Saved! 🎉"
},
"donate": {
"message": "Donate"
}
}
17 changes: 17 additions & 0 deletions chrome-extension/_locales/es/messages.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extensionName": {
"message": "AI Summary Helper"
},
"fetchSummary": {
"message": "Obtener Resumen"
},
"settings": {
"message": "Configuraciones"
},
"saved": {
"message": "¡Guardado! 🎉"
},
"donate": {
"message": "Donar"
}
}
3 changes: 2 additions & 1 deletion chrome-extension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"manifest_version": 3,
"name": "AI Summary Helper - Summarize Web Content with OpenAI, Mistral AI, and more",
"name": "__MSG_extensionName__",
"default_locale": "en",
"version": "1.4.0",
"description": "Fetch and insert AI-generated summaries of web content. Combine with Send To Kindle for quick summaries and full articles.",
"permissions": [
Expand Down
Binary file added page/aish.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions page/icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
163 changes: 163 additions & 0 deletions page/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title id="metaTitle">AI Summary Helper</title>
<meta id="metaDescription" name="description" content="AI Summary Helper enhances your browsing experience.">
<link rel="stylesheet" href="style.css">
<script>
async function loadContent(lang = 'en') {
try {
const response = await fetch('translations.json');
const translations = await response.json();
const data = translations[lang] || translations['en'];

document.getElementById('metaTitle').textContent = data.title;
document.getElementById('metaDescription').setAttribute('content', data.aboutText);

document.getElementById('title').textContent = data.title;
document.getElementById('aboutText').textContent = data.aboutText;

const featureList = document.getElementById('featureList');
featureList.innerHTML = data.featureList.map(item => `
<div class="feature-card">
${item}
</div>
`).join('');

document.getElementById('proposeFeature').textContent = data.proposeFeature;
document.getElementById('proposeFeatureText').textContent = data.proposeFeatureText;
document.getElementById('privacyNote').textContent = data.privacyNote;
document.getElementById('privacyNoteText').textContent = data.privacyNoteText;
document.getElementById('funMessage').textContent = data.funMessage;

const changelogList = document.getElementById('changelogList');
changelogList.innerHTML = data.changelogList.map(item => `<li>${item}</li>`).join('');

document.getElementById('aboutCreator').textContent = data.aboutCreator;
document.getElementById('creatorText').textContent = data.creatorText;

const whyHelperList = document.getElementById('whyHelperList');
whyHelperList.innerHTML = data.whyHelperList.map(item => `<li>${item}</li>`).join('');

document.getElementById('getStarted').textContent = data.getStarted;
document.getElementById('getStartedText').textContent = data.getStartedText;
document.getElementById('feedbackSupport').textContent = data.feedbackSupport;
document.getElementById('feedbackSupportText').textContent = data.feedbackSupportText;

} catch (error) {
console.error('Error loading content:', error);
}
}

function changeLanguage(lang) {
loadContent(lang);
const url = new URL(window.location);
url.searchParams.set('lang', lang);
window.history.pushState({}, '', url);
}

window.onload = () => {
const urlParams = new URLSearchParams(window.location.search);
const lang = urlParams.get('lang') || 'en';
loadContent(lang);
};

document.addEventListener("DOMContentLoaded", function() {
const container = document.querySelector('.feature-cards-container');
let scrollAmount = 0;
const scrollStep = 1; // Adjust this value to control the speed
const scrollInterval = 20; // Adjust this value to control the smoothness

function autoScroll() {
scrollAmount += scrollStep;
container.scrollLeft = scrollAmount;

if (scrollAmount >= container.scrollWidth - container.clientWidth) {
scrollAmount = 0; // Reset to start scrolling from the beginning
}
}

setInterval(autoScroll, scrollInterval);
});
</script>
</head>
<body>
<div class="window-frame">
<div class="window-title-bar">
<img src="icon.svg" alt="AI Summary Helper Icon" style="width: 32px; height: 32px;">
<h1 id="title" class="window-title">AI Summary Helper</h1>
<div class="window-controls">
<button class="window-button minimize">_</button>
<button class="window-button maximize"></button>
<button class="window-button close">X</button>
</div>
</div>
<section id="features-section">
<div id="featureList" class="feature-cards-container"></div>
</section>
<div class="window-content">
<section class="language-section language-menu">
<button onclick="changeLanguage('en')">🇬🇧 English</button>
<button onclick="changeLanguage('es')">🇪🇸 Español</button>
<button onclick="changeLanguage('de')">🇩🇪 Deutsch</button>
<button onclick="changeLanguage('fr')">🇫🇷 Français</button>
<button onclick="changeLanguage('it')">🇮🇹 Italiano</button>
<button onclick="changeLanguage('pt')">🇵🇹 Português</button>
<button onclick="changeLanguage('nl')">🇳🇱 Nederlands</button>
<button onclick="changeLanguage('jp')">🇯🇵 日本語</button>
<button onclick="changeLanguage('cn')">🇨🇳 中文</button>
<button onclick="changeLanguage('ru')">🇷🇺 Русский</button>
<button onclick="changeLanguage('kr')">🇰🇷 한국어</button>
<button onclick="changeLanguage('ar')">🇸🇦 عربي</button>
</section>
<header>
<img src="aish.png" alt="AI Summary Helper Preview" style="max-width: 100%;">
<p id="aboutText"></p>
<a class="primary-option" target="_blank" href="https://philwornath.gumroad.com/l/ai-summary-helper">Get it on Gumroad</a>
<a class="secondary-option" target="_blank" href="https://chrome.google.com/webstore/detail/ai-summary-helper-summari/hldbejcjaedipeegjcinmhejdndchkmb">Chrome Web Store</a>
<a class="secondary-option" target="_blank" href="https://philffm.github.io/ai-summary-helper/bookmarklet-generator/">Bookmarklet Generator</a>
</header>
<main>


<section>
<h2 id="proposeFeature"></h2>
<p id="proposeFeatureText"></p>
</section>
<section>
<h2 id="privacyNote"></h2>
<p id="privacyNoteText"></p>
</section>
<section>
<p id="funMessage"></p>
</section>
<section>
<h2>Changelog</h2>
<ul id="changelogList"></ul>
</section>
<section>
<h2 id="aboutCreator"></h2>
<p id="creatorText"></p>
</section>
<section>
<h2>Why AI Summary Helper?</h2>
<ul id="whyHelperList"></ul>
</section>
<section>
<h2 id="getStarted"></h2>
<p id="getStartedText"></p>
</section>
<section>
<h2 id="feedbackSupport"></h2>
<p id="feedbackSupportText"></p>
</section>
</main>
<footer>
<p>&copy; 2024 Phil Wornath. All rights reserved. Visit the project at <a href="https://github.com/philffm/ai-summary-helper/">AI Summary Helper</a>.</p>
</footer>
</div>
</div>
</body>
</html>
Loading

0 comments on commit 5be6ea2

Please sign in to comment.