Skip to content

Commit

Permalink
Cleaned the clutter (again!) =P
Browse files Browse the repository at this point in the history
  • Loading branch information
GuiMar10 committed Aug 25, 2024
1 parent 22cce5b commit e7b1a8c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 24 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ And things that would make it great but are not actually necessary.
If you want to contact us, open a <a href="https://github.com/betterbrowser/arcfox/issues">issue</a> or use our <a href="https://discord.gg/jDASpgt68t">discord</a>
</pre>

## Rebuild roadmap
## Our Roadmap

### Essential:

Expand Down Expand Up @@ -40,6 +40,10 @@ If you want to contact us, open a <a href="https://github.com/betterbrowser/arcf

### Non-Essential:

- [x] Peek
- [x] Use Shift to Peek
- [x] Works in most webpages (Report if smth doesn't work as expected)
- [ ] Favorites Peek by default
- [ ] Folders
- [ ] Folders Feature
- [ ] Stackable Folders
Expand Down Expand Up @@ -80,8 +84,9 @@ If you want to contact us, open a <a href="https://github.com/betterbrowser/arcf
- [ ] Boosts
- [ ] Boosts Feature
- [ ] Boosts Store
- [ ] Arc Palette

##
ArcFox still has a lot of features to be implemented and you can see our <a href="https://github.com/orgs/betterbrowser/projects/2">Full Roadmap</a> for a better understanding of the upcoming features and things we are working on :D

<p align="center">
<a href="#">
Expand Down Expand Up @@ -129,10 +134,6 @@ To install arcfox-theme you need to open your firefox configurations and turn st
- Inside the "chrome" folder, drop the "userChrome.css" that you find on the <a href="https://github.com/betterbrowser/arcfox/releases">releases.</a>
- Restart firefox.

# Roadmap

ArcFox still have a lot of features to be implemented and you can see our <a href="https://github.com/orgs/betterbrowser/projects/2">Roadmap</a> for a better understanding of the upcoming features and things we are working on :D

# Removing ArcFox

If you have a major issue, or just want a different/default look, here is how to remove ArcFox.
Expand Down
1 change: 0 additions & 1 deletion src/components/peek/peek.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
}

/* Peek */

div#peekpage {
height: 100vh;
width: 74vw;
Expand Down
31 changes: 14 additions & 17 deletions src/components/sidebar/sidebar.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,21 @@
// Define variables
let tabs = [];
let activeTab = null;

var favorites = [];
var openedFavorites = []
var openedFavoritesIds = [];

const searchInput = document.getElementById("search-input");
const tabList = document.getElementById("tab-list");
const newTabButton = document.getElementById("new-tab-button");
const searchIcon = document.querySelector('.address-bar i');
const spaceName = document.querySelector('input#space-name');

// Add event listeners
newTabButton.addEventListener("click", () =>
newTab()
);

// Get favorites from localstorage
browser.storage.local.get('favorites', function (result) {
favorites = result.favorites || [{ url: 'https://gmail.com', favicon: 'https://mailmeteor.com/logos/assets/PNG/Gmail_Logo_512px.png', id: 0 }, { url: 'https://music.youtube.com', favicon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Youtube_Music_icon.svg/2048px-Youtube_Music_icon.svg.png', id: 1 }];
console.log(favorites)
loadFavorites()
});

// Put space name on localstorage
// Put space name on browser storeage
spaceName.addEventListener('change', () => {
spaceName.blur()
browser.storage.local.set({ 'spaceName': spaceName.value })
Expand All @@ -41,13 +32,19 @@ browser.storage.local.get('spaceName', function (result) {
});

// Auto-selects address bar on click
document.getElementById('search-input').addEventListener(`click`, () => {
searchInput.addEventListener(`click`, () => {
if (document.activeElement.id == 'search-input') {
document.getElementById('search-input').select()
searchInput.select()
}
});
document.querySelector('div.address-bar').addEventListener(`click`, () => document.getElementById('search-input').select());

// Loads favorites
browser.storage.local.get('favorites', function (result) {
favorites = result.favorites || [{ url: 'https://gmail.com', favicon: 'https://mailmeteor.com/logos/assets/PNG/Gmail_Logo_512px.png', id: 0 }, { url: 'https://music.youtube.com', favicon: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/Youtube_Music_icon.svg/2048px-Youtube_Music_icon.svg.png', id: 1 }];
loadFavorites()
});

// Update sidebar when a tab changes
browser.tabs.onUpdated.addListener((changeInfo) => {
if (changeInfo.status === "complete") {
Expand Down Expand Up @@ -89,6 +86,7 @@ function handleBrowserControl(id) {
initTabSidebarControl();
}

// Handle controls
const controls = ['back', 'front', 'refresh', 'close', 'size', 'hide', 'back', 'front']
controls.forEach((control) => {
document.getElementById(control).addEventListener("click", function () {
Expand Down Expand Up @@ -216,7 +214,6 @@ function newTab() {
}

// Sidebar Code
const list = document.getElementById('tab-list');
let base, draggedOver, dragging, activeTabId;

const init = (array) => {
Expand All @@ -229,7 +226,7 @@ const init = (array) => {
};

const renderItems = (data) => {
list.innerHTML = '';
tabList.innerHTML = '';
data.forEach((tab) => {
const node = document.createElement('li');
node.draggable = true;
Expand Down Expand Up @@ -275,7 +272,7 @@ const renderItems = (data) => {
}

if (!openedFavoritesIds.includes(tab.id)) {
list.appendChild(node);
tabList.appendChild(node);
}
});
};
Expand Down Expand Up @@ -324,11 +321,11 @@ const navigateToTab = (e) => {
browser.tabs.update(tabId, { active: true, highlighted: false });
updateSearchBar();

list.querySelector('.active')?.classList.remove('active');
tabList.querySelector('.active')?.classList.remove('active');
document.querySelector('[aria-label="favopen"]')?.setAttribute('aria-label', '');

activeTabId = tabId;
list.querySelector(`[data-tab-id="${activeTabId}"]`)?.classList.add('active');
tabList.querySelector(`[data-tab-id="${activeTabId}"]`)?.classList.add('active');

e.currentTarget.classList.add('current-tab');
};
Expand Down

0 comments on commit e7b1a8c

Please sign in to comment.