Skip to content

Commit

Permalink
New 2.3. version
Browse files Browse the repository at this point in the history
New v2.3 Simplr theme.
  • Loading branch information
cara-tm committed Jan 5, 2019
1 parent 3f9ccd4 commit 321a7f0
Show file tree
Hide file tree
Showing 49 changed files with 492 additions and 602 deletions.
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,23 @@ Features:
The package is provided with this file structure:

dist/
- css/
- fonts/
- Mobile_Detect.php
- white-loader-min.gif
- simplr/
- img/
- Simplr/
- forms/
- pages/
- styles/
- Mobile_Detect.php
- manifest.json

The `fonts` directory need to be uploaded into your root server.

The `Mobile_detect.php` file need to be uploaded into your `/textpattern` folder.
The `fonts` directory need to be uploaded into your `root` server.

The `white-loader-min.gif` file is to be stored into an `img` directory.

Finally, upload the `simplr` directory and all its content into your `/themes` folder available in the root of your server.
The `css` directory and all its content need to be uploaded into your `root` server.

Finally, upload the `Simplr` directory and all its content into your `/themes` folder available in the root of your server.

Note: the custom fonts will not be displayed within some devices neither the javascript "Lightbox" voluntarily to reduce the amount on bytes to serve to small screens.

Expand All @@ -44,7 +45,7 @@ Access to your Textpattern administration interface and activate the `Simplr` th
You will need to create some sections from the Sections panel:

* `default` associated to the `default` page and the `default` styles;
* `blog` associated to the `archive` page and the `default` styles;
* a `blog` or `articles` associated to the `archive` page and the `default` styles;
* `contact` associated to the `static_pages` page and the `default` styles;
* `about` associated to the `static_pages` and the `default` styles;
* `search` associated to the `static_pages` and the `default` styles;
Expand All @@ -55,7 +56,9 @@ You will need to create some sections from the Sections panel:
From the "Override form" option into the "Write" panel, you have some visual choices for your image display:

* `default`: the default with a Lightbox to show individual images into a gallery;
* `default_no_pic`: for articles with no images associated;
* `default_black_white`: change your images into B&W ones (only visible from modern browsers);
* `default_halftone`: change images aspect to haltone;
* `default_saturated`: images gallery displaied with a little bit of colors saturation (only visible from modern browsers);
* `default_no_lightbox`: images gallery but without a "Lightbox";
* `default_no_lightbox_black_white`: B&W images gallery but without a "Lightbox";
Expand All @@ -65,7 +68,7 @@ The Simplr theme has been built to be used “as this: just install it!” witho

- `smd_thumbnail` to generate adapted copies of your images to different screen sizes;
- `com_connect` in order to generate a contact form;
- `pat_speeder` to accelerate the pages display, up to 10%.
- `pat_speeder` to accelerate the pages display, up to 10%/20%.

After installation of these three plugins, check the `static_pages` page template and change the email address instead of the fake one `recipient@example.com` by yours into this line :

Expand All @@ -77,14 +80,16 @@ Check the `footer` form if you want to add a link list of inner pages and set ac

Despite we make the use of "in build" text chains for translations support, you may need to change some. Check:

* `share` form for the main title and the close icon;
* `share` form for the main title;
* `footer` form eventually.

Note: the website footer displays a copyright with dates (e.g. 2018-2019) where the first year corresponds to your website installation date. If you want to change this first year, check the `copyright_date` form and set this line (e.g. `$first = '2014'`):

// This website date creation
$first = get_pref('sql_now_created');

The `contact_form_en` form is a model to display all fields for the Contact page: feel free to copy and translate it.

You can create as many "static pages" as you need! Just check the `sitemap` page template in order to include/exclude the sections you don't want to add into the build in sitemap (available from this URL: http://my-website.com/sitemap).

For better SEO results, you have an in build RSS Sitemap for your Blog (available from this URL: http://my-site.com/sitemap-rss)
Expand All @@ -95,6 +100,10 @@ From the Images panel, create this thumbnail profiles:

![Simplr Textpattern Theme](https://raw.githubusercontent.com/cara-tm/simplr/master/screenshots/profiles.png "smd_thumbnail plugin configuration")

Note: When you upload new images within the Textpattern interface, the `smd_thumbnail` plugin allow you to change any copies. So for your marketing effort on social networks, you can change one for this purpose: this illustration will be never shown into your website but as an image above the website description on social networks. Here is an example:

![Simplr Textpattern Theme](https://raw.githubusercontent.com/cara-tm/simplr/master/screenshots/social-share-sample.png "Social Share result")

### JSON-LD

For your SEO efforts, check the `JSON-LD` form in oder to set your social accounts and remove the sign `/*!` and `*/` (optional):
Expand All @@ -103,16 +112,7 @@ For your SEO efforts, check the `JSON-LD` form in oder to set your social accoun

### CSS file optimisation

Even it is not necessary, you can gain some advantages to externalise the CSS files. Just use your browser dev console and copy/past the "defaut" CSS into a file named `default.min.css`, then upload it into a css directory and change this line into the `doctype` form:

<txp:css format="link" name="default,lightbox_min" />

and replace it by this one:

<link rel="stylesheet" href="<txp:site_url />css/default.min.css" />

Note: for the moment, this theme do not have a specific print css file (will be available later as a separate file).

Even it is not necessary, you can gain some advantages to externalise the CSS files. Just use your browser dev console and copy/past the "defaut" CSS into a file named `default.min.css`, then upload it into a css directory and change the commented lines accordingly into the `doctype` form.

### Favicon

Expand Down
73 changes: 73 additions & 0 deletions dist/Simplr/forms/article/default_halftone.txp
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<txp:if_different>
<txp:variable name="custom_halftone" value="@supports(mix-blend-mode:screen){.halftone{overflow:hidden;position:relative;background:#fff;filter:contrast(25000%);transform:translateZ(0)}.halftone > *{filter:brightness(.5) blur(4px)}.halftone::after{content:'';position:absolute;z-index:1;top:-100%;left:-100%;right:-100%;bottom:-100%;background-blend-mode:multiply;background:radial-gradient(4px 4px,#0ff,#fff),radial-gradient(4px 4px,#f0f,#fff),radial-gradient(4px 4px,#ff0,#fff);background-size:4px 4px;background-position:0 -3px,-2px 0,2px 0;mix-blend-mode:screen;transform:rotate(11.25deg);pointer-events:none}}" />
<txp:variable name="halftone" value="halftone" />
<txp:variable name="device" value="mobile" />
<txp:php>
global $variable;
$variable['full'] = (count(explode(',', custom_field(array('name'=>'article_image')))) > 1 ? '' : ' full');
</txp:php>

<txp:else />
</txp:if_different>

<txp:variable name="id" value='<txp:article_id />' />

<txp:if_article_list>

<txp:if_article_image><txp:php>
// Get the first ID, store it into a TXP variable
global $variable;
$variable['first_pic'] = strtok(custom_field(array('name'=>'article_image')), ',');
</txp:php>
<txp:images form="images" limit="1" id='<txp:variable name="first_pic" />' break="">
<figure class="aspect-ratio">
<a href="<txp:permlink />/" title="<txp:text item="read_more" />">
<picture<txp:if_plugin name="smd_thumbnail"><txp:smd_if_thumbnail type="w_tiny27"> class="halftone" style="background:url(),url(<txp:smd_thumbnail type='w_tiny27' display='url' id='<txp:image_info type="id" />' />) center center no-repeat;background-size:100% 100%;</txp:smd_if_thumbnail></txp:if_plugin>min-height:150px;min-height:44vw">
<txp:if_plugin name="smd_thumbnail">
<img src="<txp:smd_thumbnail type='w_320' display='url' id='<txp:image_info type="id" />' form="img_sizes" />" srcset="<txp:smd_thumbnail type='w_320' id='<txp:image_info type="id" />' form="img_srcset" />, <txp:smd_thumbnail type='w_980' id='<txp:image_info type="id" />' form="img_srcset" />, <txp:smd_thumbnail type='w_1280' id='<txp:image_info type="id" />' form="img_srcset" />" sizes="(min-width: 1200px) 1140px, (min-width: 992px) 940px, (min-width: 768px) 720px, calc(100vw - 20px)" alt="<txp:image_info type='alt' />" />
<txp:else />
<img src="<txp:image_url link='0' />" width="<txp:image_info type="w" />" height="<txp:image_info type="h" />" alt="<txp:image_info type='alt' />" lazyload="on" class="no-select" />
</txp:if_plugin>
</picture>
</a>
<figcaption>
<txp:output_form form="image_count" /> <txp:image_info escape="" />
</figcaption>
</figure>
</txp:images>
<txp:else />
<txp:variable name="device" value="mobile" />
</txp:if_article_image>

<txp:output_form form="article_metas" />

<div class="excerpt">
<txp:if_excerpt>
<txp:excerpt />
<txp:else />
<p><txp:output_form form="shrink_text" /></p>
</txp:if_excerpt>
<span class="more"><a href="<txp:permlink />/"><txp:text item="continue_reading" />&thinsp;&rarr;</a></span>
<txp:if_last_article><txp:else /><hr class="bg-gray" /></txp:if_last_article>
</div>

<txp:else />

<txp:if_article_image><div class="gallery lightbox-gallery">
<txp:output_form form="no_lightbox_images" />
</div>
<txp:else />
<variable name="device" value="mobile" />
</txp:if_article_image>
<txp:output_form form="article_metas" />

<div class="row mb3">
<txp:body />
</div>

<txp:output_form form="post_pager" />


<txp:output_form form="comments_display" />

</txp:if_article_list>
29 changes: 29 additions & 0 deletions dist/Simplr/forms/article/default_no_pic.txp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<txp:if_article_list>

<txp:output_form form="article_metas" />

<div class="excerpt">
<txp:if_excerpt>
<txp:excerpt />
<txp:else />
<p><txp:output_form form="shrink_text" /></p>
</txp:if_excerpt>
<span class="more"><a href="<txp:permlink />/"><txp:text item="continue_reading" />&thinsp;&rarr;</a></span>
<txp:if_last_article><txp:else /><hr class="bg-gray" /></txp:if_last_article>
</div>

<txp:else />


<txp:output_form form="article_metas" />

<div class="row mb3">
<txp:body />
</div>

<txp:output_form form="post_pager" />


<txp:output_form form="comments_display" />

</txp:if_article_list>
9 changes: 9 additions & 0 deletions dist/Simplr/forms/misc/global.js.txp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*! Simple animated 'Go to Top' scroll by cara-tm.com, https://github.com/cara-tm/GoTop - MIT license. */
;(function GoTop(){"use strict";var link="gotop",D=document,_dis=Math.max(D.body.scrollHeight,D.documentElement.scrollHeight,D.body.offsetHeight,D.documentElement.offsetHeight,D.body.clientHeight,D.documentElement.clientHeight,D.body.scrollHeight),_el=document.getElementById(link);_el.className=0?"visible":"";"undefined"!=typeof _el&&null!=_el&&(window.onscroll=function(){if(1==true){_el.className=(window.pageYOffset||D.documentElement.scrollTop)+window.innerHeight>=750+0+48?"visible":"";}else{_el.className=(window.pageYOffset||D.documentElement.scrollTop)>=_dis-750-48+0?"visible":"";}},_el.onclick=function(){function a(){h=new Date().getTime()-m,b>h&&(c.scrollTop=n-n*(1-Math.cos(h/b*Math.PI))/1,e=setTimeout(function(){a()},0));}var b=500,c="BackCompat"==D.compatMode?D.body:D.documentElement;0===c.scrollTop&&(c=D.body);var e,h,i=c.scrollTop,m=new Date().getTime(),n=i;return clearTimeout(e),a(),!1;});{var _rs=_dis+48-750-0;console.log("GoTop: "+(750+48)+"px")}})();/*! External links */function targetBlank(){var b=location.host.replace("www.","");b=new RegExp(b,"i");for(var e,c=document.getElementsByTagName("a"),d=0;d<c.length;d++)e=c[d].host,b.test(e)||c[d].setAttribute("target","_blank")}targetBlank();<txp:if_variable name="device" value="mobile"><txp:else />/*! Simple tooltips by cara-tm.com, MIT license. https://github.com/cara-tm/simple-tooltips */;(function(a){'use strict';if(document.querySelectorAll&Math.max(document.documentElement.clientWidth,document.body.innerWidth||0)||680<=document.body.clientWidth){document.querySelector('html').classList.add('tooltips');for(var a=document.querySelectorAll('.tooltip'),b=0;b<a.length;b++){var c=a[b].getAttribute('title');c!=null?(a[b].setAttribute('data-tooltip',c),a[b].setAttribute('aria-haspopup','true'),a[b].setAttribute('role','link'),a[b].removeAttribute('title')):''}}})();
<txp:if_section name=""><txp:else />/*! Lightbox JS: Fullsize Image Overlays - CCA 2.5 License, by Lokesh Dhakar - http://www.huddletogether.com - Adaptations by cara-tm.com */var loadingImage='<txp:site_url />img/white-loader-min.gif',close_tooltip="Close",close_string="press <span>x</span> key to close",page_url="<txp:section url="1" />";function getPageScroll(){var a;return self.pageYOffset?a=self.pageYOffset:document.documentElement&&document.documentElement.scrollTop?a=document.documentElement.scrollTop:document.body&&(a=document.body.scrollTop),arrayPageScroll=['',a],arrayPageScroll}function getPageSize(){var a,b;window.innerHeight&&window.scrollMaxY?(a=document.body.scrollWidth,b=window.innerHeight+window.scrollMaxY):document.body.scrollHeight>document.body.offsetHeight?(a=document.body.scrollWidth,b=document.body.scrollHeight):(a=document.body.offsetWidth,b=document.body.offsetHeight);var c,d;return self.innerHeight?(c=self.innerWidth,d=self.innerHeight):document.documentElement&&document.documentElement.clientHeight?(c=document.documentElement.clientWidth,d=document.documentElement.clientHeight):document.body&&(c=document.body.clientWidth,d=document.body.clientHeight),pageHeight=b<d?d:b,pageWidth=a<c?c:a,arrayPageSize=[pageWidth,pageHeight,c,d],arrayPageSize}function pause(a){for(var b=new Date,c=b.getTime()+a;;)if(b=new Date,b.getTime()>c)return}function getKey(a){keycode=null==a?event.keyCode:a.which,key=String.fromCharCode(keycode).toLowerCase(),'x'==key&&hideLightbox()}function listenKey(){document.onkeypress=getKey}function showLightbox(a){var b=document.getElementById('overlay'),c=document.getElementById('lightbox'),d=document.getElementById('lightboxCaption'),f=document.getElementById('lightboxImage'),g=document.getElementById('loadingImage'),h=document.getElementById('lightboxDetails'),j=getPageSize(),k=getPageScroll();g&&(g.style.top=k[1]+(j[3]-35-g.height)/2+'px',g.style.left=(j[0]-20-g.width)/2+'px',g.style.display='block'),b.style.height=j[1]+'px',b.style.display='block',imgPreload=new Image,imgPreload.onload=function(){f.src=a.href;var l=k[1]+(j[3]-35-imgPreload.height)/2,m=(j[0]-20-imgPreload.width)/2,n=m;for(c.style.top=0>l?'0px':l+'px',c.style.left=0>m?'0px':m+'px',c.style.right=0>n?'0px':n+'px',a.getAttribute('data-title')?(d.style.display='block',d.innerHTML=a.getAttribute('data-title')):d.style.display='none',-1!=navigator.appVersion.indexOf('MSIE')&&pause(250),g&&(g.style.display='none'),selects=document.getElementsByTagName('select'),i=0;i!=selects.length;i++)selects[i].style.visibility='hidden';return c.style.display='block',j=getPageSize(),b.style.height=j[1]+'px',listenKey(),!1},imgPreload.src=a.href}function removeClass(a,b){var c=new RegExp('(\\s|^)'+b+'(\\s|$)');a.className=a.className.replace(c,' ')}function hideLightbox(){for(objOverlay=document.getElementById('overlay'),objLightbox=document.getElementById('lightbox'),objOverlay.style.display='none',objLightbox.style.display='none',selects=document.getElementsByTagName('select'),i=0;i!=selects.length;i++)selects[i].style.visibility='visible';document.onkeypress='';removeClass(document.getElementsByTagName('html')[0],'lightboxOn')}function initLightbox(){if(document.getElementsByTagName){for(var c,a=document.getElementsByTagName('a'),b=0;b<a.length;b++)c=a[b],c.getAttribute('href')&&'lightbox'==c.getAttribute('data-box')&&(c.onclick=function(){document.getElementsByTagName('html')[0].className+=' lightboxOn';return showLightbox(this),!1});var d=document.getElementsByTagName('body').item(0),f=document.createElement('div');f.setAttribute('id','overlay'),f.onclick=function(){return hideLightbox(),!1},f.style.display='none',f.style.position='absolute',f.style.top='0',f.style.left='0',f.style.zIndex='90',f.style.width='100%',d.insertBefore(f,d.firstChild);var g=getPageSize(),h=getPageScroll(),j=new Image;j.onload=function(){var r=document.createElement('a');r.setAttribute('href','#'),r.onclick=function(){return hideLightbox(),!1},f.appendChild(r);var s=document.createElement('img');return s.src=loadingImage,s.setAttribute('id','loadingImage'),s.style.position='absolute',s.style.zIndex='150',r.appendChild(s),j.onload=function(){},!1},j.src=loadingImage;var k=document.createElement('div');k.setAttribute('id','lightbox'),k.style.display='none',k.style.position='absolute',k.style.position='absolute',k.style.zIndex='100',d.insertBefore(k,f.nextSibling);var l=document.createElement('a'),r=document.createElement('span');l.setAttribute('href','#'),l.setAttribute('title',close_tooltip),r.innerHTML='×',r.setAttribute('id','closeButton'),l.appendChild(r);l.onclick=function(){return hideLightbox(),!1},k.appendChild(l);var n=document.createElement('img');n.setAttribute('id','lightboxImage'),l.appendChild(n);var o=document.createElement('div');o.setAttribute('id','lightboxDetails'),k.appendChild(o);var p=document.createElement('div');p.setAttribute('id','lightboxCaption'),p.style.display='none',o.appendChild(p);var q=document.createElement('div');q.setAttribute('id','keyboardMsg'),q.innerHTML=close_string,o.appendChild(q)}}function addLoadEvent(a){var b=window.onload;window.onload='function'==typeof window.onload?function(){b(),a()}:a}addLoadEvent(initLightbox);</txp:if_section>/*! Simple Scrollbar v0.1.0 - https://github.com/buzinas/simple-scrollbar - MIT license */
(function(n,t){function u(n){n.hasOwnProperty("data-simple-scrollbar")||Object.defineProperty(n,"data-simple-scrollbar",new SimpleScrollbar(n))}function e(n,i){function f(n){var t=n.pageY-u;u=n.pageY;r(function(){i.el.scrollTop+=t/i.scrollRatio})}function e(){n.classList.remove("ss-grabbed");t.body.classList.remove("ss-grabbed");t.removeEventListener("mousemove",f);t.removeEventListener("mouseup",e)}var u;n.addEventListener("mousedown",function(i){return u=i.pageY,n.classList.add("ss-grabbed"),t.body.classList.add("ss-grabbed"),t.addEventListener("mousemove",f),t.addEventListener("mouseup",e),!1})}function i(n){for(this.target=n,this.bar='<div class="ss-scroll">',this.wrapper=t.createElement("div"),this.wrapper.setAttribute("class","ss-wrapper"),this.el=t.createElement("div"),this.el.setAttribute("class","ss-content"),this.wrapper.appendChild(this.el);this.target.firstChild;)this.el.appendChild(this.target.firstChild);this.target.appendChild(this.wrapper);this.target.insertAdjacentHTML("beforeend",this.bar);this.bar=this.target.lastChild;e(this.bar,this);this.moveBar();this.el.addEventListener("scroll",this.moveBar.bind(this));this.el.addEventListener("mouseenter",this.moveBar.bind(this));this.target.classList.add("ss-container")}function f(){for(var i=t.querySelectorAll("*[ss-container]"),n=0;n<i.length;n++)u(i[n])}var r=n.requestAnimationFrame||n.setImmediate||function(n){return setTimeout(n,0)};i.prototype={moveBar:function(){var t=this.el.scrollHeight,i=this.el.clientHeight,n=this;this.scrollRatio=i/t;r(function(){n.bar.style.cssText="height:"+i/t*100+"%; top:"+n.el.scrollTop/t*100+"%;right:-"+(n.target.clientWidth-n.bar.clientWidth-20)+"px;"})}};t.addEventListener("DOMContentLoaded",f);i.initEl=u;i.initAll=f;n.SimpleScrollbar=i})(window,document);<txp:php>
// Init: Do not load Simple Scrollbar for ltr languages
if(text(array('item'=>'lang_dir'))=='ltr'){
echo "var bar=document.querySelector('.aside');SimpleScrollbar.initEl(bar);";
}
</txp:php></txp:if_variable>
Loading

0 comments on commit 321a7f0

Please sign in to comment.