A => homepage.js +18 -0
@@ 0,0 1,18 @@
+// ==UserScript==
+// @name TrailLink Customizations
+// @namespace http://tampermonkey.net/
+// @version 0.1
+// @description try to take over the world!
+// @author You
+// @match https://www.traillink.com/state/*/
+// @icon https://www.google.com/s2/favicons?sz=64&domain=traillink.com
+// @grant none
+// ==/UserScript==
+
+(function() {
+ 'use strict';
+
+ // Your code here...
+ var map = document.getElementById("state-map");
+ map.style.height = "40rem";
+})();
No newline at end of file
A => trailpage.js +40 -0
@@ 0,0 1,40 @@
+// ==UserScript==
+// @name TrailLink Trail Page
+// @namespace http://tampermonkey.net/
+// @version 0.1
+// @description try to take over the world!
+// @author You
+// @match https://www.traillink.com/trail/*/
+// @icon https://www.google.com/s2/favicons?sz=64&domain=traillink.com
+// @grant none
+// ==/UserScript==
+
+(function() {
+ 'use strict';
+
+ // Your code here...
+ var accordionWrap = document.querySelector("#trail-detail-reviews .accordion-wrap");
+ accordionWrap.classList.add("open");
+
+ var moreReviews = document.querySelectorAll("#trail-detail-reviews .accordion-item section");
+ moreReviews.forEach(function(review) {
+ review.style.display = "block";
+ });
+
+ var allReviews = document.querySelectorAll(".review-text p");
+ allReviews.forEach(function(review) {
+ review.style.display = "unset";
+ });
+
+ var ratedReviews = document.querySelectorAll(".review .stars [itemprop='ratingValue']");
+ var cumulativeScore = 0;
+ ratedReviews.forEach(function(ratedReview) {
+ cumulativeScore += +ratedReview.content;
+ });
+ var average = cumulativeScore/ratedReviews.length * 2;
+ console.log("Average rating = " + average);
+
+ var rounded = (Math.round(average * 10) / 10).toFixed(1);
+
+ document.querySelector(".hero-review .reviews").innerText = "" + rounded + ", " + document.querySelector(".hero-review .reviews").innerText
+})();
No newline at end of file