Skip to content

Commit 895c6b6

Browse files
authored
feat: add Examples badge to layout (#22)
1 parent a7821c7 commit 895c6b6

File tree

2 files changed

+77
-23
lines changed

2 files changed

+77
-23
lines changed

assets/css/main.css

Lines changed: 57 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,62 @@ pre {
118118
/* ----------------------------------
119119
CTA content
120120
-----------------------------------*/
121+
a.examples-block {
122+
display: block;
123+
color: #fff;
124+
margin: 0 auto;
125+
padding: 1rem;
126+
background: #1D1D22;
127+
border: 2px solid #FDA703;
128+
border-radius: 10px;
129+
margin: 2rem auto;
130+
/* color: #fff; */
131+
text-decoration: none;
132+
max-width: 370px;
133+
134+
align-items: center;
135+
border-radius: 10px;
136+
color: #fff;
137+
/* cursor: pointer; */
138+
display: flex;
139+
padding: 1rem;
140+
position: relative;
141+
text-decoration: none;
142+
}
143+
144+
a.examples-block span {
145+
color: #FDA703;
146+
}
147+
148+
.examples-block p {
149+
font-size: 0.85rem;
150+
}
151+
152+
.examples-block .glyph {
153+
background-color: #FDA703;
154+
}
155+
156+
.examples-block .glyph svg {
157+
fill: #1D1D22;
158+
}
159+
160+
a.examples-block:hover .glyph {
161+
background-color: #1D1D22;
162+
}
163+
164+
.examples-block:hover .glyph svg {
165+
fill: #FDA703;
166+
}
167+
168+
a.examples-block:hover span {
169+
color: inherit;
170+
}
171+
172+
a.examples-block:hover {
173+
background: #FDA703;
174+
color: #1D1D22;
175+
}
176+
121177
.disclaimer {
122178
background: #2D2E35;
123179
font-size: .8rem;
@@ -130,7 +186,7 @@ pre {
130186
grid-gap: 30px;
131187
grid-template-columns: repeat(2,1fr);
132188
margin-top: 1rem;
133-
padding: 3rem 0 0;
189+
padding: 0;
134190
}
135191

136192
.dialog {

index.html

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,12 @@
2828
<script async src="https://www.googletagmanager.com/gtag/js?id=G-LKETQQ110J"></script>
2929
<script>
3030
window.dataLayer = window.dataLayer || [];
31-
function gtag() {
32-
dataLayer.push(arguments);
33-
}
34-
gtag('js', new Date());
35-
36-
gtag('config', 'G-LKETQQ110J');
31+
function gtag() {
32+
dataLayer.push(arguments);
33+
}
34+
gtag('js', new Date());
35+
gtag('config', 'G-LKETQQ110J');
3736
</script>
38-
39-
40-
4137
</head>
4238

4339
<body>
@@ -82,21 +78,23 @@
8278
</div>
8379
<!-- end terminal window -->
8480

85-
<!-- begin dialog content -->
86-
<div class="dialogs">
87-
<div class="dialog dropdown" tabindex="1">
88-
<div class="glyph">
89-
<svg width="24px" height="24px" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
90-
<path fill="none" stroke="#fff" stroke-width="2" d="M9,22 L15,2 M17,17 L22,12 L17,7 M7,17 L2,12 L7,7"/>
91-
</svg>
92-
</div>
93-
94-
<div>
95-
<h2>Examples</h2>
96-
<p>Click <a href="https://pyscript.net/examples/" target="_blank">here</a> for example projects</p>
97-
</div>
81+
<!-- begin examples badge -->
82+
<a href="https://pyscript.net/examples/" target="_blank" class="examples-block">
83+
<div class="glyph">
84+
<svg width="16px" height="16px" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="currentColor" class="bi bi-grid">
85+
<path d="M1 2.5A1.5 1.5 0 0 1 2.5 1h3A1.5 1.5 0 0 1 7 2.5v3A1.5 1.5 0 0 1 5.5 7h-3A1.5 1.5 0 0 1 1 5.5v-3zM2.5 2a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 1h3A1.5 1.5 0 0 1 15 2.5v3A1.5 1.5 0 0 1 13.5 7h-3A1.5 1.5 0 0 1 9 5.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zM1 10.5A1.5 1.5 0 0 1 2.5 9h3A1.5 1.5 0 0 1 7 10.5v3A1.5 1.5 0 0 1 5.5 15h-3A1.5 1.5 0 0 1 1 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3zm6.5.5A1.5 1.5 0 0 1 10.5 9h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 13.5v-3zm1.5-.5a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5h-3z"/>
86+
</svg>
87+
</div>
88+
<div>
89+
<h2>Examples</h2>
90+
<p><span>Click here</span> for example projects</p>
9891
</div>
9992

93+
</a>
94+
<!-- end examples badge -->
95+
96+
<!-- begin dialog content -->
97+
<div class="dialogs">
10098
<div class="dialog dropdown" tabindex="2">
10199
<div class="glyph">
102100
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"

0 commit comments

Comments
 (0)