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