Skip to content

Commit

Permalink
shift to raw html
Browse files Browse the repository at this point in the history
  • Loading branch information
Abinash4567 committed Jul 7, 2024
0 parents commit 78c5788
Show file tree
Hide file tree
Showing 10 changed files with 1,190 additions and 0 deletions.
36 changes: 36 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
if(request.type === "twitterOrNot")
{
// window.stage = 4;
chrome.tabs.query({ active: true}, function(tabs){
const currentTab = tabs[0];
if(currentTab.url.includes("x.com"))
{
sendResponse({check: true})
}
else{
sendResponse({check: false})
}
})
}
return true;
});


chrome.runtime.onMessage.addListener(function(request, sender, sendResponse){
if(request.type === "getData")
{
fetch("https://recall-smoky.vercel.app/api/token").then((response) => {
if (response.ok)
return response.json(); // Convert the response to JSON
else
throw new Error("Error fetching data");
}).then((data) => {
sendResponse({ data: data }); // Use the parsed JSON data
}).catch((error) => {
console.error(error);
});
// sendResponse({data: "hello"});
return true;
}
})
1,044 changes: 1,044 additions & 0 deletions content.js

Large diffs are not rendered by default.

Binary file added images/icon128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icon16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icon32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/icon48.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions index.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>Number Slider</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="slider-container">
<h1>Recall</h1>
<h3>Slide according to intensity to which posts are to be shown</h3>
<input type="range" min="1" max="10" value="5" class="slider" id="numberSlider">
<p>Value: <span id="sliderValue">5</span></p>
</div>

<script src="script.js"></script>
</body>
</html>
39 changes: 39 additions & 0 deletions manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "recall",
"description": "Help Alzimer's people to remember loved ones.",
"version": "1.0",
"icons": {
"16": "images/icon16.png",
"32": "images/icon32.png",
"48": "images/icon48.png",
"128": "images/icon128.png"
},
"manifest_version": 3,
"background": {
"service_worker": "background.js"
},
"permissions": [
"activeTab",
"tabs",
"scripting",
"cookies"
],
"content_scripts": [
{
"matches": [
"<all_urls>"
],
"js": [
"content.js"
],
"run_at": "document_end"
}
],
"action": {
"default_popup": "index.html"
},
"host_permissions": [
"http://localhost:3001/*",
"https://*/*"
]
}
7 changes: 7 additions & 0 deletions script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const slider = document.getElementById('numberSlider');
const output = document.getElementById('sliderValue');

slider.oninput = function() {
output.textContent = this.value;
window.stage = this.value;
}
45 changes: 45 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
body {
font-family: Arial, sans-serif;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}

.slider-container {
text-align: center;
}

.slider {
-webkit-appearance: none;
width: 100%;
height: 8px;
border-radius: 5px;
/* background: #ddd; */
outline: none;
opacity: 0.7;
transition: opacity .2s;
}

.slider:hover {
opacity: 1;
}

.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 25px;
height: 25px;
border-radius: 50%;
background: #4CAF50;
cursor: pointer;
}

.slider::-moz-range-thumb {
width: 25px;
height: 25px;
border-radius: 50%;
background: #4CAF50;
cursor: pointer;
}

0 comments on commit 78c5788

Please sign in to comment.