navigator.clipboard.writeText("123")
//Текст корзины
add_filter('gettext', 'change_checkout_btn');
add_filter('ngettext', 'change_checkout_btn');
//function
function change_checkout_btn($checkout_btn){
$checkout_btn= str_ireplace('Shopping cart', 'Корзина', $checkout_btn);
$checkout_btn= str_ireplace('close', 'закрыть', $checkout_btn);
$checkout_btn= str_ireplace('Оформить заказ', 'Оформить заказ', $checkout_btn);
return $checkout_btn;
}
//Текст корзины
add_action( 'woocommerce_widget_shopping_cart_buttons', function(){
// Removing Buttons
remove_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_proceed_to_checkout', 20 );
// Adding customized Buttons
add_action( 'woocommerce_widget_shopping_cart_buttons', 'custom_widget_shopping_cart_button_view_cart', 10 );
}, 1 );
// Custom cart button
function custom_widget_shopping_cart_button_view_cart() {
$original_link = wc_get_cart_url();
$custom_link = home_url( 'http://metallika.by/#contact' ); // HERE replacing cart link
echo '<a href="' . esc_url( $custom_link ) . '" class="button wc-forward">' . esc_html__( 'View cart', 'woocommerce' ) . '</a>';
}
<body>
<p>Название</p>
<audio src='audio/Dich.mp3' controls audioplay></audio>
<p>Название</p>
<audio src='audio/Flower.mp3' controls audioplay></audio>
<p>Название</p>
<audio src='audio/Dich.mp3' controls audioplay></audio>
<p>Название</p>
<audio src='audio/Flower.mp3' controls audioplay></audio>
<p>Название</p>
<audio src='audio/Dich.mp3' controls audioplay></audio>
<p>Название</p>
<audio src='audio/Flower.mp3' controls audioplay></audio>
<script>
const aud = document.querySelectorAll('audio')
Array.from(aud).map(el => el.addEventListener('play', () => {
const played = document.querySelector('[data-play="true"]')
if(played && played !== el) {
played.pause()
played.removeAttribute('data-play')
}
el.dataset.play = 'true'
}))
</script>
</body>
но я никак не могу с ним работать, я пытался пропускать его через функции нормализации, но ни в какую
const weirdString = fetch() // здесь получаешь свою странную и корявую строку
const jsonEncoded = weirdString + '\\"}]}]"}' // для примера я вручную посчитал всё закрывающее барахло, но, возможно что для этого надо будет написать отдельную функцию. Ну, тут сам справишься, я думаю
const decodedOnce = JSON.parse(jsonEncoded) // раскодируем первый раз
const decodedTwice = JSON.parse(decodedOnce['21']); // раскодируем второй раз внутренний объект.
function getDates(startStr, endStr) {
const startDate = new Date(startStr.split('.').reverse().join('-'));
const endDate = new Date(endStr.split('.').reverse().join('-'));
const dates = [];
for (; startDate <= endDate; startDate.setDate(startDate.getDate() + 1)) {
dates.push(startDate.toLocaleDateString('ru-RU', {
year: 'numeric',
month: '2-digit',
day: '2-digit',
}));
}
return dates;
}
const inputs = [...document.querySelectorAll('.input')];
inputs.forEach(n => n.addEventListener('input', onInput));
function onInput({ target: t }) {
if (t.value.length === t.maxLength) {
t.nextElementSibling?.focus();
}
if (inputs.every(n => n.value.length === n.maxLength)) {
// здесь дёргаете свою функцию
}
}
<!DOCTYPE html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="wrapper">
<header class="header">Header</header>
<main class="main">Main</main>
<footer class="footer">Footer</footer>
</div>
</body>
</html>
html, body {
height: 100%;
margin: 0;
font-family: Helvetica;
font-size: 25px;
}
.wrapper {
min-height: 100%;
display: flex;
flex-direction: column;
}
.header {
background-color: lightsalmon;
text-align: center;
padding: 30px;
}
.main {
text-align: center;
padding: 30px;
flex: 1 1 auto;
}
.footer {
background-color: lightseagreen;
text-align: center;
padding: 30px;
}