logo

blog

My website can't be that messy, right? git clone https://anongit.hacktivis.me/git/blog.git/

css-cursors-demo.sh (1463B)


  1. #!/bin/sh
  2. CURSORS='
  3. auto
  4. default
  5. none
  6. context-menu
  7. help
  8. pointer
  9. progress
  10. wait
  11. cell
  12. crosshair
  13. text
  14. vertical-text
  15. alias
  16. copy
  17. move
  18. no-drop
  19. not-allowed
  20. grab
  21. grabbing
  22. e-resize
  23. n-resize
  24. ne-resize
  25. nw-resize
  26. s-resize
  27. se-resize
  28. sw-resize
  29. w-resize
  30. ew-resize
  31. ns-resize
  32. nesw-resize
  33. nwse-resize
  34. col-resize
  35. row-resize
  36. all-scroll
  37. zoom-in
  38. zoom-out'
  39. WORKDIR="$(dirname "$0")"
  40. (
  41. cat - <<EOF
  42. #cursors li:nth-child(odd) { background-color: var(--ansi00); }
  43. #cursors li:nth-child(even) { background-color: var(--ansi00-hard); }
  44. #cursors li { border: 1pt solid transparent; }
  45. #cursors li:hover { border: 1pt solid; }
  46. EOF
  47. for cur in ${CURSORS}; do
  48. printf '#cursors-%s { cursor: %s; }\n' "$cur" "$cur"
  49. done
  50. ) >| "${WORKDIR}/css-cursors-demo.css"
  51. (
  52. printf \
  53. '<!DOCTYPE html>
  54. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude" xml:lang="en" lang="en">
  55. <head>
  56. <!--#include file="/templates/head.shtml" -->
  57. <title>CSS cursors demo</title>
  58. <link rel="stylesheet" href="css-cursors-demo.css" />
  59. </head>
  60. <body>
  61. <!--#include file="/templates/en/nav.shtml" -->
  62. <main>
  63. <h1>CSS cursors demo</h1>
  64. <p>You can hover on each word to get it&quot;s corresponding cursor property</p>
  65. <ul id="cursors">
  66. '
  67. for cur in ${CURSORS}; do
  68. printf \
  69. ' <li id="cursors-%s">%s</li>
  70. ' "$cur" "$cur"
  71. done
  72. printf \
  73. ' </ul>
  74. </main>
  75. <!--#include file="/templates/en/footer.shtml" -->
  76. </body>
  77. </html>\n'
  78. ) >| "${WORKDIR}/css-cursors-demo.xhtml"