-
Notifications
You must be signed in to change notification settings - Fork 534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WAI-ARIA Landmark Roles #32
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Had considered implementing the WAI-ARIA roles but never got round to it, very nice thank you! |
aanduque
added a commit
to aanduque/blocks-theme
that referenced
this pull request
Jul 15, 2021
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..646ac51 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +node_modules/ diff --git a/404.php b/404.php new file mode 100644 index 0000000..44b6f10 --- /dev/null +++ b/404.php @@ -0,0 +1,24 @@ +<?php get_header(); ?> + + <main role="main"> + <!-- section --> + <section> + + <!-- article --> + <article id="post-404"> + + <h1><?php _e( 'Page not found', 'html5blank' ); ?></h1> + <h2> + <a href="<?php echo home_url(); ?>"><?php _e( 'Return home?', 'html5blank' ); ?></a> + </h2> + + </article> + <!-- /article --> + + </section> + <!-- /section --> + </main> + +<?php get_sidebar(); ?> + +<?php get_footer(); ?> diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..541c3ca --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,258 @@ +### [HTML5 Blank](http://html5blank.com) Changelog + +## 1.4.3 (02 December, 2013) + +* Update [conditionizr](http://conditionizr.com) to version 4.0.0 +* Update jQuery to v1.10.2 +* Update Google Analytics snippet to _new_ universal snippet +* Improved SVG script +* Removed empty conditionizr asset directories for `js` and `css` +* Remove redundant Modernizr file, loading from CDN + +## 1.4.2 (15 June, 2013) + +* Add _font-size:62.5%;_ to the HTML element in CSS for _rem_ (relative-ems) sizing +* Update jQuery 1.9.1 to 1.10.1 + +## 1.4.1 (26 April, 2013) + +* Removed protocol-relative scripts/styles function as causes some disruption on some local development environments +* Removed hard-coded jQuery from footer as was causing issues with plugins that relied on jQuery being enqueued +* Removed jQuery CDN fallback, jQuery 1.9.1 and theme scripts will be enqueued in the <head> from now on to avoid conflicts with WordPress jQuery checks/detects + +## 1.4.0 (09 April, 2013) + +* Move pagination into it's own file (pagination.php) and include in necessary template files +* Enhanced clearfix in CSS to micro clearfix hack (works by using parent element for clear) +* Change all HTML structural comments to lower case for cleaner look +* Add apple-touch-icon-precomposed to <head> +* Moved favicon.ico to 'img/icons' +* Moved new apple touch icon to 'img/icons' +* Remove Conditionizr default <head> setup and add config URL (cleaner code from install) please see [conditionizr](http://conditionizr.com/docs.html) for configuration +* Reordered some meta, links in <head> for better readability/consistency +* Add a few structural (but empty) classes into CSS for fast styling upon install +* Few CSS comments added to label areas/components better + +## 1.3.9 (07 April, 2013) + +* Added WAI-ARIA landmark roles to enrich semantics and improve accessibility. [Stacey Cordoni](https://github.com/staceycordoni) [#32](https://github.com/toddmotto/html5blank/pull/32) +* Added WAI-ARIA 'role=button' to search form <button> +* Upgrade search input type from 'type=text' to 'type=search' for better use of HTML5 alongside WAI-ARIA + +## 1.3.8 (02 April, 2013) + +* Load Modernizr from CloudFlare CDN (same as Conditionizr) +* Load only Conditionizr and Modernizr through the <head>, with Conditionizr call too. +* Load jQuery CDN (Google) in footer, with jQuery CDN fallback (CloudFlare) +* Separated WordPress script enqueue to load Conditionizr, Modernizr in head: 'function html5blank_header_scripts()' +* Hard-coded jQuery and CDN fallback into footer.php above custom theme scripts, more reliable fallback method +* Load custom theme scripts in footer: 'function html5blank_footer_scripts()' +* Loading scripts before closing </body> tag is best practice and not seen often in WordPress sites +* Lowercase <!doctype html> in header.php +* Remove empty line at end of functions.php + +## 1.3.7 (01 April, 2013) + +* Added Portuguese (Brazil) language translation file to /languages/ from [Wesllei Henrique](https://github.com/wesllei) + +## 1.3.6 (30 March, 2013) + +* Protocol relative jQuery and Conditionizr URLs +* Protocol relative URLs for all enqueued scripts and styles +* Added French language translation file to /languages/ from [Kevin Plattret](https://twitter.com/kevinplattret) +* Fixed search form bug by adding name="s" attribute +* Neater comments for headings in functions.php (same as style.css) +* Add date ordered contributors to ReadMe. + +## 1.3.5 (26 March, 2013) + +* Update jQuery CDN to use $_SERVER['SERVER_PORT'] to server HTTPS if needed +* Edit Google Analytics string to cater for SSL/HTTPS (footer.php) +* Added Spanish language translation file to /languages/ from Carlos Pinar +* Indent <head> and <body> elements for better code readability +* Add X-UA-Compatible meta tag to <head> to force Chrome Frame/latest document mode in IE (edge) +* Format the <head> by grouping similar elements +* Enhance footer.php indentation +* Change footer.php fallback text +* Removed HTML comments from comments.php and changed ID to class +* Improve Conditionizr formatting in header.php +* Set Conditionizr scripts/styles to _false_ by default (classes true) +* Change pagination ID to class for better CSS +* Improve indentation in 404.php for child element +* Update screenshot.png +* Update default HTML5 Blank logo and gravatar + +## 1.3.4 (22 March, 2013) + +* Update Conditionizr to version 2.2.0 +* Replaced <aside> id with a class for better CSS +* Better naming conventions for search form, more class focused +* Removed JavaScript onfocus/onblur events in search input +* Replaced onfocus/onblur events with HTML5 placeholder for 'Search' (this is fine for non-supporting browsers as the search button indicates it's a search input) +* Search <input> has been replaced to a <button> for more flexibility, allows HTML content +* Removed font-smoothing from Opera and Mozilla as no longer supported + +## 1.3.3 (03 March, 2013) + +* Hook up Conditionizr to theme Directory using WordPress theme URI hooks + +## 1.3.2 (22 February, 2013) + +* Optimise body CSS declaration to shorthand +* Remove inner wrapper inside header element, wrapper now wraps all content +* Added header and footer classes to elements to encourage class styling over element declaration (i.e. header {} always use .header {} class etc.) + +## 1.3.1 (13 February, 2013) + +* Restructured CSS file, better architecture +* Focused CSS document on a more OOCSS approach (part of restructure) +* Split CSS into; Main, Structure, Pages, Images, Typography, Responsive, Misc, Print +* Moved away from single-line CSS formatting to multiple-line formatting for clearer code +* CSS indentation formatting, new lines for shared selectors +* Update jQuery to version 1.9.1, Google CDN and CloudFlare CDN +* Update Conditionizr to CDNJS CloudFlare v2.1.1 +* Removed mediaqueries.min.js, do we really need older browsers to be responsive, HTML5Shiv (built-in Modernizr) is enough +* Updated scripts.js to ride off Modernizr.svg feature detect and remove custom script detect + +## 1.3.0 (09 February, 2013) + +* Remove jquery.min.js 'local' fallback from /js/ folder, simply fallback to another CDN (CloudFlare), see footer.php, saves code and maintenance across all sites +* Remove Google Analytics and jQuery fallback from functions.php injection, added manually in footer.php +* Setup Conditionizr to supply an HTML5Shim to Less Than IE9 browsers +* Updates Conditionizr to v1.2.0, enhanced retina detection and unlimited 'customScript', for polyfill usage (e.g. using respond.js and html5shim together) +* Added Romanian language translation file to /languages/ + +## 1.2.9 (03 February, 2013) + +* Readded [//conditionizr.com](Conditionizr), the raw JavaScript version 50% faster, previously removed to work on jQuery-free Conditionizr + +## 1.2.8 (30 January, 2013) + +* Added Google Analytics DNS Prefetch to header.php to reduce [DNS latency](//www.chromium.org/developers/design-documents/dns-prefetching) + +## 1.2.7 (23 January, 2013) + +* Update to jQuery 1.9.0 +* Removed [Conditionizr](http://conditionizr.com) +* Remove Apple Touch Icons + +## 1.2.6 (24 December, 2012) + +* [Conditionizr](http://conditionizr.com) legacy script and style loader added + * Conditional statements removed from HTML tag (HTML classes added dynamically with Conditionizr) + * Conditional statement for mediaqueries.min.js removed (added dynamically with Conditionizr, included inside scripts.js) + * conditionizr.min.js and conditionizr.js enqueued + * /css/conditionizr/ added with browser styles + * /js/conditionizr/ added with browser scripts +* Shortened ViewPort meta tag with user scalable enabled + +## 1.2.5 (09 December, 2012) + +* Added SVG support in scripts.js for SVG graphics +* Shorten DOM ready function call to shorthand +* Removed web app capable meta tag, kept viewport +* CSS3 Media Queries JavaScript polyfill added to header.php +* Included default .wrapper style for fluid-first responsive approach +* Upgraded jQuery to 1.8.3 +* Split stylesheets with separate call for Normalize as reset +* Global Box Sizing and Font-Smoothing on all elements + +## 1.2.4 (15 October, 2012) + +* Custom Comments callback - wp_list_comments('type=comment&callback=html5blankcomments'); editable comments now in functions.php +* Custom default Gravatar now built in, with demo gravatar.jpg inside the 'img' folder, swap it out +* Changed date format from the_date to the_time('F j, Y') +* Changed time format from the_time to the_time('g:i a') +* Changes above show the exact same when parsed, but have been changed due to the way WordPress works, which only shows one 'Date' for posts created on the same day. [More here](http://codex.wordpress.org/Function_Reference/the_date). + +## 1.2.3 (13 October, 2012) + +* Responsive Thumbnail support, added a function which removes width and height dynamic attributes from thumbnail + +## 1.2.2 (09 October, 2012) + +* Modified function - jQuery CDN fallback to get_template_directory_uri() instead of bloginfo('template_url') +* Add Support for Custom Header +* Tweaked support for Custom Background, added default color and placeholder background image + +## 1.2.1 (07 October, 2012) + +* Custom callback for wp_nav_menu, now in functions.php with html5blank_nav(); in header.php +* JavaScript added to 'scripts.js', hides URL bar after page load on iPhone/iPad, great for responsive projects +* Meta tag 'apple-mobile-web-app-capable' added to header.php +* Meta tag 'apple-mobile-web-app-status-bar-style' added to header.php + +## 1.2.0 (03 October, 2012) + +* Merged pull request from J-Rabe +* Localisation-support for all theme strings and empty *.pot for further translations +* German translation added by J-Rabe +* Functions.php includes new function 'load_theme_textdomain' for language support +* Loop.php created to handle the Loop core, with get_template_part inclusion for relevant files +* Loop.php includes conditional result for search results +* Swapped bloginfo('template_url'); for echo get_template_directory_uri(); on Logo + Favicon +* home_url instead of bloginfo('home') + +## 1.1.2 (02 October, 2012) + +* Merged pull request for comments.php code changes +* Merged pull request to remove 'rel' attribute from categories +* Filter added to remove autop paragraph function from Excerpts (Manual only) +* Filter added to allow shortcodes to execute inside Excerpts (Manual only) +* Filter added to strip autop tags altogether from Excerpts + +## 1.1.1 (30 September, 2012) + +* Enhanced author template +* Enhanced 404 page with return home link +* Semantic HTML enhancements +* Added 'published by the_author' hooks as a default +* Suggested include of WordPress Core CSS styles, now added + +## 1.1.0 (29 September, 2012) + +* Core template files restructure +* Semantic HTML enhancements +* Google analytics (optimised) dynamically loaded through functions.php in footer +* jQuery protocol relative fallback dynamically loaded through functions.php in footer +* Hardcoded footer.php content (analytics and jquery) removed as it's dynamically loaded now +* The Loop 'if, while, the' all inline, now inside parent section element +* Pagination links brought inside section element, outside of The Loop after our article +* Section elements brought outside The Loop to hold all page content +* The Loop 'else' content wrapper in article tag for markup/layout consistencies +* Post ID and Post Class added to article elements +* Category support for 'the category' title +* Enhanced Default Template page and Template Demo Page (page.php and template-demo.php) +* Threaded comments support +* Few obvious annotations removed +* Small typo in annotation 'function.php' changed to 'functions.php' +* Update theme default logo with new branding +* CSS tweak for default hyperlink color change to match Logo blue + +## 1.0.2 (28 September, 2012) + +* Update CDN and local jQuery fallbacks from 1.8.1 to 1.8.2 +* Conditional page loads script added to functions.php +* Added Custom Background support into functions.php +* Remove WordPress Admin bar by default +* Remove 'text/css' from enqueued stylesheet +* Updated screenshot.png logo to new HTML5 Blank branding +* CSS change, :focus changed to input:focus as FireFox was adding focus styles to any element +* CSS change, new Chrome updates renders fonts thicker, reduced font-weight on body from 400 to 300 +* CSS change, create non-semantic section below media queries, moved text-selection colors etc +* CSS change, default font-family for h1-h6 Helvetica Neue with Helvetica/Arial fallbacks (previous Georgia) +* CSS header theme details updated to new URL +* Move toddmotto.com/html5blank/ to new html5blank.com domain +* Favicon support for theme directory favicon.ico +* Apple touch icon support, drag into root folder +* LICENSE.md and README.md added and fully updated + +## 1.0.1 (27 September, 2012) + +* Commit CHANGELOG.md +* Commit README.md +* Commit of Empty Fonts folder with readme.txt inside (for GitHub detection) + +## 1.0.0 (16 September, 2012) + +* Initial commit diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..07414d5 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,13 @@ +# [HTML5 Blank](http://html5blank.com) License + +## MIT License + +Copyright © 2013 HTML5 Blank // @html5blank + +Built by Todd Motto // @toddmotto + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..aac0e97 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# TailwindCSS Wordpress Starter + +An extension of [HTML5Blank](https://github.com/toddmotto/html5blank) using TailwindCSS with Laravel Mix. + +On my blog you can read about [how to create a TailwindCSS Wordpress Theme](https://ciaran.co.za/tailwind-css-wordpress-theme-tutorial/). + +## Installation + +With NPM: +```bash +npm install +npm run watch +``` + +With Yarn: +```bash +yarn +yarn watch +``` + +You can alternately run `dev` to generate readable assets, or `prod` to run a production build. + +## Usage + +This is a blank copy of HTML5Blank with TailwindCSS installed, nothing more. Your assets build from `./assets` to `./js/scripts.js` and `./style.css` diff --git a/archive.php b/archive.php new file mode 100644 index 0000000..9f1e4f9 --- /dev/null +++ b/archive.php @@ -0,0 +1,19 @@ +<?php get_header(); ?> + + <main role="main"> + <!-- section --> + <section> + + <h1><?php _e( 'Archives', 'html5blank' ); ?></h1> + + <?php get_template_part('loop'); ?> + + <?php get_template_part('pagination'); ?> + + </section> + <!-- /section --> + </main> + +<?php get_sidebar(); ?> + +<?php get_footer(); ?> diff --git a/assets/main.js b/assets/main.js new file mode 100644 index 0000000..c986080 --- /dev/null +++ b/assets/main.js @@ -0,0 +1,485 @@ + +import Vue from 'vue/dist/vue.js'; +import moment from 'moment'; +import underscore from 'underscore'; + +const bucket = 'JuZPF4WemRttpJ7eKi15kH'; + +Vue.prototype._ = underscore; +Vue.prototype.moment = moment; + +window.blocks = new Vue({ + el: "#main", + watch: { + form: { + deep: true, + handler(new_value, old_value) { + + if (new_value === '') { + + return; + + } + + this.$nextTick(() => { + + this.open(this.form.block); + + console.log(this.form.block); + + this.focus_form(); + + }); + } + }, + }, + methods: { + + is_open(id) { + return this.opened.includes(id); + }, + open(id) { + this.opened.push(id); + }, + close(id) { + this.opened = this.opened.filter((value) => value != id) + }, + focus_form() { + setTimeout(() => { + + console.log('tried to focus') + document.getElementById("task").focus(); + document.getElementById("add_new").scrollIntoView({ + behavior: 'smooth', + }); + + }, 400); + }, + open_form(block) { + if (this.form === '') { + + this.form = { + id: Date.now(), + done: false, + order: this.todos.length + 1, + name: '', + day: this.day, + description: '', + block: block, + }; + + } else { + + this.form.block = block; + + } + }, + submit_form() { + this.todos.push(this.form); + this.save(); + this.send_to_api(); + this.close_form(); + }, + close_form() { + this.form = ''; + }, + done(id) { + const todo = this._.findWhere(this.todos, { id: id }); + todo.done = !todo.done; + }, + remove_todo(id) { + this.todos = this.todos.filter((todo) => todo.id != id) + }, + edit_todo(id) { + + const todo = this._.findWhere(this.todos, { id: id }); + + this.remove_todo(id); + + this.form = todo; + + }, + load_from_form() { + + this.parse_share(this.data_to_load); + + this.data_to_load = ''; + this.load_form = false; + + this.load(); + + }, + parse_share(hash) { + + if (!hash) { + + const hash = window.location.hash; + + } + + if (hash) { + + console.log(hash); + + const value = atob(hash.substring(1)); + + const decoded = JSON.parse(value); + + console.log('Got from hash', decoded); + + if (decoded) { + + this.save(decoded); + + window.location.hash = ''; + + } + + } // end if; + + }, + share() { + + window.location.hash = btoa(unescape(encodeURIComponent((JSON.stringify(this.$data))))); + + }, + load() { + + const list = [ + 'opened', + 'todos', + 'show_controls', + 'show_descriptions', + 'show_completed', + 'show_timeline', + // 'blocks', + ]; + + list.forEach((index) => { + + const value = localStorage.getItem(index); + + console.log('Got value', value); + + if (value !== null) { + + this[index] = JSON.parse(value); + + } // end if; + + }) + + }, + save(source) { + + const list = [ + 'opened', + 'todos', + 'blocks', + 'show_controls', + 'show_descriptions', + 'show_completed', + 'show_timeline', + ]; + + if (!source) { + + source = this; + + } // end if; + + const saved = {}; + + list.forEach((index) => { + + saved[index] = source[index]; + + const value = localStorage.setItem(index, JSON.stringify(source[index])); + + }); + + }, + get_block(block_id) { + + return this._.findWhere(this.blocks, { id: block_id }); + + }, + get_setting(block) { + + let settings = this._.findWhere(this.processed_settings, { block: block }); + + if (!settings) { + + const defaults = { + alpha: { + block: 'alpha', + start: '07:00', + end: '09:50', + day: this.day, + }, + beta: { + block: 'alpha', + start: '10:00', + end: '12:50', + day: this.day, + }, + lunch: { + block: 'lunch', + start: '13:00', + end: '14:50', + day: this.day, + }, + gama: { + block: 'gama', + start: '15:00', + end: '16:50', + day: this.day, + }, + snacks: { + block: 'snacks', + start: '17:00', + end: '17:20', + day: this.day, + }, + delta: { + block: 'delta', + start: '17:30', + end: '18:30', + day: this.day, + }, + night: { + block: 'night', + start: '18:30', + end: false, + day: this.day, + }, + } + + settings = defaults[block]; + + } + + return settings; + + }, + should_display_now(block) { + + const settings = this.get_setting(block); + + const now = this.moment(); + const start = this.moment(settings.start, 'HH:mm'); + const end = settings.end ? this.moment(settings.end, 'HH:mm') : this.moment('23:59', 'HH:mm'); + + const should_display_now = now.isAfter(start) && now.isBefore(end); + + if (this.get_block(block).type === 'separator' && should_display_now) { + + console.log('Block...') + + this.waiting_block = this.get_block(block); + + } // end if; + + return should_display_now; + + }, + close_all() { + + this.form = ''; + this.load_form = false; + + }, + should_wait() { + + // console.log(this.ignore_waiting.includes(this.waiting_block.id)); + + return this.waiting_block && !this.ignore_waiting.includes(this.waiting_block.id); + + }, + send_to_api() { + + const saved = this.$data; + + fetch('https://kvdb.io/' + bucket + '/' + 'arindo', { + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json' + }, + method: 'POST', + body: JSON.stringify(saved), + }).then((results) => console.log(results)) + + }, + load_from_api() { + + fetch('https://kvdb.io/' + bucket + '/' + 'arindo', { + headers: { + 'Accept': 'application/json', + 'Content-Type': 'application/json' + }, + method: 'GET', + }).then(response => response.json()) + .then(data => { + + console.log(typeof data); + + console.log(data); + + const list = [ + 'opened', + 'todos', + 'show_controls', + 'show_descriptions', + 'show_completed', + 'show_timeline', + // 'blocks', + ]; + + list.forEach((index) => { + + console.log('Got value from api', data[index]); + + this[index] = data[index]; + + }) + + }); + + } + }, + computed: { + processed_todos() { + + return this._.groupBy(this._.filter(this._.sortBy(this.todos, (todo) => -todo.order), (todo) => todo.day === this.day), 'block'); + + }, + processed_settings() { + + return this._.filter(this.settings, (setting) => setting.day === this.day) + + }, + }, + updated() { + this.$nextTick(function () { + this.send_to_api(); + }); + }, + mounted() { + + this.day = this.moment().format('YYYYMMDD'); + + // this.parse_share(); + + this.load_from_api(); + + // window.onbeforeunload = (event) => this.save(); + window.onbeforeunload = (event) => this.send_to_api(); + + setInterval(() => { + + console.log('Saving...'); + + this.save(); + + }, 30000); + + }, + data() { + return { + menu_open: false, + ignore_waiting: [], + waiting_block: false, + load_form: false, + data_to_load: '', + day: false, + show_timeline: true, + show_completed: true, + show_date_selector: false, + show_descriptions: true, + show_controls: false, + form: '', + opened: ['alpha'], + todos: [], + all_settings: [ + { + block: 'alpha', + start: '07:00', + end: '12:00', + day: '20210715', + } + ], + blocks: [ + { + id: 'alpha', + type: 'block', + name: "Alpha α", + classes: 'border-red-300', + start: '', + end: '', + description: '', + priority: 0, + }, + { + id: 'beta', + type: 'block', + name: "Beta β", + classes: 'border-yellow-300', + start: '', + end: '', + description: '', + priority: 0, + }, + { + id: 'lunch', + type: 'separator', + name: "Lunch", + classes: '', + start: '', + end: '', + description: '', + priority: 0, + }, + { + id: 'gama', + type: 'block', + name: "Gama 𝛾", + classes: 'border-blue-300', + start: '', + end: '', + description: '', + priority: 0, + }, + { + id: 'snacks', + type: 'separator', + name: "Snacks", + classes: 'bg-gray-50', + start: '', + end: '', + description: '', + priority: 0, + }, + { + id: 'delta', + type: 'block', + name: "Delta δ", + classes: 'border-green-300', + start: '', + end: '', + description: '', + priority: 0, + }, + { + id: 'night', + type: 'separator', + name: "End of Work", + classes: 'bg-gray-50', + start: '', + end: '', + description: '', + priority: 0, + }, + ] + } + } +}); \ No newline at end of file diff --git a/assets/style.css b/assets/style.css new file mode 100644 index 0000000..a175629 --- /dev/null +++ b/assets/style.css @@ -0,0 +1,62 @@ +/*! + Theme Name: HTML5 Blank + Theme URI: http://html5blank.com + Description: HTML5 Blank WordPress Theme + Version: 1.4.3 + Author: Todd Motto (@toddmotto) + Author URI: http://toddmotto.com + Tags: Blank, HTML5, CSS3 + + License: MIT + License URI: http://opensource.org/licenses/mit-license.php + + Modified by ciaran.co.za to include TailwindCSS +*/ + +@tailwind base; +@tailwind components; +@tailwind utilities; + + + [v-cloak] { + display: none; + } + input:checked + svg { + display: block; + } + /* Enter and leave animations can use different */ +/* durations and timing functions. */ +.slide-fade-enter-active, .block-container { + transition: all .3s ease; +} +.slide-fade-leave-active { + transition: all .3s cubic-bezier(1.0, 0.5, 0.8, 1.0); +} +.slide-fade-enter, .slide-fade-leave-to +/* .slide-fade-leave-active below version 2.1.8 */ { + transform: translateX(10px); + opacity: 0; +} +.slide-fade-inverse-enter-active { + transition: all .3s ease; +} +.slide-fade-inverse-leave-active { + transition: all .3s cubic-bezier(1.0, 0.5, 0.8, 1.0); +} +.slide-fade-inverse-enter, .slide-fade-inverse-leave-to +/* .slide-fade-leave-active below version 2.1.8 */ { + transform: translateX(-10px); + opacity: 0; +} + +.slide-enter-active, .slide-leave-active { + transition: all .3s ease; +} +.slide-leave { + overflow: hidden; +} +.slide-enter, .slide-leave-to +{ + transform: translateY(-100%); + opacity: 0; +} \ No newline at end of file diff --git a/author.php b/author.php new file mode 100644 index 0000000..773c11d --- /dev/null +++ b/author.php @@ -0,0 +1,77 @@ +<?php get_header(); ?> + + <main role="main"> + <!-- section --> + <section> + + <?php if (have_posts()): the_post(); ?> + + <h1><?php _e( 'Author Archives for ', 'html5blank' ); echo get_the_author(); ?></h1> + + <?php if ( get_the_author_meta('description')) : ?> + + <?php echo get_avatar(get_the_author_meta('user_email')); ?> + + <h2><?php _e( 'About ', 'html5blank' ); echo get_the_author() ; ?></h2> + + <?php echo wpautop( get_the_author_meta('description') ); ?> + + <?php endif; ?> + + <?php rewind_posts(); while (have_posts()) : the_post(); ?> + + <!-- article --> + <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> + + <!-- post thumbnail --> + <?php if ( has_post_thumbnail()) : // Check if Thumbnail exists ?> + <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"> + <?php the_post_thumbnail(array(120,120)); // Declare pixel size you need inside the array ?> + </a> + <?php endif; ?> + <!-- /post thumbnail --> + + <!-- post title --> + <h2> + <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a> + </h2> + <!-- /Post title --> + + <!-- post details --> + <span class="date"><?php the_time('F j, Y'); ?> <?php the_time('g:i a'); ?></span> + <span class="author"><?php _e( 'Published by', 'html5blank' ); ?> <?php the_author_posts_link(); ?></span> + <span class="comments"><?php comments_popup_link( __( 'Leave your thoughts', 'html5blank' ), __( '1 Comment', 'html5blank' ), __( '% Comments', 'html5blank' )); ?></span> + <!-- /post details --> + + <?php html5wp_excerpt('html5wp_index'); // Build your custom callback length in functions.php ?> + + <br class="clear"> + + <?php edit_post_link(); ?> + + </article> + <!-- /article --> + + <?php endwhile; ?> + + <?php else: ?> + + <!-- article --> + <article> + + <h2><?php _e( 'Sorry, nothing to display.', 'html5blank' ); ?></h2> + + </article> + <!-- /article --> + + <?php endif; ?> + + <?php get_template_part('pagination'); ?> + + </section> + <!-- /section --> + </main> + +<?php get_sidebar(); ?> + +<?php get_footer(); ?> diff --git a/category.php b/category.php new file mode 100644 index 0000000..2840217 --- /dev/null +++ b/category.php @@ -0,0 +1,19 @@ +<?php get_header(); ?> + + <main role="main"> + <!-- section --> + <section> + + <h1><?php _e( 'Categories for ', 'html5blank' ); single_cat_title(); ?></h1> + + <?php get_template_part('loop'); ?> + + <?php get_template_part('pagination'); ?> + + </section> + <!-- /section --> + </main> + +<?php get_sidebar(); ?> + +<?php get_footer(); ?> diff --git a/comments.php b/comments.php new file mode 100644 index 0000000..46b4e9b --- /dev/null +++ b/comments.php @@ -0,0 +1,24 @@ +<div class="comments"> + <?php if (post_password_required()) : ?> + <p><?php _e( 'Post is password protected. Enter the password to view any comments.', 'html5blank' ); ?></p> +</div> + + <?php return; endif; ?> + +<?php if (have_comments()) : ?> + + <h2><?php comments_number(); ?></h2> + + <ul> + <?php wp_list_comments('type=comment&callback=html5blankcomments'); // Custom callback in functions.php ?> + </ul> + +<?php elseif ( ! comments_open() && ! is_page() && post_type_supports( get_post_type(), 'comments' ) ) : ?> + + <p><?php _e( 'Comments are closed here.', 'html5blank' ); ?></p> + +<?php endif; ?> + +<?php comment_form(); ?> + +</div> diff --git a/features.php b/features.php new file mode 100644 index 0000000..3ad376e --- /dev/null +++ b/features.php @@ -0,0 +1,33 @@ +<?php + +/** + * Only logged users. + */ +add_action('template_redirect', function() { + + if (is_user_logged_in()) { + + return; + + } + + auth_redirect(); + + exit; + +}); + +/** + * Styles and Scripts + */ +add_action('wp_enqueue_scripts', function() { + + wp_enqueue_style('icons', 'https://cdn.linearicons.com/free/1.0.0/icon-font.min.css'); + + wp_enqueue_style('blocks', get_template_directory_uri() . '/style.css'); + + wp_register_script('blocks', get_template_directory_uri() . '/js/scripts.js', array(), '1.0.0', true); + + wp_enqueue_script('blocks'); // Enqueue it! + +}); \ No newline at end of file diff --git a/fonts/readme.txt b/fonts/readme.txt new file mode 100644 index 0000000..ca87836 --- /dev/null +++ b/fonts/readme.txt @@ -0,0 +1 @@ +* File added so GitHub will recognise the empty folder, please delete * \ No newline at end of file diff --git a/footer.php b/footer.php new file mode 100644 index 0000000..6488410 --- /dev/null +++ b/footer.php @@ -0,0 +1,5 @@ + + <?php wp_footer(); ?> + + </body> +</html> diff --git a/functions.php b/functions.php new file mode 100644 index 0000000..82f670f --- /dev/null +++ b/functions.php @@ -0,0 +1,441 @@ +<?php +/* + * Author: Todd Motto | @toddmotto + * URL: html5blank.com | @html5blank + * Custom functions, support, custom post types and more. + */ + +require_once dirname(__FILE__) . '/features.php'; + +/*------------------------------------*\ + External Modules/Files +\*------------------------------------*/ + +// Load any external files you have here + +/*------------------------------------*\ + Theme Support +\*------------------------------------*/ + +if (!isset($content_width)) +{ + $content_width = 900; +} + +if (function_exists('add_theme_support')) +{ + // Add Menu Support + add_theme_support('menus'); + + // Add Thumbnail Theme Support + add_theme_support('post-thumbnails'); + add_image_size('large', 700, '', true); // Large Thumbnail + add_image_size('medium', 250, '', true); // Medium Thumbnail + add_image_size('small', 120, '', true); // Small Thumbnail + add_image_size('custom-size', 700, 200, true); // Custom Thumbnail Size call using the_post_thumbnail('custom-size'); + + // Add Support for Custom Backgrounds - Uncomment below if you're going to use + /*add_theme_support('custom-background', array( + 'default-color' => 'FFF', + 'default-image' => get_template_directory_uri() . '/img/bg.jpg' + ));*/ + + // Add Support for Custom Header - Uncomment below if you're going to use + /*add_theme_support('custom-header', array( + 'default-image' => get_template_directory_uri() . '/img/headers/default.jpg', + 'header-text' => false, + 'default-text-color' => '000', + 'width' => 1000, + 'height' => 198, + 'random-default' => false, + 'wp-head-callback' => $wphead_cb, + 'admin-head-callback' => $adminhead_cb, + 'admin-preview-callback' => $adminpreview_cb + ));*/ + + // Enables post and comment RSS feed links to head + add_theme_support('automatic-feed-links'); + + // Localisation Support + load_theme_textdomain('html5blank', get_template_directory() . '/languages'); +} + +/*------------------------------------*\ + Functions +\*------------------------------------*/ + +// HTML5 Blank navigation +function html5blank_nav() +{ + wp_nav_menu( + array( + 'theme_location' => 'header-menu', + 'menu' => '', + 'container' => 'div', + 'container_class' => 'menu-{menu slug}-container', + 'container_id' => '', + 'menu_class' => 'menu', + 'menu_id' => '', + 'echo' => true, + 'fallback_cb' => 'wp_page_menu', + 'before' => '', + 'after' => '', + 'link_before' => '', + 'link_after' => '', + 'items_wrap' => '<ul>%3$s</ul>', + 'depth' => 0, + 'walker' => '' + ) + ); +} + +// Load HTML5 Blank scripts (header.php) +function html5blank_header_scripts() +{ + if ($GLOBALS['pagenow'] != 'wp-login.php' && !is_admin()) { + + // wp_register_script('html5manuscripts', get_template_directory_uri() . '/js/scripts.js', array('jquery'), '1.0.0'); // Custom scripts + // wp_enqueue_script('html5blankscripts'); // Enqueue it! + } +} + +// Load HTML5 Blank conditional scripts +function html5blank_conditional_scripts() +{ + +} + +// Load HTML5 Blank styles +function html5blank_styles() +{ + +} + +// Register HTML5 Blank Navigation +function register_html5_menu() +{ + register_nav_menus(array( // Using array to specify more menus if needed + 'header-menu' => __('Header Menu', 'html5blank'), // Main Navigation + 'sidebar-menu' => __('Sidebar Menu', 'html5blank'), // Sidebar Navigation + 'extra-menu' => __('Extra Menu', 'html5blank') // Extra Navigation if needed (duplicate as many as you need!) + )); +} + +// Remove the <div> surrounding the dynamic navigation to cleanup markup +function my_wp_nav_menu_args($args = '') +{ + $args['container'] = false; + return $args; +} + +// Remove Injected classes, ID's and Page ID's from Navigation <li> items +function my_css_attributes_filter($var) +{ + return is_array($var) ? array() : ''; +} + +// Remove invalid rel attribute values in the categorylist +function remove_category_rel_from_category_list($thelist) +{ + return str_replace('rel="category tag"', 'rel="tag"', $thelist); +} + +// Add page slug to body class, love this - Credit: Starkers Wordpress Theme +function add_slug_to_body_class($classes) +{ + global $post; + if (is_home()) { + $key = array_search('blog', $classes); + if ($key > -1) { + unset($classes[$key]); + } + } elseif (is_page()) { + $classes[] = sanitize_html_class($post->post_name); + } elseif (is_singular()) { + $classes[] = sanitize_html_class($post->post_name); + } + + return $classes; +} + +// If Dynamic Sidebar Exists +if (function_exists('register_sidebar')) +{ + // Define Sidebar Widget Area 1 + register_sidebar(array( + 'name' => __('Widget Area 1', 'html5blank'), + 'description' => __('Description for this widget-area...', 'html5blank'), + 'id' => 'widget-area-1', + 'before_widget' => '<div id="%1$s" class="%2$s">', + 'after_widget' => '</div>', + 'before_title' => '<h3>', + 'after_title' => '</h3>' + )); + + // Define Sidebar Widget Area 2 + register_sidebar(array( + 'name' => __('Widget Area 2', 'html5blank'), + 'description' => __('Description for this widget-area...', 'html5blank'), + 'id' => 'widget-area-2', + 'before_widget' => '<div id="%1$s" class="%2$s">', + 'after_widget' => '</div>', + 'before_title' => '<h3>', + 'after_title' => '</h3>' + )); +} + +// Remove wp_head() injected Recent Comment styles +function my_remove_recent_comments_style() +{ + global $wp_widget_factory; + remove_action('wp_head', array( + $wp_widget_factory->widgets['WP_Widget_Recent_Comments'], + 'recent_comments_style' + )); +} + +// Pagination for paged posts, Page 1, Page 2, Page 3, with Next and Previous Links, No plugin +function html5wp_pagination() +{ + global $wp_query; + $big = 999999999; + echo paginate_links(array( + 'base' => str_replace($big, '%#%', get_pagenum_link($big)), + 'format' => '?paged=%#%', + 'current' => max(1, get_query_var('paged')), + 'total' => $wp_query->max_num_pages + )); +} + +// Custom Excerpts +function html5wp_index($length) // Create 20 Word Callback for Index page Excerpts, call using html5wp_excerpt('html5wp_index'); +{ + return 20; +} + +// Create 40 Word Callback for Custom Post Excerpts, call using html5wp_excerpt('html5wp_custom_post'); +function html5wp_custom_post($length) +{ + return 40; +} + +// Create the Custom Excerpts callback +function html5wp_excerpt($length_callback = '', $more_callback = '') +{ + global $post; + if (function_exists($length_callback)) { + add_filter('excerpt_length', $length_callback); + } + if (function_exists($more_callback)) { + add_filter('excerpt_more', $more_callback); + } + $output = get_the_excerpt(); + $output = apply_filters('wptexturize', $output); + $output = apply_filters('convert_chars', $output); + $output = '<p>' . $output . '</p>'; + echo $output; +} + +// Custom View Article link to Post +function html5_blank_view_article($more) +{ + global $post; + return '... <a class="view-article" href="' . get_permalink($post->ID) . '">' . __('View Article', 'html5blank') . '</a>'; +} + +// Remove Admin bar +function remove_admin_bar() +{ + return false; +} + +// Remove 'text/css' from our enqueued stylesheet +function html5_style_remove($tag) +{ + return preg_replace('~\s+type=["\'][^"\']++["\']~', '', $tag); +} + +// Remove thumbnail width and height dimensions that prevent fluid images in the_thumbnail +function remove_thumbnail_dimensions( $html ) +{ + $html = preg_replace('/(width|height)=\"\d*\"\s/', "", $html); + return $html; +} + +// Custom Gravatar in Settings > Discussion +function html5blankgravatar ($avatar_defaults) +{ + $myavatar = get_template_directory_uri() . '/img/gravatar.jpg'; + $avatar_defaults[$myavatar] = "Custom Gravatar"; + return $avatar_defaults; +} + +// Threaded Comments +function enable_threaded_comments() +{ + if (!is_admin()) { + if (is_singular() AND comments_open() AND (get_option('thread_comments') == 1)) { + wp_enqueue_script('comment-reply'); + } + } +} + +// Custom Comments Callback +function html5blankcomments($comment, $args, $depth) +{ + $GLOBALS['comment'] = $comment; + extract($args, EXTR_SKIP); + + if ( 'div' == $args['style'] ) { + $tag = 'div'; + $add_below = 'comment'; + } else { + $tag = 'li'; + $add_below = 'div-comment'; + } +?> + <!-- heads up: starting < for the html tag (li or div) in the next line: --> + <<?php echo $tag ?> <?php comment_class(empty( $args['has_children'] ) ? '' : 'parent') ?> id="comment-<?php comment_ID() ?>"> + <?php if ( 'div' != $args['style'] ) : ?> + <div id="div-comment-<?php comment_ID() ?>" class="comment-body"> + <?php endif; ?> + <div class="comment-author vcard"> + <?php if ($args['avatar_size'] != 0) echo get_avatar( $comment, $args['180'] ); ?> + <?php printf(__('<cite class="fn">%s</cite> <span class="says">says:</span>'), get_comment_author_link()) ?> + </div> +<?php if ($comment->comment_approved == '0') : ?> + <em class="comment-awaiting-moderation"><?php _e('Your comment is awaiting moderation.') ?></em> + <br /> +<?php endif; ?> + + <div class="comment-meta commentmetadata"><a href="<?php echo htmlspecialchars( get_comment_link( $comment->comment_ID ) ) ?>"> + <?php + printf( __('%1$s at %2$s'), get_comment_date(), get_comment_time()) ?></a><?php edit_comment_link(__('(Edit)'),' ','' ); + ?> + </div> + + <?php comment_text() ?> + + <div class="reply"> + <?php comment_reply_link(array_merge( $args, array('add_below' => $add_below, 'depth' => $depth, 'max_depth' => $args['max_depth']))) ?> + </div> + <?php if ( 'div' != $args['style'] ) : ?> + </div> + <?php endif; ?> +<?php } + +/*------------------------------------*\ + Actions + Filters + ShortCodes +\*------------------------------------*/ + +// Add Actions +add_action('init', 'html5blank_header_scripts'); // Add Custom Scripts to wp_head +add_action('wp_print_scripts', 'html5blank_conditional_scripts'); // Add Conditional Page Scripts +add_action('get_header', 'enable_threaded_comments'); // Enable Threaded Comments +add_action('wp_enqueue_scripts', 'html5blank_styles'); // Add Theme Stylesheet +add_action('init', 'register_html5_menu'); // Add HTML5 Blank Menu +add_action('init', 'create_post_type_html5'); // Add our HTML5 Blank Custom Post Type +add_action('widgets_init', 'my_remove_recent_comments_style'); // Remove inline Recent Comment Styles from wp_head() +add_action('init', 'html5wp_pagination'); // Add our HTML5 Pagination + +// Remove Actions +remove_action('wp_head', 'feed_links_extra', 3); // Display the links to the extra feeds such as category feeds +remove_action('wp_head', 'feed_links', 2); // Display the links to the general feeds: Post and Comment Feed +remove_action('wp_head', 'rsd_link'); // Display the link to the Really Simple Discovery service endpoint, EditURI link +remove_action('wp_head', 'wlwmanifest_link'); // Display the link to the Windows Live Writer manifest file. +remove_action('wp_head', 'index_rel_link'); // Index link +remove_action('wp_head', 'parent_post_rel_link', 10, 0); // Prev link +remove_action('wp_head', 'start_post_rel_link', 10, 0); // Start link +remove_action('wp_head', 'adjacent_posts_rel_link', 10, 0); // Display relational links for the posts adjacent to the current post. +remove_action('wp_head', 'wp_generator'); // Display the XHTML generator that is generated on the wp_head hook, WP version +remove_action('wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0); +remove_action('wp_head', 'rel_canonical'); +remove_action('wp_head', 'wp_shortlink_wp_head', 10, 0); + +// Add Filters +add_filter('avatar_defaults', 'html5blankgravatar'); // Custom Gravatar in Settings > Discussion +add_filter('body_class', 'add_slug_to_body_class'); // Add slug to body class (Starkers build) +add_filter('widget_text', 'do_shortcode'); // Allow shortcodes in Dynamic Sidebar +add_filter('widget_text', 'shortcode_unautop'); // Remove <p> tags in Dynamic Sidebars (better!) +add_filter('wp_nav_menu_args', 'my_wp_nav_menu_args'); // Remove surrounding <div> from WP Navigation +// add_filter('nav_menu_css_class', 'my_css_attributes_filter', 100, 1); // Remove Navigation <li> injected classes (Commented out by default) +// add_filter('nav_menu_item_id', 'my_css_attributes_filter', 100, 1); // Remove Navigation <li> injected ID (Commented out by default) +// add_filter('page_css_class', 'my_css_attributes_filter', 100, 1); // Remove Navigation <li> Page ID's (Commented out by default) +add_filter('the_category', 'remove_category_rel_from_category_list'); // Remove invalid rel attribute +add_filter('the_excerpt', 'shortcode_unautop'); // Remove auto <p> tags in Excerpt (Manual Excerpts only) +add_filter('the_excerpt', 'do_shortcode'); // Allows Shortcodes to be executed in Excerpt (Manual Excerpts only) +add_filter('excerpt_more', 'html5_blank_view_article'); // Add 'View Article' button instead of [...] for Excerpts +add_filter('show_admin_bar', 'remove_admin_bar'); // Remove Admin bar +add_filter('style_loader_tag', 'html5_style_remove'); // Remove 'text/css' from enqueued stylesheet +add_filter('post_thumbnail_html', 'remove_thumbnail_dimensions', 10); // Remove width and height dynamic attributes to thumbnails +add_filter('image_send_to_editor', 'remove_thumbnail_dimensions', 10); // Remove width and height dynamic attributes to post images + +// Remove Filters +remove_filter('the_excerpt', 'wpautop'); // Remove <p> tags from Excerpt altogether + +// Shortcodes +add_shortcode('html5_shortcode_demo', 'html5_shortcode_demo'); // You can place [html5_shortcode_demo] in Pages, Posts now. +add_shortcode('html5_shortcode_demo_2', 'html5_shortcode_demo_2'); // Place [html5_shortcode_demo_2] in Pages, Posts now. + +// Shortcodes above would be nested like this - +// [html5_shortcode_demo] [html5_shortcode_demo_2] Here's the page title! [/html5_shortcode_demo_2] [/html5_shortcode_demo] + +/*------------------------------------*\ + Custom Post Types +\*------------------------------------*/ + +// Create 1 Custom Post type for a Demo, called HTML5-Blank +function create_post_type_html5() +{ + register_taxonomy_for_object_type('category', 'html5-blank'); // Register Taxonomies for Category + register_taxonomy_for_object_type('post_tag', 'html5-blank'); + register_post_type('html5-blank', // Register Custom Post Type + array( + 'labels' => array( + 'name' => __('HTML5 Blank Custom Post', 'html5blank'), // Rename these to suit + 'singular_name' => __('HTML5 Blank Custom Post', 'html5blank'), + 'add_new' => __('Add New', 'html5blank'), + 'add_new_item' => __('Add New HTML5 Blank Custom Post', 'html5blank'), + 'edit' => __('Edit', 'html5blank'), + 'edit_item' => __('Edit HTML5 Blank Custom Post', 'html5blank'), + 'new_item' => __('New HTML5 Blank Custom Post', 'html5blank'), + 'view' => __('View HTML5 Blank Custom Post', 'html5blank'), + 'view_item' => __('View HTML5 Blank Custom Post', 'html5blank'), + 'search_items' => __('Search HTML5 Blank Custom Post', 'html5blank'), + 'not_found' => __('No HTML5 Blank Custom Posts found', 'html5blank'), + 'not_found_in_trash' => __('No HTML5 Blank Custom Posts found in Trash', 'html5blank') + ), + 'public' => true, + 'hierarchical' => true, // Allows your posts to behave like Hierarchy Pages + 'has_archive' => true, + 'supports' => array( + 'title', + 'editor', + 'excerpt', + 'thumbnail' + ), // Go to Dashboard Custom HTML5 Blank post for supports + 'can_export' => true, // Allows export in Tools > Export + 'taxonomies' => array( + 'post_tag', + 'category' + ) // Add Category and Post Tags support + )); +} + +/*------------------------------------*\ + ShortCode Functions +\*------------------------------------*/ + +// Shortcode Demo with Nested Capability +function html5_shortcode_demo($atts, $content = null) +{ + return '<div class="shortcode-demo">' . do_shortcode($content) . '</div>'; // do_shortcode allows for nested Shortcodes +} + +// Shortcode Demo with simple <h2> tag +function html5_shortcode_demo_2($atts, $content = null) // Demo Heading H2 shortcode, allows for nesting within above element. Fully expandable. +{ + return '<h2>' . $content . '</h2>'; +} + +?> diff --git a/header.php b/header.php new file mode 100644 index 0000000..b08b108 --- /dev/null +++ b/header.php @@ -0,0 +1,15 @@ +<!doctype html> +<html <?php language_attributes(); ?> class="no-js"> + <head> + <meta charset="<?php bloginfo('charset'); ?>"> + <title><?php wp_title(''); ?><?php if(wp_title('', false)) { echo ' :'; } ?> <?php bloginfo('name'); ?></title> + + <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <meta name="description" content="<?php bloginfo('description'); ?>"> + + <?php wp_head(); ?> + + </head> + <body <?php body_class('bg-gray-800'); ?>> + diff --git a/img/gravatar.jpg b/img/gravatar.jpg new file mode 100644 index 0000000..fb1b5f8 Binary files /dev/null and b/img/gravatar.jpg differ diff --git a/img/icons/favicon.ico b/img/icons/favicon.ico new file mode 100644 index 0000000..bdec8e7 Binary files /dev/null and b/img/icons/favicon.ico differ diff --git a/img/icons/touch.png b/img/icons/touch.png new file mode 100644 index 0000000..ea63f35 Binary files /dev/null and b/img/icons/touch.png differ diff --git a/img/logo.png b/img/logo.png new file mode 100644 index 0000000..c8f0042 Binary files /dev/null and b/img/logo.png differ diff --git a/img/logo.svg b/img/logo.svg new file mode 100644 index 0000000..988bfa1 --- /dev/null +++ b/img/logo.svg @@ -0,0 +1,71 @@ +<?xml version="1.0" encoding="utf-8"?> +<!-- Generator: Adobe Illustrator 15.0.2, SVG Export Plug-In . SVG Version: 6.00 Build 0) --> +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> +<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" + width="300px" height="95px" viewBox="-61.75 -24.158 300 95" enable-background="new -61.75 -24.158 300 95" xml:space="preserve" + > +<path fill="#D9D9D9" d="M-60.155-21.633l7.236,81.19l32.475,9.176l32.652-9.176l7.236-81.19H-60.155z M4.441-2.394L3.91,2.724 + L3.735,4.84h-24.179l0,0h-13.944l0.883,10.237h13.237H0.027h2.824l-0.352,2.647L0.205,44.021l-0.176,1.766l-20.297,5.6v0.049h-0.176 + l-20.473-5.646l-1.236-15.708h4.588h5.293l0.708,7.939l11.12,3.003l0.176-0.048l10.943-2.952l1.236-12.885h-12.178h-22.415 + l-2.472-27.531l-0.176-2.65h24.886h0.176H4.618L4.441-2.394z"/> +<polygon fill="#E3E3E3" points="-8.091,25.137 -20.268,25.137 -20.268,25.137 -20.268,40.975 -9.327,38.022 "/> +<polygon fill="#E3E3E3" points="-20.268,-15.104 -20.268,-5.042 4.618,-5.042 4.441,-2.394 3.91,2.724 3.735,4.842 -20.268,4.842 + -20.268,15.077 0.027,15.077 2.851,15.077 2.499,17.724 0.205,44.022 0.029,45.788 -20.268,51.388 -20.268,61.674 6.03,54.435 + 12.206,-15.104 "/> +<g enable-background="new "> + <path fill="#D9D9D9" d="M35.648,8.159v4.586h1.354v3.351h-6.514l0.048-3.351h1.354V0.313h-1.354v-3.399h6.466v3.399h-1.354V4.64 + h3.4V0.313h-1.403v-3.399h6.489v3.399h-1.332v7.812v4.621h1.332v3.351h-6.489v-3.351h1.403V8.159H35.648z"/> + <path fill="#D9D9D9" d="M54.547,16.097h-6.395v-3.351h1.26V0.313h-1.213v2.305h-3.091v-5.634h12.408v5.634h-3.091V0.313h-1.214 + v12.432h1.332L54.547,16.097L54.547,16.097z"/> + <path fill="#D9D9D9" d="M70.657-3.085h6.662V0.36h-1.139v12.363h1.139v3.375h-6.037v-3.375h0.999V5.663l-2.973,10.436h-2.52 + L63.863,5.663v7.061h1.213v3.375h-6.514v-3.375h1.379V0.362h-1.379v-3.447h6.996l2.655,12.954L70.657-3.085z"/> + <path fill="#D9D9D9" d="M83.57,12.746h3.59v-2.545h3.635v5.896H78.411v-3.351h1.403V0.313h-1.403v-3.399h6.49v3.399h-1.332 + L83.57,12.746L83.57,12.746z"/> + <path fill="#D9D9D9" d="M93.624,8.396L91.7,6.024v-9.109h11.573v5.158h-3.898V0.457h-3.97v4.136h5.941l1.998,1.95v7.892 + l-1.71,1.664h-7.94l-1.998-1.998v-3.399h3.54v1.951h4.399V8.396H93.624L93.624,8.396z"/> + <path fill="#D9D9D9" d="M123.077,16.097H112v-3.351h1.377l0.025-12.48h-1.45v-3.446h11.125l1.928,1.708v5.913l-1.381,1.637 + l1.381,1.424v6.505L123.077,16.097z M121.01,0.36h-3.853v4.23h3.853V0.36z M121.01,8.038h-3.853v4.708h3.853V8.038z"/> + <path fill="#D9D9D9" d="M131.205,12.746h3.59v-2.545h3.638v5.896h-12.385v-3.351h1.402V0.313h-1.402v-3.399h6.49v3.399h-1.333 + V12.746z"/> + <path fill="#D9D9D9" d="M144.374,16.097h-4.992v-3.305h0.69l2.875-12.478h-0.833l-0.026-3.399h5.709v3.399h-0.643l3.161,12.478 + h0.692v3.305h-5.113v-3.305h0.879l-0.26-1.091h-2.687l-0.286,1.091h0.833V16.097L144.374,16.097z M145.874,9.132l-0.738-2.971 + l-0.762,2.971H145.874z"/> + <path fill="#D9D9D9" d="M158.187,16.097h-6.299v-3.445h1.424V0.266h-1.424v-3.351h5.531l2.765,8.2v-4.92h-1.356v-3.28h6.559v3.351 + h-1.35v12.386h1.35v3.445h-5.178l-3.188-9.818v6.37h1.166V16.097L158.187,16.097z"/> + <path fill="#D9D9D9" d="M173.353,0.313v-3.399h6.156v3.399h-0.999l-4.114,5.454l4.016,6.978h1.098v3.351h-6.156v-3.351h1.05 + l-2.093-4.065l-0.928,1.307v2.758h1.354v3.351h-6.467l-0.021-3.351h1.377V0.313h-1.377v-3.399h6.487v3.399h-1.356v3.85l2.973-3.85 + H173.353z"/> +</g> +<g enable-background="new "> + <path fill="#D9D9D9" d="M37.692,44.622h-3.4l-2.328-15.737H30.8v-3.448h5.871v3.448H35.72l0.894,9.005l1.928-7.558h2.487 + l2.115,7.418l1.014-8.865h-1.235v-3.448h5.682v3.448h-1.117L45.229,44.62h-3.4l-2.068-8.653L37.692,44.622z"/> + <path fill="#D9D9D9" d="M51.384,44.622l-1.545-1.546V27.29l1.832-1.853h7.892l1.807,1.781V42.84l-1.76,1.782H51.384z + M57.612,28.887h-4.018v12.405h4.018V28.887z"/> + <path fill="#D9D9D9" d="M68.998,44.622h-6.489v-3.351h1.354V28.887h-1.354V25.44h10.504l1.81,2.141v7.128l-2.021,1.95h-1.188 + l2.591,4.612h0.713v3.353h-5.372v-3.353h0.784l-2.377-4.469h-0.166v4.469H69L68.998,44.622L68.998,44.622z M70.854,28.887h-3.066 + v4.326h3.066V28.887z"/> + <path fill="#D9D9D9" d="M86.447,44.622H75.868l-0.024-3.327h1.426V28.887h-1.426V25.44h10.65l2.115,1.851v15.412L86.447,44.622z + M84.591,28.887h-3.566v12.405h3.566V28.887z"/> + <path fill="#D9D9D9" d="M96.81,44.622h-6.606v-3.378h1.331V28.887h-1.331V25.44h9.872l1.846,1.871v7.21l-1.949,1.994h-4.543 + l0.027,4.731h1.379L96.81,44.622z M97.904,28.887h-2.521v4.181h2.521V28.887z"/> + <path fill="#D9D9D9" d="M109.313,44.622h-6.49v-3.351h1.354V28.887h-1.354V25.44h10.503l1.81,2.141v7.128l-2.018,1.95h-1.19 + l2.591,4.612h0.715v3.353h-5.374v-3.353h0.785l-2.378-4.469H108.1v4.469h1.211v3.351H109.313z M111.168,28.887h-3.064v4.326h3.064 + V28.887L111.168,28.887z"/> + <path fill="#D9D9D9" d="M128.447,44.622h-12.504v-3.351h1.357V28.837h-1.449V25.44h12.596v5.49h-3.634v-2.092h-3.756v4.445h2.877 + v3.378h-2.877v4.612h3.756V38.73h3.634V44.622z"/> + <path fill="#D9D9D9" d="M129.353,38.964h3.757v2.331h4.326v-4.636h-6.281l-1.802-1.763v-7.765l1.761-1.691h8.175l1.976,1.957v3.7 + h-3.828v-2.209h-4.326v4.326h6.322l1.76,1.76v7.845l-1.832,1.807h-7.939l-2.067-2.046V38.964L129.353,38.964z"/> + <path fill="#D9D9D9" d="M142.069,38.964h3.754v2.331h4.325v-4.636h-6.282l-1.8-1.763v-7.765l1.759-1.691h8.178l1.974,1.957v3.7 + h-3.826v-2.209h-4.327v4.326h6.323l1.758,1.76v7.845l-1.829,1.807h-7.939l-2.067-2.046L142.069,38.964L142.069,38.964z"/> + <path fill="#D9D9D9" d="M171.713,44.622h-6.396v-3.351h1.262V28.837h-1.214v2.305h-3.089v-5.633h12.405v5.633h-3.092v-2.305h-1.214 + v12.435h1.333L171.713,44.622L171.713,44.622z"/> + <path fill="#D9D9D9" d="M181.053,36.683v4.589h1.354v3.351h-6.511l0.044-3.351h1.354V28.837h-1.354V25.44h6.467v3.396h-1.354v4.328 + h3.396v-4.328h-1.401V25.44h6.487v3.396h-1.329v7.812v4.619h1.329v3.353h-6.487v-3.353h1.401v-4.585H181.053L181.053,36.683z"/> + <path fill="#D9D9D9" d="M203.016,44.622h-12.503v-3.351h1.356V28.837h-1.452V25.44h12.599v5.49h-3.637v-2.092h-3.756v4.445h2.877 + v3.378h-2.877v4.612h3.756V38.73h3.637V44.622L203.016,44.622z"/> + <path fill="#D9D9D9" d="M216.014,25.44h6.661v3.446h-1.142v12.36h1.142v3.377h-6.037v-3.377h0.999v-7.06l-2.973,10.435h-2.52 + l-2.921-10.435v7.06h1.21v3.377h-6.511v-3.377h1.377v-12.36h-1.377V25.44h6.995l2.655,12.954L216.014,25.44z"/> + <path fill="#D9D9D9" d="M236.198,44.622h-12.504v-3.351h1.356V28.837h-1.452V25.44h12.6v5.49h-3.638v-2.092h-3.757v4.445h2.878 + v3.378h-2.878v4.612h3.757V38.73h3.638V44.622L236.198,44.622z"/> +</g> +</svg> diff --git a/index.php b/index.php new file mode 100644 index 0000000..218e528 --- /dev/null +++ b/index.php @@ -0,0 +1,496 @@ +<?php get_header(); ?> + + <div id="main" class="max-w-md mx-auto" v-cloak @keydown.esc="close_all"> + + <!-- All Screen --> + <transition name="slide-fade"> + <div class="space-y-5 bg-gray-50" v-if="should_wait()"> + <div class="p-10 box-border h-screen flex flex-col"> + <!-- This example requires Tailwind CSS v2.0+ --> + <button type="button" class="flex-grow relative block w-full border-2 border-gray-300 border-dashed rounded-lg p-12 text-center"> + <span class="text-3xl text-gray-600 lnr lnr-clock"></span> + <span class="mt-2 block text-sm font-medium text-gray-600"> + <strong>{{ waiting_block.name }}</strong> <span v-if="get_setting(waiting_block.id).end">ends in {{ moment(get_setting(waiting_block.id).end, 'HH:mm').fromNow() }}</span> + <small class="block text-gray-400">Enjoy, and come back in a while.</small> + </span> + </button> + + <div class="flex-shrink pt-8"> + + <button @click.prevent="ignore_waiting.push(waiting_block.id)" type="button" class="block items-center px-4 py-2 border border-transparent text-base font-sm rounded-md shadow-sm text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 text-center w-full text-center"> + <span>Skip</span> + </button> + + </div> + </div> + </div> + </transition> + + <div v-show="should_wait() == false" class="h-screen"> + + <!-- This example requires Tailwind CSS v2.0+ --> +<nav class="bg-gray-800"> + <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> + <div class="flex justify-between h-16"> + <div class="flex"> + <div class="-ml-2 mr-2 flex items-center hidden"> + <!-- Mobile menu button --> + <button type="button" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-white hover:bg-gray-700 focus:outline-none focus:ring-2 focus:ring-inset focus:ring-white" aria-controls="mobile-menu" aria-expanded="false"> + <span class="sr-only">Open main menu</span> + <!-- + Icon when menu is closed. + + Heroicon name: outline/menu + + Menu open: "hidden", Menu closed: "block" + --> + <svg class="block h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" /> + </svg> + <!-- + Icon when menu is open. + + Heroicon name: outline/x + + Menu open: "block", Menu closed: "hidden" + --> + <svg class="hidden h-6 w-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" aria-hidden="true"> + <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /> + </svg> + </button> + </div> + <div class="flex-shrink-0 flex items-center font-mono text-white text-lg leading-none"> + Blo<strong>cks</strong> + </div> + + </div> + <div class="flex items-center"> + <div class="flex-shrink-0"> + <button v-show="!show_date_selector" @click.prevent="show_date_selector = true" type="button" class="relative inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-xs rounded-md text-white bg-indigo-500 hover:bg-indigo-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-indigo-500"> + <span class="mr-3 lnr lnr-calendar-full"></span> {{ moment(day, 'YYYYMMDD').format('MMMM Do YYYY') }} + </button> + <select + v-show="show_date_selector" + @change="show_date_selector = false" + v-model="day" + class="ml-3 block pl-3 pr-10 py-2 text-base border-gray-300 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm rounded-md" + > + <option + v-for="index in _.range(-3, 8)" + :value="moment().subtract(index, 'days').format('YYYYMMDD')" + > + {{ moment().subtract(index, 'days').format('MMMM Do YYYY') }} + </option> + </select> + </div> + <div class="md:ml-4 md:flex-shrink-0 md:flex md:items-center"> + + <!-- Profile dropdown --> + <div class="ml-3 relative"> + <div> + <button @click.prevent="menu_open = !menu_open" type="button" class="bg-gray-800 flex text-sm rounded-full focus:outline-none focus:ring-2 text-white focus:ring-offset-2 focus:ring-offset-gray-800 focus:ring-white" id="user-menu-button" aria-expanded="false" aria-haspopup="true"> + <span class="sr-only">Open user menu</span> + <!-- Heroicon name: solid/dots-vertical --> + <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true"> + <path d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z" /> + </svg> + </button> + </div> + + + </div> + </div> + </div> + </div> + </div> + + <!-- Mobile menu, show/hide based on menu state. --> + <div v-cloak v-show="menu_open" id="mobile-menu"> + <div class="px-4 sm:px-3"> + + <fieldset + class="space-y-2 mb-4" + > + <legend class="sr-only">Notifications</legend> + + <!-- Actions --> + <div + class="relative flex items-center rounded p-2 px-4" + :class="show_controls ? 'bg-gray-900' : ''" + > + <div class="flex items-center h-5"> + + <div class="bg-gray-700 border-2 rounded border-gray-800 w-5 h-5 flex flex-shrink-0 justify-center items-center focus-within:border-blue-500"> + <input v-model="show_controls" type="checkbox" class="opacity-0 absolute"> + <svg class="fill-current hidden w-3 h-3 text-gray-200 pointer-events-none" viewBox="0 0 20 20"><path d="M0 11l2-2 5 5L18 3l2 2L7 18z"/></svg> + </div> + + </div> + <div class="ml-4 text-sm flex-grow"> + <label class="font-medium text-gray-200"> + Display Actions + </label> + <span class="block text-xs text-gray-400"> + Show the edit and remove buttons. + </span> + </div> + </div> + <!-- End Actions --> + + <!-- Descriptions --> + <div + class="relative flex items-center rounded p-2 px-4" + :class="show_descriptions ? 'bg-gray-900' : ''" + > + <div class="flex items-center h-5"> + + <div class="bg-gray-700 border-2 rounded border-gray-800 w-5 h-5 flex flex-shrink-0 justify-center items-center focus-within:border-blue-500"> + <input v-model="show_descriptions" type="checkbox" class="opacity-0 absolute"> + <svg class="fill-current hidden w-3 h-3 text-gray-200 pointer-events-none" viewBox="0 0 20 20"><path d="M0 11l2-2 5 5L18 3l2 2L7 18z"/></svg> + </div> + + </div> + <div class="ml-4 text-sm flex-grow"> + <label class="font-medium text-gray-200"> + Display Descriptions + </label> + <span class="block text-xs text-gray-400"> + Show todo descriptions. + </span> + </div> + </div> + <!-- End Descriptions --> + + <!-- Timeline --> + <div + class="relative flex items-center rounded p-2 px-4" + :class="show_timeline ? 'bg-gray-900' : ''" + > + <div class="flex items-center h-5"> + + <div class="bg-gray-700 border-2 rounded border-gray-800 w-5 h-5 flex flex-shrink-0 justify-center items-center focus-within:border-blue-500"> + <input v-model="show_timeline" type="checkbox" class="opacity-0 absolute"> + <svg class="fill-current hidden w-3 h-3 text-gray-200 pointer-even…
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added WAI-ARIA Landmark Roles to enrich semantics and improve accessibility.