The question is a bit to extensive and I'm surprised it wasn't closed, but as you are new here I will give you an head start, you had everything you need on this website:
You need to:
1- Find out if your article is in view-port and extract id
. On this topic among others you have couple of different solutions on how to: Dynamically detect current div on page scroll in jQuery with random number of divs
2- You need to update the a address bar URL without reloading, you need to learn how to on next topics: Updating address bar with new URL without hash or reloading the page and How do I modify the URL without reloading the page?
I have made you basic example of how that works:
<html>
<body>
<header>
<style type="text/css">
section {
min-height: 300px
}
</style>
</header>
<section id="section1"> section 1</section>
<section id="section2"> section 2</section>
<section id="section3"> section 3</section>
<section id="section4"> section 4</section>
<script type="text/javascript">
var isInViewport = function(elem) {
var distance = elem.getBoundingClientRect();
return (
distance.top >= 0 &&
distance.left >= 0 &&
distance.bottom <= (window.innerHeight || document.documentElement.clientHeight) &&
distance.right <= (window.innerWidth || document.documentElement.clientWidth)
);
};
var findMe = document.querySelectorAll('section');
window.addEventListener('scroll', function(event) {
// add event on scroll
findMe.forEach(page => {
//for each .page
if (isInViewport(page)) {
//if in Viewport
console.clear();
console.log(page.id);
// exampla with hash #:
//document.location.hash = page.id;
//new url
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + '?' + page.id;
window.history.pushState({
path: newurl
}, '', newurl);
}
});
}, false);
</script>
</body>
</html>
This is more then enough for you to get going yourself. First search for topics here for answer, then feel free if you get stuck on some part of code to ask for help.
Welcome to SO and good luck.