forked from simonwep/pickr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
135 lines (116 loc) · 5.12 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=5.0, minimum-scale=1.0"/>
<meta http-equiv="X-UA-Compatible" content="ie=edge"/>
<!-- Chrome, Firefox OS and Opera -->
<meta name="theme-color" content="#42445A"/>
<!-- Windows Phone -->
<meta name="msapplication-navbutton-color" content="#42445A"/>
<!-- iOS Safari -->
<meta name="apple-mobile-web-app-status-bar-style" content="#42445A"/>
<!-- SEO Stuff -->
<meta name="audience" lang="en" content="all"/>
<meta name="expires" content="7 days"/>
<meta name="robots" content="follow"/>
<meta name="revisit-after" content="7 days"/>
<meta name="page-topic" content="Color picker"/>
<meta name="copyright" content="Simon Reinisch"/>
<meta name="author" content="Simon Reinisch"/>
<meta name="description"
content="Flat, simple, responsive and hackable Color-Picker library. No dependencies, no jQuery. Compatible with all CSS Frameworks e.g. Bootstrap, Materialize. Supports alpha channel, rgba, hsla, hsva and more!"/>
<meta name="keywords" content="colorpicker, color-picker, design, ux-design, ui-design, web-development, programming, colors"/>
<!-- Open Graph / Facebook -->
<meta property="og:image" content="st/favicon.png"/>
<meta property="og:type" content="website"/>
<meta property="og:url" content="https://simonwep.github.io/pickr/"/>
<meta property="og:site_name" content="Pickr"/>
<meta property="og:title" content="Pickr - Modern Color Picker"/>
<meta property="og:description"
content="Flat, simple, responsive and hackable Color-Picker. No dependencies, no jQuery. Compatible with all CSS Frameworks e.g. Bootstrap, Materialize."/>
<!-- Twitter -->
<meta property="twitter:url" content="https://simonwep.github.io/pickr/">
<meta property="twitter:title" content="Pickr - Modern Color Picker">
<meta property="twitter:description"
content="Flat, simple, responsive and hackable Color-Picker library. No dependencies, no jQuery. Compatible with all CSS Frameworks e.g. Bootstrap, Materialize. Supports alpha channel, rgba, hsla, hsva and more!">
<meta property="twitter:image" content="st/favicon.png">
<title>Pickr</title>
<!-- Icons -->
<link rel="icon" href="st/favicon.png"/>
<link rel="fluid-icon" href="st/favicon.png"/>
<link rel="apple-touch-icon" href="st/favicon.png"/>
<!-- Style sheets -->
<link href="https://fonts.googleapis.com/css?family=Montserrat:300,400&display=swap" rel="stylesheet">
<link href="dist/themes/classic.min.css" rel="stylesheet"/>
<link href="dist/themes/monolith.min.css" rel="stylesheet"/>
<link href="dist/themes/nano.min.css" rel="stylesheet"/>
<link href="st/styles.css" rel="stylesheet"/>
</head>
<body>
<header>
<h1>Pickr. Keep it simple.</h1>
<a href="https://github.com/Simonwep/pickr">VIEW ON GITHUB</a>
</header>
<main>
<div class="theme-container"></div>
<div class="pickr-container"></div>
<p>(Tap it)</p>
<iframe width="1000" height="1000"></iframe>
</main>
<script src="dist/pickr.es5.min.js"></script>
<script src="st/script.js"></script>
<script>
var html = 'Hello from <div class="pickr-test-container"></div>';
var iframe = document.querySelector('iframe');
var iframeDoc = iframe.contentWindow.document;
var iframeWindow = iframe.contentWindow;
iframeDoc.querySelector('head').innerHTML = `<link href="dist/themes/classic.min.css" rel="stylesheet"/>
<link href="dist/themes/nano.min.css" rel="stylesheet"/>`
iframeDoc.querySelector('body').innerHTML = '<div class="pickr-in-iframe"></div>';
var pickrDom = iframeDoc.querySelector('.pickr-in-iframe');
var pickrInstance = new Pickr({
el: pickrDom,
theme: 'nano',
comparison: false,
default: 'transparent',
container: iframeDoc.querySelector('body'),
document:iframeDoc,
elementInstance: iframeWindow.Element,
swatches: [
'rgba(244, 67, 54, 1)',
'rgba(233, 30, 99, 0.95)',
'rgba(156, 39, 176, 0.9)',
'rgba(103, 58, 183, 0.85)',
'rgba(63, 81, 181, 0.8)',
'rgba(33, 150, 243, 0.75)',
'rgba(3, 169, 244, 0.7)',
'rgba(0, 188, 212, 0.7)',
'rgba(0, 150, 136, 0.75)',
'rgba(76, 175, 80, 0.8)',
'rgba(139, 195, 74, 0.85)',
'rgba(205, 220, 57, 0.9)',
'rgba(255, 235, 59, 0.95)',
'rgba(255, 193, 7, 1)'
],
components: {
// Main components
preview: true,
opacity: true,
hue: true,
// Input / output Options
interaction: {
hex: true,
rgba: true,
hsla: true,
hsva: true,
cmyk: true,
input: true,
clear: false,
save: false
}
}
});
</script>
</body>
</html>