Skip to content

Commit ea33fc2

Browse files
authored
Merge pull request #34 from AnumanyaJaiswal/dark-mode
feat: darkmode button
2 parents 4253c68 + 215e085 commit ea33fc2

File tree

11 files changed

+128
-132
lines changed

11 files changed

+128
-132
lines changed

bihar-culture-landing/Khelobihar.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
<meta charset="UTF-8">
55
<title>Khelo Bihar: Sports & Youth</title>
66
<link rel="stylesheet" href="style.css">
7+
<script type="text/javascript" src="darkmode.js" defer></script>
78
</head>
89
<body>
910
<header class="sub-hero">
1011
<h1 style="font-family: cursive;">Khelo Bihar</h1>
12+
<button id ="theme-switch">
13+
<img src="assets/images/dark_mode.png" alt="">
14+
<img src="assets/images/light_mode.png" alt="">
15+
16+
</button>
1117
<h3 style="font-weight: 30;">Sports and Youth Empowerment in Bihar</h3>
1218
</header>
1319

440 Bytes
Loading
568 Bytes
Loading

bihar-culture-landing/culture.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="UTF-8">
55
<title>Bihar Culture & Arts</title>
66
<link rel="stylesheet" href="style.css">
7+
<script type="text/javascript" src="darkmode.js" defer></script>
78
</head>
89

910
<body>
@@ -12,6 +13,11 @@
1213
<header>
1314
<div class="header-content">
1415
<h1>Culture & Arts of Bihar</h1>
16+
<button id ="theme-switch">
17+
<img src="assets/images/dark_mode.png" alt="">
18+
<img src="assets/images/light_mode.png" alt="">
19+
20+
</button>
1521
<h2>Where Tradition Meets Timeless Beauty</h2>
1622
<p class="tagline">Explore the rich art, music, and heritage that define the soul of Bihar.</p>
1723
</div>

bihar-culture-landing/darkmode.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
let darkmode = localStorage.getItem('darkmode')
2+
const themeSwitch = document.getElementById('theme-switch')
3+
4+
const enableDarkmode = () => {
5+
document.body.classList.add('darkmode')
6+
localStorage.setItem('darkmode', 'active')
7+
}
8+
9+
const disableDarkmode = () => {
10+
document.body.classList.remove('darkmode')
11+
localStorage.setItem('darkmode', null)
12+
}
13+
14+
themeSwitch.addEventListener("click", () => {
15+
darkmode = localStorage.getItem('darkmode')
16+
if (darkmode === "active") {
17+
enableDarkmode()
18+
}
19+
else{
20+
disableDarkmode()
21+
}
22+
})
23+
themeSwitch.addEventListener("click", () => {
24+
darkmode = localStorage.getItem('darkmode')
25+
if (darkmode !== "active") {
26+
enableDarkmode()
27+
}
28+
else{
29+
disableDarkmode()
30+
}
31+
})

bihar-culture-landing/festivals.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<meta charset="UTF-8">
55
<title>Bihar Festivals</title>
66
<link rel="stylesheet" href="style.css">
7+
<script type="text/javascript" src="darkmode.js" defer></script>
78

89
</head>
910
<body>
@@ -12,6 +13,11 @@
1213
<header class="sub-hero">
1314
<h1 style="font-family:cursive">
1415
Festivals of Bihar</h1>
16+
<button id ="theme-switch">
17+
<img src="assets/images/dark_mode.png" alt="">
18+
<img src="assets/images/light_mode.png" alt="">
19+
20+
</button>
1521
<h3>Rythm of Devotion, Soul of a State</h3>
1622
<p class="tagline">Checkout the seamless beauty of festivals of Bihar</p>
1723
</header>

bihar-culture-landing/history.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
<meta charset="UTF-8">
55
<title>Bihar History</title>
66
<link rel="stylesheet" href="style.css">
7+
<script type="text/javascript" src="darkmode.js" defer></script>
78
</head>
89
<body>
910
<header class="sub-hero">
1011
<h1 style="font-family: cursive;">History & Heritage</h1>
12+
<button id ="theme-switch">
13+
<img src="assets/images/dark_mode.png" alt="">
14+
<img src="assets/images/light_mode.png" alt="">
15+
16+
</button>
1117
<h3 style="font-weight: 30;">Weaving the tapestry of Bihar</h3>
1218
</header>
1319

