'; var continueParagraph = document.createElement('p'); continueParagraph.classList.add('viewed'); continueParagraph.appendChild(continueLink); var deleteIcon = document.createElement('span');deleteIcon.innerHTML = ``;deleteIcon.addEventListener('mouseover', function() { deleteIcon.style.transform = 'scale(1.2)'; deleteIcon.style.cursor = 'pointer';});deleteIcon.addEventListener('mouseout', function() { deleteIcon.style.transform = 'scale(1)';});deleteIcon.addEventListener('click', function() { deleteReadingHistoryItem(item.story_id); listItem.remove();});continueParagraph.appendChild(deleteIcon); continueParagraph.style.display = 'flex'; continueParagraph.style.justifyContent = 'space-between'; continueParagraph.style.alignItems = 'center'; listItem.appendChild(titleHeading); listItem.appendChild(continueParagraph); return listItem;}function displayHistoryList() { var historyList = document.getElementById('historyList'); if (historyList) { historyList.innerHTML = ''; var readingHistory = JSON.parse(localStorage.getItem('readingHistory')) || []; readingHistory.slice(0, 5).forEach(function(item) { var listItem = createReadingHistoryItem(item); historyList.appendChild(listItem); }); }}function deleteReadingHistoryItem(storyId) { var readingHistory = JSON.parse(localStorage.getItem('readingHistory')) || []; var updatedHistory = readingHistory.filter(function(item) { return item.story_id !== storyId; }); localStorage.setItem('readingHistory', JSON.stringify(updatedHistory)); displayHistoryList(); }displayHistoryList();