Skip to content

Commit 46aab88

Browse files
authored
adds madcss banner to site (#2153)
1 parent 45c11bd commit 46aab88

5 files changed

Lines changed: 145 additions & 1 deletion

File tree

src/lib/MadCSS.svelte

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
<script lang="ts">
2+
</script>
3+
4+
<a
5+
href="https://madcss.com"
6+
target="_blank"
7+
rel="noopener noreferrer"
8+
class="layout mad-css-banner"
9+
>
10+
<div class="banner-content">
11+
<img src="/mad-css-logo2.svg" alt="MadCSS Logo" class="logo" />
12+
13+
<div class="text-section">
14+
<h1 class="headline">MadCSS Starts March 6!</h1>
15+
<h2 class="subtitle">16 Devs Battle for Glory</h2>
16+
<p class="cta">
17+
Fill out your bracket today to win over <span class="prize">$2,000 in swag!</span>
18+
</p>
19+
</div>
20+
</div>
21+
</a>
22+
23+
<style lang="postcss">
24+
.mad-css-banner {
25+
background: #f1360d;
26+
width: 100%;
27+
position: relative;
28+
overflow: visible;
29+
padding: 0;
30+
color: white;
31+
grid-column: 1 / -1;
32+
background: #000;
33+
background-image:
34+
linear-gradient(to bottom, #00000080, #0000004d),
35+
url(https://madcss.com/assets/madcss-wide-hGTXblif.jpg);
36+
background-size: cover, cover;
37+
background-position: center, center;
38+
background-repeat: no-repeat, no-repeat;
39+
mask-image:
40+
url(/repeating-paper-top.png), url(/paper-stripe-bottom.png), linear-gradient(#000, #000);
41+
--mask-size: 20px;
42+
--mask-position: calc(100% + 5px);
43+
mask-size:
44+
auto 20px,
45+
auto var(--mask-size),
46+
100% 100%;
47+
mask-position:
48+
center 0px,
49+
center var(--mask-position),
50+
center;
51+
mask-repeat: repeat-x, repeat-x, no-repeat;
52+
mask-composite: exclude;
53+
mask-mode: alpha;
54+
text-decoration: none;
55+
display: block;
56+
cursor: pointer;
57+
transition: opacity 0.2s ease;
58+
}
59+
60+
.logo {
61+
width: 250px;
62+
height: auto;
63+
64+
@media (--below-med) {
65+
width: 120px;
66+
}
67+
}
68+
69+
.banner-content {
70+
max-width: 1200px;
71+
margin: 0 auto;
72+
display: grid;
73+
grid-template-columns: auto 1fr auto;
74+
align-items: center;
75+
justify-content: space-between;
76+
gap: 10px;
77+
padding: 20px;
78+
79+
@media (--below-med) {
80+
padding: 8px;
81+
gap: 6px;
82+
}
83+
}
84+
85+
.text-section {
86+
flex: 1;
87+
display: flex;
88+
gap: 4px;
89+
flex-direction: column;
90+
91+
@media (--below-med) {
92+
gap: 2px;
93+
}
94+
& > * {
95+
margin: 0;
96+
line-height: 1;
97+
background: black;
98+
width: fit-content;
99+
padding: 5px;
100+
101+
@media (--below-med) {
102+
padding: 2px 4px;
103+
}
104+
}
105+
}
106+
107+
.headline {
108+
font-size: 3.5rem;
109+
font-weight: 900;
110+
line-height: 0.9;
111+
112+
@media (--below-med) {
113+
font-size: 1.5rem;
114+
}
115+
}
116+
117+
.subtitle {
118+
font-size: 2rem;
119+
font-weight: 800;
120+
121+
@media (--below-med) {
122+
font-size: 0.9rem;
123+
}
124+
}
125+
126+
.cta {
127+
font-size: 1.2rem;
128+
margin: 0;
129+
130+
@media (--below-med) {
131+
font-size: 0.7rem;
132+
}
133+
}
134+
135+
.prize {
136+
background: var(--yellow);
137+
color: black;
138+
font-weight: 800;
139+
}
140+
</style>

src/routes/(site)/Header.svelte

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import Logo from '$lib/Logo.svelte';
33
import Search from '$lib/search/Search.svelte';
44
import MobileNav from './MobileNav.svelte';
5+
import MadCSS from '$lib/MadCSS.svelte';
56
import { page } from '$app/stores';
67
interface Props {
78
transparent?: boolean;
@@ -10,6 +11,7 @@
1011
let { transparent = false }: Props = $props();
1112
</script>
1213

14+
<MadCSS />
1315
<header class="layout full" class:transparent style:--fg="var(--fg-1)">
1416
<div class="header-container content">
1517
<div class="logo">
@@ -39,7 +41,8 @@
3941

4042
<style lang="postcss">
4143
header {
42-
background-image: url('/svg/grit.svg?dark'),
44+
background-image:
45+
url('/svg/grit.svg?dark'),
4346
linear-gradient(to bottom, var(--header-gradient-1) 0%, var(--header-gradient-2) 100%);
4447
background-size: 250px;
4548
background-color: var(--bg);

static/mad-css-logo2.svg

Lines changed: 1 addition & 0 deletions
Loading

static/paper-stripe-bottom.png

373 KB
Loading

static/repeating-paper-top.png

261 KB
Loading

0 commit comments

Comments
 (0)