Skip to content
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

Strata static build #1

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"presets": [[
"@babel/preset-env",
{
"targets": "> 0.25%, not dead"
}]
]
}
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,4 @@ node_modules
npm-debug.log

# SASS
.sass_cache

# dist
web/dist
.sass_cache
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v12.16.0
v10.2.1
49 changes: 26 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Client Site name
# Strata website

WordPress website for Site name. Hosted on AWS Single Cloud 1.
Static website for Strata, built using [Apollo](https://apollo.studio24.net/). Hosted on AWS Single Cloud 1.

## Getting started

Expand Down Expand Up @@ -28,7 +28,7 @@ Also see more [detailed project documentation](docs/README.md) and the [project
* https://staging.strata.dev/_build_summary.json

### Development
* https://local.strata.dev
* http://strata.localhost

## Installing

Expand All @@ -43,45 +43,48 @@ Also see more [detailed project documentation](docs/README.md) and the [project

### Installing locally

A step-by-step set of instructions that tell you how to get your local development environment running.
How to get your local development environment running.

Clone repo:
#### Clone repo:

````bash
git clone [email protected]:strata/strata_website.git
````

Install PHP dependencies:
#### Install PHP dependencies:

```php
composer install
```

Install project dependencies:
#### Install project dependencies:

````bash
# Switch your version of Node to the correct version for this project (see `.nvmrc`)
From within the project root

```bash
# Switch your version of Node to the correct version for this project (see .nvmrc)
nvm use

cd web/wp-content/themes/example
# Install dependencies
npm install
````
npm run build
```

Build assets:
### Build

````bash
cd web/wp-content/themes/example
npm build
````
To re-build the assets once

Watch for changes:
```bash
npm run build
```

````bash
cd web/wp-content/themes/example
npm watch
````
To watch for changes

### Configuration
```bash
npm run watch
```

## Configuration

Any details on configuration files required.

Expand Down Expand Up @@ -135,4 +138,4 @@ see the [sync](https://github.com/studio24/deployer-recipes/blob/main/docs/sync.
## Credits
- **Alan Isaacson** - *Support Developer* - Studio 24
- **Simon Jones** - *Managing Director* - Studio 24

- **Isaac Lowe** - *Design Strategy Director* - Studio 24
Binary file added apollo/assets/fonts/Amiko-Bold-webfont.woff
Binary file not shown.
Binary file added apollo/assets/fonts/Amiko-Regular-webfont.woff
Binary file not shown.
Binary file added apollo/assets/fonts/Amiko-SemiBold-webfont.woff
Binary file not shown.
Binary file added apollo/assets/images/ccs-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apollo/assets/images/ffi-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apollo/assets/images/og-strata-image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apollo/assets/images/w3c-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 84 additions & 0 deletions apollo/assets/js/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
/**
* Does it dijon?
*
* The matchMedia API is supported by IE10 and IE11.
* If the browser supports this then we know it has better standards support than IE9.
*/
if (typeof window.matchMedia !== 'undefined') {

// The default behaviour is to add a `js` class to the HTML element if
// Javascript is available. The class is added in the <head> for better performance

// Helper function for finding elements
function findElement(target) {
// querySelector returns the first element on a page that matches the selector.
// For IDs, there should only be one match per page. For classes, it would return the first element with that class.
return document.querySelector(target);
}

// Check for if an element exists
function exists(elem) {
return (elem != null && (elem.length >= 0 || elem.innerHTML.length >= 0) )
}

// classList polyfill until browser support is better

/*
* classList.js: Cross-browser full element.classList implementation.
* 1.2.20171210
*
* By Eli Grey, http://eligrey.com
* License: Dedicated to the public domain.
* See https://github.com/eligrey/classList.js/blob/master/LICENSE.md
*/

/*global self, document, DOMException */

/*! @source http://purl.eligrey.com/github/classList.js/blob/master/classList.js */

if ("document" in self) {

// Full polyfill for browsers with no classList support
// Including IE < Edge missing SVGElement.classList
if (
!("classList" in document.createElement("_"))
|| document.createElementNS
&& !("classList" in document.createElementNS("http://www.w3.org/2000/svg","g"))
) {
myApp.polyfill(self)
}

// There is full or partial native classList support, so just check if we need
// to normalize the add/remove and toggle APIs.

myApp.normalize();
}

if (matchMedia) {
var mq = window.matchMedia("(min-width: 1000px)");
mq.addEventListener("change", myApp.updateARIAroles);
}

var contentToggler = document.querySelectorAll('[data-toggler]');

myApp.updateARIAroles(contentToggler);

// Collapsible
var collapsibleHeading = document.querySelectorAll('.js-collapsible-heading');

myApp.collaps(collapsibleHeading);

// Tab
myApp.tabs();

document.addEventListener('DOMContentLoaded', function () {

myApp.updateARIAroles(null);

// Traverse DOM and create variables
var body = findElement('body');

});
//End of ready()
}
// End of dijon
21 changes: 21 additions & 0 deletions apollo/assets/js/core.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// The core app code
var myApp = (function () {

'use strict';

// Create a public methods object
var methods = {};

/**
* Extend the public methods object
* @param {String} name The new method name
* @param {Function} fn The new method
*/
methods.extend = function (name, fn) {
methods[name] = fn;
};

// Return public methods object
return methods;

})();
38 changes: 38 additions & 0 deletions apollo/assets/js/functions/collapsibles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
(function () {

var collaps = function (collapsibleHeading){
collapsibleHeading.forEach( function(obj) {

var thisElement = obj;

// create unique id for a11y relationship
var id = 'collapsible-' + Array.prototype.indexOf.call(collapsibleHeading, thisElement);

// wrap the content and make it focusable
thisElement.nextElementSibling
.insertAdjacentHTML("afterend", '<div class="js-collapsible-content collapsible-content" id="' + id + '" aria-hidden="true"></div>');

var fragment = document.createDocumentFragment();
fragment.appendChild(thisElement.nextElementSibling);
thisElement.nextElementSibling.appendChild(fragment);

var panel = thisElement.nextElementSibling;

// Add the button inside `.js-collapsible-heading` so both the heading and button semanics are read

thisElement.innerHTML = '<button aria-expanded="false" type="button" aria-controls="' + id + '">' + thisElement.textContent + '</button>';

thisElement.classList.add('collapsible-heading');
var button = thisElement.children[0];

// Toggle the state properties
button.addEventListener("click", function () {
var state = this.getAttribute('aria-expanded') === 'false';
this.setAttribute('aria-expanded', state);
panel.setAttribute('aria-hidden', !state);
});
});
};

myApp.extend('collaps', collaps);
})();
67 changes: 67 additions & 0 deletions apollo/assets/js/functions/normalize.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
(function () {

var normalize = function () {
"use strict";

var testElement = document.createElement("_");

testElement.classList.add("c1", "c2");

// Polyfill for IE 10/11 and Firefox <26, where classList.add and
// classList.remove exist but support only one argument at a time.
if (!testElement.classList.contains("c2")) {
var createMethod = function(method) {
var original = DOMTokenList.prototype[method];

DOMTokenList.prototype[method] = function(token) {
var i, len = arguments.length;

for (i = 0; i < len; i++) {
token = arguments[i];
original.call(this, token);
}
};
};
createMethod('add');
createMethod('remove');
}

testElement.classList.toggle("c3", false);

// Polyfill for IE 10 and Firefox <24, where classList.toggle does not
// support the second argument.
if (testElement.classList.contains("c3")) {
var _toggle = DOMTokenList.prototype.toggle;

DOMTokenList.prototype.toggle = function(token, force) {
if (1 in arguments && !this.contains(token) === !force) {
return force;
} else {
return _toggle.call(this, token);
}
};

}

// replace() polyfill
if (!("replace" in document.createElement("_").classList)) {
DOMTokenList.prototype.replace = function (token, replacement_token) {
var
tokens = this.toString().split(" ")
, index = tokens.indexOf(token + "")
;
if (~index) {
tokens = tokens.slice(index);
this.remove.apply(this, tokens);
this.add(replacement_token);
this.add.apply(this, tokens.slice(1));
}
}
}

testElement = null;
};

myApp.extend('normalize', normalize)

})();
Loading
Loading