Fixed main page

This commit is contained in:
MaxOvs19 2023-04-07 15:02:11 +03:00
parent 4c136507fe
commit a195ccd27b
8 changed files with 84 additions and 5239 deletions

View File

@ -97,7 +97,7 @@
id="version--0231"
style="color: inherit; text-decoration: none"
>
<h2>version ~ 0.2.6</h2>
<h2>version ~ 0.3.0</h2>
</a>
<p>
This component allows you to create a custom select. It offers more

View File

@ -32,7 +32,7 @@
<li><a href="src/constructor/constructor.html">Constructor</a></li>
</ul>
</nav>
<p class="version">v. 0.2.7</p>
<p class="version">v. 0.3.0</p>
</header>
</div>

View File

@ -1,7 +1,8 @@
import CGSelect from "cg-select";
import "./style.scss";
import "./src/buttonControlCode";
import "./style.scss";
// ------------------------------Обычный селект--------------------
const dropdown = new CGSelect({
selector: ".cg-dropdown_one",

5228
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "example-cg-select-page",
"version": "0.2.6",
"version": "0.3.0",
"description": "This is a test page to demonstrate the capabilities of the select",
"scripts": {
"start": "parcel ./index.html -p 4660 --open",
@ -30,7 +30,7 @@
},
"homepage": "https://cg-select.itguild.info",
"dependencies": {
"cg-select": "^0.2.7",
"cg-select": "^0.3.0",
"gh-pages": "^5.0.0",
"parcel": "^2.8.3"
},

View File

@ -8,64 +8,53 @@ const copy7 = document.getElementById("cp7");
const copy8 = document.getElementById("cp8");
const firstBtn = document.getElementById("first");
const codeFirst = document.getElementById("codeFirst");
const codeFirst = document.getElementById("codeFirst"); // cp1
copyCode(copy1, codeFirst);
const secondBtn = document.getElementById("second");
const codeSecond = document.getElementById("codeSecond");
const codeSecond = document.getElementById("codeSecond"); // cp4
copyCode(copy2, codeSecond);
copyCode(copy4, codeSecond);
const thirdBtn = document.getElementById("third");
const codeThird = document.getElementById("codeThird");
const codeThird = document.getElementById("codeThird"); // cp5
copyCode(copy5, codeThird);
const fourthBtn = document.getElementById("fourth");
const codeFourth = document.getElementById("codeFourth");
const codeFourth = document.getElementById("codeFourth"); // cp7
copyCode(copy7, codeFourth);
const fifthBtn = document.getElementById("fifth");
const codeFifth = document.getElementById("codeFifth");
const codeFifth = document.getElementById("codeFifth"); // cp8
copyCode(copy8, codeFifth);
const six = document.getElementById("six");
const codeSix = document.getElementById("codeSix");
const codeSix = document.getElementById("codeSix"); // cp3
copyCode(copy3, codeSix);
const Native = document.getElementById("Native");
const codeNative = document.getElementById("codeNative");
const codeNative = document.getElementById("codeNative"); // cp2
copyCode(copy2, codeNative);
const callback = document.getElementById("callback");
const codeCallback = document.getElementById("codeCallback");
const codeCallback = document.getElementById("codeCallback"); // cp6
firstBtn.addEventListener("click", () => {
codeFirst.classList.toggle("active");
});
copyCode(copy6, codeCallback);
secondBtn.addEventListener("click", () => {
codeSecond.classList.toggle("active");
});
thirdBtn.addEventListener("click", () => {
codeThird.classList.toggle("active");
});
fourthBtn.addEventListener("click", () => {
codeFourth.classList.toggle("active");
});
fifthBtn.addEventListener("click", () => {
codeFifth.classList.toggle("active");
});
six.addEventListener("click", () => {
codeSix.classList.toggle("active");
});
Native.addEventListener("click", () => {
codeNative.classList.toggle("active");
});
callback.addEventListener("click", () => {
codeCallback.classList.toggle("active");
});
toggleCode(firstBtn, codeFirst);
toggleCode(secondBtn, codeSecond);
toggleCode(thirdBtn, codeThird);
toggleCode(fourthBtn, codeFourth);
toggleCode(fifthBtn, codeFifth);
toggleCode(six, codeSix);
toggleCode(Native, codeNative);
toggleCode(callback, codeCallback);
function copyCode(button, elementCopy) {
button.addEventListener("click", (e) => {
@ -73,3 +62,9 @@ function copyCode(button, elementCopy) {
navigator.clipboard.writeText(elementCopy.textContent);
});
}
function toggleCode(button, elementCopy) {
button.addEventListener("click", () => {
elementCopy.classList.toggle("active");
});
}

View File

@ -33,7 +33,7 @@
<li><a href="./constructor.html">Constructor</a></li>
</ul>
</nav>
<p class="version">v. 0.2.7</p>
<p class="version">v. 0.3.0</p>
</header>
</div>

View File

@ -1,9 +0,0 @@
// import { CustomTheme } from 'components/theme/theme.interface';
// export const newCustomTheme: CustomTheme = {
// name: 'test',
// styles: {
// head: 'testClass',
// list: 'listTest',
// },
// };