Skip to content

Instantly share code, notes, and snippets.

@Manyaka
Manyaka / pagination.html
Last active June 16, 2021 07:40
Pagination a11y
<nav class="pagination" aria-label="pagination">
<a class="pagination__item pagination__item--first-page" href="#">
<span class="visually-hidden">Первая страница</span>
</a>
<a class="pagination__item pagination__item--previous-page" href="#" rel="prev">
<span class="visually-hidden">Предыдущая страница</span>
</a>
<a class="pagination__item" href="#">
@Manyaka
Manyaka / doAjax.js
Created January 13, 2021 09:08
Ajax Call
// Function to do an Ajax call
const doAjax = async () => {
const response = await fetch('Ajax.php'); // Generate the Response object
if (response.ok) {
const jVal = await response.json(); // Get JSON value from the response body
return Promise.resolve(jVal);
}
else
return Promise.reject('*** PHP file not found');
}
@Manyaka
Manyaka / autofill.css
Created October 5, 2020 05:53
Убирает стиль автозаполнения
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
-webkit-transition: 'color 9999s ease-out, background-color 9999s ease-out';
-webkit-transition-delay: 9999s;
}
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
@Manyaka
Manyaka / toggle-switch.pug
Created September 1, 2020 12:52
toggle-switch
input.toggle-switch( type="checkbox")
@Manyaka
Manyaka / readme.md
Last active August 6, 2020 16:59
polifills for IE11 and choices.js
@Manyaka
Manyaka / js.js
Created June 25, 2020 10:53
год
var YEAR = 365.259641 * 24 * 60 * 60 * 1000;
div {
margin: 1em auto;
width: 50vw;
height: 50vh;
background-color: gray;
background-image: url("img.webp");
background-position: 50% 50%;
background-size: cover;
@supports (background-image: -webkit-image-set(url("img.webp") 1x)) {
meta name="theme-color" content="#ffffff"
link rel="icon" href="/favicon.svg"
link rel="mask-icon" href="/mask-icon.svg" color="#000000"
link rel="apple-touch-icon" href="/apple-touch-icon.png"
link rel="manifest" href="/manifest.json"
@Manyaka
Manyaka / img.html
Last active May 8, 2020 09:13
responsive img
<picture>
<source
media="(max-width: 799px)"
srcset="cupcake.webp 1x, [email protected] 2x"
type="image/webp"
>
<source
media="(min-width: 800px)"
srcset="huge-cupcake.webp 1x, [email protected] 2x"
type="image/webp"