trang mạng:Bảng màu cho thiết kế và họa sĩ - Hunt màuNội dung
ColorHunt-ColorPalettesforDesignersandArtistswindow.dataLayer=window.dataLayer||[];functiongt(){dataLayer.push(arguments);}gt('js',newDate());gt('config','G-P464R9CGC0');functiongetFeed(){ $.ajax({type:'POST',url:'/php/feed.php',dataType:"html",data:{ step:step, sort:$('.left.tab[status=on]').attr('tab'), ts:ts, timeframe:$('.timeframe[status=on]').attr('timeframe') },success:function(data){ itemIndex=0; JSON.parse(data).forEach(function(itemData){ placeItem('feed',itemData['code'],formatThousands(itemData['likes']),itemData['date']) }); $('.loader').hide(); if($('.feed.item').not('.hide').length==0){ $('.noResultsPe').show(); $('.right.meta').hide(); } carbonAd(); if(!bannerInFeed){ placeBannerInFeed() } } });}functiongetLikes(){ myCollection=[]; if(localStore.getItem("myCollection")!=null&&localStore.getItem("myCollection")!=""){ myCollection=localStore.getItem("myCollection").split(","); } itemIndex=0; myCollection.forEach(function(code){ placeItem('likesList',code); $('.right.likes').show(); });}functiBảng màu cho thiết kế và họa sĩ - Hunt màuonplaceItem(place,code,likes,date){ item=$('.main.item.hide').clone().removeClass('hide') .attr('data-index',itemIndex).attr('data-code',code) .css('animation-delay',itemIndex*30+"ms"); paintPalette(item,code); item.find('.palettea').attr('href','/palette/'+code); item.find('.palettea').attr('aria-label','Palette'+code) item.find('.like').attr('onclick','like("'+code+'")'); if(myCollection.indexOf(code)!=-1){ item.find('.like').attr('status','on'); } item.find('.likespan').text(likes); item.find('.date').text(date); if(place=="likesList"){ item=item.find('.palette').attr('data-code',code); item.find('span').remove(); item.append('✕'); $('.likesList').prepend(item); }else{ item.appendTo('.'+place); } itemIndex++;}functionpaintPalette(obj,code){ i=0;while(i=$("body").height()-300){ step++; getFeed(); oktoload="no"; setTimeout(function(){oktoload="yes"},500); } }); $(window).click(function(event){ if(!$(event.target).closest(".filterContainer").length){ $('.filterWindow').addClass('hidden'); } if(!$(event.target).closest(".kebab").length){ $('.littleMenu').addClass('hidden'); $('.kebab').attr('status','off'); } }); $('.tab').click(function(){ $('.tab').attr('status','off') $(this).attr('status','on') $('.timeframe').hide(); if($(this).attr('tab')=='popular'){ $('.timeframe').css('display','flex'); } }); $('a').click(function(){ $('.loader').show(); setTimeouBảng màu cho thiết kế và họa sĩ - Hunt màut(function(){ $('.loader').hide(); },2000) }); $('.filterContainerinput').keydown(function(e){ if(e.keyCode==13&&query!=""){ gt('event',query,{'event_category':'search_query'}); if($('.filterWindow.button.t').length>0){ $('.filterWindow.button.t').eq(0).click() }else{ tString=$('.filterContainerinput').val().replace('and','-').replace('','-') tArray=tString.split('-') for(wordintArray){ if($('.button.t[t='+tArray[word]+']').length==0){ deletetArray[word] } } tString=tArray.filter(value=>JSON.stringify(value)!=='{}').join('-') window.location='/palettes/'+tString } } if(e.keyCode==8&&query==""){ $('.inputContainer.t').last().click(); } }); $('.filterContainerinput').focus(function(e){ showTs(); $('.filterWindow').removeClass('hidden'); }); $('.kebab').click(function(e){ if($('.littleMenu.hidden').length==1){ $('.kebab').attr('status','on'); $('.littleMenu').removeClass('hidden'); }else{ $('.kebab').attr('status','off'); $('.littleMenu').addClass('hidden'); } }); if('serviceWorker'innigator){ nigator.serviceWorker.register('/service-worker.js',{ scope:'.'// @mediaonlyscreenand(min-width:0px)and(min-height:0px){ div[id^="bsa-zone_69-3_"]{ min-width:300px; min-height:250px; } } functionshowTs(){ $('.filterWindow.section').hide(); $('.filterWindow.button').remove(); query=$('.filterContainerinput').val().toLowerCase(); $('.tBank.button').each(function(){ t=$(this).attr('t'); type=$(this).attr('type'); if(!type){type="collection";} alt=$(this).attr('alt').split(""); if(t.substring(0,query.length)==query){ $('.filterWindow.'+type).append($(this).clone()).show(); } if(alt.includes(query)){ $('.filterWindow.related').append($(this).clone()).show(); } });}functiontoggleT(t){ if($(t).attr('status')!='on'){ applyT($(t).attr('t')); }else{ $('[t='+$(t).attr('t')+']').Bảng màu cho thiết kế và họa sĩ - Hunt màuattr('status','off'); $('.inputContainer[t='+$(t).attr('t')+']').remove(); } tString=""; $('.inputContainer.t[status=on]').each(function(){ tString=tString+"-"+$(this).attr('t'); }); tString=tString.substring(1); if(filterRedirect==true){ $('.loader').show(); window.location.href='/palettes/'+tString; }}functionapplyT(t){ $('[t='+t+']').attr('status','on'); $('.tBank[t='+t+']').clone().insertBefore($('.inputContainerinput')); $('.filterContainerinput').addClass('filled'); $('.filterContainerinput').val(''); $('.filterContainerinput').attr('placeholder','Addt');}functionchangeTimeframe(obj){ $('.timeframe.button').attr('status','off') $(obj).attr('status','on') $('.loader').show(); $('.feed.item').not('.hide').fadeOut(100); step=0; oktoload="yes"; getFeed();}functioncopy(obj,url){ input=document.createElement('input'); if(url){ input.setAttribute('value',document.URL); }else{ input.setAttribute('value',$(obj).attr('data-copy').replace('#','')); } document.body.appendChild(input); input.select(); result=document.execCommand('copy'); document.body.removeChild(input) setTimeout(function(){$('.copied').remove();},1000); $(obj).append("Copied");}functionformatThousands(n,dp){vars=''+(Math.floor(n)),d=n%1,i=s.length,r='';while((i-=3)>0){r=','+s.substr(i,3)+r;}returns.substr(0,i+3)+r+(d?'.'+Math.round(d*Math.pow(10,dp||2)):'');}functionlike(code){ if(myCollection.indexOf(code)==-1){ myCollection.push(code); $('.item[data-code='+code+'].like').attr('status','on'); $.post("/php/like.php",{code:code},function(data){}); curlikes=$('.item[data-code='+code+']:last').find('.likespan').text().replace(',',''); curlikes++; curlikes=formatThousands(curlikes); $('.item[data-code='+code+']').find('.likespan').text(curlikes); placeItem('likesList',code); $('.right.likes').show(); if($('#like_tip').length>0){ $('#like_tip').remove(); } $('.likes').append("Sed!"); $('.tongue').addClass('animate'); setTimeout(function(){$('.tongue').removeClass('animate');},800) }else{ myCollection.splice(myCollection.indexOf(code),1); $('.item[data-code='+code+'].like').attr('status','off'); $('.likes.palette[data-code='+code+']').remove(); varcurlikes=$('.item[data-code='+code+']:last').find('.likespan').text().replace(',',''); curlikes--; curlikes=formatThousands(curlikes); $('.item[data-code='+code+']').find('.likespan').text(curlikes); } localStore.setItem('myCollection',myCollection);}functioncarbonAd(){ if(carbonRendered==true){return} carbonRendered=true; script=document.createElement('script'); script.onload=function(){ if(typeof_bsa!=='undefined'&&_bsa){ _bsa.init('custom','CK7DCK7E','placement:colorhuntco', { target:'#sponsor-banner', carbonfallback:'CKYIP27I', disable_css:true, template:` ##description## adsviaBuySellAds ` },optimize());//CALLINGTHEFALLBACKAD _bsa.init('custom','CWYDV53E','placement:colorhuntco-badgebanner', { target:'#badge-js', template:` .bsa__##external_id##{ background-ime:linear-gradient( 145deg, ##backgroundColor##, 90%, ##backgroundColor##80 ), linear-gradient(##textColor##1px,transparent0), linear-gradient( 90deg, ##textColor##1px, transparent0 ); background-color:##backgroundColor##; } ##company##—##tline## ##description## ##callToAction## AdsviaBuySellAds ` }); } }; script.src="//m.servedby-buysellads.com/monetization.js"; document.head.appendChild(script);}functionoptimize(){ setTimeout(function(){ loadOptimize=false if($('#sponsor-banner').html().length>300){ $('#bsa-zone_69-3_').remove() }else{ loadOptimize=true } if(single!=''||pe=='collection'){ if($('#badge-js').html().length>300){ $('#bsa-zone_49-4_').remove() }else{ loadOptimize=true } } if(loadOptimize==true){ console.log('LoadingOptimize') varbsa_optimize=document.createElement('script'); bsa_optimize.type='text/jascript'; bsa_optimize.async=true; bsa_optimize.src='cdn4.buysellads.net/pub/colorhunt.js?'+(newDate()-newDate()%); (document.getElementsByTName('head')[0]||document.getElementsByTName('body')[0]).appendChild(bsa_optimize); } },1500)}