Skip to content

Commit

Permalink
Merge pull request #713 from waynestate/feature/flag-upgrade
Browse files Browse the repository at this point in the history
Feature/flag upgrade
  • Loading branch information
breakdancingcat committed May 2, 2024
2 parents 31a8b1a + c2e2214 commit 2403127
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 44 deletions.
4 changes: 2 additions & 2 deletions factories/Flag.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public function create($limit = 1, $flatten = false, $options = [])
for ($i = 1; $i <= $limit; $i++) {
$data[$i] = [
'class' => 'flag',
'title' => 'Make a',
'title' => 'Make a <em>Gift</em>',
'link' => 'https://wayne.edu',
'excerpt' => 'Gift',
'excerpt' => '',
];

$data[$i] = array_replace_recursive($data[$i], $options);
Expand Down
94 changes: 63 additions & 31 deletions resources/scss/components/_flag.scss
Original file line number Diff line number Diff line change
@@ -1,41 +1,73 @@
.flag {
@apply absolute hidden mt:flex z-40 bg-gold text-green-800 hover:text-green-900 items-center justify-center mr-4 right-0 pt-0 duration-500;

transition-property: height, padding;
width: 140px;
height: 30px;

// Pointy bottom
&::after {
@apply border-gold absolute duration-500;

transition-property: top;
border-left-color: transparent;
border-right-color: transparent;
border-style: solid;
border-width: 12px 70px 0;
top: 30px;
content: "";
left: 0;
.flag__container {
.flag {
&__title {
@apply uppercase text-sm tracking-wide leading-3 relative z-50;
}

em,
&__excerpt {
@apply normal-case text-xl italic font-serif pl-0.5 leading-3;
}
}

&:hover {
@apply duration-500;
&.flag--sm {
@apply mx-4;

transition-property: height, padding;
height: 38px;
padding-top: 8px;
.flag {
@extend .gold-gradient-button;

&::after {
top: 38px;
@apply w-full font-normal mt:hidden;
}
}

&__title {
@apply uppercase text-sm tracking-wide pt-1.5 pt-1;
}
&.flag--mt {
@apply row relative;

.flag {
@apply absolute hidden mt:flex z-40 bg-gold text-green-800 hover:text-green-900 items-center justify-center mr-4 right-0 px-2 duration-500;

transition-property: height, padding;
min-width: 140px;
height: 28px;

&__container {
@apply row relative;
}

&__excerpt {
@apply normal-case text-xl italic font-serif pt-0.5 pl-1;
// Pointy bottom
&::after {
@apply bg-gold absolute duration-500;

clip-path: polygon(0 0, 100% 0, 100% 4%, 50% 14%, 0 4%);
//clip-path: polygon(0 0, 100% 0, 100% 12%, 50% 4%, 0 12%);
transition-property: top;
width: 100%;
height: 8rem;
top: 24px;
content: "";
left: 0;

/*
@apply border-gold absolute duration-500;
border-left-color: transparent;
border-right-color: transparent;
border-style: solid;
border-width: 12px 70px 0;
*/
}

&:hover {
@apply duration-500;

transition-property: height, padding;
height: 30px;
padding-top: 8px;

&::after {
top: 28px;
}
}
}
}
}
6 changes: 3 additions & 3 deletions resources/views/components/flag.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{--
$flag => array // [['title', 'link', 'excerpt']]
--}}
<div class="row relative">
<div class="flag__container {{ $class ?? '' }}">
<a class="flag" href="{{ $flag['link'] }}">
<span class="flag__title">{{ $flag['title'] }}</span>
@if($flag['excerpt'] != '')
<span class="flag__title">{!! $flag['title'] !!}</span>
@if(!empty($flag['excerpt']))
<span class="flag__excerpt">{{ $flag['excerpt'] }}</span>
@endif
</a>
Expand Down
6 changes: 2 additions & 4 deletions resources/views/layouts/contained-hero.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@endif

@if(!empty($base['flag']))
@include('components.flag', ['flag' => $base['flag']])
@include('components.flag', ['flag' => $base['flag'], 'class' => 'flag--mt'])
@endif
</header>

Expand Down Expand Up @@ -67,9 +67,7 @@
@endif

@if(!empty($base['flag']))
<div class="min-w-full px-4 mt:px-0 mb-4 mt:hidden">
<a href="{{ $base['flag']['link'] }}" class="button w-full flag__title">{{ $base['flag']['title'] }} <span class="flag__excerpt">{{ $base['flag']['excerpt'] }}</span></a>
</div>
@include('components.flag', ['flag' => $base['flag'], 'class' => 'flag--sm'])
@endif

@yield('below_menu')
Expand Down
6 changes: 2 additions & 4 deletions resources/views/layouts/main.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@endif

@if(!empty($base['flag']))
@include('components.flag', ['flag' => $base['flag']])
@include('components.flag', ['flag' => $base['flag'], 'class' => 'flag--mt'])
@endif
</header>

Expand Down Expand Up @@ -67,9 +67,7 @@
@endif

@if(!empty($base['flag']))
<div class="min-w-full px-4 mt:px-0 mb-4 mt:hidden">
<a href="{{ $base['flag']['link'] }}" class="button w-full flag__title">{{ $base['flag']['title'] }} <span class="flag__excerpt">{{ $base['flag']['excerpt'] }}</span></a>
</div>
@include('components.flag', ['flag' => $base['flag'], 'class' => 'flag--sm'])
@endif

@yield('below_menu')
Expand Down

0 comments on commit 2403127

Please sign in to comment.