Merge branch 'HEAD' into main

This commit is contained in:
Matt Walsh 2023-09-20 15:41:13 -05:00
commit 3baf6d6870
9 changed files with 3107 additions and 2828 deletions

1
.gitattributes vendored
View file

@ -1,4 +1,5 @@
*.js text eol=lf
*.mjs text eol=lf
*.ejs text eol=lf
*.html text eol=lf
*.json text eol=lf

1039
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -25,7 +25,7 @@
"eslint": "^8.21.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-sonarjs": "^0.19.0",
"eslint-plugin-sonarjs": "^0.21.0",
"eslint-plugin-unicorn": "^46.0.0",
"express": "^4.17.1",
"gulp": "^4.0.2",

View file

@ -44,7 +44,7 @@ class LocalForecast extends WeatherDisplay {
forecastsElem.append(...templates);
// increase each forecast height to a multiple of container height
this.pageHeight = forecastsElem.parentNode.getBoundingClientRect().height;
this.pageHeight = forecastsElem.parentNode.scrollHeight;
templates.forEach((forecast) => {
const newHeight = Math.ceil(forecast.scrollHeight / this.pageHeight) * this.pageHeight;
forecast.style.height = `${newHeight}px`;

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load diff

View file

@ -46,12 +46,20 @@
// if the user released on a different target, cancel!
if (startEl !== e.target) return;
var swipeThreshold = parseInt(getNearestAttribute(startEl, 'data-swipe-threshold', '20'), 10); // default 20px
var swipeThreshold = parseInt(getNearestAttribute(startEl, 'data-swipe-threshold', '20'), 10); // default 20 units
var swipeUnit = getNearestAttribute(startEl, 'data-swipe-unit', 'px'); // default px
var swipeTimeout = parseInt(getNearestAttribute(startEl, 'data-swipe-timeout', '500'), 10); // default 500ms
var timeDiff = Date.now() - timeDown;
var eventType = '';
var changedTouches = e.changedTouches || e.touches || [];
if (swipeUnit === 'vh') {
swipeThreshold = Math.round((swipeThreshold / 100) * document.documentElement.clientHeight); // get percentage of viewport height in pixels
}
if (swipeUnit === 'vw') {
swipeThreshold = Math.round((swipeThreshold / 100) * document.documentElement.clientWidth); // get percentage of viewport height in pixels
}
if (Math.abs(xDiff) > Math.abs(yDiff)) { // most significant
if (Math.abs(xDiff) > swipeThreshold && timeDiff < swipeTimeout) {
if (xDiff > 0) {
@ -139,7 +147,7 @@
*/
function getNearestAttribute(el, attributeName, defaultValue) {
// walk up the dom tree looking for data-action and data-trigger
// walk up the dom tree looking for attributeName
while (el && el !== document.documentElement) {
var attributeValue = el.getAttribute(attributeName);

View file

@ -52,5 +52,6 @@
"editor.defaultFormatter": "j69.ejs-beautify"
},
"files.exclude": {},
"files.eol": "\n",
},
}