-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathImage:Testimonial.html
190 lines (185 loc) · 6.39 KB
/
Image:Testimonial.html
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
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Image Gallery with Testimonials</title>
<style>
body, html {
margin: 0;
padding: 0;
font-family: 'Roboto', sans-serif;
line-height: 1.6;
color: #333;
}
.section {
padding: 40px 5%;
background-color: #ffffff;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
h2 {
font-size: 2rem;
margin-bottom: 1rem;
color: #2c3e50;
text-align: center;
}
.gallery {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
margin-bottom: 40px;
}
.gallery-item {
position: relative;
overflow: hidden;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}
.gallery-item img {
width: 100%;
height: 250px;
object-fit: cover;
transition: transform 0.3s ease;
}
.gallery-item:hover img {
transform: scale(1.1);
}
.gallery-caption {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background-color: rgba(0,0,0,0.7);
color: #ffffff;
padding: 10px;
transform: translateY(100%);
transition: transform 0.3s ease;
}
.gallery-item:hover .gallery-caption {
transform: translateY(0);
}
.testimonials {
position: relative;
height: 200px;
overflow: hidden;
margin-top: 40px;
}
.testimonial {
position: absolute;
top: 0;
left: 0;
width: 100%;
background-color: #f8f9fa;
border-radius: 8px;
padding: 20px;
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
opacity: 0;
transition: opacity 0.5s ease;
}
.testimonial.active {
opacity: 1;
}
.testimonial img {
width: 80px;
height: 80px;
border-radius: 50%;
margin-bottom: 10px;
}
.testimonial p {
font-style: italic;
margin-bottom: 10px;
}
.testimonial .name {
font-weight: bold;
color: #2c3e50;
}
@media (max-width: 768px) {
.section {
padding: 20px 3%;
}
h2 {
font-size: 1.5rem;
}
.gallery {
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.testimonials {
height: 250px;
}
}
</style>
</head>
<body>
<section class="section">
<div class="container">
<h2>Our Work</h2>
<div class="gallery">
<div class="gallery-item">
<img src="/api/placeholder/400/250" alt="Project 1">
<div class="gallery-caption">Project 1: Web Design</div>
</div>
<div class="gallery-item">
<img src="/api/placeholder/400/250" alt="Project 2">
<div class="gallery-caption">Project 2: Mobile App</div>
</div>
<div class="gallery-item">
<img src="/api/placeholder/400/250" alt="Project 3">
<div class="gallery-caption">Project 3: Branding</div>
</div>
<div class="gallery-item">
<img src="/api/placeholder/400/250" alt="Project 4">
<div class="gallery-caption">Project 4: E-commerce</div>
</div>
<div class="gallery-item">
<img src="/api/placeholder/400/250" alt="Project 5">
<div class="gallery-caption">Project 5: SEO Optimization</div>
</div>
<div class="gallery-item">
<img src="/api/placeholder/400/250" alt="Project 6">
<div class="gallery-caption">Project 6: Social Media Campaign</div>
</div>
</div>
<h2>What Our Clients Say</h2>
<div class="testimonials">
<div class="testimonial active">
<img src="/api/placeholder/80/80" alt="Client 1">
<p>"Working with this team was a game-changer for our business. Their expertise and dedication are unmatched."</p>
<div class="name">- John Doe, CEO</div>
</div>
<div class="testimonial">
<img src="/api/placeholder/80/80" alt="Client 2">
<p>"The results we've seen since partnering with them have been phenomenal. Highly recommended!"</p>
<div class="name">- Jane Smith, Marketing Director</div>
</div>
<div class="testimonial">
<img src="/api/placeholder/80/80" alt="Client 3">
<p>"Their innovative approach and attention to detail set them apart. We couldn't be happier with the outcome."</p>
<div class="name">- Mike Johnson, Founder</div>
</div>
</div>
</div>
</section>
<script>
// Add click event to gallery items
const galleryItems = document.querySelectorAll('.gallery-item');
galleryItems.forEach(item => {
item.addEventListener('click', () => {
const caption = item.querySelector('.gallery-caption').textContent;
alert(`You clicked on: ${caption}`);
});
});
// Testimonial rotation
const testimonials = document.querySelectorAll('.testimonial');
let currentTestimonial = 0;
function rotateTestimonials() {
testimonials[currentTestimonial].classList.remove('active');
currentTestimonial = (currentTestimonial + 1) % testimonials.length;
testimonials[currentTestimonial].classList.add('active');
}
setInterval(rotateTestimonials, 5000);
</script>
</body>
</html>