PerlDistSite/Component/LayoutScss.pm untested

filter: Statementstmt 0.0% 0 / 13 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 4 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 19 SCAR 6.9
CC
1
Cov
0%
filename
2.0
raw_content
2.0
BEGIN
2.0
CRAP 2.0
1 package Web::PerlDistSite::Component::LayoutScss;
2  
3 our $VERSION = '0.001010';
4  
5 use Moo;
6 use Web::PerlDistSite::Common -lexical, -all;
7  
8 with 'Web::PerlDistSite::Component';
9  
10 sub filename ( $self ) {
11 return '_build/layout.scss';
12 }
13  
14 sub raw_content ( $self ) {
15 state $content = do { local $/ = <DATA> };
16 return $content;
17 }
18  
19 1;
20  
21 __DATA__
22
23 body {
24 @extend .d-flex;
25 @extend .flex-column;
26 @extend .min-vh-100;
27
28 &.at-top header {
29 box-shadow: none;
30 }
31 &.is-scrolled header {
32 box-shadow: 0px 0px 12px 0px $dark;
33 }
34 }
35
36 header {
37 @extend .sticky-top;
38 @extend .bg-primary;
39 @extend .text-light;
40
41 transition: box-shadow 1s ease-in-out;
42
43 .nav-link, .navbar-brand {
44 @extend .text-light;
45 @include border-radius($btn-border-radius);
46 }
47 .nav-link:hover {
48 background: darken($primary, 5%);
49 }
50 .dropdown-menu {
51 @extend .bg-secondary;
52 @extend .text-light;
53 .dropdown-item {
54 @extend .text-light;
55 }
56 .dropdown-item:hover {
57 background: darken($secondary, 5%);
58 }
59 }
60 }
61
62 #main {
63 height: 1px;
64 width: 1px;
65 }
66
67 .homepage-hero {
68 @extend .bg-primary;
69 position: relative;
70
71 &.homepage-hero-dark, &.homepage-hero-banner {
72 @extend .bg-dark;
73 }
74
75 .homepage-hero-text {
76 position: absolute;
77 top: 20vh;
78 width: 100%;
79
80 div {
81 @extend .container;
82 @extend .text-white;
83 @extend .text-center;
84 }
85
86 h1 {
87 @extend .display-1;
88 @extend .fw-bold;
89 }
90
91 h2 {
92 @extend .display-6;
93 @extend .fw-bold;
94 @extend .pt-4;
95 }
96 }
97
98 .homepage-hero-graphic {
99 width: 100%;
100 height: 95vh;
101 height: calc(100vh - 56px);
102 height: calc(100dvh - 56px);
103 }
104 }
105
106 .homepage-hero-button {
107 @extend .text-white;
108 @extend .text-center;
109 position: absolute;
110 bottom: 18vh;
111 width: 100%;
112 font-size: 2rem;
113
114 opacity: 1;
115 pointer-events: auto;
116 transition: opacity 0.6s ease-in-out;
117
118 a:link, a:visited {
119 @extend .text-white;
120 text-decoration: underline;
121 position: relative;
122 i {
123 position: absolute;
124 top: 0;
125 left: -0.67rem;
126 animation: bounce 1.2s infinite alternate;
127 }
128 }
129 }
130
131 body.is-scrolled .homepage-hero-button {
132 opacity: 0;
133 pointer-events: none;
134 }
135
136 @keyframes bounce {
137 to { transform: scale(1.2); }
138 }
139
140 .homepage-hero-banner {
141 width: 100%;
142 height: 95vh;
143 height: calc(100vh - 56px);
144 .homepage-hero-text, .homepage-hero-button {
145 text-shadow: 0px 0px 6px $dark;
146 opacity: 0.9;
147 }
148 }
149
150 body.page main {
151 @extend .my-4;
152 }
153
154 .heading-wrapper {
155 .heading {
156 @extend .container;
157 @extend .py-3;
158 h1 {
159 @extend .display-2;
160 }
161 }
162 }
163
164 main {
165 .has-sections {
166 & > section {
167 @extend .py-5;
168 }
169 & > section:nth-child(even) {
170 @extend .bg-light;
171 @extend .text-dark;
172 &:last-child {
173 @extend .bg-white;
174 @extend .text-dark;
175 @extend .border-top;
176 }
177 }
178 }
179
180 pre code {
181 @include border-radius($card-border-radius);
182 display: block;
183 padding: calc($spacer / 2);
184 background: lighten($light, 5%) !important;
185 border: 1px solid $light;
186 }
187 }
188
189 footer {
190 @extend .py-3;
191 @extend .mt-auto;
192 @extend .bg-dark;
193 @extend .text-light;
194 a:link, a:visited {
195 @extend .text-light;
196 }
197 }
198
199 #return-to-top {
200 @extend .text-secondary;
201 font-size: 2rem;
202 text-decoration: none;
203
204 opacity: 0;
205 pointer-events: none;
206 transition: opacity 0.6s ease-in-out;
207
208 position: fixed;
209 bottom: 2rem;
210 right: 3rem;
211
212 i {
213 animation: bounce 1.2s infinite alternate;
214 }
215 }
216
217 body.is-scrolled-deeply #return-to-top {
218 opacity: 0.75;
219 pointer-events: auto;
220 &:hover {
221 opacity: 1;
222 }
223 }