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

CC-3 - Enzyme Prediction website styling #10

Open
wants to merge 3 commits into
base: website
Choose a base branch
from
Open
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

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
function openTab(evt, tabName) {
const tabContents = document.querySelectorAll('.tab-content');
const tabLinks = document.querySelectorAll('.tab-link');

// Hide all tab contents
// tabContents.forEach(content => content.style.display = 'none');
tabContents.forEach(content => content.classList.remove('show-tab-content'));

// Remove active class from all tabs
tabLinks.forEach(link => link.classList.remove('active'));

// Show the selected tab content
// document.getElementById(tabName).style.display = 'block';
evt.currentTarget.classList.add('active');
document.getElementById(tabName).classList.add('show-tab-content');
}

document.addEventListener('DOMContentLoaded', function() {
document.getElementById('validateuniprotid').addEventListener('submit', function(event) {
event.preventDefault(); // Prevent form submission

const query = document.getElementById('uid').value;
const url = `https://rest.uniprot.org/uniprotkb/search?size=1&query=${query}`;

const errorDiv = document.getElementById('error');
const errorMsg = errorDiv.querySelector('p');
// errorDiv.style.display = 'none'; // Hide error message initially
errorDiv.classList.add('show-error');

fetch(url)
.then(response => response.json())
.then(data => {
if (data.results && data.results.length > 0) {
console.log('Results found:', data.results);
// Proceed with form submission or further action
} else {
errorMsg.textContent = 'UniProt ID is invalid. Please check your query';
// errorDiv.style.display = 'block'; // Show error message
}
})
.catch(error => {
errorMsg.textContent = 'Error occurred during the request. Please try again.';
// errorDiv.style.display = 'block'; // Show error message
console.error('Error:', error);
});
});
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading