Skip to content

Commit bd474e6

Browse files
authored
style(ui): improve UI (laike9m#52)
* Replace GitHub ribbon with icon and update sidebar actions * Fix wrong margin top for challenge header title * Add sematic icon to Pyright Playground link * Update sidebar space and challenge header font size
1 parent 0b4e4ef commit bd474e6

File tree

4 files changed

+28
-21
lines changed

4 files changed

+28
-21
lines changed

templates/base.html

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
</head>
3535

3636
<body>
37-
{% include 'components/github_ribbon.html' %}
3837
{% block content %}{% endblock %}
3938
</body>
4039

templates/challenge.html

+11-5
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
.sidebar-container .sidebar-actions {
3737
display: flex;
3838
align-items: center;
39-
justify-content: center;
39+
justify-content: space-around;
4040
margin-top: 8px;
4141
padding-top: 8px;
4242
border-top: 1px solid hsl(205, 20%, 94%);
@@ -55,13 +55,13 @@
5555
display: flex;
5656
align-items: center;
5757
margin-bottom: 1rem;
58+
margin-top: 8px;
5859
}
5960

6061
.challenge-header__title>span:nth-child(1) {
6162
font-size: 35px;
6263
font-weight: 700;
6364
margin-right: 20px;
64-
margin-top: 8px;
6565
}
6666

6767
.challenge-header__exerpt {
@@ -88,6 +88,9 @@
8888
}
8989

9090
#playground-link {
91+
display: flex;
92+
place-items: center;
93+
gap: 2px;
9194
position: absolute;
9295
top: 3px;
9396
right: 3px;
@@ -144,11 +147,11 @@
144147

145148
.sidebar-container {
146149
margin-right: 0;
147-
margin-bottom: 2rem;
148150
flex-direction: row;
149151
width: 100%;
150152
border-right: 0px;
151153
gap: 4px;
154+
padding: 0;
152155
}
153156

154157
.sidebar-container .sidebar-challenge-main {
@@ -162,6 +165,7 @@
162165
padding-top: 0px;
163166
border-top: 0px;
164167
width: initial;
168+
gap: 8px;
165169
}
166170

167171
.challenge-header__title {
@@ -171,7 +175,7 @@
171175

172176
.challenge-header__title>span:nth-child(1) {
173177
width: 100%;
174-
font-size: 20px;
178+
font-size: 32px;
175179
margin-bottom: 8px;
176180
}
177181

@@ -208,6 +212,7 @@
208212
{% include 'components/challenge_sidebar.html' with context %}
209213
</div>
210214
<div class="sidebar-actions">
215+
{% include 'components/github_icon.html' %}
211216
{% include 'components/darkmode.html' %}
212217
</div>
213218
</div>
@@ -233,7 +238,8 @@
233238
<div class="codemirror-container">
234239
<div id="editor">
235240
<a id="playground-link" target="_blank" rel="noopener noreferrer">
236-
Open Pyright Playground
241+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24"><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 4H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-4m-8-2l8-8m0 0v5m0-5h-5"/></svg>
242+
<span>Open Pyright Playground</span>
237243
</a>
238244
</div>
239245
<div class="editor-actions">

templates/components/github_icon.html

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<style type="text/css">
2+
.icon {
3+
display: inline-flex;
4+
place-items: center;
5+
/* override picocss default text color style for `<a>` tag */
6+
color: unset;
7+
width: 20px;
8+
height: 20px;
9+
}
10+
</style>
11+
12+
<a href="https://github.com/laike9m/Python-Type-Challenges" class="icon" target="_blank" rel="noopener noreferrer">
13+
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 16 16">
14+
<path fill="currentColor"
15+
d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59c.4.07.55-.17.55-.38c0-.19-.01-.82-.01-1.49c-2.01.37-2.53-.49-2.69-.94c-.09-.23-.48-.94-.82-1.13c-.28-.15-.68-.52-.01-.53c.63-.01 1.08.58 1.23.82c.72 1.21 1.87.87 2.33.66c.07-.52.28-.87.51-1.07c-1.78-.2-3.64-.89-3.64-3.95c0-.87.31-1.59.82-2.15c-.08-.2-.36-1.02.08-2.12c0 0 .67-.21 2.2.82c.64-.18 1.32-.27 2-.27c.68 0 1.36.09 2 .27c1.53-1.04 2.2-.82 2.2-.82c.44 1.1.16 1.92.08 2.12c.51.56.82 1.27.82 2.15c0 3.07-1.87 3.75-3.65 3.95c.29.25.54.73.54 1.48c0 1.07-.01 1.93-.01 2.2c0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8" />
16+
</svg>
17+
</a>

templates/components/github_ribbon.html

-15
This file was deleted.

0 commit comments

Comments
 (0)