Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Daily Devotionals Extension #2638

Merged
merged 1 commit into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Daily Devotionals Extension/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"manifest_version": 3,
"name": "Daily Devotionals",
"version": "1.0",
"description": "A Chrome extension that displays daily devotionals.",
"permissions": [],
"action": {
"default_popup": "popup.html",
"default_icon": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
}
},
"icons": {
"16": "icons/icon16.png",
"48": "icons/icon48.png",
"128": "icons/icon128.png"
}
}

37 changes: 37 additions & 0 deletions Daily Devotionals Extension/popup.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 10px;
width: 300px;
}

.container {
text-align: center;
}

h1 {
font-size: 24px;
margin-bottom: 20px;
}

#devotional {
background-color: #f9f9f9;
padding: 15px;
border: 1px solid #ddd;
border-radius: 5px;
margin-bottom: 15px;
}

button {
background-color: #007bff;
color: white;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
}

button:hover {
background-color: #0056b3;
}

19 changes: 19 additions & 0 deletions Daily Devotionals Extension/popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Daily Devotionals</title>
<link rel="stylesheet" href="popup.css">
</head>
<body>
<div class="container">
<h1>Daily Devotionals</h1>
<div id="devotional">
<p>Loading...</p>
</div>
<button id="refresh">Refresh</button>
</div>
<script src="popup.js"></script>
</body>
</html>
23 changes: 23 additions & 0 deletions Daily Devotionals Extension/popup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
document.addEventListener('DOMContentLoaded', function() {
const devotionalElement = document.getElementById('devotional');
const refreshButton = document.getElementById('refresh');

function fetchDevotional() {
// Simulate fetching a daily devotional
const devotionals = [
"Start your day with a grateful heart.",
"God's love never fails.",
"You are blessed beyond measure.",
"Faith can move mountains.",
"Be strong and courageous."
];
const devotional = devotionals[Math.floor(Math.random() * devotionals.length)];
devotionalElement.innerHTML = `<p>${devotional}</p>`;
}

refreshButton.addEventListener('click', fetchDevotional);

// Fetch a devotional when the popup is opened
fetchDevotional();
});

Loading