Skip to content

Instantly share code, notes, and snippets.

View jamesfacts's full-sized avatar

James White jamesfacts

View GitHub Profile
@jamesfacts
jamesfacts / figure-component.blade.php
Created May 6, 2021 19:18
Figure with variable aspect ratio
<figure>
<a href="{{ $url }}">
<div class="aspect-ratio-wrap relative" style="padding-bottom: {{ $aspect_ratio ?? '0%' }};">
<img src="{{ $img_url }}" @if($alt) alt="{!! $alt !!}" @endif
class="block absolute top-0 left-0 object-cover w-full h-full">
</div>
</a>
</figure>
@jamesfacts
jamesfacts / hero.blade.php
Created May 6, 2021 19:22
Hero section with buttons
<section class="relative pt-32 pb-16 mb-8 flex content-center items-center justify-center lg:shadow-sm" style="min-height: 55vh;">
<div class="absolute top-0 w-full h-full bg-center bg-cover"
style="background-image: url('{{ \Roots\asset('images/header-mock-reversed.jpg') }}');">
<span id="blackOverlay" class="w-full h-full absolute opacity-50 bg-white lg:bg-gradient-to-r lg:from-white lg:to-transparent"></span></div>
<div class="container relative mx-auto">
<div class="items-center flex flex-wrap">
<div class="w-full lg:w-8/12 xl:w-6/12 px-4 ml-auto mr-auto text-center lg:mr-12 lg:mt-12 lg:text-left">
<div class="px-4">
<h1 class="text-gray-800 font-semibold text-3xl md:text-5xl font-oxygen leading-none mb-4 lg:text-right">
{{ "Hero Hedline Text" }}