We recently finished a relaunch of our agency website: https://www.meuter.de/
Features:
Minimalistic and modern design
Page transitions and preloading for a really fast browsing expierence
Custom content builder for blog posts, references and subpages
Content is king: Many case studies and blog posts
Under the hood:
Webpack with ES6 and SCSS
LQIP with Base64 Images
Lazy loading with lazysizes
Automatic generation of scrset images, Base64 placeholder images and background positions
Page transitions with barba.js
Preload pages when user hover over link
Interactive components which reacts on scroll events. Built with ScrollMagic
Handwritten template
Modules used:
ProFields
Markup Sitemap XML
Video embed for YouTube/Vimeo
Our Content Builder for a reference:
Clean page structure:
The code for the image generator:
<?php
// ------------------------------
// Image modifications
// ------------------------------
/**
* Responsive Image Options
*/
class imageModifier {
// Responsive Sizes from lowest to highest
private $responsiveSizes = array(320,640,768,1024,1366,1600,1920,2560);
private $base64ImageWidth = 20;
private $imageOptions = array(
'upscaling' => true
);
// Return a string with the srcset information
public function getSrcSet($image){
// Create an emptry output string
$srcSetOutputString = '';
// Create each image for each size
foreach ($this->responsiveSizes as $responsiveSizeId => $responsiveSizeWidth) {
// Check if the image is bigger then the final size
if($image->width >= $responsiveSizeWidth){
// Create the image and put the url into the output string
$srcSetOutputString .= $image->width($responsiveSizeWidth, $this->imageOptions)->url;
// Put the width in the output string
$srcSetOutputString .= ' ' . $responsiveSizeWidth . 'w' . ',';
}
}
//When the original image is smaller then the highest quality
if($image->width < $this->responsiveSizes[count($this->responsiveSizes) - 1]){
// Create the image and put the url into the output string
$srcSetOutputString .= $image->width($image->width)->url;
// Put the width in the output string
$srcSetOutputString .= ' ' . $image->width . 'w' . ',';
}
// Remove last commata
$srcSetOutputString = rtrim($srcSetOutputString, ',');
// Return the srcSet information
return $srcSetOutputString;
}
//Returns the lowest quality image
public function getLowestQuality($image){
return $image->width($this->responsiveSizes[0]);
}
//Returns the highest quality image
public function getHighestQuality($image){
// if image is bigger or same than max quality
if($image->width >= $this->responsiveSizes[count($this->responsiveSizes) - 1]){
return $image->width($this->responsiveSizes[count($this->responsiveSizes) - 1]);
}
// When image is smaller then the highest quality
else {
return $image;
}
}
// Returns the base64 data string
public function getBase64($image){
// Get the image path
$imagePath = $image->width($this->base64ImageWidth)->filename;
// Get the image extension
$imageType = pathinfo($imagePath, PATHINFO_EXTENSION);
// Get the data of the image
$imageData = file_get_contents($imagePath);
// Create the base64 Code
$base64Code = 'data:image/' . $imageType . ';base64,' . base64_encode($imageData);
// Return the code
return $base64Code;
}
// Returns the position point
public function getPosition($image){
// Get distance from top
$distanceTop = '' . intval($image->focus()['top']);
// Get distance from left
$distanceLeft = '' . intval($image->focus()['left']);
// Return the position with percent
return $distanceLeft . '% ' . $distanceTop . '%';
}
}
Thanks for the community and Processwire. It is a joy to use ?