asafarim-navlinks
Version:
A versatile React navigation component with unlimited multi-level dropdowns, four alignment options, mobile responsiveness, and customizable styling. Perfect for modern web applications.
591 lines (512 loc) • 12.3 kB
CSS
/* ASafariM NavLinks Demo Styles */
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css');
/* CSS Variables for Demo */
:root {
--demo-primary: #3498db;
--demo-secondary: #2ecc71;
--demo-accent: #9b59b6;
--demo-warning: #f39c12;
--demo-danger: #e74c3c;
--demo-light: #ecf0f1;
--demo-dark: #2c3e50;
--demo-text: #2c3e50;
--demo-text-light: #7f8c8d;
--demo-bg: #ffffff;
--demo-border: #bdc3c7;
--demo-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
--demo-radius: 8px;
--demo-transition: all 0.3s ease;
--demo-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
}
/* Dark mode support */
@media (prefers-color-scheme: dark) {
:root {
--demo-bg: #1a1a1a;
--demo-text: #ffffff;
--demo-text-light: #bdc3c7;
--demo-border: #404040;
--demo-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
}
/* Base Styles */
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
font-family: var(--demo-font-family);
line-height: 1.6;
color: var(--demo-text);
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
min-height: 100vh;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New', monospace;
background: rgba(0, 0, 0, 0.05);
padding: 2px 6px;
border-radius: 4px;
font-size: 0.9em;
}
/* Demo Container */
.demo-container {
max-width: 1200px;
margin: 0 auto;
padding: 20px;
background: var(--demo-bg);
border-radius: var(--demo-radius);
box-shadow: var(--demo-shadow);
margin-top: 20px;
margin-bottom: 20px;
}
/* Header Styles */
.demo-header {
text-align: center;
padding: 40px 0;
background: linear-gradient(135deg, var(--demo-primary), var(--demo-secondary));
color: white;
border-radius: var(--demo-radius);
margin-bottom: 40px;
position: relative;
overflow: hidden;
}
.demo-header::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20"><defs><pattern id="a" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="2" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="20" fill="url(%23a)"/></svg>') repeat;
z-index: 1;
}
.demo-header > * {
position: relative;
z-index: 2;
}
.demo-main-title {
font-size: 3rem;
font-weight: 700;
margin: 0 0 20px;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
.demo-subtitle {
font-size: 1.2rem;
margin: 0 0 30px;
opacity: 0.9;
max-width: 600px;
margin-left: auto;
margin-right: auto;
}
/* Theme Toggle */
.theme-toggle {
margin-top: 20px;
}
.demo-flex {
display: flex;
justify-content: space-between;
align-items: center;
gap: 20px;
}
.theme-btn {
background: rgba(255, 255, 255, 0.2);
border: 2px solid rgba(255, 255, 255, 0.3);
color: white;
padding: 12px 24px;
border-radius: 50px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: var(--demo-transition);
backdrop-filter: blur(10px);
}
.theme-btn:hover {
background: rgba(255, 255, 255, 0.3);
border-color: rgba(255, 255, 255, 0.5);
transform: translateY(-2px);
}
/* Section Styles */
.demo-section {
margin-bottom: 60px;
padding: 40px;
background: var(--demo-bg);
border-radius: var(--demo-radius);
box-shadow: var(--demo-shadow);
border: 1px solid var(--demo-border);
transition: var(--demo-transition);
}
.demo-section:hover {
transform: translateY(-2px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}
.demo-section.highlighted {
background: linear-gradient(135deg, rgba(52, 152, 219, 0.05), rgba(46, 204, 113, 0.05));
border: 2px solid var(--demo-primary);
}
.demo-title {
color: var(--demo-primary);
margin: 0 0 20px;
padding-bottom: 15px;
border-bottom: 3px solid var(--demo-primary);
font-size: 2rem;
font-weight: 700;
display: flex;
align-items: center;
gap: 10px;
}
.demo-description {
color: var(--demo-text-light);
margin-bottom: 30px;
font-size: 1.1rem;
line-height: 1.7;
}
/* Features Grid */
.features-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
gap: 20px;
margin: 30px 0;
}
.feature-card {
background: var(--demo-bg);
border: 1px solid var(--demo-border);
border-radius: var(--demo-radius);
padding: 25px;
text-align: center;
transition: var(--demo-transition);
box-shadow: var(--demo-shadow);
}
.feature-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
border-color: var(--demo-primary);
}
.feature-icon {
font-size: 3rem;
margin-bottom: 15px;
}
.feature-title {
font-size: 1.3rem;
font-weight: 600;
color: var(--demo-text);
margin-bottom: 10px;
}
.feature-description {
color: var(--demo-text-light);
font-size: 0.95rem;
line-height: 1.5;
}
/* Navigation Demo Styles */
.nav-demo {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 20px;
border-radius: var(--demo-radius);
margin: 20px 0;
box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.1);
}
.nav-demo.comprehensive {
background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
padding: 25px;
}
/* Theme Examples */
.theme-examples {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 30px;
margin: 30px 0;
}
.theme-example {
background: var(--demo-bg);
border: 1px solid var(--demo-border);
border-radius: var(--demo-radius);
padding: 20px;
box-shadow: var(--demo-shadow);
}
.theme-example h3 {
color: var(--demo-text);
margin: 0 0 15px;
font-size: 1.2rem;
}
/* Alignment Demos */
.alignment-demos {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
gap: 30px;
margin: 30px 0;
}
.alignment-demo {
background: var(--demo-bg);
border: 1px solid var(--demo-border);
border-radius: var(--demo-radius);
padding: 20px;
box-shadow: var(--demo-shadow);
}
.alignment-demo h3 {
color: var(--demo-text);
margin: 0 0 15px;
font-size: 1.1rem;
}
/* Mobile Demo */
.mobile-demo {
display: flex;
justify-content: center;
margin: 30px 0;
}
.mobile-frame {
width: 375px;
height: 667px;
background: #000;
border-radius: 30px;
padding: 20px;
box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
position: relative;
overflow: hidden;
}
.mobile-frame::before {
content: '';
position: absolute;
top: 10px;
left: 50%;
transform: translateX(-50%);
width: 60px;
height: 6px;
background: #333;
border-radius: 3px;
}
.mobile-nav {
width: 100%;
height: 100%;
background: #fff;
border-radius: 20px;
overflow: hidden;
}
/* API Table */
.api-table {
overflow-x: auto;
margin: 20px 0;
}
.api-table table {
width: 100%;
border-collapse: collapse;
background: var(--demo-bg);
border-radius: var(--demo-radius);
overflow: hidden;
box-shadow: var(--demo-shadow);
}
.api-table th,
.api-table td {
padding: 15px;
text-align: left;
border-bottom: 1px solid var(--demo-border);
}
.api-table th {
background: var(--demo-primary);
color: white;
font-weight: 600;
}
.api-table tr:hover {
background: rgba(52, 152, 219, 0.05);
}
.api-table code {
background: rgba(52, 152, 219, 0.1);
color: var(--demo-primary);
padding: 4px 8px;
border-radius: 4px;
font-weight: 600;
}
/* Footer */
.demo-footer {
background: linear-gradient(135deg, var(--demo-dark), #34495e);
color: white;
padding: 40px;
border-radius: var(--demo-radius);
margin-top: 60px;
}
.footer-content {
display: flex;
justify-content: space-between;
align-items: center;
flex-wrap: wrap;
gap: 20px;
}
.footer-info h3 {
margin: 0 0 10px;
font-size: 1.5rem;
}
.footer-info p {
margin: 0;
opacity: 0.8;
}
.footer-links {
display: flex;
gap: 20px;
flex-wrap: wrap;
}
.footer-links a {
color: white;
text-decoration: none;
padding: 10px 20px;
border: 2px solid rgba(255, 255, 255, 0.2);
border-radius: 25px;
transition: var(--demo-transition);
}
.footer-links a:hover {
background: rgba(255, 255, 255, 0.1);
border-color: rgba(255, 255, 255, 0.4);
transform: translateY(-2px);
}
/* Responsive Design */
@media (max-width: 768px) {
.demo-container {
margin: 10px;
padding: 15px;
}
.demo-main-title {
font-size: 2rem;
}
.demo-subtitle {
font-size: 1rem;
}
.demo-section {
padding: 25px;
margin-bottom: 30px;
}
.features-grid {
grid-template-columns: 1fr;
gap: 15px;
}
.theme-examples,
.alignment-demos {
grid-template-columns: 1fr;
}
.footer-content {
flex-direction: column;
text-align: center;
}
.mobile-frame {
width: 300px;
height: 533px;
}
}
/* Animations */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.demo-section {
animation: fadeInUp 0.6s ease-out forwards;
}
/* Accessibility */
@media (prefers-reduced-motion: reduce) {
* {
animation-duration: 0.01ms ;
animation-iteration-count: 1 ;
transition-duration: 0.01ms ;
}
}
/* Focus styles */
button:focus,
a:focus {
outline: 2px solid var(--demo-primary);
outline-offset: 2px;
}
/* Print styles */
@media print {
.demo-container {
box-shadow: none;
background: white;
}
.demo-header {
background: var(--demo-primary) ;
color: white ;
}
.nav-demo {
background: #f5f5f5 ;
border: 1px solid #ddd;
}
}
/* Navigation Demo Specific Styles - Removed conflicting styles */
/* All navigation behavior is now handled by the package CSS */
/* Code Block Styling */
.code-highlight-container {
margin: 20px 0;
border-radius: 8px;
overflow: hidden;
background-color: #282c34;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.code-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 16px;
background-color: #21252b;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.language-badge {
font-size: 0.7rem;
color: #abb2bf;
font-weight: 500;
background-color: #3a404b;
padding: 3px 10px;
border-radius: 4px;
letter-spacing: 0.5px;
text-transform: uppercase;
}
.copy-button {
background-color: rgba(255, 255, 255, 0.07);
color: #abb2bf;
border: 1px solid rgba(255, 255, 255, 0.15);
border-radius: 4px;
padding: 5px 12px;
font-size: 0.85rem;
cursor: pointer;
display: flex;
align-items: center;
gap: 6px;
transition: all 0.2s ease;
font-weight: 500;
}
.copy-button:hover {
background-color: rgba(255, 255, 255, 0.15);
color: #ffffff;
}
.copy-button:active {
transform: translateY(1px);
}
.code-highlight-container pre {
margin: 0;
padding: 16px;
overflow-x: auto;
font-family: "SFMono-Regular", Menlo, Consolas, "Liberation Mono", Courier, monospace;
font-size: 0.95rem;
line-height: 1.6;
tab-size: 2;
}
.code-highlight-container code {
display: block;
padding: 0;
margin: 0;
background: transparent;
font-family: inherit;
}
/* Enhanced scrollbar for code blocks */
.code-highlight-container pre::-webkit-scrollbar {
height: 8px;
background-color: rgba(0, 0, 0, 0.1);
}
.code-highlight-container pre::-webkit-scrollbar-thumb {
background-color: rgba(255, 255, 255, 0.2);
border-radius: 4px;
}
.code-highlight-container pre::-webkit-scrollbar-thumb:hover {
background-color: rgba(255, 255, 255, 0.3);
}