Skip to content

Commit cd03e54

Browse files
committed
will fix the css later i am so done :D
1 parent 5b8019e commit cd03e54

File tree

6 files changed

+116
-87
lines changed

6 files changed

+116
-87
lines changed

_includes/menu-categories.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!-- Don't edit anything here, categories are dynamically generated -->
22

3-
<nav class="navbar navbar-expand-lg navbar-light bg-white pl-2 pr-2">
3+
<nav class="navbar navbar-expand-lg navbar-light pl-2 pr-2">
44
<button class="navbar-light navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExplore" aria-controls="navbarsDefault" aria-expanded="false" aria-label="Toggle navigation">
55
<span class="navbar-toggler-icon"></span>
66
</button>

_layouts/default.html

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,25 @@
99
{% seo %}
1010

1111
<link rel="shortcut icon" type="image/x-icon" href="{{site.baseurl}}/{{site.favicon}}">
12+
13+
14+
<link rel="stylesheet" href="{{site.baseurl}}/assets/css/bootstrap.css">
15+
16+
<link rel="stylesheet" href="{{site.baseurl}}/assets/css/theme-switcher.css">
1217

1318
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.13/css/all.css" integrity="sha384-DNOHZ68U8hZfKXOrtjWvjxusGo9WQnrNx2sqG0tfsghAvtVlRW3tvkXWZh58N9jp" crossorigin="anonymous">
14-
15-
<link rel="stylesheet" href="{{site.baseurl}}/assets/css/bootstrap.css">
19+
1620

1721
<!--<link rel="stylesheet" href="{{site.baseurl}}/assets/css/theme.css"> -->
1822

19-
<link rel="stylesheet" href="{{site.baseurl}}/assets/css/theme-switcher.css">
20-
23+
2124

2225

2326
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
2427

2528
{% include tracking-header.html %}
2629

30+
2731
</head>
2832

2933
<body>

_layouts/page.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: default
33
---
44

5-
<section class="bg-gray200 pt-5 pb-5">
5+
<section class="bg-gray200 row bg-transparent pt-5 pb-5">
66

77
<div class="container">
88

_pages/categories.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
<div class="container mb-1">
1010
<h1 class="font-weight-bold title">Categories</h1>
11-
<div class="menu-categories">
11+
<div class="row">
1212
{% include menu-categories.html %}
1313
</div>
1414
</div>

assets/css/theme-switcher.css

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -311,10 +311,6 @@ pre {
311311
text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3); /* Enhanced shadow for better contrast */
312312
}
313313

