-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce0a589
commit d493244
Showing
15 changed files
with
348 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<?php | ||
|
||
namespace Factories; | ||
|
||
use Contracts\Factories\FactoryContract; | ||
use Faker\Factory; | ||
|
||
class Icon implements FactoryContract | ||
{ | ||
/** | ||
* Construct the factory. | ||
*/ | ||
public function __construct(Factory $faker) | ||
{ | ||
$this->faker = $faker->create(); | ||
} | ||
|
||
/** | ||
* {@inheritdoc} | ||
*/ | ||
public function create($limit = 1, $flatten = false, $options = []) | ||
{ | ||
$icon_green = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjAuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAxMDAgMTAwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+CjxzdHlsZSB0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', $this->faker->words(2))), | ||
'excerpt' => ucfirst(implode(' ', $this->faker->words(5))), | ||
'description' => '<p>'.ucfirst(implode(' ', $this->faker->words(10))).' <a href="#">'.implode(' ', $this->faker->words(2)).'</a>.</p>', | ||
//'description' => '<p>' . $this->faker->text(20) . ' <a href="https://wayne.edu">'. $this->faker->sentence(3) .'</a></p>', | ||
'promo_item_id' => $i, | ||
'relative_url' => $icon_green, | ||
'filename_alt_text' => 'Placeholder icon '.$i, | ||
'option' => '', | ||
'group' => [ | ||
'title' => 'Promo group title', | ||
], | ||
]; | ||
|
||
$data[$i] = array_replace_recursive($data[$i], $options); | ||
} | ||
|
||
if ($limit === 1 && $flatten === true) { | ||
return current($data); | ||
} | ||
|
||
return $data; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,19 @@ | ||
{{-- | ||
$item => array // ['title', 'link', 'excerpt', 'filename_url', 'filename_alt_text'] | ||
--}} | ||
<ul class="grid grid-cols-1 gap-6"> | ||
@foreach($data as $step) | ||
<li> | ||
<a class="block group" href="{{ $step['link'] }}"> | ||
<div class="flex gap-3"> | ||
<div class="w-16 grow-0 shrink-0"> | ||
@image($step['filename_url'], $step['filename_alt_text'], 'block mx-auto') | ||
</div> | ||
<ul class="grid grid-cols-1 items-start gap-6 lg:gap-8 mt-2 mb-8 lg:my-8"> | ||
@foreach($data as $item) | ||
<li> | ||
<{{ !empty($item['link']) ? 'a href='.$item['link'] : 'div' }} class="flex items-start gap-x-4 {{ !empty($item['link']) ? 'group' : '' }}"> | ||
@image($item['relative_url'], $item['filename_alt_text'], 'grow-0 shrink-0 w-16') | ||
<div> | ||
<div class="text-lg lg:text-base xl:text-xl mt-0 mb-1 underline group-hover:no-underline">{{ $step['title'] }}</div> | ||
<p class="text-base lg:text-sm xl:text-base text-black mb-0">{{ $step['excerpt'] }}</p> | ||
<div class="font-bold text-xl mt-0 mb-1 text-green no-underline group-hover:underline">{{ $item['title'] }}</div> | ||
@if(!empty($item['excerpt']))<div class="text-sm text-black">{{ $item['excerpt'] }}</div>@endif | ||
@if(!empty($item['description'])) | ||
<div class="text-sm text-black">{!! !empty($item['link']) ? preg_replace(array('"<a href(.*?)>"', '"</a>"'), array('',''), $item['description']) : $item['description'] !!}</div> | ||
@endif | ||
</div> | ||
</div> | ||
</a> | ||
</li> | ||
@endforeach | ||
<{{ !empty($item['link']) ? '/a' : '/div' }}> | ||
</li> | ||
@endforeach | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{-- | ||
$item => array // ['title', 'link', 'excerpt', 'filename_url', 'filename_alt_text'] | ||
--}} | ||
<ul class="grid items-start gap-6 lg:gap-8 mt-2 mb-8 lg:my-8 md:grid-cols-2 lg:grid-cols-{{ !empty($component['columns']) && $component['columns'] >= 3 ? '3' : '2' }} xl:grid-cols-{{ !empty($component['columns']) ? $component['columns'] : '2' }}"> | ||
@foreach($data as $item) | ||
<li> | ||
<{{ !empty($item['link']) ? 'a href='.$item['link'] : 'div' }} class="flex items-start gap-x-4 {{ !empty($item['link']) ? 'group' : '' }}"> | ||
@image($item['relative_url'], $item['filename_alt_text'], 'grow-0 shrink-0 w-16 '.(!empty($component['columns']) && $component['columns'] >= 3 ? ' xl:w-16' : ' xl:w-20')) | ||
<div> | ||
<div class="font-bold text-xl xl:text-2xl mt-0 mb-1 no-underline group-hover:underline">{{ $item['title'] }}</div> | ||
@if(!empty($item['excerpt']))<div class="text-sm lg:text-base text-black">{{ $item['excerpt'] }}</div>@endif | ||
@if(!empty($item['description'])) | ||
<div class="text-sm xl:text-base text-black content">{!! !empty($item['link']) ? preg_replace(array('"<a href(.*?)>"', '"</a>"'), array('',''), $item['description']) : $item['description'] !!}</div> | ||
@endif | ||
</div> | ||
<{{ !empty($item['link']) ? '/a' : '/div' }}> | ||
</li> | ||
@endforeach | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{{-- | ||
$item => array // ['title', 'link', 'excerpt', 'filename_url', 'filename_alt_text'] | ||
--}} | ||
<ul class="grid items-start gap-6 gap-y-2 lg:gap-8 lg:gap-y-4 mt-2 mb-8 lg:my-8 grid-cols-2 lg:grid-cols-{{ !empty($component['columns']) && count($data) % 2 == 0 ? '2' : '3' }} xl:grid-cols-{{ !empty($component['columns']) ? $component['columns'] : '2' }}"> | ||
@foreach($data as $item) | ||
<li> | ||
<{{ !empty($item['link']) ? 'a href='.$item['link'] : 'div' }} {{ !empty($item['link']) ? 'class="group"' : '' }}> | ||
@image($item['relative_url'], $item['filename_alt_text'], 'grow-0 shrink-0 mb-2 w-16'.(!empty($component['columns']) && $component['columns'] >= 5 ? ' xl:w-16' : ' xl:w-20')) | ||
<div> | ||
<div class="font-bold text-xl mt-0 mb-1 no-underline group-hover:underline">{{ $item['title'] }}</div> | ||
@if(!empty($item['excerpt']))<div class="text-sm text-black">{{ $item['excerpt'] }}</div>@endif | ||
@if(!empty($item['description'])) | ||
<div class="text-sm text-black content">{!! !empty($item['link']) ? preg_replace(array('"<a href(.*?)>"', '"</a>"'), array('',''), $item['description']) : $item['description'] !!}</div> | ||
@endif | ||
</div> | ||
<{{ !empty($item['link']) ? '/a' : '/div' }}> | ||
</li> | ||
@endforeach | ||
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.