Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 55a7b73

Browse files
svg added
1 parent 50eabf8 commit 55a7b73

File tree

6 files changed

+42
-32
lines changed

6 files changed

+42
-32
lines changed

‎api/__pycache__/views.cpython-39.pyc

-203 Bytes
Binary file not shown.

‎api/views.py

Lines changed: 40 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,6 @@ def svg_icon(request, username):
152152
# 'line-height: 1.5;'
153153
# '}'
154154

155-
# '.problems-solved {'
156-
# color: #8A8A8E;font-size: 12px;line-height: 17px; margin-bottom: 2px;white-space: nowrap;font-weight: 500;
157-
# '}'
158-
159155
# '.total-solved-container .total-count::before {'
160156
# 'content: "/";'
161157
# 'margin: 0 1px;'
@@ -171,46 +167,60 @@ def svg_icon(request, username):
171167
# '.top {'
172168
# 'height: 108px;'
173169
# '}'
174-
175-
# 'foreignObject {'
176-
# 'width: calc(100% - 10px - 32px);'
177-
# 'height: calc(100% - 10px - 24px);'
178-
# '}'
179170
# '</style>'
180171
'<g>'
181-
'<rect x="5" y="5" id="background" style="width: calc(100% - 10px);height: calc(100% - 10px);fill: #FFF;rx: 8px;ry: 8px;"/>'
172+
'<rect x="5" y="5" id="background" style="width: calc(100% - 10px);height: 400px;fill: #FFF;rx: 8px;ry: 8px;"/>'
182173
'<g>'
183-
'<foreignObject x="21" y="17" width="318" height="176">'
174+
'<foreignObject x="21" y="17" width="318" height="176" style="width: calc(100% - 10px - 32px); height: 400px;">'
184175
'<div xmlns="http://www.w3.org/1999/xhtml">'
185-
'<div class="stat-wrapper top" size="108" style="display: flex; flex-direction: column;text-align: start;">'
186-
'<div class="problems-solved" style="color: #8A8A8E;font-size: 12px;line-height: 17px; margin-bottom: 2px;white-space: nowrap;font-weight: 500;">Problems Solved</div>'
187-
'<div class="total-solved-count" style="font-size: 22px;font-weight: 600;line-height: 100%;white-space: nowrap;color: #262626;">{0}</div>'
176+
'<div style="margin-bottom:15px; font-size:18px;"><b style="color:#fc9905;">{0}</b> - LeetCode Stats</div>'
177+
'<div class="row1" style="margin-top:10px;">'
178+
'<div class="column" style="float: left;width: 35%;">'
179+
'<div class="stat-wrapper top" size="108" style="display: flex; flex-direction: column;text-align: start; margin-top:40px;">'
180+
'<div class="problems-solved" style="color: #8A8A8E;font-size: 16px;line-height: 17px; margin-bottom: 2px;white-space: nowrap;font-weight: 500;">Problems Solved</div>'
181+
'<div class="total-solved-count" style="font-size: 22px;font-weight: 600;line-height: 100%;white-space: nowrap;color: #262626;">{1}</div>'
182+
'</div>'
183+
# '<div class="total-solved-container" style="display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;color: #9e9e9e;height: 33px;">'
184+
# '<div class="stat-wrapper" data-difficulty="Easy" style="display: flex; flex-direction: column;text-align: start;">'
185+
# '<div class="difficulty-label easy" style="color: #43A047;font-size: 12px;font-weight: normal;line-height: 17px;margin-bottom: 2px;white-space: nowrap;">Easy</div>'
186+
# '<div class="solved" style="color: #262626;font-size: 14px;font-weight: 600;line-height: 100%;white-space: nowrap;">'
187+
# '{2}<span class="total-count">/568</span>'
188+
# '</div>'
189+
# '</div>'
190+
# '<div class="stat-wrapper" data-difficulty="Medium" style="display: flex; flex-direction: column;text-align: start;">'
191+
# '<div class="difficulty-label medium" style="color: #FB8C00;font-size: 12px;font-weight: normal;line-height: 17px;margin-bottom: 2px;white-space: nowrap;">Medium</div>'
192+
# '<div class="solved" style="color: #262626;font-size: 14px;font-weight: 600;line-height: 100%;white-space: nowrap;">'
193+
# '{3}<span class="total-count">/1203</span>'
194+
# '</div>'
195+
# '</div>'
196+
# '<div class="stat-wrapper" data-difficulty="Hard" style="display: flex; flex-direction: column;text-align: start;">'
197+
# '<div class="difficulty-label hard" style="color: #E91E63;font-size: 12px;font-weight: normal;line-height: 17px;margin-bottom: 2px;white-space: nowrap;">Hard</div>'
198+
# '<div class="solved" style="color: #262626;font-size: 14px;font-weight: 600;line-height: 100%;white-space: nowrap;">'
199+
# '{4}<span class="total-count">/491</span>'
200+
# '</div>'
201+
# '</div>'
202+
# '</div>'
188203
'</div>'
189-
'<div class="total-solved-container" style="display: -webkit-box;display: -ms-flexbox;display: flex;-webkit-box-pack: justify;-ms-flex-pack: justify;justify-content: space-between;color: #9e9e9e;height: 33px;">'
190-
'<div class="stat-wrapper" data-difficulty="Easy" style="display: flex; flex-direction: column;text-align: start;">'
191-
'<div class="difficulty-label easy" style="color: #43A047;font-size: 12px;font-weight: normal;line-height: 17px;margin-bottom: 2px;white-space: nowrap;">Easy</div>'
192-
'<div class="solved" style="color: #262626;font-size: 14px;font-weight: 600;line-height: 100%;white-space: nowrap;">'
193-
'{0}<span class="total-count">/568</span>'
204+
'<div class="column" style="float: left;width: 65%;">'
205+
'<div style="margin:20px; margin-bottom:2px; margin-top:0px;"><span style="color:#5db55f;">Easy:</span> <b style="color:#5db55f;">{2}</b>/568</div>'
206+
'<div style="background-color:#e4e4e4; border-radius:50px; margin:20px; margin-top:2px;">'
207+
'<div style="height:4px; width:calc(({2}/568) * 100%); background-color:#5db55f; border-radius:50px;"></div>'
194208
'</div>'
195-
'</div>'
196-
'<div class="stat-wrapper" data-difficulty="Medium" style="display: flex; flex-direction: column;text-align: start;">'
197-
'<div class="difficulty-label medium" style="color: #FB8C00;font-size: 12px;font-weight: normal;line-height: 17px;margin-bottom: 2px;white-space: nowrap;">Medium</div>'
198-
'<div class="solved" style="color: #262626;font-size: 14px;font-weight: 600;line-height: 100%;white-space: nowrap;">'
199-
'{0}<span class="total-count">/1203</span>'
209+
'<div style="margin:20px; margin-bottom:2px;"><span style="color:#faab43;">Medium: </span> <b style="color:#faab43;">{3}</b>/1203</div>'
210+
'<div style="background-color:#e4e4e4; border-radius:50px; margin:20px; margin-top:2px;">'
211+
'<div style="height:4px; width:calc(({3}/1203) * 100%); background-color:#faab43; border-radius:50px;"></div>'
200212
'</div>'
201-
'</div>'
202-
'<div class="stat-wrapper" data-difficulty="Hard" style="display: flex; flex-direction: column;text-align: start;">'
203-
'<div class="difficulty-label hard" style="color: #E91E63;font-size: 12px;font-weight: normal;line-height: 17px;margin-bottom: 2px;white-space: nowrap;">Hard</div>'
204-
'<div class="solved" style="color: #262626;font-size: 14px;font-weight: 600;line-height: 100%;white-space: nowrap;">'
205-
'{0}<span class="total-count">/491</span>'
213+
'<div style="margin:20px; margin-bottom:2px;"><span style="color:#d55951;">Hard: </span> <b style="color:#d55951;">{4}</b>/491</div>'
214+
'<div style="background-color:#e4e4e4; border-radius:50px; margin:20px; margin-top:2px;">'
215+
'<div style="height:4px; width:calc(({4}/491) * 100%); background-color:#d55951; border-radius:50px;"></div>'
206216
'</div>'
207217
'</div>'
208218
'</div>'
209219
'</div>'
210220
'</foreignObject>'
211221
'</g>'
212222
'</g>'
213-
'</svg>',total, easy, med, hard)
223+
'</svg>',username, total, easy, med, hard, )
214224

215225
# return mark_safe(svg_tag)
216226
return HttpResponse(svg_tag, content_type="image/svg+xml")
-2 Bytes
Binary file not shown.

‎leetcodeApi/urls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
urlpatterns = [
2222
path('admin/', admin.site.urls),
2323
path('', home),
24-
# path('<str:username>/', getUsername),
25-
path('a/<str:username>/', svg_icon),
24+
path('<str:username>/', svg_icon),
25+
# path('a/<str:username>/', svg_icon),
2626
]

‎static/images/LeetCode_logo_black.png

39.8 KB
Loading[フレーム]

‎static/images/LeetCode_logo_rvs.png

37.1 KB
Loading[フレーム]

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /