Fixed pages
This commit is contained in:
264
index.html
264
index.html
@ -15,7 +15,7 @@
|
||||
|
||||
<title>Cg-Select</title>
|
||||
<link rel="shortcut icon" href="src/img/logoCG2.ico" type="image/x-icon" />
|
||||
<link href="example.scss" rel="stylesheet" />
|
||||
<link type="text/css" media="all" rel="stylesheet" href="style.scss" />
|
||||
</head>
|
||||
<body class="body-example">
|
||||
<div class="container">
|
||||
@ -27,11 +27,12 @@
|
||||
<hr style="width: 55%" />
|
||||
<nav>
|
||||
<ul class="navlist">
|
||||
<li><a href="">Home</a></li>
|
||||
<li><a href="docs/index.html">Documentation</a></li>
|
||||
<li><a href="">Home</a></li>
|
||||
<li><a href="src/constructor/constructor.html">Constructor</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<p class="version">v. 0.2.6</p>
|
||||
<p class="version">v. 0.2.7</p>
|
||||
</header>
|
||||
</div>
|
||||
|
||||
@ -46,12 +47,14 @@
|
||||
<input type="submit" value="Submit!" class="example-select_submit" />
|
||||
|
||||
<button type="button" class="check-code" id="first">View code</button>
|
||||
|
||||
<code id="codeFirst">
|
||||
<pre>
|
||||
<button class="copy" id="cp1">Copy code</button>
|
||||
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">CGSelect</span>({
|
||||
selector: <span class="code__string">'.cg-dropdown_one',</span>
|
||||
placeholder: <span class="code__string">'Choose a car',</span>
|
||||
lable: <span class="code__string">'EXAMPLE',</span>
|
||||
label: <span class="code__string">'EXAMPLE',</span>
|
||||
items: [
|
||||
<span class="code__string">'BMW',</span>
|
||||
{
|
||||
@ -78,90 +81,93 @@
|
||||
</div>
|
||||
|
||||
<div class="example-select">
|
||||
<h2 class="example-select_title">Default select with function nativeSelectMode</h2>
|
||||
<h2 class="example-select_title">
|
||||
Default select with function nativeSelectMode
|
||||
</h2>
|
||||
|
||||
<form method="get" class="form">
|
||||
<p style="margin-left: 12px; color: white">
|
||||
*Native select appears on mobile resolution.
|
||||
</p>
|
||||
<div class="layout-select">
|
||||
<button class="cg-dropdown cg-dropdown_selectNative"></button>
|
||||
</div>
|
||||
<p style="margin-left: 12px; color: white">
|
||||
*Native select appears on mobile resolution.
|
||||
</p>
|
||||
<div class="layout-select">
|
||||
<button class="cg-dropdown cg-dropdown_selectNative"></button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="check-code" id="Native">View code</button>
|
||||
<code id="codeNative">
|
||||
<pre>
|
||||
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">CGSelect</span>({
|
||||
selector: <span class="code__string">'.cg-dropdown_one',</span>
|
||||
placeholder: <span class="code__string">'Choose a car',</span>
|
||||
nativeSelectMode: <span class="code__keyword">true,</span>
|
||||
items: [
|
||||
<span class="code__string">'BMW',</span>
|
||||
{
|
||||
id: <span class="code__string">'213sade',</span>
|
||||
title: <span class="code__string">'Opel',</span>
|
||||
value: 1,
|
||||
},
|
||||
<span class="code__string">'Mersedes',</span>
|
||||
<span class="code__string">'MAN',</span>
|
||||
<span class="code__string">'Ferari',</span>
|
||||
],
|
||||
styles: {
|
||||
head: {
|
||||
width: <span class="code__string">'830px',</span>
|
||||
},
|
||||
list: {
|
||||
width: <span class="code__string">'824px',</span>
|
||||
},
|
||||
<button type="button" class="check-code" id="Native">View code</button>
|
||||
<code id="codeNative">
|
||||
<pre>
|
||||
<button class="copy" id="cp2">Copy code</button>
|
||||
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">CGSelect</span>({
|
||||
selector: <span class="code__string">'.cg-dropdown_one',</span>
|
||||
placeholder: <span class="code__string">'Choose a car',</span>
|
||||
nativeSelectMode: <span class="code__keyword">true,</span>
|
||||
items: [
|
||||
<span class="code__string">'BMW',</span>
|
||||
{
|
||||
id: <span class="code__string">'213sade',</span>
|
||||
title: <span class="code__string">'Opel',</span>
|
||||
value: 1,
|
||||
},
|
||||
});
|
||||
</pre>
|
||||
</code>
|
||||
</form>
|
||||
<span class="code__string">'Mersedes',</span>
|
||||
<span class="code__string">'MAN',</span>
|
||||
<span class="code__string">'Ferari',</span>
|
||||
],
|
||||
styles: {
|
||||
head: {
|
||||
width: <span class="code__string">'830px',</span>
|
||||
},
|
||||
list: {
|
||||
width: <span class="code__string">'824px',</span>
|
||||
},
|
||||
},
|
||||
});
|
||||
</pre>
|
||||
</code>
|
||||
</div>
|
||||
|
||||
<div class="example-select">
|
||||
<h2 class="example-select_title">Default select with function listDisplayMode</h2>
|
||||
<h2 class="example-select_title">
|
||||
Default select with function listDisplayMode
|
||||
</h2>
|
||||
|
||||
<form method="get" class="form">
|
||||
<p style="margin-left: 12px; color: white">
|
||||
*When using this method, the selection sheet appears as a modal window.
|
||||
</p>
|
||||
<div class="layout-select">
|
||||
<button class="cg-dropdown cg-dropdown_listDisplayMode"></button>
|
||||
</div>
|
||||
<p style="margin-left: 12px; color: white">
|
||||
*When using this method, the selection sheet appears as a modal
|
||||
window.
|
||||
</p>
|
||||
<div class="layout-select">
|
||||
<button class="cg-dropdown cg-dropdown_listDisplayMode"></button>
|
||||
</div>
|
||||
|
||||
<button type="button" class="check-code" id="six">View code</button>
|
||||
<button type="button" class="check-code" id="six">View code</button>
|
||||
|
||||
<code id="codeSix">
|
||||
<pre>
|
||||
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">CGSelect</span>({
|
||||
selector: <span class="code__string">'.cg-dropdown_listDisplayMode',</span>
|
||||
placeholder: <span class="code__string">'Choose a car',</span>
|
||||
listDisplayMode: <span class="code__keyword">true,</span>
|
||||
items: [
|
||||
<span class="code__string">'BMW',</span>
|
||||
{
|
||||
id: <span class="code__string">'213sade',</span>
|
||||
title: <span class="code__string">'Opel',</span>
|
||||
value: 1,
|
||||
},
|
||||
<span class="code__string">'Mersedes',</span>
|
||||
<span class="code__string">'MAN',</span>
|
||||
<span class="code__string">'Ferari',</span>
|
||||
],
|
||||
styles: {
|
||||
head: {
|
||||
width: <span class="code__string">'830px',</span>
|
||||
},
|
||||
list: {
|
||||
width: <span class="code__string">'824px',</span>
|
||||
},
|
||||
<code id="codeSix">
|
||||
<pre>
|
||||
<button class="copy" id="cp3">Copy code</button>
|
||||
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">CGSelect</span>({
|
||||
selector: <span class="code__string">'.cg-dropdown_listDisplayMode',</span>
|
||||
placeholder: <span class="code__string">'Choose a car',</span>
|
||||
listDisplayMode: <span class="code__keyword">true,</span>
|
||||
items: [
|
||||
<span class="code__string">'BMW',</span>
|
||||
{
|
||||
id: <span class="code__string">'213sade',</span>
|
||||
title: <span class="code__string">'Opel',</span>
|
||||
value: 1,
|
||||
},
|
||||
});
|
||||
</pre>
|
||||
</code>
|
||||
</form>
|
||||
<span class="code__string">'Mersedes',</span>
|
||||
<span class="code__string">'MAN',</span>
|
||||
<span class="code__string">'Ferari',</span>
|
||||
],
|
||||
styles: {
|
||||
head: {
|
||||
width: <span class="code__string">'830px',</span>
|
||||
},
|
||||
list: {
|
||||
width: <span class="code__string">'824px',</span>
|
||||
},
|
||||
},
|
||||
});
|
||||
</pre>
|
||||
</code>
|
||||
</div>
|
||||
|
||||
<div class="example-select">
|
||||
@ -173,10 +179,11 @@
|
||||
|
||||
<code id="codeSecond">
|
||||
<pre>
|
||||
<button class="copy" id="cp4">Copy code</button>
|
||||
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">CGSelect</span>({
|
||||
selector: <span class="code__string">'.cg-dropdown_three',</span>
|
||||
placeholder: <span class="code__string">'URL',</span>
|
||||
url: <span class="code__string">'https://jsonplaceholder.typicode.com/users',</span>
|
||||
url: <span class="code__string">'https://jsonplaceholder.typicode.com/todos',</span>
|
||||
searchMode: <span class="code__keyword">true,</span>
|
||||
darkTheme: <span class="code__keyword">false,</span>
|
||||
language: <span class="code__string">'ru',</span>
|
||||
@ -201,16 +208,16 @@
|
||||
<div class="col">
|
||||
<h5>Default theme:</h5>
|
||||
<p style="margin-right: 50px">
|
||||
To change the theme of the select, you need to specify this parameter in the select
|
||||
settings. The default theme is the classic theme, you can choose a white or dark
|
||||
theme.
|
||||
To change the theme of the select, you need to specify this
|
||||
parameter in the select settings. The default theme is the
|
||||
classic theme, you can choose a white or dark theme.
|
||||
</p>
|
||||
<code style="display: block; margin-top: 104px; ">
|
||||
<pre style="height: 240px;">
|
||||
<code style="display: block; margin-top: 104px">
|
||||
<pre style="height: 240px">
|
||||
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">CGSelect</span>({
|
||||
selector: <span class="code__string">'.cg-dropdown_one',</span>
|
||||
placeholder: <span class="code__string">'Choose a car',</span>
|
||||
lable: <span class="code__string">'EXAMPLE',</span>
|
||||
label: <span class="code__string">'EXAMPLE',</span>
|
||||
items: [
|
||||
...
|
||||
],
|
||||
@ -224,11 +231,14 @@
|
||||
<h5>Create custom theme:</h5>
|
||||
<div class="createTheme">
|
||||
<p style="margin-right: 25px">
|
||||
To create your own theme, you need to create an object with the following fields.
|
||||
In these fields you need to insert the previously created css class. After
|
||||
creating the object, just pass it to the select settings.
|
||||
<br>The main interface for creating a theme uses a Json data view, however if you want
|
||||
to set the theme locally using classes, use the CustomTheme interface (an example with it is below)
|
||||
To create your own theme, you need to create an object with
|
||||
the following fields. In these fields you need to insert the
|
||||
previously created css class. After creating the object, just
|
||||
pass it to the select settings.
|
||||
<br />The main interface for creating a theme uses a Json data
|
||||
view, however if you want to set the theme locally using
|
||||
classes, use the CustomTheme interface (an example with it is
|
||||
below)
|
||||
</p>
|
||||
<code style="display: block">
|
||||
<pre>
|
||||
@ -240,7 +250,7 @@
|
||||
placeholder?: <span class="code__class">object</span> ,
|
||||
caret?: <span class="code__class">object</span> ,
|
||||
search?: <span class="code__class">object</span> ,
|
||||
lable?: <span class="code__class">object</span> ,
|
||||
label?: <span class="code__class">object</span> ,
|
||||
},
|
||||
};
|
||||
</pre>
|
||||
@ -258,7 +268,7 @@
|
||||
|
||||
<div class="row">
|
||||
<code style="display: block">
|
||||
<pre style="height:460px">
|
||||
<pre style="height: 460px">
|
||||
<span class="code__keyword">const</span> <span class="code__var">newTheme</span>:<span class="code__class"> CustomTheme</span> = {
|
||||
name: <span class="code__string">'test',</span>
|
||||
styles: {
|
||||
@ -268,7 +278,7 @@
|
||||
caret: <span class="code__string">'caretTestClass',</span> ,
|
||||
search: <span class="code__string">'searchTestClass',</span> ,
|
||||
chips: <span class="code__string">'chipsTestClass',</span> ,
|
||||
lable: <span class="code__string">'lableTestClass',</span> ,
|
||||
label: <span class="code__string">'labelTestClass',</span> ,
|
||||
},
|
||||
};
|
||||
|
||||
@ -305,7 +315,7 @@
|
||||
borderTop: '6px solid white'
|
||||
</span> },
|
||||
search: {},
|
||||
lable: {},
|
||||
label: {},
|
||||
},
|
||||
};
|
||||
</pre>
|
||||
@ -326,44 +336,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="example-select">
|
||||
<h1 class="example-select_title">Select constructor</h1>
|
||||
<div class="row" style="margin: 20px; color: white">
|
||||
<div class="col">
|
||||
<h5 style="font-size: 18px; margin: 0;">Select Style Builder:</h5>
|
||||
<p style="margin-right: 50px; font-size: 17px">
|
||||
This is a constructor for styling a select online without downloading. For it to work,
|
||||
you need to:
|
||||
<ol style="font-size: 15px;">
|
||||
<li class="liList">Select a part of the select for customization. </li>
|
||||
<li class="liList">Enter styles in the text field in the form "color: red;".</li>
|
||||
<li class="liList">Click on the render button.</li>
|
||||
</ol>
|
||||
</p>
|
||||
</div>
|
||||
<div class="col">
|
||||
<div class="layout-select constructor">
|
||||
<button class="cg-dropdown body"></button>
|
||||
<textarea
|
||||
name="styles"
|
||||
id="styles"
|
||||
cols="30"
|
||||
rows="5"
|
||||
class="textareaStyle"
|
||||
placeholder="Enter CSS properties"
|
||||
disabled="disabled"
|
||||
></textarea>
|
||||
<button type="button" class="check-code render">Render</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="layout-select constructor" style="margin-bottom: 60px;">
|
||||
<button class="cg-dropdown select"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="example-select">
|
||||
<h1 class="example-select_title">Categories</h1>
|
||||
|
||||
@ -374,6 +346,7 @@
|
||||
|
||||
<code id="codeThird">
|
||||
<pre>
|
||||
<button class="copy" id="cp5">Copy code</button>
|
||||
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">CGSelect</span>({
|
||||
selector: <span class="code__string">'.cg-dropdown_categories',</span>
|
||||
placeholder: <span class="code__string">'Выберите регион',</span>
|
||||
@ -427,20 +400,28 @@
|
||||
|
||||
<div class="example-select">
|
||||
<h1 class="example-select_title">Use callbacks</h1>
|
||||
|
||||
|
||||
<div class="layout-select">
|
||||
<div class="col">
|
||||
<p style="color: white;">When using a callback, you can pass in the first parameter such values as: <span class="code__string">open, close, select, clear</span>.
|
||||
<br>The second parameter is a function in which there are two parameters: <span class="code__string">state</span> and <span class="code__string">value</span>.
|
||||
<br>The output of the value can be seen in the browser console.
|
||||
<p style="color: white">
|
||||
When using a callback, you can pass in the first parameter such
|
||||
values as:
|
||||
<span class="code__string">open, close, select, clear</span>.
|
||||
<br />The second parameter is a function in which there are two
|
||||
parameters: <span class="code__string">state</span> and
|
||||
<span class="code__string">value</span>. <br />The output of the
|
||||
value can be seen in the browser console.
|
||||
</p>
|
||||
</div>
|
||||
<button class="cg-dropdown cg-dropdown_callback"></button>
|
||||
</div>
|
||||
<button type="button" class="check-code" id="callback">View code</button>
|
||||
<button type="button" class="check-code" id="callback">
|
||||
View code
|
||||
</button>
|
||||
|
||||
<code id="codeCallback">
|
||||
<pre>
|
||||
<button class="copy" id="cp6">Copy code</button>
|
||||
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">CGSelect</span>({
|
||||
selector: <span class="code__string">'.cg-dropdown_categories',</span>
|
||||
placeholder: <span class="code__string">'Choose a car',</span>
|
||||
@ -486,6 +467,7 @@
|
||||
|
||||
<code id="codeFourth">
|
||||
<pre>
|
||||
<button class="copy" id="cp7">Copy code</button>
|
||||
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">CGSelect</span>({
|
||||
selector: <span class="code__string">'.cg-dropdown_usedBtn',</span>
|
||||
placeholder: <span class="code__string">'Choose a car',</span>
|
||||
@ -532,7 +514,12 @@
|
||||
<div class="example-select">
|
||||
<h1 class="example-select_title">Function disabled</h1>
|
||||
|
||||
<input type="checkbox" name="chbx" id="checkboxDisable" style="margin: 16px" />
|
||||
<input
|
||||
type="checkbox"
|
||||
name="chbx"
|
||||
id="checkboxDisable"
|
||||
style="margin: 16px"
|
||||
/>
|
||||
<label for="checkboxDisable" style="color: white">
|
||||
You agree to the processing of data</label
|
||||
>
|
||||
@ -544,6 +531,7 @@
|
||||
<button type="button" class="check-code" id="fifth">View code</button>
|
||||
<code id="codeFifth">
|
||||
<pre>
|
||||
<button class="copy" id="cp8">Copy code</button>
|
||||
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">CGSelect</span>({
|
||||
selector: <span class="code__string">'.cg-dropdown_checkboxDisable',</span>
|
||||
placeholder: <span class="code__string">'Choose a car',</span>
|
||||
|
Reference in New Issue
Block a user