Skip to content
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
32 changes: 32 additions & 0 deletions static/css/tab.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,38 @@ body {
margin-right: 0.5rem;
transition: background-color 0.3s ease;
}
#expand {
float: right;
padding: 0.5rem;
cursor: pointer;
background-color: var(--accent-color);
color: var(--text-color);
border: none;
border-radius: 5px;
margin-right: 0.5rem;
transition: background-color 0.3s ease;
}
#reload {
float: right;
padding: 0.5rem;
cursor: pointer;
background-color: var(--accent-color);
color: var(--text-color);
border: none;
border-radius: 5px;
margin-right: 0.5rem;
transition: background-color 0.3s ease;
}

#reload:hover {
background-color: var(--hover-color);
}


#expand:hover {
background-color: var(--hover-color);
}


#add-tab:hover {
background-color: var(--hover-color);
Expand Down
26 changes: 20 additions & 6 deletions static/scripts/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ document.addEventListener("DOMContentLoaded", function(event) {
}
}
});



newTab.appendChild(tabTitle);
Expand All @@ -68,11 +69,11 @@ document.addEventListener("DOMContentLoaded", function(event) {
newIframe.classList.add('active');
iframeContainer.appendChild(newIframe);

// svery epic
newIframe.addEventListener('load', () => {
const title = newIframe.contentDocument.title;
tabTitle.textContent = title;
});
// updates the iframe to the title of the page, but dynamic doesn't have a title specific to the page so it's commented out
// newIframe.addEventListener('load', () => {
// const title = newIframe.contentDocument.title;
// tabTitle.textContent = title;
// });

tabCounter++;
});
Expand Down Expand Up @@ -195,4 +196,17 @@ document.addEventListener("DOMContentLoaded", function(event) {
});

});

function reload() {
const iframeContainer = document.getElementById('iframe-container');
const iframes = Array.from(iframeContainer.querySelectorAll('iframe'));
const activeIframe = iframes.find(iframe => iframe.classList.contains('active'));
activeIframe.src=activeIframe.src;
}
function expand() {
const iframeContainer = document.getElementById('iframe-container');
const iframes = Array.from(iframeContainer.querySelectorAll('iframe'));
const activeIframe = iframes.find(iframe => iframe.classList.contains('active'));
activeIframe.requestFullscreen();
}


18 changes: 15 additions & 3 deletions static/tabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@
<html>
<head>
<meta charset="UTF-8" />
<link rel="shortcut icon" id="dynamic-favicon" href="favicon.png">
<title id="dynamic-title">Classes</title>
<title>
Earth's Moon: Formation, Composition, Orbit & Exploration | Solar Eclipse,
Solar System & Astronomy
</title>
<link rel="stylesheet" type="text/css" href="/css/tab.css" />
<link rel="stylesheet" href="/css/tabinner.css" />
<script src="/scripts/tab.js"></script>
Expand All @@ -13,10 +15,20 @@
></script>
</head>
<body>
<input
type="checkbox"
id="toggle-nav-checkbox"
class="toggle-nav-checkbox"
/>
<label for="toggle-nav-checkbox" id="toggle-nav" class="toggle-nav">
<span class="hamburger"></span>
</label>
<div class="container">
<nav class="nav" id="right-side-nav">
<ul id="tab-list"></ul>
<button id="add-tab"><i class="fa-solid fa-plus"></i></button>
<button id="expand" onclick="expand()"><i class="fa-solid fa-expand"></i></button>
<button id="reload" onclick="reload()"><i class="fa-solid fa-rotate-right"></i></button>
<div class="adress-bar-container">
<form method="POST" class="adress-bar-search-form" id="inpbox">
<input
Expand All @@ -36,4 +48,4 @@
<script src="/scripts/index.js"></script>
</body>
<script src="/scripts/customIcon.js"></script>
</html>
</html>