bihar-culture-landing/index.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,17 @@
66
<title>Bihar Culture - Discover the Rich Heritage of Bihar</title>
77
<link rel="stylesheet" href="style.css">
88
<link rel="icon" type="image/x-icon" href="assets/icons/favicon.ico">
9+
<script type="text/javascript" src="darkmode.js" defer></script>
910
</head>
1011
<body>
1112
<header>
1213
<div class="header-content">
1314
<h1>बिहार संस्कृति</h1>
15+
<button id ="theme-switch">
16+
<img src="assets/images/dark_mode.png" alt="">
17+
<img src="assets/images/light_mode.png" alt="">
18+
19+
</button>
1420
<h2>Bihar Culture</h2>
1521
<p class="tagline">Discover the Rich Heritage and Vibrant Culture of Bihar</p>
1622
</div>

bihar-culture-landing/modern.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@
44
<meta charset="UTF-8">
55
<title>Modern Bihar</title>
66
<link rel="stylesheet" href="style.css">
7+
<script type="text/javascript" src="darkmode.js" defer></script>
78
</head>
89
<body>
910
<header class="sub-hero">
1011
<h1>Modern Bihar</h1>
12+
<button id ="theme-switch">
13+
<img src="assets/images/dark_mode.png" alt="">
14+
<img src="assets/images/light_mode.png" alt="">
15+
16+
</button>
1117
</header>
1218

1319
<nav class="main-navigation">

bihar-culture-landing/style.css

Lines changed: 54 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -4,37 +4,6 @@
44
padding: 0;
55
box-sizing: border-box;
66
}
7-
.footer-links li a:hover {
8-
color: #e8541f; /* Orange hover matches theme */
9-
}
10-
.footer-section {
11-
background-color: rgb(240, 242, 227);
12-
text-align: center;
13-
color: #e8541f;
14-
padding: 20px;
15-
border-radius: 8px;
16-
box-shadow: var(--shadow);
17-
}
18-
.footer-links li a {
19-
text-decoration: none;
20-
color: #007bff;
21-
font-weight: 600;
22-
font-size: 1.1rem;
23-
transition: color 0.3s ease;
24-
}
25-
26-
27-
.footer-links {
28-
29-
display: flex;
30-
justify-content: center;
31-
align-items: center;
32-
flex-wrap: wrap;
33-
gap: 25px;
34-
list-style: none;
35-
padding: 0;
36-
margin: 15px 0;
37-
}
387

398
/* CSS Custom Properties for consistent theming */
409
:root {
@@ -54,6 +23,24 @@
5423
--font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
5524
}
5625

26+
.darkmode{
27+
--primary-color: #432323;
28+
--secondary-color: #2F5755;
29+
--accent-color: #5A9690;
30+
--dark-color: #2c3e50;
31+
--light-color: #ecf0f1;
32+
--white: #ffffff;
33+
--text-dark: #2c3e50;
34+
--text-light: #7f8c8d;
35+
background-color: black;
36+
--shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
37+
--shadow-hover: 0 8px 25px rgba(0, 0, 0, 0.15);
38+
--border-radius: 12px;
39+
--transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
40+
--font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
41+
--font-heading: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
42+
}
43+
5744
/* Import Google Fonts */
5845
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@400;500;600;700&display=swap');
5946

@@ -70,6 +57,31 @@ body {
7057
overflow-x: hidden;
7158
}
7259

60+
#theme-switch{
61+
height: 50px;
62+
width: 50px;
63+
padding: 0;
64+
border-radius: 50%;
65+
background-color: transparent;
66+
display: flex;
67+
justify-content: center;
68+
align-items: center;
69+
position: fixed;
70+
top: 10px;
71+
right:20px ;
72+
border: none;
73+
}
74+
75+
#theme-switch img:last-child{
76+
display: none;
77+
}
78+
.darkmode #theme-switch img:first-child{
79+
display: none;
80+
}
81+
.darkmode #theme-switch img:last-child{
82+
display: block;
83+
}
84+
7385
/* Typography */
7486
h1, h2, h3, h4, h5, h6 {
7587
font-family: var(--font-heading);
@@ -109,16 +121,7 @@ header::before {
109121
background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
110122
opacity: 0.3;
111123
}
112-
@keyframes typing {
113-
from { width: 0 }
114-
to { width: 100% }
115-
}
116124

117-
/* The typewriter cursor effect */
118-
@keyframes blink-caret {
119-
from, to { border-color: transparent }
120-
50% { border-color: orange; }
121-
}
122125
.header-content {
123126
position: relative;
124127
z-index: 2;
@@ -127,26 +130,19 @@ header::before {
127130
}
128131

129132
.header-content h1 {
130-
overflow: hidden;
131-
border-right: .15em solid orange;
132-
white-space: nowrap;
133-
margin: 0 auto;
134-
letter-spacing: .15em;
135-
animation:
136-
typing 3.5s steps(40, end),
137-
blink-caret .75s step-end infinite;
138-
133+
font-size: clamp(2.5rem, 6vw, 4.5rem);
134+
font-weight: 700;
135+
margin: 0 auto;
136+
137+
/*margin-bottom: 0.5rem;*/
138+
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
139139
}
140140

141141
.header-content h2 {
142-
overflow: hidden;
143-
border-right: .15em solid orange;
144-
white-space: nowrap;
145-
margin: 0 auto;
146-
letter-spacing: .15em;
147-
animation:
148-
typing 3.5s steps(40, end),
149-
blink-caret .75s step-end infinite;
142+
font-size: clamp(1.5rem, 3vw, 2.5rem);
143+
font-weight: 400;
144+
margin-bottom: 1rem;
145+
opacity: 0.9;
150146
}
151147

152148
.tagline {
@@ -765,77 +761,4 @@ body.dark-mode .theme-toggle-btn .moon {
765761
grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
766762
gap: 2rem;
767763
margin-bottom: 4rem;
768-
}
769-
#text{
770-
text-align: center;
771-
color: aliceblue;
772-
background-color: #2c3e50;
773-
}
774-
#sidemain{
775-
background-color: #ff6b35;
776-
height: 100%;
777-
width: 100%;
778-
}
779-
780-
#personalities{
781-
background-color: #ff6b35;
782-
display: flex;
783-
align-items: center;
784-
785-
border-bottom: #2c3e50 solid 2px;
786-
}
787-
788-
.pic{
789-
width: 50%;
790-
791-
}
792-
#aryabhatta .pic img{
793-
object-fit: cover;
794-
width: 450px;
795-
height: 400px;
796-
797-
}
798-
#aryabhatta{
799-
display: flex;
800-
margin-top: 90px;
801-
border-bottom: #2c3e50 solid 2px;
802-
}
803-
.intro{
804-
width: 50%;
805-
padding-left: 5px;
806-
border-left: 2px solid black;
807-
}
808-
#anand{
809-
width: 100%;
810-
811-
display: flex;
812-
margin-top: 50px;
813-
justify-content: space-between;
814-
flex-direction: row-reverse;
815-
border-bottom: #2c3e50 solid 2px;
816-
}
817-
#anand .intro{
818-
border-right: 2px solid black;
819-
}
820-
#anand .pic{
821-
flex: 0 0 ;
822-
823-
padding-right: 5px;
824-
}
825-
826-
#bismil{
827-
margin-top: 70px;
828-
width: 100%;
829-
display:flex;
830-
justify-content: space-between;
831-
flex-direction: row-reverse;
832-
833-
}
834-
#bismil .intro{
835-
border-right: 2px solid black;
836-
}
837-
#bismil .pic{
838-
padding-left: 35px;
839-
}
840-
841-
764+
}

0 commit comments

Comments
 (0)