<!DOCTYPE html>
<html>
<head>
<style data-hitch-interpret>
#indicator:returning-visit(2)::after {
color: red;
content: ' Welcome back!';
}
</style>
<script src="http://www.hitchjs.com/dist/hitch-0.6.3.min.js"></script>
<script src="script.js"></script>
</head>
<body>
<div id="indicator">Hi!</div>
</body>
</html>
Hitch.add([{
name: 'returning-visit',
filter: function(match, arg) {
var count = +localStorage.getItem('returningVisit') || 0;
localStorage.setItem('returningVisit', count + 1);
return count >= arg;
}
}]);