This project provides a badge for sharing your current book in your github profile.
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.

118 lines
3.5 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <svg width="480" height="133" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
  2. <foreignObject width="480" height="133">
  3. <div xmlns="http://www.w3.org/1999/xhtml" class="container">
  4. <style>
  5. div {
  6. font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;
  7. }
  8. .main {
  9. display: flex;
  10. }
  11. .container {
  12. border-radius: 5px;
  13. padding: 10px 10px 10px 0px;
  14. }
  15. .reading {
  16. font-weight: bold;
  17. color: #53b14f;
  18. text-align: center;
  19. display: flex;
  20. justify-content: center;
  21. align-items: center;
  22. }
  23. .not-read {
  24. color: #ff1616;
  25. }
  26. .art {
  27. float: left;
  28. width: 27%;
  29. margin-left: -5px;
  30. }
  31. .text {
  32. width: 71%;
  33. }
  34. .book {
  35. font-size: 18px;
  36. color: #666;
  37. text-align: center;
  38. margin-top: 3px;
  39. }
  40. .author {
  41. font-size: 12px;
  42. color: #b3b3b3;
  43. text-align: center;
  44. margin-bottom: 5px;
  45. }
  46. .logo {
  47. margin-left: 5px;
  48. margin-top: 5px;
  49. }
  50. .cover {
  51. border-radius: 2px;
  52. }
  53. .progressbar-container {
  54. position: relative;
  55. text-align: center;
  56. border-style: solid;
  57. border-radius: 2px;
  58. width: 100%;
  59. border-width: 1px;
  60. border-color: #666;
  61. }
  62. .progressbar {
  63. padding: 1px;
  64. width: {{progress}}%;
  65. height: 18px;
  66. background-color: #AAA;
  67. }
  68. .progressbar-text{
  69. display: inline-block;
  70. margin: 0px;
  71. padding-top: 2px;
  72. color: #555;
  73. position: absolute;
  74. }
  75. </style>
  76. {% if book_name %}
  77. <div class="main">
  78. <a class="art" href="{}" target="_BLANK">
  79. <center>
  80. <img src="data:image/png;base64, {{img}}" class="cover" />
  81. </center>
  82. </a>
  83. <div class="text">
  84. <div class="book">{{book_name}}</div>
  85. <div class="author">by {{author}}</div>
  86. <div class="progressbar-container">
  87. <p class="progressbar-text">
  88. {{progress}}%
  89. </p>
  90. <div class="progressbar">
  91. </div>
  92. </div>
  93. </div>
  94. {% else %}
  95. <div class="reading not-read">Nothing on GoodReads</div>
  96. {% endif %}
  97. </div>
  98. </div>
  99. </foreignObject>
  100. </svg>