element_stop.erl 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. -module(element_stop).
  2. -author('Konstantin Zakablukovsky').
  3. -include("nitro.hrl").
  4. -compile(export_all).
  5. render_element(Record) ->
  6. wf_tags:emit_tag(<<"stop">>, nitro:render(Record#stop.body),
  7. lists:append([
  8. [
  9. {<<"id">>, Record#stop.id},
  10. {<<"class">>, Record#stop.class},
  11. {<<"style">>, Record#stop.style},
  12. {<<"offset">>, Record#stop.offset}
  13. ],
  14. svg_core(Record),
  15. svg_presentation(Record),
  16. Record#stop.data_fields,
  17. Record#stop.aria_states
  18. ])).
  19. %% Common SVG attributes
  20. svg_core(Record)-> [
  21. {<<"xml:base">>, Record#stop.xmlbase},
  22. {<<"xml:lang">>, Record#stop.xmllang},
  23. {<<"xml:space">>, Record#stop.xmlspace}
  24. ].
  25. svg_presentation(Record)-> [
  26. {<<"alignment-baseline">>, Record#stop.alignment_baseline},
  27. {<<"baseline-shift">>, Record#stop.baseline_shift},
  28. {<<"clip">>, Record#stop.clip},
  29. {<<"clip-path">>, Record#stop.clip_path},
  30. {<<"clip-rule">>, Record#stop.clip_rule},
  31. {<<"color">>, Record#stop.color},
  32. {<<"color-interpolation">>, Record#stop.color_interpolation},
  33. {<<"color-interpolation-filters">>, Record#stop.color_interpolation_filters},
  34. {<<"color-profile">>, Record#stop.color_profile},
  35. {<<"color-rendering">>, Record#stop.color_rendering},
  36. {<<"cursor">>, Record#stop.cursor},
  37. {<<"direction">>, Record#stop.direction},
  38. {<<"display">>, Record#stop.display},
  39. {<<"dominant-baseline">>, Record#stop.dominant_baseline},
  40. {<<"enable-background">>, Record#stop.enable_background},
  41. {<<"fill">>, Record#stop.fill},
  42. {<<"fill-opacity">>, Record#stop.fill_opacity},
  43. {<<"fill-rule">>, Record#stop.fill_rule},
  44. {<<"filter">>, Record#stop.filter},
  45. {<<"flood-color">>, Record#stop.flood_color},
  46. {<<"flood-opacity">>, Record#stop.flood_opacity},
  47. {<<"font-family">>, Record#stop.font_family},
  48. {<<"font-size">>, Record#stop.font_size},
  49. {<<"font-size-adjust">>, Record#stop.font_size_adjust},
  50. {<<"font-stretch">>, Record#stop.font_stretch},
  51. {<<"font-style">>, Record#stop.font_style},
  52. {<<"font-variant">>, Record#stop.font_variant},
  53. {<<"font-weight">>, Record#stop.font_weight},
  54. {<<"glyph-orientation-horizontal">>, Record#stop.glyph_orientation_horizontal},
  55. {<<"glyph-orientation-vertical">>, Record#stop.glyph_orientation_vertical},
  56. {<<"image-rendering">>, Record#stop.image_rendering},
  57. {<<"kerning">>, Record#stop.kerning},
  58. {<<"letter-spacing">>, Record#stop.letter_spacing},
  59. {<<"lighting-color">>, Record#stop.lighting_color},
  60. {<<"marker-end">>, Record#stop.marker_end},
  61. {<<"marker-mid">>, Record#stop.marker_mid},
  62. {<<"marker-start">>, Record#stop.marker_start},
  63. {<<"mask">>, Record#stop.mask},
  64. {<<"opacity">>, Record#stop.opacity},
  65. {<<"overflow">>, Record#stop.overflow},
  66. {<<"pointer-events">>, Record#stop.pointer_events},
  67. {<<"shape-rendering">>, Record#stop.shape_rendering},
  68. {<<"stop-color">>, Record#stop.stop_color},
  69. {<<"stop-opacity">>, Record#stop.stop_opacity},
  70. {<<"stroke">>, Record#stop.stroke},
  71. {<<"stroke-dasharray">>, Record#stop.stroke_dasharray},
  72. {<<"stroke-dashoffset">>, Record#stop.stroke_dashoffset},
  73. {<<"stroke-linecap">>, Record#stop.stroke_linecap},
  74. {<<"stroke-linejoin">>, Record#stop.stroke_linejoin},
  75. {<<"stroke-miterlimit">>, Record#stop.stroke_miterlimit},
  76. {<<"stroke-opacity">>, Record#stop.stroke_opacity},
  77. {<<"stroke-width">>, Record#stop.stroke_width},
  78. {<<"text-anchor">>, Record#stop.text_anchor},
  79. {<<"text-decoration">>, Record#stop.text_decoration},
  80. {<<"text-rendering">>, Record#stop.text_rendering},
  81. {<<"unicode-bidi">>, Record#stop.unicode_bidi},
  82. {<<"visibility">>, Record#stop.visibility},
  83. {<<"word-spacing">>, Record#stop.word_spacing},
  84. {<<"writing-mode">>, Record#stop.writing_mode}
  85. ].