3.7 C
İstanbul
Çarşamba, Şubat 21, 2024
Ana SayfaFutbolSüper Lig 2023-24: Pendikspor - Galatasaray (14/38)

Süper Lig 2023-24: Pendikspor – Galatasaray (14/38)

- Reklam -
.ans-match-squad td:nth-child(2) { text-align: right; } .ans-match-squad td:nth-child(8) { text-align: left; } .ans-match-squad thead th { border: none; } .ans-match-squad img:hover { box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Hover olduğunda gölge efekti */ } .ans-match-squad img { border-radius: 50%; max-width: 35px; object-fit: contain; border: 2px solid #fff; /* Renk ayarını tercih ettiğiniz renk yapabilirsiniz */ transition: box-shadow 0.3s ease; /* Gölge için hover efekti */ } .ans-match-squad img { border-radius: 50%; max-width: 35px; object-fit: contain; border: 2px solid #3498db; /* Kenarlık rengini tercih ettiğiniz renk yapabilirsiniz */ background-color: #ecf0f1; /* Arka plan rengini tercih ettiğiniz renk yapabilirsiniz */ transition: box-shadow 0.3s ease; /* Gölge için hover efekti */ } .ans-match-squad td:nth-child(7) img:hover { box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Hover olduğunda gölge efekti */ } .ans-match-squad td { vertical-align: middle; /* Hücre içeriğini dikeyde ortaya hizala */ } .ans-match-squad table { border: 0px; } .ans-match-stats table { border: 0px; } .ans-match-squad { margin-top: -10px !important; } .ans-match-squad thead tr th:nth-child(3), thead tr th:nth-child(1) { text-align: right; } @media only screen and (max-width: 768px) { .ans-match-squad td { font-size: 12px; } .ans-match-info td { font-size: 12px; } .ans-match-squad thead { font-size: 14px; } .ans-match-stats thead { font-size: 14px; } .ans-match-info thead { font-size: 14px; } } .ans-match-squad table td { border: none !important } .ans-match-info table td { border: none !important } .ans-match-squad td:nth-child(3) { text-align: right; } .ans-match-squad td:nth-child(1) { text-align: right; } .ans-match-squad td:nth-child(2)::before { content: “#”; } .ans-match-squad td:nth-child(7)::before { content: “#”; } .ans-match-squad td:nth-child(4), td:nth-child(5) { text-align: center; } .ans-match-stats td:nth-child(1) { text-align: right; } .ans-match-stats td:nth-child(2) { text-align: center; } .ans-match-stats td:nth-child(3) { text-align: left; } .ans-match-stats td { border: none; } .ans-match-stats tr { border: none; } .ans-match-stats tr:nth-child(even) { background-color: #f2f2f2; } .ans-match-stats tr:hover { background-color: #ddd; } .ans-match-stats table { border-collapse: collapse; width: 100%; } .ans-match-stats td { border: none; } .ans-match-info table { border-collapse: collapse; width: 100%; } .ans-match-squad table { border-collapse: collapse; width: 100%; } .ans-match-stats th:nth-child(2) { text-align: center; } /* Sekme Konteyner Stili */ .tab-container { display: flex; justify-content: center; padding: 15px; background-color: #171717; } /* Genel Sekme Stili */ .tab { background-color: #303134; color: white; border: none; outline: none; cursor: pointer; padding: 10px 20px; transition: background-color 0.3s, transform 0.3s; margin: 0 5px; border-radius: 5px; font-size: 16px; } /* Hover ve Aktif Sekme Stili */ .tab:hover, .active-tab { background-color: #ddd; border: 1px solid white; color: rgb(46, 44, 44) transform: translateY(-2px); } /* Aktif Sekme Özelleştirmesi */ .active-tab { background-color: #666; color: white; border-rgb(27, 26, 26): 4px solid #444; } /* Tablo Stilleri */ .ans-match-squad table { border-collapse: collapse; width: 100%; margin-top: 10px; } .ans-match-squad td, .ans-match-squad th { border: 1px solid #ddd; padding: 8px; text-align: left; } .ans-match-squad tr:nth-child(even) { background-color: #f2f2f2; } .ans-match-squad tr:hover { background-color: #ddd; } .ans-match-squad th { padding-top: 12px; padding-bottom: 12px; background-color: #666; color: white; } .ans-match-stats th { padding-top: 12px; padding-bottom: 12px; background-color: #666; color: white; } .ans-match-info th { padding-top: 12px; padding-bottom: 12px; background-color: #666; color: white; border: none; } .ans-match-info td:nth-child(1)::after { content: “‘”; } .ans-match-info td:nth-child(5) { text-align: left; } .ans-match-info td:nth-child(2) { text-align: center; } .ans-match-info td:nth-child(1) { text-align: center; font-weight: 700; background-color: #171717; color: white; } .ans-match-info td:nth-child(5), .ans-match-info td:nth-child(6), .ans-match-info td:nth-child(7) { display: block; /* İhtiyaca bağlı olarak ayarlayabilirsiniz */ } .ans-match-info td:nth-child(7) { font-size: 14px; } .ans-match-info th:nth-child(5), .ans-match-info th:nth-child(6), .ans-match-info th:nth-child(7) { display: block; /* İhtiyaca bağlı olarak ayarlayabilirsiniz */ }
document.addEventListener(‘DOMContentLoaded’, function () { // Yükleme mesajını oluştur ve ‘ans-match-squad’ sınıfına sahip ilk elemana ekle var loadingDiv = document.createElement(‘div’); loadingDiv.id = ‘loadingMessage’; loadingDiv.textContent = ‘Veriler getiriliyor…’; loadingDiv.style.fontSize = ’16px’; loadingDiv.style.color = ‘black’; loadingDiv.style.textAlign = ‘center’; loadingDiv.style.padding = ’10px’; document.getElementsByClassName(‘ans-match-squad’)[0].appendChild(loadingDiv); createTabs(); // Sekmeleri oluştur gapi.load(‘client’, initClient); }); // Veri yükleme fonksiyonlarınızda, veriler yüklendikten sonra yükleme mesajını kaldırın function hideLoadingMessage() { var loadingMessage = document.getElementById(‘loadingMessage’); if (loadingMessage) { loadingMessage.remove(); } } function initClient() { gapi.client.init({ ‘apiKey’: ‘AIzaSyAp-SloEss6Xhjf90z073sGuy-eS7-rOoU’, ‘discoveryDocs’: [‘https://sheets.googleapis.com/$discovery/rest?version=v4’], }).then(function () { fetchDataFromSheets(); fetchDataForSecondTable(); }, function (error) { console.error(‘API Initialization failed’, error); }); } function fetchDataFromSheets() { gapi.client.sheets.spreadsheets.values.get({ spreadsheetId: ‘133kLTOvZ-sDlp64aBLHnV8t581AKIPZrU3kyUCEEseY’, range: ‘ans-match-squad!A:H’, }).then(function (response) { var squadElements = document.getElementsByClassName(‘ans-match-squad’); if (squadElements.length > 0) { squadElements[0].innerHTML = ”; squadElements[0].appendChild(createTable(response.result.values, ‘squad’)); } }, function (response) { console.error(‘Error fetching squad data: ‘ + response.result.error.message); }); } function fetchDataForSecondTable() { gapi.client.sheets.spreadsheets.values.get({ spreadsheetId: ‘133kLTOvZ-sDlp64aBLHnV8t581AKIPZrU3kyUCEEseY’, range: ‘ans-match-stats!A:C’, }).then(function (response) { var statsElements = document.getElementsByClassName(‘ans-match-stats’); if (statsElements.length > 0) { statsElements[0].innerHTML = ”; // Sadece ‘ans-match-stats’ içeriğini temizle statsElements[0].appendChild(createTable(response.result.values, ‘matchInfo’)); } }, function (response) { console.error(‘Error fetching stats data: ‘ + response.result.error.message); }); } function fetchDataForThirdTable() { gapi.client.sheets.spreadsheets.values.get({ spreadsheetId: ‘133kLTOvZ-sDlp64aBLHnV8t581AKIPZrU3kyUCEEseY’, range: ‘ans-match-info!J:R’, }).then(function (response) { var infoElements = document.getElementsByClassName(‘ans-match-info’); if (infoElements.length > 0) { infoElements[0].innerHTML = ”; // Sadece ‘ans-match-info’ içeriğini temizle infoElements[0].appendChild(createTable(response.result.values, ‘importantMoments’)); } }, function (response) { console.error(‘Error fetching important moments data: ‘ + response.result.error.message); }); } function createTabs() { const tabContainer = document.querySelector(‘.tab-container’); const squadTab = createTabButton(‘Takım Kadroları’, ‘.ans-match-squad’); const matchInfoTab = createTabButton(‘Maç Bilgileri’, ‘.ans-match-stats’); const importantMomentsTab = createTabButton(‘Önemli Dakikalar’, ‘.ans-match-info’); // Yeni sekme tabContainer.appendChild(squadTab); tabContainer.appendChild(matchInfoTab); tabContainer.appendChild(importantMomentsTab); // Yeni sekme ekleme addTabEventListeners(); activateTab(‘.ans-match-squad’, squadTab); } function createTabButton(text, target) { const tabButton = document.createElement(‘button’); tabButton.innerText = text; tabButton.classList.add(‘tab’); tabButton.dataset.target = target; return tabButton; } function addTabEventListeners() { const tabs = document.querySelectorAll(‘.tab’); tabs.forEach(tab => { tab.addEventListener(‘click’, function () { fetchDataForTab(this.dataset.target, this); }); }); } function fetchDataForTab(target, activeTab) { if (target === ‘.ans-match-squad’) { fetchDataFromSheets(); } else if (target === ‘.ans-match-stats’) { fetchDataForSecondTable(); } else if (target === ‘.ans-match-info’) { // Yeni sekme için veri çekme fetchDataForThirdTable(); } activateTab(target, activeTab); } function activateTab(target, activeTab) { document.querySelectorAll(‘.tab’).forEach(tab => { tab.classList.remove(‘active-tab’); }); if (activeTab) { activeTab.classList.add(‘active-tab’); } // Tüm sekmeleri gizleme listesini güncelle const elementsToHide = [‘.ans-match-squad’, ‘.ans-match-stats’, ‘.ans-match-info’]; elementsToHide.forEach(el => { document.querySelector(el).style.display = ‘none’; }); document.querySelector(target).style.display = ‘block’; } function createTable(data, tabName) { var table = document.createElement(‘table’); table.style.width = ‘100%’; table.border = ‘1’; table.classList.add(tabName); // Tablonun başlık kısmı için oluştur var thead = document.createElement(‘thead’); var headerRow = document.createElement(‘tr’); if (data.length > 0) { data[0].forEach(function (cellData) { var headerCell = document.createElement(‘th’); headerCell.textContent = cellData || ”; // Eğer cellData boşsa, boş string ata headerRow.appendChild(headerCell); }); thead.appendChild(headerRow); table.appendChild(thead); } // Tablonun gövdesi için oluştur var tbody = document.createElement(‘tbody’); // İlk satırdan sonra gelen verileri içine ekle data.slice(1).forEach(function (rowData) { var row = document.createElement(‘tr’); rowData.forEach(function (cellData, index) { var cell = document.createElement(‘td’); if (tabName === ‘squad’ && (index === 0 || index === 7)) { var img = document.createElement(‘img’); img.src = cellData; img.alt = ‘Görsel’; img.onload = function () { console.log(‘Resim yüklendi:’, img.src); }; cell.appendChild(img); } else { cell.textContent = cellData; } row.appendChild(cell); }); tbody.appendChild(row); }); table.appendChild(tbody); return table; }
- Advertisement -

Son içerikler

CEVAP VER

Lütfen yorumunuzu giriniz!
Lütfen isminizi buraya giriniz