Train Line

Developer
Size
2,857 Kb
Views
26,312

How do I make an train line?

(WIP) Train Line style navigation using pseudo elements.. What is a train line? How do you make a train line? This script and codes were developed by Mark Murray on 12 August 2022, Friday.

Train Line Previews

Train Line - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Train Line</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <ul> <li class='active'>Station 1</li> <li>Station 2</li> <li>Station 3</li> <li>Station 4</li>
</ul> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Train Line - Script Codes CSS Codes

@import url(http://fonts.googleapis.com/css?family=Open+Sans);
html, body { background: #2980b9; color: white;
}
ul { font-family: 'Open Sans', sans-serif; position: absolute; top: 50%; left: 50%; -moz-transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%);
}
ul li.active:before { background: white;
}
ul li.active { opacity: 1;
}
ul li { display: inline-block; margin-right: 2em; position: relative; opacity: 0.8; cursor: pointer;
}
ul li:hover { opacity: 1;
}
ul li:last-of-type { margin: 0;
}
ul li:last-of-type:after { content: none;
}
ul li:before { content: ''; position: absolute; top: -200%; left: 50%; -moz-transform: translate(-50%); -ms-transform: translate(-50%); -webkit-transform: translate(-50%); transform: translate(-50%); width: 10px; height: 10px; -moz-border-radius: 50%; -webkit-border-radius: 50%; border-radius: 50%; background: transparent; border: 2px solid white; -moz-transition: background 0.5s ease; -o-transition: background 0.5s ease; -webkit-transition: background 0.5s ease; transition: background 0.5s ease;
}
ul li:after { content: ''; position: absolute; background: white; height: 2px; width: 92px; top: -160%; left: 58%;
}

Train Line - Script Codes JS Codes

(function($){ $('li').click(function(){ $('.active').removeClass('active'); $(this).addClass('active'); });
}(jQuery));
Train Line - Script Codes
Train Line - Script Codes
Home Page Home
Developer Mark Murray
Username markmurray
Uploaded August 12, 2022
Rating 4.5
Size 2,857 Kb
Views 26,312
Do you need developer help for Train Line?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Mark Murray (markmurray) Script Codes
Create amazing blog posts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!