4,092
edits
No edit summary |
No edit summary |
||
Line 422: | Line 422: | ||
} | } | ||
function | function setShowArticleRotationEffect() { | ||
const offset = 15; | |||
const showArticle = document.querySelector('#show-article'); | const showArticle = document.querySelector('#show-article'); | ||
const h = showArticle.clientHeight; | const h = showArticle.clientHeight; | ||
const a = Math.cos(Math.atan( | const a = Math.cos(Math.atan(offset/h)); | ||
const b = Math.sin(Math.atan( | const b = -Math.sin(Math.atan(offset/h)); | ||
const c = | const c = Math.sin(Math.atan(offset/h)); | ||
const d = Math.cos(Math.atan( | const d = Math.cos(Math.atan(offset/h)); | ||
const showArticleBefore = document.querySelector('#show-article-before'); | const showArticleBefore = document.querySelector('#show-article-before'); | ||
const transformValue = 'matrix('+a+','+b+','+c+','+d+',0,0)'; | |||
const transformValue = 'matrix('+a+','+b+','+c+','+d+',0,0)' | |||
showArticleBefore.style.transform = transformValue; | showArticleBefore.style.transform = transformValue; | ||
} | } | ||
Line 447: | Line 441: | ||
} | } | ||
openModal(this, event); // Pass the event object to openModal | openModal(this, event); // Pass the event object to openModal | ||
setShowArticleRotationEffect(); | |||
}); | }); | ||
$('#show-article-wrapper').on('mousedown', '.related-article', function(event) { | $('#show-article-wrapper').on('mousedown', '.related-article', function(event) { | ||
openModal(this, event); // Call openModal when a related-article is clicked | openModal(this, event); // Call openModal when a related-article is clicked | ||
setShowArticleRotationEffect(); | |||
}); | }); | ||