cg-select/src/index.html

259 lines
11 KiB
HTML
Raw Normal View History

2022-09-12 19:14:08 +03:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cg-Select</title>
2022-11-14 12:23:18 +03:00
<link href="style/main.scss" rel="stylesheet" />
2022-09-12 19:14:08 +03:00
</head>
<body>
<div class="container">
2022-11-11 17:21:42 +03:00
<header class="header">
2022-11-17 21:21:06 +03:00
<div class="header__logoBox">
<h1>CG-SELECT</h1>
<img src="/src/images/logoCG.jpg" alt="#" class="header__logo" />
</div>
<hr style="width: 55%" />
<nav>
<ul class="navlist">
<li><a href="">Home</a></li>
<li><a href="../documentation/index.html">Documentation</a></li>
</ul>
</nav>
2022-11-11 17:21:42 +03:00
</header>
</div>
2022-09-12 19:14:08 +03:00
2022-11-11 17:21:42 +03:00
<div class="container content">
<div class="example-select">
2022-12-19 22:48:05 +03:00
<h2 class="example-select_title">Дефолтный селект</h2>
2022-11-11 17:21:42 +03:00
<form method="get" class="form">
2022-12-19 22:48:05 +03:00
<div class="layout-select">
2022-11-11 17:21:42 +03:00
<button class="cg-dropdown cg-dropdown_one"></button>
</div>
2022-10-13 13:42:46 +03:00
2022-11-11 17:21:42 +03:00
<input type="submit" value="Отправить!" class="example-select_submit" />
2022-12-19 21:15:47 +03:00
2022-12-20 14:46:57 +03:00
<button type="button" class="check-code" id="first">Посмотреть код</button>
<code id="codeFirst">
2022-12-19 21:15:47 +03:00
<pre>
2022-12-19 22:48:05 +03:00
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">DropDown</span>({
selector: <span class="code__string">'.cg-dropdown_one',</span>
placeholder: <span class="code__string">'Выберите авто',</span>
lable: <span class="code__string">'EXAMPLE',</span>
2022-12-19 21:15:47 +03:00
items: [
2022-12-19 22:48:05 +03:00
<span class="code__string">'BMW',</span>
2022-12-19 21:15:47 +03:00
{
2022-12-19 22:48:05 +03:00
id: <span class="code__string">'213sade',</span>
title: <span class="code__string">'Opel',</span>
2022-12-19 21:15:47 +03:00
value: 1,
},
2022-12-19 22:48:05 +03:00
<span class="code__string">'Mersedes',</span>
<span class="code__string">'MAN',</span>
<span class="code__string">'Ferari',</span>
2022-12-19 21:15:47 +03:00
],
styles: {
head: {
2022-12-19 22:48:05 +03:00
width: <span class="code__string">'830px',</span>
2022-12-19 21:15:47 +03:00
},
list: {
2022-12-19 22:48:05 +03:00
width: <span class="code__string">'824px',</span>
2022-12-19 21:15:47 +03:00
},
},
});
</pre>
</code>
2022-11-11 17:21:42 +03:00
</form>
</div>
<div class="example-select">
<h1 class="example-select_title">Селект с данными с URL</h1>
2022-12-19 22:48:05 +03:00
<div class="layout-select">
<button class="cg-dropdown cg-dropdown_three"></button>
</div>
2022-12-20 14:46:57 +03:00
<button type="button" class="check-code" id="second">Посмотреть код</button>
2022-12-19 22:48:05 +03:00
2022-12-20 14:46:57 +03:00
<code id="codeSecond">
2022-12-19 22:48:05 +03:00
<pre>
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">DropDown</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>
searchMode: <span class="code__keyword">true,</span>
darkTheme: <span class="code__keyword">false,</span>
language: <span class="code__string">'ru',</span>
styles: {
head: {
width: <span class="code__string">'830px',</span>
},
list: {
width: <span class="code__string">'824px',</span>
},
},
});
</pre>
</code>
</div>
2022-11-11 17:21:42 +03:00
<div class="example-select">
<h1 class="example-select_title">Категории</h1>
2022-12-19 22:48:05 +03:00
<div class="layout-select">
<button class="cg-dropdown cg-dropdown_categories"></button>
</div>
2022-12-20 14:46:57 +03:00
<button type="button" class="check-code" id="third">Посмотреть код</button>
2022-12-19 22:48:05 +03:00
2022-12-20 14:46:57 +03:00
<code id="codeThird">
2022-12-19 22:48:05 +03:00
<pre>
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">DropDown</span>({
selector: <span class="code__string">'.cg-dropdown_categories',</span>
placeholder: <span class="code__string">'Выберите регион',</span>
searchMode: <span class="code__keyword">true,</span>
items: [
{
category: <span class="code__string">'Russia',</span>
categoryItems: [
{
id: <span class="code__string">'28qwds',</span>
title: <span class="code__string">'Москва',</span>
value: 0,
},
<span class="code__string">'Ростов-на-дону',</span>
<span class="code__string">'Саратов',</span>
<span class="code__string">'Волгоград',</span>
<span class="code__string">'Донецк',</span>
],
},
{
category: <span class="code__string">'USA',</span>
categoryItems: <span class="code__string">['Alabama', 'Texas', 'Colorado', 'Klirens', 'Los-Angeles'],</span>
},
{
category: <span class="code__string">'France',</span>
categoryItems: <span class="code__string">['Paris'],</span>
},
],
styles: {
head: {
width: <span class="code__string">'830px',</span>
},
list: {
width: <span class="code__string">'824px',</span>
},
placeholder: {
maxWidth: <span class="code__string">'500px ',</span>
},
},
multiselect: <span class="code__keyword">true,</span>
multiselectTag: <span class="code__keyword">true,</span>
});
</pre>
</code>
</div>
2022-11-11 17:21:42 +03:00
<div class="example-select">
<h1 class="example-select_title">Управление с помошью кнопок</h1>
<div style="margin-bottom: 15px">
<button class="button__open example-select_submit">Open</button>
<button class="button__close example-select_submit">Close</button>
</div>
2022-12-19 22:48:05 +03:00
<div class="layout-select">
<button class="cg-dropdown cg-dropdown_usedBtn"></button>
</div>
2022-12-20 14:46:57 +03:00
<button type="button" class="check-code" id="fourth">Посмотреть код</button>
<code id="codeFourth">
2022-12-19 22:48:05 +03:00
<pre>
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">DropDown</span>({
selector: <span class="code__string">'.cg-dropdown_usedBtn',</span>
placeholder: <span class="code__string">'Выберите авто',</span>
searchMode: <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">'max',</span>
],
styles: {
head: {
width: <span class="code__string">'830px',</span>
color: <span class="code__string">'black',</span>
backgroundColor: <span class="code__string">'rgb(176 223 167)',</span>
},
list: {
width: <span class="code__string">'824px',</span>
color: <span class="code__string">'black',</span>
backgroundColor: <span class="code__string">'rgb(176 223 167)',</span>
},
caret: {
borderTop: <span class="code__string">'6px solid black',</span>
},
search: {
backgroundColor: <span class="code__string">'#d7ffff',</span>
borderRadius: <span class="code__string">'5px',</span>
borderBottom: <span class="code__string">'none',</span>
width: <span class="code__string">'95%',</span>
color: <span class="code__string">'black',</span>
},
},
multiselect: <span class="code__keyword">true,</span>
});
</pre>
</code>
</div>
2022-11-11 17:21:42 +03:00
<div class="example-select">
<h1 class="example-select_title">Функция disabled</h1>
2022-12-20 14:46:57 +03:00
<input type="checkbox" name="chbx" id="checkboxDisable" style="margin: 16px" />
<label for="checkboxDisable">Вы согласны на обработку данных</label>
2022-12-19 22:48:05 +03:00
<div class="layout-select">
<button class="cg-dropdown cg-dropdown_checkboxDisable"></button>
</div>
2022-12-20 14:46:57 +03:00
<button type="button" class="check-code" id="fifth">Посмотреть код</button>
<code id="codeFifth">
2022-12-19 22:48:05 +03:00
<pre>
<span class="code__keyword">const</span> <span class="code__var">dropdown</span> = <span class="code__keyword">new</span> <span class="code__class">DropDown</span>({
selector: <span class="code__string">'.cg-dropdown_checkboxDisable',</span>
placeholder: <span class="code__string">'Выберите авто',</span>
lable: <span class="code__string">'EXAMPLE',</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>
},
placeholder: {
maxWidth: <span class="code__string">'500px ',</span>
},
},
});
</pre>
</code>
</div>
2022-10-13 13:42:46 +03:00
</div>
2022-09-12 19:14:08 +03:00
</body>
2022-11-11 17:50:55 +03:00
<script type="module" src="/src/index.js"></script>
2022-09-12 19:14:08 +03:00
</html>