Skip to content

Instantly share code, notes, and snippets.

View wibawasuyadnya's full-sized avatar
🌱
Planting

Suyadnya wibawasuyadnya

🌱
Planting
View GitHub Profile
//list of RegExp
/* Pattern for Matching Search Filter */
var pattern1 = /^[\w\s\-]*$/;
var pattern2 = /^[\a-Z\w\’£\s]*$/;
var pattern3 = /^[\a-Z\w\'’£\s]*$/; /* Uncaught range change to */ /^[\a-zA\w\-\’£®™\s]*$/
var pattern4 = /^[\a-Z\w\’£®™\s]*$/;
var pattern5 = /^[\w\-\.+,;:='’£%™®\s]*$/; //Used and best approach for custom alphanumerical
//in page search filter with callback if no result found//
jQuery(document).ready(function($){
var $search = $("#inpsearch-bar").on('input',function(){
var matcher = new RegExp($(this).val(), 'gi');
$('.filter-box').show().not(function(){
return matcher.test($(this).find('.name').text())
}).hide();
if($('.filter-box:visible').length===0){
$('.noresult').show();
} else {
@wibawasuyadnya
wibawasuyadnya / voiceSpeech.js
Created September 4, 2022 12:52
Text Speech with JavaScript
let msg = new SpeechSynthesisUtterance();
let voices = speechSynthesis.getVoices();
msg.voice = voices[0];
let tags = document.querySelectorAll('p,a,h1,h2,h3'); // add more tags for you project
tags.forEach((tag) => {
tag.addEventListener('click', (e) => {
msg.text = e.target.innerText;
tag.style.backgroundColor = "yellow";
speechSynthesis.speak(msg);
selector .box-container:hover .box-img:after{
content: "COMING SOON";
opacity: 1;
font-size: 24px;
color: var(--e-global-color-710bfa0);
text-shadow: 0px 1px 0px 0px rgba(0.0.0.0,5);
letter-spacing: 1,5em;
position: absolute;
font-weight: bold;
top: 50%;
jQuery(document).ready(function($) {
$("#myInput").on("keyup", function() {
var value = $(this).val().toLowerCase();
//Select all article and show
$("article > div").show().filter(function() {
//Find h3 and p also check if the value is substring of the text. Return true if not found.
return $(this).find('h3,p').text().toLowerCase().indexOf(value) === -1;
}).hide();
//Hide all h3 and p that that the value is not the substring of text
});
const headerSticky = document.querySelector('#stickyheaders');
const headerUP = document.querySelector('.headerup');
const styles = {
sticky: {
transition : 'transform 0.34s ease'
},
up: {
transform: 'translateY(-80px)'
},
};
var sp_freqency = 14500;
var sp_timeout = 1200;
var popbackup = "";
var names = ["Anonymous", "Anonymous", "Anonymous", "Someone", "Someone", "Irma", "Frank", "Ella", "Liz", "Sasha", "Mariella", "Jeremy", "Virginia", "Charles", "Karina", "Vihaan", "Reyansh", "Krishna", "Akshay", "Rajesh"];
var towns = ["Portland","Hillsboro","Beaverton","Bethany","Aloha","Tigard","King City","Forest Grove","Rock Creek","Raleigh Hills","Garden Home","East Portland","Tualatin"];
var pastactions = ["Buy Healy"];
var recentactions = ["Registered Free Lesson", "Buy Healy"];
var futureactions = ["Buy Healy", "Registered Free Lesson"];
( function() {
var the_timer = setInterval( function() {
if( typeof Swiper && typeof jQuery ) {
runTheCode();
clearInterval( the_timer );
}
}, 100 );
} )();
function runTheCode() {
// add 'swiper-container' class to .elementor-container
var $ = jQuery;
$(document).ready(function(){
//default
$('.text-details').hide();
$('.text-details.active').show();
//after click
$(".tabmenu").on("click", function(){
var dataId = $(this).attr("data-tab");
'use strict'
var testim = document.getElementById("testim"),
testimDots = Array.prototype.slice.call(document.getElementById("testim-dots").children),
testimContent = Array.prototype.slice.call(document.getElementById("testim-content").children),
testimLeftArrow = document.getElementById("left-arrow"),
testimRightArrow = document.getElementById("right-arrow"),
testimSpeed = 9000,
currentSlide = 0,
currentActive = 0,
testimTimer,