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 |
A Pen by cmalven | 3,247 Kb |
Smooth Chars | 4,429 Kb |
Speed | 2,847 Kb |
Self-Generating Node Network | 7,385 Kb |
Three.js Playground | 3,712 Kb |
Responsive Device Morph | 7,940 Kb |
Hello, there. | 2,563 Kb |
Type Pathfitting | 6,112 Kb |
Input with Draggable Values | 3,061 Kb |
Progressively-Enhanced Smooth Scroll | 3,910 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 |
A Pen by Jason Kinney | Jason-kinney | 1,980 Kb |
Spinners using Font Icons | Keyamoon | 3,007 Kb |
Impress JS Algorhytmic Generator | Jeffscottward | 7,906 Kb |
A Pen by Ash | Littleginger | 2,386 Kb |
Blog | Rottingroom | 1,430 Kb |
Tab panels | Accessibility | 0 Kb |
Project Euler Problem 17 | Bfillmer | 2,739 Kb |
Canvas snow | Win7killer | 2,572 Kb |
SVG Playground | Roygwells | 1,834 Kb |
Slide out Menu | Rbiggs | 4,936 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!