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

Feature/remove ie support #118

Draft
wants to merge 7 commits into
base: develop
Choose a base branch
from
Draft
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
10 changes: 0 additions & 10 deletions .modernizrrc.js

This file was deleted.

1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ COPY source source
COPY lib lib
COPY locales locales
COPY data data
COPY .modernizrrc.js .
COPY config.rb .
COPY Gemfile .
COPY Gemfile.lock .
Expand Down
5 changes: 3 additions & 2 deletions config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,15 @@ def retry_on_error(limit: 5)
raise e
end

DATO_ENV = ENV.has_key?("DATO_ENV") ? ENV.fetch("DATO_ENV") : nil
# DATO_ENV = ENV.has_key?("DATO_ENV") ? ENV.fetch("DATO_ENV") : nil

retry_on_error(limit: 10) do
activate :dato,
token: ENV.fetch("DATO_API_TOKEN"),
live_reload: true,
preview: ENV.fetch("BUILD_ENV") != "production",
environment: DATO_ENV
environment: "develop"
# environment: DATO_ENV
end

webpack_command =
Expand Down
10 changes: 3 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"bootstrap-italia": "^1.4.1",
"compression-webpack-plugin": "^7.0.0",
"css-loader": "^5",
"datocms-client": "^3.5.9",
"file-loader": "^6.2.0",
"get-caller-file": "1.0.3",
"glob": "^7.1.2",
Expand All @@ -45,23 +46,18 @@
"svg-spritemap-webpack-plugin": ">= 3.7.1",
"terser-webpack-plugin": "^5.0.3",
"webpack": "^5.10.0",
"webpack-cli": ">= 3.2.1",
"webpack-modernizr-loader": "^5",
"datocms-client": "^3.5.9"
"webpack-cli": ">= 3.2.1"
},
"dependencies": {
"@popperjs/core": "^2.6.0",
"core-js": "^3.8.3",
"focus-visible": "^5.2.0",
"gh-pages": "^3.1.0",
"lazysizes": "^5.2.2",
"sharer.js": "^0.4.1",
"svg4everybody": "^2.1.9",
"swiper": "^6.4.5"
},
"browserslist": [
"last 2 versions",
"> 1%",
"IE 11"
"> 1%"
]
}
6 changes: 0 additions & 6 deletions source/javascripts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ import "lazysizes";
import "lazysizes/plugins/respimg/ls.respimg";
import "focus-visible/src/focus-visible.js";
import Sharer from "sharer.js/sharer.js";
import "core-js/features/promise";
import "core-js/features/object/assign";
import "core-js/features/string/repeat";
import "core-js/features/number";
import svg4everybody from "svg4everybody";
const progressIndicator = require("progress-indicator.js");
const DatoCmsSearch = require("datocms-search.widget.js");

Expand Down Expand Up @@ -78,7 +73,6 @@ $(".nav-item").click(function (e) {
});

initSearch();
svg4everybody();
progressIndicator.updateProgress();
window.onscroll = function () {
progressIndicator.updateProgress();
Expand Down
43 changes: 23 additions & 20 deletions source/javascripts/progress-indicator.js
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
export function updateProgress() {
$('._content').each(function(i, obj) {
$("._content").each(function (i, obj) {
var winScroll = Math.abs(obj.getBoundingClientRect().top);
var height = obj.getBoundingClientRect().height;
var scrolled = (winScroll / height) * 100;
if (obj.getBoundingClientRect().top <= 0) {
$('._progress-indicator').each(function() {
$("._progress-indicator").each(function () {
this.style.width = valueLimit(scrolled, 0, 100) + "%";
setActiveSection()
})
setActiveSection();
});
} else {
$('._progress-indicator').each(function() {
$("._progress-indicator").each(function () {
this.style.width = 0 + "%";
})
});
}
})
});
}

function valueLimit(val, min, max) {
return (Math.min(max, Math.max(min, val)));
return Math.min(max, Math.max(min, val));
}

function setActiveSection() {
$('._anchor').each(function(i, obj) {
if (obj.getBoundingClientRect().top <= 10 ) {
clearAllActives()
setActive($(obj).children().attr('id'))
$("._anchor").each(function (i, obj) {
if (obj.getBoundingClientRect().top <= 10) {
clearAllActives();
setActive($(obj).children().attr("id"));
}
});
}

function clearAllActives() {
$('.nav-item').each(function(i, obj) {
$(obj).children().removeClass('active')
})
$(".nav-item").each(function (i, obj) {
$(obj).children().removeClass("active");
});
}

function setActive(id) {
$('._top-menu .nav-item').each(function(i, obj) {
if ($(obj).children().attr('href') === `#${id}` && !$(obj).children().hasClass('active')) {
$(obj).children().addClass('active')
$("._top-menu .nav-item").each(function (i, obj) {
if (
$(obj).children().attr("href") === `#${id}` &&
!$(obj).children().hasClass("active")
) {
$(obj).children().addClass("active");
}
})
}
});
}
17 changes: 0 additions & 17 deletions source/stylesheets/custom/_ie-fixes.scss

This file was deleted.

3 changes: 0 additions & 3 deletions source/stylesheets/custom/_mid-search.scss
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,10 @@
}
.datocms-widget__pagination__page {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
-webkit-box-pack: center;
-ms-flex-pack: center;
justify-content: center;
height: 2.5rem;
min-width: 2.5rem;
Expand Down
Loading