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.

146 lines
3.3 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>Coloris examples</title>
  7. <link rel="stylesheet" type="text/css" href="coloris.min.css">
  8. <style type="text/css">
  9. @import url(https://fonts.googleapis.com/css2?family=Lato:wght@400;700&display=swap);
  10. body {
  11. height: 120vh;
  12. margin: 30px;
  13. color: #444;
  14. background-color: #fff;
  15. font-family: 'Lato', sans-serif;
  16. }
  17. h1 {
  18. margin-bottom: 1.5em;
  19. }
  20. input {
  21. width: 150px;
  22. height: 32px;
  23. padding: 0 10px;
  24. border: 1px solid #ccc;
  25. border-radius: 5px;
  26. font-family: inherit;
  27. font-size: inherit;
  28. font-weight: inherit;
  29. box-sizing: border-box;
  30. }
  31. .examples {
  32. display: flex;
  33. flex-wrap: wrap;
  34. }
  35. .example {
  36. flex-shrink: 0;
  37. width: 300px;
  38. margin-bottom: 30px;
  39. }
  40. .square .clr-field button,
  41. .circle .clr-field button {
  42. width: 22px;
  43. height: 22px;
  44. left: 5px;
  45. right: auto;
  46. border-radius: 5px;
  47. }
  48. .square .clr-field input,
  49. .circle .clr-field input {
  50. padding-left: 36px;
  51. }
  52. .circle .clr-field button {
  53. border-radius: 50%;
  54. }
  55. .full .clr-field button {
  56. width: 100%;
  57. height: 100%;
  58. border-radius: 5px;
  59. }
  60. </style>
  61. </head>
  62. <body>
  63. <a href="https://github.com/mdbassit/Coloris">View <b>Coloris</b> on GitHub</a>
  64. <h1>Coloris examples</h1>
  65. <div class="examples">
  66. <div class="example">
  67. <p>Default color thumbnail</p>
  68. <input type="text" value="green" data-coloris>
  69. </div>
  70. <div class="example square">
  71. <p>Rounded square thumbnail</p>
  72. <input type="text" class="coloris instance1" value="rgb(255, 0, 0)">
  73. </div>
  74. <div class="example circle">
  75. <p>Circular thumbnail</p>
  76. <input type="text" class="coloris instance2" value="#cc458faa">
  77. </div>
  78. <div class="example full">
  79. <p>Full size thumbnail</p>
  80. <input type="text" class="coloris instance3" value="#ffcc00">
  81. </div>
  82. <div class="example square" style="position: relative; top: 300px; padding-bottom: 30px;">
  83. <p>The dialog will appear on top of this field for lack of space under it.</p>
  84. <input type="text" class="coloris" value="#00a5cc">
  85. </div>
  86. </div>
  87. <script type="text/javascript" src="coloris.min.js"></script>
  88. <script type="text/javascript">
  89. /** Default configuration **/
  90. Coloris({
  91. el: '.coloris',
  92. swatches: [
  93. '#264653',
  94. '#2a9d8f',
  95. '#e9c46a',
  96. '#f4a261',
  97. '#e76f51',
  98. '#d62828',
  99. '#023e8a',
  100. '#0077b6',
  101. '#0096c7',
  102. '#00b4d8',
  103. '#48cae4'
  104. ]
  105. });
  106. /** Instances **/
  107. Coloris.setInstance('.instance1', {
  108. theme: 'pill',
  109. themeMode: 'dark',
  110. formatToggle: true,
  111. closeButton: true,
  112. clearButton: true,
  113. swatches: [
  114. '#067bc2',
  115. '#84bcda',
  116. '#80e377',
  117. '#ecc30b',
  118. '#f37748',
  119. '#d56062'
  120. ]
  121. });
  122. Coloris.setInstance('.instance2', { theme: 'polaroid' });
  123. Coloris.setInstance('.instance3', {
  124. theme: 'polaroid',
  125. swatchesOnly: true
  126. });
  127. </script>
  128. </body>
  129. </html>