314-
.navbar-nav categories {
315-
background-color: transparent;
316-
}
317-
318314
/* Add a forced contrast class for navbar items */
319315
.navbar .forced-light-text,
320316
[data-theme^="dark"] .navbar .nav-link,
@@ -343,8 +339,7 @@ pre {
343339

344340
.navbar .nav-link:hover {
345341
color: #fff !important; /* Force white text on hover */
346-
background: transparent;
347-
342+
background: transparent; /* Remove gradient background */
348343
transform: none; /* No movement */
349344
box-shadow: 0 0 15px var(--accent-color1); /* Glow effect */
350345
border: 1px solid var(--accent-color1); /* Highlight border */
@@ -854,7 +849,7 @@ a.prev:hover,
854849
a.next:hover {
855850
transform: translateY(-50%) scale(1.1) !important;
856851
background: var(--gradient1) !important;
857-
color: #fffb00 !important;
852+
color: #fff !important;
858853
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
859854
opacity: 1 !important;
860855
}
@@ -899,6 +894,8 @@ a.next:empty::before {
899894
}
900895

901896
.pinme:hover {
897+
transform: translateY(-50%) scale(1.1) !important;
898+
background: var(--gradient1) !important;
902899
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15) !important;
903900
opacity: 1 !important;
904901
}
@@ -912,7 +909,7 @@ a.next:empty::before {
912909
}
913910

914911
.pinme:hover a {
915-
box-shadow: 0 0px 5px hsl(216, 100%, 73%) !important;
912+
box-shadow: 0 px 5px hsl(0, 100%, 82%) !important;
916913
}
917914

918915
.gotopost {

assets/js/theme-switcher.js

Lines changed: 100 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ document.addEventListener('DOMContentLoaded', function() {
44
const themeDropdownMenu = document.getElementById('theme-dropdown-menu');
55

66
if (themeDropdownToggle && themeDropdownMenu) {
7-
// Toggle dropdown menu with stopPropagation to prevent immediate closing
7+
// Toggle dropdown menu
88
themeDropdownToggle.addEventListener('click', function(e) {
99
e.preventDefault();
10-
e.stopPropagation();
1110
themeDropdownMenu.classList.toggle('show');
1211
});
1312

@@ -27,110 +26,139 @@ document.addEventListener('DOMContentLoaded', function() {
2726
localStorage.setItem('theme', theme);
2827
themeDropdownMenu.classList.remove('show');
2928

30-
// Visual feedback for selection
31-
themeItems.forEach(i => i.classList.remove('active'));
32-
this.classList.add('active');
29+
// Add visual feedback for selection
30+
this.classList.add('selected');
31+
setTimeout(() => {
32+
this.classList.remove('selected');
33+
}, 500);
3334
});
3435
});
3536
}
3637

3738
// Apply saved theme or default on page load
38-
const savedTheme = localStorage.getItem('theme') || 'light-soft';
39+
const savedTheme = localStorage.getItem('theme') || 'light-retro';
3940
applyTheme(savedTheme);
4041

4142
// Function to apply a theme
4243
function applyTheme(theme) {
4344
document.documentElement.setAttribute('data-theme', theme);
4445

45-
// Update active item in dropdown
46+
// Update active item in dropdown if it exists
4647
const themeItems = document.querySelectorAll('.theme-dropdown-item');
4748
themeItems.forEach(item => {
4849
if (item.getAttribute('data-theme') === theme) {
4950
item.classList.add('active');
51+
item.style.fontWeight = 'bold';
5052
} else {
5153
item.classList.remove('active');
54+
item.style.fontWeight = 'normal';
5255
}
5356
});
5457

55-
// Update toggle icon based on light or dark theme
58+
// Update toggle text and icon
5659
const themeToggle = document.getElementById('theme-dropdown-toggle');
5760
if (themeToggle) {
5861
const isLight = theme.startsWith('light');
59-
// Check if using Font Awesome 5 (fas) or older version (fa)
60-
const iconPrefix = document.querySelector('.fas') ? 'fas' : 'fa';
6162
const iconClass = isLight ? 'fa-sun' : 'fa-moon';
62-
themeToggle.innerHTML = `<i class="${iconPrefix} ${iconClass}"></i> Theme`;
63+
themeToggle.innerHTML = `<i class="fas ${iconClass}"></i> Theme`;
6364
}
6465

65-
// Fix visibility issues with navigation arrows
66-
fixNavigationArrows();
67-
68-
// Additional theme-specific adjustments
69-
adjustThemeSpecificElements(theme);
66+
// Apply special effects based on theme
67+
applyThemeSpecificEffects(theme);
7068
}
7169

72-
// Additional function to adjust elements based on theme
73-
function adjustThemeSpecificElements(theme) {
74-
const isDark = theme.startsWith('dark');
70+
// Apply special effects based on current theme
71+
function applyThemeSpecificEffects(theme) {
72+
// Get all cards for animations
73+
const cards = document.querySelectorAll('.card');
7574

76-
// Adjust navbar toggler for better visibility in dark themes
77-
const navbarToggler = document.querySelector('.navbar-toggler');
78-
if (navbarToggler) {
79-
if (isDark) {
80-
navbarToggler.style.backgroundColor = 'rgba(255, 255, 255, 0.1)';
81-
} else {
82-
navbarToggler.style.backgroundColor = '';
83-
}
75+
// Apply different animations based on the theme
76+
if (theme.includes('retro')) {
77+
// For retro themes, add subtle parallax effect to cards
78+
cards.forEach(card => {
79+
card.classList.add('retro-effect');
80+
81+
// Add hover listener for parallax effect
82+
card.addEventListener('mousemove', function(e) {
83+
const cardRect = card.getBoundingClientRect();
84+
const cardCenterX = cardRect.left + cardRect.width / 2;
85+
const cardCenterY = cardRect.top + cardRect.height / 2;
86+
const mouseX = e.clientX - cardCenterX;
87+
const mouseY = e.clientY - cardCenterY;
88+
89+
// Limit the rotation
90+
const maxRotation = 8;
91+
const rotateY = (mouseX / cardRect.width) * maxRotation;
92+
const rotateX = -((mouseY / cardRect.height) * maxRotation);
93+
94+
card.style.transform = `perspective(1000px) rotateX(${rotateX}deg) rotateY(${rotateY}deg) scale3d(1.02, 1.02, 1.02)`;
95+
});
96+
97+
// Reset on mouse leave
98+
card.addEventListener('mouseleave', function() {
99+
card.style.transform = 'perspective(1000px) rotateX(0) rotateY(0) scale3d(1, 1, 1)';
100+
});
101+
});
102+
} else {
103+
// Remove retro effects if not a retro theme
104+
cards.forEach(card => {
105+
card.classList.remove('retro-effect');
106+
card.style.transform = '';
107+
108+
// Remove event listeners (clone and replace)
109+
const newCard = card.cloneNode(true);
110+
card.parentNode.replaceChild(newCard, card);
111+
});
84112
}
85113

86-
// Ensure navigation arrows have appropriate contrast
87-
const navArrows = document.querySelectorAll('a.prev, a.next');
88-
navArrows.forEach(arrow => {
89-
if (isDark) {
90-
arrow.style.backgroundColor = 'rgba(255, 255, 255, 0.15)';
91-
arrow.style.color = '#fff';
92-
} else {
93-
arrow.style.backgroundColor = '';
94-
arrow.style.color = '';
114+
// Enhance buttons based on theme
115+
const buttons = document.querySelectorAll('.btn-primary, .btn-danger, .btn-warning');
116+
if (theme.includes('mono')) {
117+
// For mono themes, add subtle grow effect
118+
buttons.forEach(btn => {
119+
btn.classList.add('mono-effect');
120+
});
121+
} else {
122+
// Remove mono effects
123+
buttons.forEach(btn => {
124+
btn.classList.remove('mono-effect');
125+
});
126+
}
127+
128+
// Apply header footer gradients based on theme
129+
const navbar = document.querySelector('.navbar');
130+
const footer = document.querySelector('.footer');
131+
132+
if (navbar && footer) {
133+
if (theme.includes('soft')) {
134+
navbar.style.background = 'var(--gradient1) !important';
135+
footer.style.background = 'var(--gradient1) !important';
136+
} else if (theme.includes('mono')) {
137+
navbar.style.background = 'var(--gradient2) !important';
138+
footer.style.background = 'var(--gradient2) !important';
139+
} else if (theme.includes('retro')) {
140+
navbar.style.background = 'var(--gradient3) !important';
141+
footer.style.background = 'var(--gradient3) !important';
95142
}
96-
});
143+
}
97144
}
98145

99-
// Function to fix navigation arrows
100-
function fixNavigationArrows() {
101-
const prevNextLinks = document.querySelectorAll('a.prev, a.next');
102-
prevNextLinks.forEach(link => {
103-
// Ensure icons are visible
104-
if (!link.querySelector('i')) {
105-
// Check if using Font Awesome 5 (fas) or older version (fa)
106-
const iconPrefix = document.querySelector('.fas') ? 'fas' : 'fa';
107-
link.innerHTML = link.classList.contains('prev') ?
108-
`<i class="${iconPrefix} fa-angle-left"></i>` :
109-
`<i class="${iconPrefix} fa-angle-right"></i>`;
110-
}
111-
112-
// Make slightly visible by default
113-
link.style.opacity = '0.8';
114-
115-
// Set background and text color for better visibility
116-
const theme = document.documentElement.getAttribute('data-theme') || 'light-soft';
117-
const isDark = theme.startsWith('dark');
118-
119-
if (isDark) {
120-
link.style.backgroundColor = 'rgba(255, 255, 255, 0.15)';
121-
link.style.color = '#ffffff';
122-
} else {
123-
// For light themes, use accent color as background
124-
const computedStyle = getComputedStyle(document.documentElement);
125-
const accentColor = computedStyle.getPropertyValue('--accent-color1');
126-
link.style.backgroundColor = accentColor || '#007BFF';
127-
link.style.color = '#ffffff';
128-
}
129-
130-
link.style.boxShadow = '0 4px 10px rgba(0, 0, 0, 0.3)';
146+
// Add special class to cards for animations
147+
document.querySelectorAll('.card').forEach(card => {
148+
card.addEventListener('mouseenter', function() {
149+
this.classList.add('card-hover');
131150
});
132-
}
151+
152+
card.addEventListener('mouseleave', function() {
153+
this.classList.remove('card-hover');
154+
});
155+
});
133156

134-
// Initialize navigation arrows on page load
135-
fixNavigationArrows();
157+
// Enhance post navigation
158+
const prevNextLinks = document.querySelectorAll('a.prev, a.next');
159+
prevNextLinks.forEach(link => {
160+
link.innerHTML = link.classList.contains('prev') ?
161+
'<i class="fa fa-angle-left"></i>' :
162+
'<i class="fa fa-angle-right"></i>';
163+
});
136164
});

0 commit comments

Comments
 (0)