Stacked Card Navigation
How do I make an stacked card navigation?
What is a stacked card navigation? How do you make a stacked card navigation? This script and codes were developed by Cmalven on 29 January 2023, Sunday.
Stacked Card Navigation - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Stacked Card Navigation</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> <div class="container"> <div class="tab tab-1">HAL</div> <div class="tab tab-2">VICI</div> <div class="tab tab-3">KITT</div> <div class="tab tab-4">BISHOP</div>
</div> <script src='https://code.jquery.com/jquery-2.2.4.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/1.19.0/TweenMax.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Stacked Card Navigation - Script Codes CSS Codes
.container { width: 320px; height: 480px; background-color: #ddd; position: absolute; top: 0; right: 0; bottom: 0; left: 0; margin: auto; overflow: hidden;
}
.tab { cursor: pointer; position: absolute; padding: 32px; top: 0; right: 0; bottom: 0; left: 0; box-shadow: 0 0 70px rgba(0, 0, 0, 0.8); font-family: 'Avenir'; font-weight: 700; font-size: 38px; color: #fff; -webkit-font-smoothing: antialiased;
}
.tab:hover { -webkit-filter: grayscale(0.3); filter: grayscale(0.3);
}
.tab-1 { background-color: #0085a1;
}
.tab-2 { background-color: #3d2471;
}
.tab-3 { background-color: #28a636;
}
.tab-4 { background-color: #ae001f;
}
Stacked Card Navigation - Script Codes JS Codes
'use strict';
var $container = $('.container');
var $tabs = $('.tab');
var $activeTab = null;
var height = $container.outerHeight();
var eachHeight = height / $tabs.length;
var collapsedHeight = 20;
var resetTabs = function resetTabs() { for (var idx = 0; idx < $tabs.length; idx++) { var $tab = $tabs.eq(idx); var targetY = idx * eachHeight; TweenLite.to($tab, 0.5, { y: targetY, ease: Power3.easeOut }); } $activeTab = null;
};
var selectTab = function selectTab(selectedIdx) { if ($activeTab) return resetTabs(); $activeTab = $tabs.eq(selectedIdx); var targetY = null; for (var idx = 0; idx < $tabs.length; idx++) { var $tab = $tabs.eq(idx); if (idx <= selectedIdx) { targetY = idx * collapsedHeight; } else { targetY = height - collapsedHeight * ($tabs.length - idx); } TweenLite.to($tab, 0.5, { y: targetY, ease: Power3.easeOut }); }
};
resetTabs();
$tabs.on('click', function (evt) { var idx = $tabs.index($(this)); selectTab(idx);
});
![Stacked Card Navigation - Script Codes](http://shots.codepen.io/cmalven/pen/vKrNqp-512.jpg)
Developer | Cmalven |
Username | cmalven |
Uploaded | January 29, 2023 |
Rating | 3 |
Size | 3,205 Kb |
Views | 2,024 |
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!
Name | Size |
Chi Coast | 12,923 Kb |
Speed | 2,847 Kb |
Input with Draggable Values | 3,061 Kb |
TweenMax Smoke | 2,994 Kb |
Responsive Device Morph | 7,940 Kb |
Three.js Playground | 3,712 Kb |
Smooth Chars | 4,429 Kb |
One Distortion | 4,981 Kb |
Three.js Node Cloud | 5,315 Kb |
Let it Snow | 3,149 Kb |
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!
Name | Username | Size |
JQuery AJAX reddit Exercise | Btholt | 1,777 Kb |
React JS Movie Info App | MTushar | 4,870 Kb |
Popup Modal | Aldlevine | 3,696 Kb |
Image Hover | Johnheiner | 3,409 Kb |
12 DAYS OF XMAS | Proto78 | 2,313 Kb |
Random Gradients - JS | Aldlevine | 2,026 Kb |
Pomodoro Timer | Sdas13 | 2,900 Kb |
A Pen by Jay | Jaycode | 3,784 Kb |
Wave Lines | Mikehobizal | 4,023 Kb |
Material Design-Layout-Principles Practice | Fraina | 2,331 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!