You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

158 lines
33 KiB

4 years ago
  1. +++
  2. title = "Alert"
  3. description = "Display contextual alert messages and dialogs."
  4. categories = ["experience"]
  5. tags = ["alert", "dialog", "message", "advertisement"]
  6. html_attributes = ['class']
  7. custom_attributes = ["type", "text"]
  8. snippets_used = ["alert", "card", "external", "button", "button group", "progress"]
  9. disable_csp = true
  10. [[copyright]]
  11. owner = "Josh Habdas"
  12. date = "2019"
  13. license = "agpl-3.0-or-later"
  14. +++
  15. <style>.margin-reset { margin: 0; }</style>
  16. {{< hackcss-card header="Quick Example" >}}
  17. {{< hackcss-alert type="info" class="margin-reset" >}}
  18. {{< hackcss-button
  19. type="primary" text="Toggle"
  20. onclick="this.parentElement.classList.toggle('alert')"
  21. />}} alert styling.
  22. {{< /hackcss-alert >}}
  23. {{< highlight html "linenos=inline" >}}
  24. {{</* hackcss-alert type="info" >}}
  25. {{< hackcss-button
  26. type="primary" text="Toggle"
  27. onclick="this.parentElement.classList.toggle('alert')"
  28. />}} alert styling.
  29. {{< /hackcss-alert */>}}
  30. {{< /highlight >}}
  31. {{< /hackcss-card >}}
  32. Default with plain text and hidden comment:
  33. ```html
  34. {{</* hackcss-alert text="Alert Text" /*/>}}
  35. {{</* hackcss-alert >}}Inner Alert Text{{< /hackcss-alert */>}}
  36. {{</* hackcss-alert text="Alert Text" >}}Hidden Comment{{< /hackcss-alert */>}}
  37. ```
  38. {{< hackcss-alert text="Alert Text" />}}
  39. {{< hackcss-alert >}}Inner Alert Text{{< /hackcss-alert >}}
  40. {{< hackcss-alert text="Alert Text" >}}Hidden Comment{{< /hackcss-alert >}}
  41. Default with formatted text:
  42. ```html
  43. {{</* hackcss-alert >}}
  44. <strong>HTML</strong> Text
  45. {{< /hackcss-alert */>}}
  46. {{%/* hackcss-alert %}}**Markdown** Text{{% /hackcss-alert */%}}
  47. ```
  48. {{< hackcss-alert >}}
  49. <strong>HTML</strong> Text
  50. {{< /hackcss-alert >}}
  51. {{% hackcss-alert %}}**Markdown** Text{{% /hackcss-alert %}}
  52. Typed with plain and formatted text:
  53. ```html
  54. {{</* hackcss-alert type="success" text="Success Text" /*/>}}
  55. {{</* hackcss-alert type="info" >}}<s>Info</s> ~~Text~~{{< /hackcss-alert */>}}
  56. {{%/* hackcss-alert type="warning" %}}~~Warning~~ Text{{% /hackcss-alert */%}}
  57. {{</* hackcss-alert type="error" >}}
  58. <strong>Error</strong> Text
  59. {{< /hackcss-alert */>}}
  60. ```
  61. {{< hackcss-alert type="success" text="Success Text" />}}
  62. {{< hackcss-alert type="info" >}}<s>Info</s> ~~Text~~{{< /hackcss-alert >}}
  63. {{% hackcss-alert type="warning" %}}~~Warning~~ Text{{% /hackcss-alert %}}
  64. {{< hackcss-alert type="error" >}}
  65. <strong>Error</strong> Text
  66. {{< /hackcss-alert >}}
  67. Typed with interactive [Button](../button) and plain text:
  68. ```html
  69. {{</* hackcss-alert type="info" >}}
  70. {{< hackcss-button
  71. type="info" isghost="true" text="Toggle"
  72. onclick="this.parentElement.classList.toggle('alert')"
  73. />}} alert styling.
  74. {{< /hackcss-alert */>}}
  75. ```
  76. {{< hackcss-alert type="info" >}}
  77. {{< hackcss-button
  78. type="info" isghost="true" text="Toggle"
  79. onclick="this.parentElement.classList.toggle('alert')"
  80. />}} alert styling.
  81. {{< /hackcss-alert >}}
  82. Inside a [Card](../card) with a [Button Group](../button-group) and two interactive [Buttons](../button):
  83. ```html
  84. {{</* hackcss-card header="Card Title" >}}
  85. {{< hackcss-alert type="success" text="Congratulations! Your application was approved." />}}
  86. {{< hackcss-buttongroup >}}
  87. {{< hackcss-button text="Hide" type="primary" onclick="this.closest('.card').querySelector('.alert').hidden=true" />}}
  88. {{< hackcss-button text="Show" onclick="this.closest('.card').querySelector('.alert').hidden=false" />}}
  89. {{< /hackcss-buttongroup >}}
  90. {{< /hackcss-card */>}}
  91. ```
  92. {{< hackcss-card header="Card Title" >}}
  93. {{< hackcss-alert type="success" text="Congratulations! Your application was approved." />}}
  94. {{< hackcss-buttongroup >}}
  95. {{< hackcss-button text="Hide" type="primary" onclick="this.closest('.card').querySelector('.alert').hidden=true" />}}
  96. {{< hackcss-button text="Show" onclick="this.closest('.card').querySelector('.alert').hidden=false" />}}
  97. {{< /hackcss-buttongroup >}}
  98. {{< /hackcss-card >}}
  99. Typed with HTML graphic and [External](../external) link:
  100. ```html
  101. {{</* hackcss-alert type="success" >}}
  102. <img alt="Advertisement" src="/images/products/nano-s.jpg">
  103. {{< external href="https://go.habd.as/nano-s" class="muted" >}}
  104. <small>Ledger Nano S - The secure hardware wallet</small>
  105. {{< /external >}}
  106. {{< /hackcss-alert */>}}
  107. ```
  108. {{< hackcss-alert type="success" >}}
  109. <img alt="Advertisement" src="data:image/png;base64,/9j//gARTGF2YzU3LjEwNy4xMDAA/9sAQwAIDg4QDhATExMTExMWFRYXFxcWFhYWFxcXGRkZHR0dGRkZFxcZGRwcHR0gISAeHh0eISEjIyMqKigoMTEyPDxI/8QAtwABAAEFAQEAAAAAAAAAAAAAAAEGBwQCAwUIAQEBAAMBAQEAAAAAAAAAAAAAAQQDAgYFBxAAAgEDAQQGBQgGCQQCAwEBAAECEQQDEiExUQWRQRNhcQZSgRQiMhYVsZLSQtGhk8FyYlMjJDSys9MzgnN04fA1Q6KDVfE2w0URAQACAQEFBQUFCAEFAQAAAAABAhEDEjEhUQQTcdFBYYEyU5IisZFCFPBDweFSoTRiMyMksvFyogX/wAARCAC0BbADARIAAhIAAxIA/9oADAMBAAIRAxEAPwC/JAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABJAASQAEkABIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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iCo2IAokgANaGwBGpuFUcmbkURyOhBUcjpt4AUcjp6gA4nQAORvQANUdEAGuoncAE17znXuADbUTFcKfqQBDvboiieZc4x2zcMVJT63vArlVs7uGLqr47CxGW8uLh1lJgUXZy
  110. {{< external href="https://go.habd.as/nano-s" class="muted" >}}
  111. <small>Ledger Nano S - The secure hardware wallet</small>
  112. {{< /external >}}
  113. {{< /hackcss-alert >}}
  114. Containing a [Card](../card) with six [Progress](../progress) indicators:
  115. ```html
  116. {{</* hackcss-alert >}}
  117. {{< hackcss-card header="Value-added Tax by Country" >}}
  118. {{< hackcss-progress value="16" showpercent="true" filltext="China – 增值税" >}}
  119. {{< hackcss-progress value="20" showpercent="true" filltext="France – TVA" >}}
  120. {{< hackcss-progress value="10" showpercent="true" filltext="Indonesia – PPN" >}}
  121. {{< hackcss-progress value="8" showpercent="true" filltext="Japan – 消費税" >}}
  122. {{< hackcss-progress value="15" showpercent="true" filltext="New Zealand – GST" >}}
  123. {{< hackcss-progress value="20" showpercent="true" filltext="United Kingdom – VAT" >}}
  124. {{< /hackcss-card >}}
  125. {{< /hackcss-alert */>}}
  126. ```
  127. {{< hackcss-alert >}}
  128. {{< hackcss-card header="Value-added Tax by Country" >}}
  129. {{< hackcss-progress value="16" showpercent="true" filltext="China – 增值税" >}}
  130. {{< hackcss-progress value="20" showpercent="true" filltext="France – TVA" >}}
  131. {{< hackcss-progress value="10" showpercent="true" filltext="Indonesia – PPN" >}}
  132. {{< hackcss-progress value="8" showpercent="true" filltext="Japan – 消費税" >}}
  133. {{< hackcss-progress value="15" showpercent="true" filltext="New Zealand – GST" >}}
  134. {{< hackcss-progress value="20" showpercent="true" filltext="United Kingdom – VAT" >}}
  135. {{< /hackcss-card >}}
  136. {{< /hackcss-alert >}}