diff --git a/theme-source/partials/base-body.tsx b/theme-source/partials/base-body.tsx index d5a58c8de7ecb63595500acd0eae3240a5e07127..a08aab7d722c361d790851baa84e686a03bf3e95 100644 --- a/theme-source/partials/base-body.tsx +++ b/theme-source/partials/base-body.tsx @@ -1,7 +1,6 @@ import React, { PropsWithChildren } from 'react' import { css } from '@emotion/react' import { SymbolSearch, SymbolMenu, SymbolFacebook } from './svgs' -import { Search } from './search' function hideOnAndUp(px: number) { return css` @@ -353,7 +352,6 @@ export function BaseBody({ </ul> </div> </nav> - <Search /> {children} diff --git a/theme-source/partials/html.js b/theme-source/partials/html.js index 0a452eef481e023f1586d5fa03edf863c5a1a7c6..4d3f0a7d3f71a46e782f94e0b24ed29bf611a1c5 100644 --- a/theme-source/partials/html.js +++ b/theme-source/partials/html.js @@ -1,6 +1,5 @@ import React from 'react' -import { SymbolSearch, SymbolMenu, SymbolFacebook } from './svgs' -import { Search } from './search' +import { SymbolMenu, SymbolFacebook } from './svgs' export function Html({ prehead = null, diff --git a/theme-source/partials/search.js b/theme-source/partials/search.js deleted file mode 100644 index af7c8273c6348de3ffe0a6357b8a0379085c5607..0000000000000000000000000000000000000000 --- a/theme-source/partials/search.js +++ /dev/null @@ -1,170 +0,0 @@ -import React from 'react' -import { SymbolClose } from './svgs' - -export function Search() { - return ( - <> - <div className="hidden" id="search" style={{ display: 'none' }}> - <div> - <div> - <div> - <div style={{ backgroundColor: 'white' }}> - <div id="searchbox" style={{ padding: '0 60px 0 10px' }}> - <form> - <input - style={{ - padding: '0 60px 0 10px', - margin: '0 -10px', - width: '100%', - }} - placeholder="Vyhledávejte psanĂm..." - /> - </form> - <div - style={{ - cursor: 'pointer', - right: 0, - position: 'absolute', - top: 0, - width: 50, - height: 50, - lineHeight: 50, - }} - className="close-search" - > - <div - style={{ - height: '2em', - margin: 'auto 0', - position: 'relative', - top: '50%', - marginTop: '-1em', - }} - > - <SymbolClose color="gray" size="2em" /> - </div> - </div> - </div> - <div id="searchresults"></div> - </div> - </div> - </div> - </div> - </div> - <div id="search-overlay" style={{ display: 'none' }}></div> - <script - dangerouslySetInnerHTML={{ - __html: ` - function debounce(func, wait, immediate) { - var timeout; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - if (!immediate) func.apply(context, args); - }; - var callNow = immediate && !timeout; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - if (callNow) func.apply(context, args); - }; - }; - - var csc; - - var myCallback = function() { - var doRender = function() { - var options = {}; - options[google.search.Search.RESTRICT_EXTENDED_ARGS] = { - 'as_sitesearch': 'ok1kvk.cz' - }; - - csc = new google.search.CustomSearchControl('003089460452505374651:q5prtsadbio', options); - csc.setLinkTarget (google.search.Search.LINK_TARGET_SELF); - - var drawOptions = new google.search.DrawOptions(); - drawOptions.enableSearchResultsOnly(); - csc.draw("searchresults", drawOptions); - - var s = $("#searchbox input").val() - if(s != "") - csc.execute(s); - } - if (document.readyState == 'complete') { - doRender(); - } else { - google.setOnLoadCallback(doRender, true); - } - }; - - window.__gcse = { - parsetags: 'explicit', - callback: myCallback - }; - - (function() { - var cx = '003089460452505374651:q5prtsadbio'; - var gcse = document.createElement('script'); gcse.type = 'text/javascript'; - gcse.async = true; - gcse.src = 'https://cse.google.com/cse.js?cx=' + cx; - var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(gcse, s); - })(); - - $("#searchbox form").submit(function(e) { - e.preventDefault(); - }); - - $("#searchbox form").on("input", debounce(function(e) { - var s = $("#searchbox input").val() - if(s == "") { - $("#searchresults").html(""); - myCallback(); - } else - csc.execute(s); - },250)); - - (function() { - var searchHeight = $('#search').height(); - var adjustHeight = function() { - var newh = $('#search').height(); - if(newh != searchHeight) { - searchHeight = newh; - $("#all").height("auto"); - if(!$("#search").hasClass("hidden") && $("#all").height() < searchHeight+20+194) { - $("#all").height(searchHeight+20+194); - } - } - } - // Resize page on searching - $("#search > div").bind('DOMSubtreeModified', adjustHeight); - - // Search showing - $(".search-icon").on("click", function() { - $("#search").show(); - setTimeout(function() { - $("#search").removeClass("hidden"); - $("body").append(''); - $("#search-overlay").show().addClass("shown"); - adjustHeight(); - setTimeout(function() { - $("#searchbox input").focus(); - }, 320); - },0); - }); - - // Search hiding on search overlay click - $("#search-overlay, .close-search").click(function() { - $("#search-overlay").removeClass("shown"); - $("#search").addClass("hidden"); - setTimeout(function() { - adjustHeight(); - $("#search").hide(); - },320); - }); - })(); - `, - }} - /> - </> - ) -} diff --git a/theme-source/templates/tag.tsx b/theme-source/templates/tag.tsx index 0ae13c464988d34ca152242a53f6968beefebe52..18d7c07cd66d999407a631dcdd1885c59cc33424 100644 --- a/theme-source/templates/tag.tsx +++ b/theme-source/templates/tag.tsx @@ -287,10 +287,6 @@ function TagGlobalStyles() { border-radius: 2px; } - .left { - float: left !important; - } - .right { float: right !important; } @@ -358,20 +354,6 @@ function TagGlobalStyles() { height: 100%; } - nav .brand-logo { - position: absolute; - color: #fff; - display: inline-block; - font-size: 2.1rem; - padding: 0; - white-space: nowrap; - } - @media only screen and (max-width: 992px) { - nav .brand-logo { - left: 50%; - transform: translateX(-50%); - } - } nav ul { margin: 0; } @@ -513,54 +495,6 @@ function TagGlobalStyles() { background-color: #e4e4e4; } - /*************************** - Text Inputs + Textarea - ****************************/ - ::-webkit-input-placeholder { - color: #d1d1d1; - } - - :-moz-placeholder { - /* Firefox 18- */ - color: #d1d1d1; - } - - ::-moz-placeholder { - /* Firefox 19+ */ - color: #d1d1d1; - } - - :-ms-input-placeholder { - color: #d1d1d1; - } - - input:not([type]), - input[type='text'], - input[type='password'], - input[type='email'], - input[type='url'], - input[type='time'], - input[type='date'], - input[type='datetime-local'], - input[type='tel'], - input[type='number'], - input[type='search'], - textarea.materialize-textarea { - background-color: transparent; - border: none; - border-bottom: 1px solid #9e9e9e; - border-radius: 0; - outline: none; - height: 3rem; - width: 100%; - font-size: 1rem; - margin: 0 0 15px 0; - padding: 0; - box-shadow: none; - box-sizing: content-box; - transition: all 0.3s; - } - .hiddendiv { display: none; white-space: pre-wrap; @@ -604,14 +538,6 @@ function TagGlobalStyles() { padding: 0 15px; } - .drag-target { - height: 100%; - width: 10px; - position: fixed; - top: 0; - z-index: 998; - } - #sidenav-overlay { position: fixed; top: 0; @@ -713,53 +639,11 @@ function TagGlobalStyles() { line-height: 40px; } - .toplinks > a, - .menu-icon { - display: block; - padding: 0 15px; - line-height: 64px; - cursor: pointer; - } - - .toplinks > a:hover, - .menu-icon:hover { - background-color: rgba(0, 0, 0, 0.1); - } - - .toplinks { - z-index: 3; - position: absolute; - right: 0; - } - .breadcrumb, .breadcrumb:last-child { color: rgba(0, 0, 0, 0.7); } - .search-icon svg, - .menu-icon svg { - height: 64px; - width: 30px; - } - - .search-icon, - .menu-icon { - height: 64px; - } - - @media only screen and (max-width: 600px) { - .search-icon svg, - .menu-icon svg { - height: 56px; - } - .toplinks > a, - .search-icon, - .menu-icon { - height: 56px; - } - } - /* Bottom nav */ .pagination li { padding: 0px;