Skip to content

Commit

Permalink
Merge pull request #21 from Labanquise/dev
Browse files Browse the repository at this point in the history
Bug cookies on page Score
  • Loading branch information
Frackher authored Oct 25, 2021
2 parents 38d480f + 8a7a10c commit 58a41c7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 15 deletions.
18 changes: 6 additions & 12 deletions themes/frozenTacos/assets/js/score.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ if (document.readyState === 'loading') { // Loading hasn't finished yet
getData();
}

// Toggling Class
const contentToggle = (id, id2) => {
document.getElementById(id).classList.toggle('hidden');
document.getElementById(id2).classList.add('hidden');
}

// Saving in BDD
async function getData(){
const queryString = window.location.search;
Expand Down Expand Up @@ -38,11 +32,11 @@ const populate = (res,id) => {
document.getElementById('date').innerHTML = date;


gauge('ei',res['eco-index']);
gauge('perf',res['lighthouse-perf']);
gauge('acc',res['lighthouse-accessibility']);
gauge('bp',res['lighthouse-best-practices']);
gauge('seo',res['lighthouse-seo']);
gaugeB('ei',res['eco-index']);
gaugeB('perf',res['lighthouse-perf']);
gaugeB('acc',res['lighthouse-accessibility']);
gaugeB('bp',res['lighthouse-best-practices']);
gaugeB('seo',res['lighthouse-seo']);

document.getElementById('res-pepper').classList.add('done', res['pepper-index']);
document.getElementById('s-pepper').innerHTML = res['pepper-index-score'];
Expand All @@ -58,7 +52,7 @@ const getDate = (date,ts) => {
}

// Animating Mobile results
const gauge = (id, score) => {
const gaugeB = (id, score) => {
if(score === null)
console.log('error null');
else{
Expand Down
5 changes: 2 additions & 3 deletions themes/frozenTacos/layouts/partials/script.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
{{ else if eq .Params.mp "Contact" }}
{{ $js := resources.Get "/js/contact.js" | resources.Minify | resources.Fingerprint }}
<script src="{{ $js.Permalink }}" async></script>
{{ else }}
{{ end }}
{{ $js := resources.Get "/js/main.js" | resources.Minify | resources.Fingerprint }}
<script src="{{ $js.Permalink }}" async></script>
{{ end }}
<script src="{{ $js.Permalink }}" async></script>

0 comments on commit 58a41c7

Please sign in to comment.