Skip to content

Commit b280807

Browse files
committed
Add Markdown and Anki icons in "Export" menu
1 parent d9c3267 commit b280807

File tree

2 files changed

+192
-5
lines changed

2 files changed

+192
-5
lines changed

src/Icons.elm

+178-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module Icons exposing
2-
( arrowUp
2+
( anki
3+
, arrowUp
34
, chevronDown
45
, chevronRight
56
, documentDownload
@@ -16,8 +17,37 @@ module Icons exposing
1617
)
1718

1819
import Html exposing (Html)
19-
import Svg exposing (circle, path, svg)
20-
import Svg.Attributes exposing (clipRule, cx, cy, d, fill, fillRule, height, r, stroke, strokeLinecap, strokeLinejoin, strokeWidth, viewBox, width)
20+
import Svg exposing (circle, clipPath, defs, g, node, path, svg)
21+
import Svg.Attributes
22+
exposing
23+
( clipPathUnits
24+
, clipRule
25+
, cx
26+
, cy
27+
, d
28+
, fill
29+
, fillRule
30+
, gradientTransform
31+
, gradientUnits
32+
, height
33+
, offset
34+
, r
35+
, rx
36+
, ry
37+
, stroke
38+
, strokeLinecap
39+
, strokeLinejoin
40+
, strokeWidth
41+
, style
42+
, transform
43+
, viewBox
44+
, width
45+
, x1
46+
, x2
47+
, y
48+
, y1
49+
, y2
50+
)
2151

2252

2353
withAdditionalAttributes :
@@ -263,3 +293,148 @@ markdown =
263293
[]
264294
]
265295
]
296+
297+
298+
anki : List (Html.Attribute msg) -> Html msg
299+
anki =
300+
withAdditionalAttributes
301+
[ viewBox "0 0 6.0854168 7.9375"
302+
, fill "currentColor"
303+
]
304+
[ defs []
305+
[ clipPath
306+
[ clipPathUnits "userSpaceOnUse"
307+
]
308+
[ node "rect"
309+
[ height "30"
310+
, rx "4.6187186"
311+
, ry "4.6187186"
312+
, width "23"
313+
, Svg.Attributes.x "5"
314+
, y "1"
315+
]
316+
[]
317+
]
318+
, node "linearGradient"
319+
[ gradientTransform "matrix(0.954545,0,0,0.965517,1.704545,0.551724)"
320+
, gradientUnits "userSpaceOnUse"
321+
, x1 "15.5"
322+
, x2 "4"
323+
, y1 "5.9497476"
324+
, y2 "31"
325+
]
326+
[]
327+
, node "linearGradient"
328+
[]
329+
[ node "stop"
330+
[ offset "0"
331+
, style "stop-color:#3c3c3c;stop-opacity:1"
332+
]
333+
[]
334+
, node "stop"
335+
[ offset "1"
336+
, style "stop-color:#9e9e9e;stop-opacity:1"
337+
]
338+
[]
339+
]
340+
, node "linearGradient"
341+
[ gradientUnits "userSpaceOnUse"
342+
, x1 "253.74718"
343+
, x2 "188.00023"
344+
, y1 "412.82977"
345+
, y2 "542.33295"
346+
]
347+
[]
348+
, node "linearGradient"
349+
[]
350+
[ node "stop"
351+
[ offset "0"
352+
, style "stop-color:#0084dd;stop-opacity:1"
353+
]
354+
[]
355+
, node "stop"
356+
[ offset "1"
357+
, style "stop-color:white;stop-opacity:1"
358+
]
359+
[]
360+
]
361+
, node "linearGradient"
362+
[ gradientTransform "matrix(0.09240924,0,0,0.09240924,-5.65772,-25.6423)"
363+
, gradientUnits "userSpaceOnUse"
364+
, x1 "247"
365+
, x2 "292"
366+
, y1 "441.86218"
367+
, y2 "282.36218"
368+
]
369+
[]
370+
, node "linearGradient"
371+
[]
372+
[ node "stop"
373+
[ offset "0"
374+
, style "stop-color:white;stop-opacity:0.49411765;"
375+
]
376+
[]
377+
, node "stop"
378+
[ offset "1"
379+
, style "stop-color:white;stop-opacity:0.25098041;"
380+
]
381+
[]
382+
]
383+
, node "linearGradient"
384+
[ gradientUnits "userSpaceOnUse"
385+
, x1 "253.74718"
386+
, x2 "188.00023"
387+
, y1 "412.82977"
388+
, y2 "542.33295"
389+
]
390+
[]
391+
]
392+
, g [ transform "translate(-137.84645,-70.369748)" ]
393+
[ g
394+
[ style "display:inline"
395+
, transform "matrix(0.26458333,0,0,0.26458333,136.52353,70.105165)"
396+
]
397+
[ node "rect"
398+
[ height "32"
399+
, rx "0"
400+
, ry "0"
401+
, width "32"
402+
, Svg.Attributes.x "0"
403+
, y "0"
404+
]
405+
[]
406+
, node "rect"
407+
[ height "28"
408+
, rx "4"
409+
, ry "4"
410+
, width "21"
411+
, Svg.Attributes.x "6"
412+
, y "2"
413+
]
414+
[]
415+
, path
416+
[ d "m 312.50679,544.32837 c -20.28396,20.1643 -45.83498,-32.08006 -74.19864,-28.40036 -29.32333,3.80421 -41.202,60.28859 -67.50841,46.78663 -25.44547,-13.06007 16.34617,-53.50493 4.08171,-79.34329 -12.67942,-26.71258 -70.06997,-20.55523 -65.35797,-49.74645 4.55778,-28.23586 55.93746,-0.9878 76.72126,-20.63649 21.48703,-20.31349 -2.10362,-72.99241 27.11497,-77.53162 28.26233,-4.39065 18.22508,52.89443 43.33464,66.58923 25.95913,14.15816 68.76986,-24.55656 82.11594,1.82928 12.9093,25.52229 -44.67374,33.67836 -49.93898,61.7909 -5.4434,29.06371 44.60573,57.81562 23.63548,78.66217 z"
417+
, style "fill:none;fill-opacity:1;stroke:none;stroke-width:16.2321;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
418+
, transform "matrix(0.09169279,0.01148462,-0.01148462,0.09169279,1.24989,-28.62005)"
419+
]
420+
[]
421+
, path
422+
[ d "m 294.46869,523.45259 c -9.08043,8.81335 -45.57491,-17.76993 -58.10148,-15.97712 -12.52658,1.79282 -40.09949,37.54547 -51.28749,31.63294 -11.18801,-5.91252 2.81678,-48.83551 -2.75921,-60.19499 -5.57599,-11.35947 -48.09928,-26.53469 -45.93342,-39.00218 2.16586,-12.46749 47.31577,-12.41208 56.39619,-21.22544 9.08043,-8.81335 10.3725,-53.9448 22.89908,-55.73762 12.52657,-1.79281 26.42597,41.16443 37.61397,47.07695 11.188,5.91252 54.50984,-6.80503 60.08583,4.55445 5.57599,11.35947 -30.98363,37.85309 -33.14948,50.32059 -2.16586,12.46749 23.31643,49.73906 14.23601,58.55242 z"
423+
, style "fill:url(#linearGradient1230);fill-opacity:1;stroke:#ffffff;stroke-width:15.9837;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
424+
, transform "matrix(0.07507522,4.398431e-4,-4.398431e-4,0.07507522,-2.36792,-12.92398)"
425+
]
426+
[]
427+
, path
428+
[ d "m 294.46869,523.45259 c -9.08043,8.81335 -45.57491,-17.76993 -58.10148,-15.97712 -12.52658,1.79282 -40.09949,37.54547 -51.28749,31.63294 -11.18801,-5.91252 2.81678,-48.83551 -2.75921,-60.19499 -5.57599,-11.35947 -48.09928,-26.53469 -45.93342,-39.00218 2.16586,-12.46749 47.31577,-12.41208 56.39619,-21.22544 9.08043,-8.81335 10.3725,-53.9448 22.89908,-55.73762 12.52657,-1.79281 26.42597,41.16443 37.61397,47.07695 11.188,5.91252 54.50984,-6.80503 60.08583,4.55445 5.57599,11.35947 -30.98363,37.85309 -33.14948,50.32059 -2.16586,12.46749 23.31643,49.73906 14.23601,58.55242 z"
429+
, style "fill:url(#linearGradient2975);fill-opacity:1;stroke:#ffffff;stroke-width:24.8699;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
430+
, transform "matrix(0.03131375,-0.02522366,0.02522366,0.03131375,2.32085,0.206819)"
431+
]
432+
[]
433+
, path
434+
[ d "M 2.659112,0.45056835 H 30.289475 L 29.457792,20.39883 C 25.879683,16.517642 12.825421,10.535309 3.6153,10.535309 Z"
435+
, style "display:inline;opacity:1;fill:url(#linearGradient2979);fill-opacity:1;stroke:none;stroke-width:3;stroke-miterlimit:4;stroke-opacity:1"
436+
]
437+
[]
438+
]
439+
]
440+
]

src/Pages/ListAll.elm

+14-2
Original file line numberDiff line numberDiff line change
@@ -1191,10 +1191,22 @@ viewExportButton enabled exportDropdownMenu =
11911191
, text "Export"
11921192
]
11931193
[ Components.DropdownMenu.choice
1194-
[ text "Anki deck" ]
1194+
[ span
1195+
[ class "inline-flex items-center" ]
1196+
[ Icons.anki
1197+
[ Svg.Attributes.class "h-5 w-5 text-gray-500 dark:text-gray-600 mr-2" ]
1198+
, text "Anki deck"
1199+
]
1200+
]
11951201
(PageMsg.Internal <| DownloadAnki)
11961202
, Components.DropdownMenu.choice
1197-
[ text "Markdown" ]
1203+
[ span
1204+
[ class "inline-flex items-center" ]
1205+
[ Icons.markdown
1206+
[ Svg.Attributes.class "h-5 w-5 text-gray-500 dark:text-gray-400 mr-2" ]
1207+
, text "Markdown"
1208+
]
1209+
]
11981210
(PageMsg.Internal <| DownloadMarkdown)
11991211
]
12001212

0 commit comments

Comments
 (0)