-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHome.js
More file actions
155 lines (146 loc) · 4.82 KB
/
Home.js
File metadata and controls
155 lines (146 loc) · 4.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
import React, { useEffect, useState } from 'react';
import { Link } from 'react-router-dom';
import Slider from 'react-slick';
import "slick-carousel/slick/slick-theme.css";
import "slick-carousel/slick/slick.css";
const styles = {
pageContent: {
display: 'flex',
justifyContent: 'center',
alignItems: 'center',
minHeight: '88vh', // Ensure it covers the full viewport height
background: 'url(https://wallpapercave.com/wp/5Oi2ZbZ.jpg) center/cover no-repeat', // Background image with URL
backgroundColor: '#f0f4f8', // Fallback background color
},
contentContainer: {
textAlign: 'center',
color: '#fff', // Dark text color for contrast
maxWidth: '600px',
padding: '40px', // Increased padding for better spacing
background: 'rgba(0, 0, 0, 0.9)', // White background with 90% opacity
borderRadius: '12px', // Slightly rounded corners for modern feel
//boxShadow: '0 10px 20px rgba(0, 0, 0, 0.2)', // Subtle shadow for depth
transform: 'translateY(20px)', // Initial state for animation
opacity: 0, // Initial state for animation
transition: 'all 0.6s ease-out', // Smooth transition for animation
},
contentContainerVisible: {
transform: 'translateY(0)', // Final state for animation
opacity: 1, // Final state for animation
},
welcomeText: {
fontSize: '36px',
fontWeight: '700', // Bold weight for emphasis
marginBottom: '20px',
transition: 'color 0.3s ease', // Transition for hover effect
color: '#007bff', // Blue text color
},
infoText: {
fontSize: '18px',
lineHeight: '1.6',
marginBottom: '30px',
color: '#ffffff', // Slightly lighter text for contrast
},
buttonsContainer: {
display: 'flex',
justifyContent: 'center',
gap: '20px', // Space between buttons
},
button: {
padding: '12px 24px', // Larger padding for touch-friendly buttons
fontSize: '16px',
cursor: 'pointer',
border: 'none',
backgroundColor: '#007bff', // Blue background color
color: '#fff',
borderRadius: '8px',
transition: 'background-color 0.3s ease, transform 0.3s ease', // Smooth hover effect
textDecoration: 'none',
},
buttonHover: {
backgroundColor: '#0056b3',
transform: 'translateY(-2px)', // Lift button on hover
},
sliderContainer: {
marginTop: '40px', // Space above the slider
},
slide: {
padding: '20px',
background: '#e3f2fd',
borderRadius: '8px',
boxShadow: '0 4px 8px rgba(0, 0, 0, 0.1)',
textAlign: 'center',
fontSize: '18px',
color: '#ffffff',
},
};
function Home() {
const [showContent, setShowContent] = useState(false);
useEffect(() => {
setShowContent(true);
}, []);
const tips = [
"Fix leaking taps and pipes.",
"Use water filters certified to remove specific contaminants.",
"Store water in clean, sealed containers away from chemicals.",
"Stay updated on local water quality reports and advisories.",
"Boil water before drinking or cooking to kill harmful pathogens.",
];
const settings = {
dots: true,
infinite: true,
speed: 500,
slidesToShow: 1,
slidesToScroll: 1,
autoplay: true,
autoplaySpeed: 3000,
};
return (
<div style={styles.pageContent}>
<div
style={{
...styles.contentContainer,
...(showContent ? styles.contentContainerVisible : {}),
}}
>
<h1
style={styles.welcomeText}
onMouseEnter={(e) => (e.currentTarget.style.color = '#0056b3')}
onMouseLeave={(e) => (e.currentTarget.style.color = '#007bff')}
>
Water Quality Monitoring
</h1>
<p style={styles.infoText}>
We're here to help you make a difference. Whether it's reporting a leak or learning how to conserve water, our platform is designed to empower you to take action.
</p>
<div style={styles.buttonsContainer}>
<Link to="/complaint" style={{ textDecoration: 'none' }}>
<button
style={styles.button}
onMouseEnter={(e) => {
e.currentTarget.style.backgroundColor = styles.buttonHover.backgroundColor;
e.currentTarget.style.transform = styles.buttonHover.transform;
}}
onMouseLeave={(e) => {
e.currentTarget.style.backgroundColor = styles.button.backgroundColor;
e.currentTarget.style.transform = 'translateY(0)';
}}
>
Raise a Complaint
</button>
</Link>
</div>
<div style={styles.sliderContainer}>
<Slider {...settings}>
{tips.map((tip, index) => (
<div key={index} style={{ ...styles.slide, color: '#fff' }}>
{tip}
</div>
))}
</Slider>
</div>
</div>
</div>
);
}
export default Home;