images
This commit is contained in:
parent
2a5a6010a0
commit
1332379a59
@ -60,7 +60,7 @@ h1, h2, h3, h4, h5, h6 {
|
||||
}
|
||||
|
||||
.hero {
|
||||
background: linear-gradient(135deg, rgba(74, 144, 226, 0.9), rgba(80, 227, 194, 0.9)), url('https://picsum.photos/seed/hero/1600/900');
|
||||
background: linear-gradient(135deg, rgba(74, 144, 226, 0.9), rgba(80, 227, 194, 0.9)), url('../images/pexels/7688336.jpg');
|
||||
background-size: cover;
|
||||
background-position: center;
|
||||
color: white;
|
||||
|
||||
BIN
assets/images/pexels/14979020.jpg
Normal file
BIN
assets/images/pexels/14979020.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 49 KiB |
BIN
assets/images/pexels/25626512.jpg
Normal file
BIN
assets/images/pexels/25626512.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 111 KiB |
BIN
assets/images/pexels/4515793.jpg
Normal file
BIN
assets/images/pexels/4515793.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 216 KiB |
BIN
assets/images/pexels/7688336.jpg
Normal file
BIN
assets/images/pexels/7688336.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 227 KiB |
49
includes/pexels.php
Normal file
49
includes/pexels.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
function pexels_key() {
|
||||
$k = getenv('PEXELS_KEY');
|
||||
return $k && strlen($k) > 0 ? $k : 'Vc99rnmOhHhJAbgGQoKLZtsaIVfkeownoQNbTj78VemUjKh08ZYRbf18';
|
||||
}
|
||||
function pexels_get($url) {
|
||||
$ch = curl_init();
|
||||
curl_setopt_array($ch, [
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_HTTPHEADER => [ 'Authorization: '. pexels_key() ],
|
||||
CURLOPT_TIMEOUT => 15,
|
||||
]);
|
||||
$resp = curl_exec($ch);
|
||||
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||
curl_close($ch);
|
||||
if ($code >= 200 && $code < 300 && $resp) return json_decode($resp, true);
|
||||
return null;
|
||||
}
|
||||
function download_to($srcUrl, $destPath) {
|
||||
// Ensure the destination directory exists.
|
||||
$dir = dirname($destPath);
|
||||
if (!is_dir($dir)) {
|
||||
if (!mkdir($dir, 0775, true)) {
|
||||
error_log("Failed to create directory: $dir");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$context = stream_context_create([
|
||||
"ssl" => [
|
||||
"verify_peer" => false,
|
||||
"verify_peer_name" => false,
|
||||
],
|
||||
]);
|
||||
|
||||
$data = file_get_contents($srcUrl, false, $context);
|
||||
if ($data === false) {
|
||||
error_log("Failed to download image from: $srcUrl");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (file_put_contents($destPath, $data) === false) {
|
||||
error_log("Failed to save image to: $destPath");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -83,7 +83,7 @@
|
||||
<div class="card-body">
|
||||
<h3 class="card-title h4">Web Design</h3>
|
||||
<p class="card-text">Stunning, user-centric designs that capture your brand and engage your audience. Mobile-first and responsive.</p>
|
||||
<img src="https://picsum.photos/seed/service1/600/400" class="img-fluid rounded mt-3" alt="A close-up of a user interface design on a tablet.">
|
||||
<img src="assets/images/pexels/14979020.jpg" class="img-fluid rounded mt-3" alt="A close-up of a user interface design on a tablet.">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -94,7 +94,7 @@
|
||||
<div class="card-body">
|
||||
<h3 class="card-title h4">Web Development</h3>
|
||||
<p class="card-text">Clean, scalable, and performant code. From landing pages to complex web applications, we build solutions that work.</p>
|
||||
<img src="https://picsum.photos/seed/service2/600/400" class="img-fluid rounded mt-3" alt="Code on a computer screen representing web development.">
|
||||
<img src="assets/images/pexels/25626512.jpg" class="img-fluid rounded mt-3" alt="Code on a computer screen representing web development.">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -105,7 +105,7 @@
|
||||
<div class="card-body">
|
||||
<h3 class="card-title h4">Digital Strategy</h3>
|
||||
<p class="card-text">Data-driven strategies to boost your online presence. SEO, content marketing, and analytics to help you grow.</p>
|
||||
<img src="https://picsum.photos/seed/service3/600/400" class="img-fluid rounded mt-3" alt="A chart showing upward trends, representing business growth.">
|
||||
<img src="assets/images/pexels/4515793.jpg" class="img-fluid rounded mt-3" alt="A chart showing upward trends, representing business growth.">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user