diff --git a/lib/Feed.php b/lib/Feed.php index f64061c..42de64e 100644 --- a/lib/Feed.php +++ b/lib/Feed.php @@ -30,9 +30,6 @@ class Feed extends PhpObject { //Timezone const TIMEZONE_HOOK = 'http://api.geonames.org/timezoneJSON'; - const TIMEZONE_PARAM = array( - 'username' => Settings::TIMEZONE_USER - ); //DB Tables const SPOT_TABLE = 'spots'; @@ -235,10 +232,10 @@ class Feed extends PhpObject { 'type' => $asMsg['messageType'], 'latitude' => $asMsg['latitude'], 'longitude' => $asMsg['longitude'], - 'iso_time' => $asMsg['dateTime'], //ISO 8601 time (backup) - 'site_time' => date(Db::TIMESTAMP_FORMAT, $asMsg['unixTime']), //Conversion to Site Time - 'timezone' => $this->getTimeZone(array($asMsg['latitude'], $asMsg['longitude']), $asMsg['unixTime']), - 'unix_time' => $asMsg['unixTime'], //UNIX Time (backup) + 'iso_time' => $asMsg['dateTime'], //ISO 8601 time (backup) + 'site_time' => date(Db::TIMESTAMP_FORMAT, $asMsg['unixTime']), //Conversion to Site Time + 'timezone' => $this->getTimeZone($asMsg['latitude'], $asMsg['longitude']), //Get message time zone + 'unix_time' => $asMsg['unixTime'], //UNIX Time (backup) 'content' => $asMsg['messageContent'], 'battery_state' => $asMsg['batteryState'] ); @@ -291,10 +288,12 @@ class Feed extends PhpObject { ); } - private function getTimeZone($asLatLng, $iTimeStamp) { - $asParams = self::TIMEZONE_PARAM; - $asParams['lat'] = $asLatLng[0]; - $asParams['lng'] = $asLatLng[1]; + private function getTimeZone($iLat, $iLng) { + $asParams = array( + 'username' => Settings::TIMEZONE_USER, + 'lat' => $iLat, + 'lng' => $iLng + ); $sApiUrl = self::TIMEZONE_HOOK.'?'.http_build_query($asParams); $asTimeZone = json_decode(file_get_contents($sApiUrl), true); diff --git a/lib/Livetrail.php b/lib/Livetrail.php index 422d287..1db374c 100755 --- a/lib/Livetrail.php +++ b/lib/Livetrail.php @@ -271,9 +271,9 @@ class Livetrail extends Main //Send Update Email if($bNewMsg) { $bSuccess = $this->sendEmail(); - $sDesc = $bSuccess?'mail_sent':'mail_failure'; + $sDesc = Mask::LANG_PREFIX.($bSuccess?'email.sent':'email.failure'); } - else $sDesc = 'no_new_msg'; + else $sDesc = Mask::LANG_PREFIX.'spot.no_new_msg'; return self::getJsonResult($bSuccess, $sDesc); } @@ -711,14 +711,14 @@ class Livetrail extends Main if($bSuccess) { $bSuccess = $this->sendEmail(); - $sDesc = $bSuccess?'mail_sent':'mail_failure'; + $sDesc = Mask::LANG_PREFIX.($bSuccess?'email.sent':'email.failure'); } else $sDesc = 'error.commit_db'; return self::getJsonResult($bSuccess, $sDesc); } - public function getAdminSettings($sType='') { + public function getAdminSettings() { $oFeed = new Feed($this->oDb); $asData = array( 'project' => $this->oProject->getProjects(), diff --git a/lib/Map.php b/lib/Map.php index 534a007..944804f 100644 --- a/lib/Map.php +++ b/lib/Map.php @@ -3,7 +3,6 @@ namespace Franzz\Livetrail; use Franzz\Objects\PhpObject; use Franzz\Objects\Db; -use \Settings; class Map extends PhpObject { @@ -63,4 +62,4 @@ class Map extends PhpObject { return $sUrl; } -} \ No newline at end of file +} diff --git a/lib/Media.php b/lib/Media.php index a99e0cd..af70c48 100644 --- a/lib/Media.php +++ b/lib/Media.php @@ -4,7 +4,6 @@ namespace Franzz\Livetrail; use Franzz\Objects\PhpObject; use Franzz\Objects\Db; use Franzz\Objects\ToolBox; -use \Settings; class Media extends PhpObject { @@ -21,7 +20,6 @@ class Media extends PhpObject { private Project $oProject; private $asMedia; private $asMedias; - //private $sSystemType; private $iMediaId; @@ -31,7 +29,6 @@ class Media extends PhpObject { $this->oProject = &$oProject; $this->asMedia = array(); $this->asMedias = array(); - //$this->sSystemType = (substr(php_uname(), 0, 7) == "Windows")?'win':'unix'; $this->setMediaId($iMediaId); } @@ -328,4 +325,4 @@ class Media extends PhpObject { preg_match('/^(?P[\+\-][0,1]?\d{2}\.\d+)(?P[\+\-][0,1]?\d{2}\.\d+)(?P[\+\-]\d+)?/', $sIso6709, $asMatches); return array(floatval($asMatches['lat']), floatval($asMatches['lng']), floatval($asMatches['alt'] ?? 0)); } -} \ No newline at end of file +} diff --git a/lib/Project.php b/lib/Project.php index 580a0ee..7a551ca 100644 --- a/lib/Project.php +++ b/lib/Project.php @@ -3,7 +3,6 @@ namespace Franzz\Livetrail; use Franzz\Objects\PhpObject; use Franzz\Objects\Db; -use \Settings; class Project extends PhpObject { @@ -28,7 +27,6 @@ class Project extends PhpObject { private $sCodeName; private $sMode; private $asActive; - private $asGeo; public function __construct(Db &$oDb, $iProjectId=0) { parent::__construct(__CLASS__); @@ -195,7 +193,6 @@ class Project extends PhpObject { $this->sCodeName = $asProject['codename']; $this->sMode = $asProject['mode']; $this->asActive = array('from'=>$asProject['active_from'], 'to'=>$asProject['active_to']); - $this->asGeo = array(/*'geofile'=>$asProject['geofilepath'], */'gpxfile'=>$asProject['gpxfilepath']); } else $this->addError('Error while setting project: no project ID'); } diff --git a/lib/User.php b/lib/User.php index 2eb6558..b7b5e08 100644 --- a/lib/User.php +++ b/lib/User.php @@ -3,7 +3,6 @@ namespace Franzz\Livetrail; use Franzz\Objects\PhpObject; use Franzz\Objects\Db; -use \Settings; class User extends PhpObject { diff --git a/resources/lang/en.json b/resources/lang/en.json index c87e600..c511fb8 100644 --- a/resources/lang/en.json +++ b/resources/lang/en.json @@ -55,6 +55,8 @@ "subject": "Registration confirmed", "thanks_subject": "You're all set!" }, + "failure": "Failed to send the update email", + "sent": "Update email sent", "unsubscribe": "PS: Changed your mind?", "unsubscribe_button": "Unsubscribe", "update": { @@ -140,6 +142,7 @@ "id": "Spot ID", "model": "Model", "name": "Spot name", + "no_new_msg": "No new messages", "plural": "Spots", "ref_id": "Ref. Spot ID" }, diff --git a/resources/lang/es.json b/resources/lang/es.json index eb55ce3..072a48e 100644 --- a/resources/lang/es.json +++ b/resources/lang/es.json @@ -55,6 +55,8 @@ "subject": "Confirmación", "thanks_subject": "¡Hecho!" }, + "failure": "No se pudo enviar el correo de actualización", + "sent": "Correo de actualización enviado", "unsubscribe": "PD: ¿Demasiados correos electrónicos?", "unsubscribe_button": "Darse de baja", "update": { @@ -140,6 +142,7 @@ "id": "ID de Spot", "model": "Modelo", "name": "Spot", + "no_new_msg": "No hay mensajes nuevos", "plural": "Spots", "ref_id": "ID de referencia de Spot" }, diff --git a/resources/lang/fr.json b/resources/lang/fr.json index 7079754..ebca399 100644 --- a/resources/lang/fr.json +++ b/resources/lang/fr.json @@ -55,6 +55,8 @@ "subject": "Confirmation", "thanks_subject": "C'est tout bon !" }, + "failure": "Échec de l’envoi de l’e-mail de mise à jour", + "sent": "E-mail de mise à jour envoyé", "unsubscribe": "PS : Trop d'e-mails ?", "unsubscribe_button": "Se désinscrire", "update": { @@ -140,6 +142,7 @@ "id": "ID Spot", "model": "Modèle", "name": "Spot", + "no_new_msg": "Aucun nouveau message", "plural": "Spots", "ref_id": "ID Spot ref." }, diff --git a/src/components/Admin.vue b/src/components/Admin.vue index ff5fb6b..e0d0117 100644 --- a/src/components/Admin.vue +++ b/src/components/Admin.vue @@ -69,7 +69,7 @@ export default { }; this.api.post('admin_delete', asInputs) - .then((asData) => { + .then(() => { delete this.elems[asInputs.type][asInputs.id]; this.addFeedback('success', this.l('admin.delete_success'), asInputs); }) @@ -91,7 +91,7 @@ export default { }; this.api.post('admin_set', asInputs) - .then((asData) => { + .then(() => { this.elems[oElem.type][oElem.id][oEvent.target.name] = sNewVal; this.addFeedback('success', this.l('admin.save_success'), asInputs); }) @@ -106,8 +106,8 @@ export default { this.saveTimer = setTimeout(() => {this.updateElem(oElem, oEvent);}, 2000); }, updateProject() { - this.api.post('update_project') - .then((asData, sMsg) => {this.addFeedback('success', sMsg, {'update':'project'});}) + this.api.request('update_project', {}, 'POST') + .then((oResponse) => {this.addFeedback('success', oResponse.desc, {'update':'project'});}) .catch((sMsg) => {this.addFeedback('error', sMsg, {'update':'project'});}); } } diff --git a/src/components/AppIcon.vue b/src/components/AppIcon.vue index 4ffbb0e..da7e4ff 100644 --- a/src/components/AppIcon.vue +++ b/src/components/AppIcon.vue @@ -18,14 +18,6 @@ export default { transform: String }, computed: { - iconClassNames() { - return [ - 'app-icon', - this.icon, - ...(this.classes || '').split(/\s+/), - this.margin?'margin-'+this.margin:null - ].filter(Boolean).join(' '); - }, resolvedFixedWidth() { return (this.width == 'fixed') || null; }, @@ -93,4 +85,4 @@ export default { margin-left: var.$text-spacing; } } - \ No newline at end of file + diff --git a/src/components/Project.vue b/src/components/Project.vue index fa8d7ca..372f2a9 100644 --- a/src/components/Project.vue +++ b/src/components/Project.vue @@ -121,7 +121,7 @@ export default { project: this }; }, - inject: ['api', 'lang', 'hash', 'projects', 'user', 'consts', 'isMobile'], + inject: ['api', 'lang', 'hash', 'projects', 'consts', 'isMobile'], mounted() { //Starts default project init() through watcher if(this.hash.items.length == 0) { diff --git a/src/components/ProjectFeed.vue b/src/components/ProjectFeed.vue index f76e41f..802a3dc 100644 --- a/src/components/ProjectFeed.vue +++ b/src/components/ProjectFeed.vue @@ -3,7 +3,6 @@ import Simplebar from 'simplebar-vue'; import AppIcon from '@components/AppIcon'; import ProjectPost from '@components/ProjectPost'; -import { faHistory, faThumbTackSlash } from '@fortawesome/free-solid-svg-icons'; export default { components: { diff --git a/src/components/ProjectPost.vue b/src/components/ProjectPost.vue index f1c1736..96cfa4c 100644 --- a/src/components/ProjectPost.vue +++ b/src/components/ProjectPost.vue @@ -147,7 +147,7 @@ this.feed.checkNewFeed(); this.sending = false; }) - .catch((sDesc) => { + .catch(() => { this.sending = false; }); } diff --git a/src/components/Upload.vue b/src/components/Upload.vue index 5a3067c..67db013 100644 --- a/src/components/Upload.vue +++ b/src/components/Upload.vue @@ -104,7 +104,7 @@ export default { 'longitude': position.coords.longitude, 'timestamp': Math.round(position.timestamp / 1000) }) - .then((asData) => {this.logs.push(this.lang.get('upload.success', [this.lang.get('upload.position.new')]));}) + .then(() => {this.logs.push(this.lang.get('upload.success', [this.lang.get('upload.position.new')]));}) .catch((sMsgId) => {this.logs.push(this.lang.get(sMsgId));}); }, (error) => { diff --git a/src/scripts/icons.js b/src/scripts/icons.js index e1a2a6d..54041be 100644 --- a/src/scripts/icons.js +++ b/src/scripts/icons.js @@ -1,9 +1,9 @@ +// Font Awesome Free Solid Icons import { faArrowsRotate, faBars, faCamera, faCarSide, - faChartArea, faCheck, faChevronLeft, faChevronRight, @@ -61,7 +61,11 @@ function customIcon(iconName, width, height, hex, path) { }; } -/* TODO: Use official icons: https://github.com/visualcrossing/WeatherIcons/tree/main/SVG/2nd%20Set%20-%20Monochrome */ +// Additional Icons +const faCommentPen = customIcon('comment-pen', 512, 512, 'f4ae', 'M256 480c141.4 0 256-107.5 256-240S397.4 0 256 0 0 107.5 0 240c0 54.3 19.2 104.3 51.6 144.5L2.8 476.8c-4.8 9-3.3 20 3.6 27.5s17.8 9.8 27.1 5.8l118.4-50.7C183.7 472.6 218.9 480 256 480zM144.4 334.3l12.3-49.4c2.1-8.4 6.5-16.2 12.6-22.3L290.7 141.3c8.5-8.5 20-13.3 32-13.3 25 0 45.3 20.3 45.3 45.3 0 12-4.8 23.5-13.3 32L233.4 326.6c-6.2 6.2-13.9 10.5-22.3 12.6l-49.4 12.3c-1.1 .3-2.3 .4-3.5 .4-7.9 0-14.2-6.4-14.2-14.2 0-1.2 .1-2.3 .4-3.5z'); +const findMeSpot = customIcon('find-me-spot', 406, 469, 'e900', 'M85.806 195.8c-1-0.8-1.3-2.3-0.6-3.4 11.1-18.2 56.5-85.8 117.3-85.8 49.6 0 90.4 33.4 110.3 53.3 1.2 1.2 2.9 1.9 4.6 1.9s3.4-0.7 4.6-1.9l16.4-16.3c1-1 1.1-2.5 0.2-3.5-5.1-6.1-15.3-17.2-29.8-28.2-31.7-24.1-67.5-36.3-106.3-36.3-79.4 0-129.8 75.4-142.3 96.5-0.8 1.4-2.6 1.7-3.8 0.7l-55.4-43.6c-1-0.8-1.3-2.2-0.7-3.3 5.9-10.8 23-39.4 48.5-63.7 42.8-40.7 95.1-62.2 151.4-62.2 56 0 109.2 18.9 153.9 54.8 27.3 21.9 45.5 43.2 51.3 50.4 0.8 1 0.7 2.5-0.2 3.5l-12.3 12.2c-1.1 1.1-2.9 1-3.8-0.2-7.3-8.9-26.2-30.5-49.7-49.2-41.1-32.7-88-49.2-139.2-49.2-50.9 0-96.5 18.6-135.4 55.4-20.9 19.7-30.4 34.1-35.6 42.3-0.7 1.1-0.5 2.6 0.6 3.5l16.7 13.2c1.2 0.9 2.6 1.4 4.1 1.4 2.2 0 4.2-1.1 5.4-2.9 7.4-10.7 15.9-20.6 26.8-31.1 34.3-33.1 75.7-50.6 119.9-50.6 92 0 151.2 70.7 165.3 89.4 0.8 1.1 0.7 2.5-0.3 3.4l-49.8 49.3c-1.1 1.1-2.8 1-3.8-0.1-15.9-18.1-63-66.5-111.4-66.5-23.6 0-46.6 11.3-68.4 33.5-7.2 7.3-13.9 15.6-19.9 24.4-0.8 1.1-0.5 2.7 0.6 3.6l93.1 73.2c1.1 0.9 1.3 2.5 0.4 3.7l-10.5 13.3c-0.9 1.1-2.5 1.3-3.7 0.4l-108.5-85.3z M205.91 468.9c-56 0-109.2-18.9-153.9-54.8-27.3-21.9-45.5-43.2-51.3-50.4-0.8-1-0.7-2.5 0.2-3.5l12.3-12.2c1.1-1.1 2.9-1 3.8 0.2 7.3 8.9 26.2 30.5 49.7 49.2 41.1 32.7 88 49.2 139.2 49.2 50.9 0 96.5-18.6 135.4-55.4 20.9-19.7 30.4-34.1 35.6-42.3 0.7-1.1 0.5-2.6-0.6-3.5l-16.7-13.2c-1.2-0.9-2.6-1.4-4.1-1.4-2.2 0-4.2 1.1-5.4 2.9-7.4 10.7-15.9 20.6-26.8 31.1-34.3 33.1-75.7 50.6-119.8 50.6-92 0-151.2-70.7-165.3-89.4-0.8-1.1-0.7-2.5 0.3-3.4l49.8-49.3c1.1-1.1 2.8-1 3.8 0.1 15.9 18.1 63 66.5 111.4 66.5 23.6 0 46.6-11.3 68.4-33.5 7.2-7.3 13.9-15.6 19.9-24.4 0.8-1.1 0.5-2.7-0.6-3.6l-93.1-73.2c-1.1-0.9-1.3-2.5-0.4-3.7l10.5-13.3c0.9-1.1 2.5-1.3 3.7-0.4l108.3 85.2c1 0.8 1.3 2.3 0.6 3.4-11.1 18.2-56.5 85.8-117.3 85.8-49.6 0-90.4-33.4-110.3-53.3-1.2-1.2-2.9-1.9-4.6-1.9s-3.4 0.7-4.6 1.9l-16.4 16.3c-1 1-1.1 2.5-0.2 3.5 5.1 6.1 15.3 17.2 29.8 28.2 31.7 24.1 67.5 36.3 106.3 36.3 79.4 0 129.8-75.4 142.3-96.5 0.8-1.4 2.6-1.7 3.8-0.7l55.4 43.6c1 0.8 1.3 2.2 0.7 3.3-5.9 10.8-23 39.4-48.5 63.7-42.6 40.8-95 62.3-151.3 62.3z'); + +// Additional Weather Icons (TODO: Use official icons: https://github.com/visualcrossing/WeatherIcons/tree/main/SVG/2nd%20Set%20-%20Monochrome ) const faCloudBoltMoon = customIcon('cloud-bolt-moon', 640, 512, 'f76d', 'M399.1 48.4c34.7 19.6 59.3 54.8 64.2 96.1 38.8 22 64.9 63.6 64.9 111.4 35.6 .6 63.5-10.3 89.7-31.2 3.5-2.8 6.9-5.8 10.1-8.9 4.1-4 5.3-10.1 3-15.3s-7.7-8.4-13.4-7.9c-4 .3-7.9 .4-11.9 .3-55.5-1.9-99.9-47.5-99.9-103.4 0-36.3 18.7-68.3 47.1-86.8 3.3-2.2 6.8-4.1 10.3-5.9 5.1-2.5 8.1-8 7.4-13.7s-4.9-10.3-10.4-11.6c-10.5-2.4-21.2-3.5-31.9-3.5-56.7 0-105.8 32.8-129.3 80.5zM206.8 416L175.5 520.1c-3.6 11.9 5.3 23.9 17.8 23.9 4.6 0 9-1.7 12.4-4.7L346.9 412.9c3.5-3.1 5.5-7.6 5.5-12.4 0-9.2-7.4-16.6-16.6-16.6l-61.8 0 31.2-104.1c3.6-11.9-5.3-23.9-17.8-23.9-4.6 0-9 1.7-12.4 4.7L133.9 387.1c-3.5 3.1-5.5 7.6-5.5 12.4 0 9.2 7.4 16.6 16.6 16.6l61.8 0zm193.5-80.1c44.2 0 80-35.8 80-80 0-39.3-28.4-72.1-65.8-78.7 1.2-5.6 1.9-11.3 1.9-17.2 0-44.2-35.8-80-80-80-17 0-32.8 5.3-45.8 14.4-16.8-27.8-47.3-46.4-82.2-46.4-53.1 0-96.3 44.5-96 97.3-45.4 7.6-80 47.1-80 94.6 0 50 38.3 91.1 87.2 95.6L243.1 225c12.2-10.9 28-17 44.4-17 44.6 0 76.5 43 63.7 85.7l-12.7 42.2 61.8 0z'); const faCloudBoltSun = customIcon('cloud-bolt-sun', 576, 512, 'f76e', 'M248.5-31c-4.2-1.7-8.9-1.3-12.6 1.2L176 9.9 116.2-29.8c-3.7-2.5-8.5-2.9-12.6-1.2s-7.2 5.4-8.1 9.8L81.2 49.2 10.8 63.4c-4.4 .9-8.1 3.9-9.8 8.1S-.2 80.4 2.3 84.2L41.9 144 2.3 203.8c-2.5 3.7-2.9 8.5-1.2 12.6s5.4 7.2 9.8 8.1l69.3 14c.5-47.2 26.5-88.2 64.9-110 7.3-60.8 57.3-108.5 119.1-112.3l-7.6-37.4c-.9-4.4-3.9-8.1-8.1-9.8zM128 239.9c0 44.2 35.8 80 80 80l6.7 0 124-111c12.2-10.9 28-17 44.4-17 44.6 0 76.5 43 63.7 85.7l-12.7 42.2 45.8 0c53 0 96-43 96-96 0-47.6-34.6-87-80-94.6 .4-52.8-42.9-97.3-96-97.3-34.9 0-65.4 18.6-82.2 46.4-13-9.1-28.8-14.4-45.8-14.4-44.2 0-80 35.8-80 80 0 5.9 .6 11.7 1.9 17.2-37.4 6.7-65.8 39.4-65.8 78.7zM302.4 400L271.2 504.1c-3.6 11.9 5.3 23.9 17.8 23.9 4.6 0 9-1.7 12.4-4.7L442.5 396.9c3.5-3.1 5.5-7.6 5.5-12.4 0-9.2-7.4-16.6-16.6-16.6l-61.8 0 31.2-104.1c3.6-11.9-5.3-23.9-17.8-23.9-4.6 0-9 1.7-12.4 4.7L229.5 371.1c-3.5 3.1-5.5 7.6-5.5 12.4 0 9.2 7.4 16.6 16.6 16.6l61.8 0z'); const faCloudFog = customIcon('cloud-fog', 576, 512, 'f74e', 'M32 224c0 53 43 96 96 96l320 0c53 0 96-43 96-96s-43-96-96-96c-.5 0-1.1 0-1.6 0 1.1-5.2 1.6-10.5 1.6-16 0-44.2-35.8-80-80-80-24.3 0-46.1 10.9-60.8 28-18.7-35.7-56.1-60-99.2-60-61.9 0-112 50.1-112 112 0 7.1 .7 14.1 1.9 20.8-38.3 12.6-65.9 48.7-65.9 91.2zM512 392c0-13.3-10.7-24-24-24L24 368c-13.3 0-24 10.7-24 24s10.7 24 24 24l464 0c13.3 0 24-10.7 24-24zM88 464c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-80 0zm176 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l288 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-288 0z'); @@ -69,10 +73,9 @@ const faCloudHail = customIcon('cloud-hail', 512, 512, 'f739', 'M96 320c-53 0-96 const faCloudSleet = customIcon('cloud-sleet', 512, 512, 'f741', 'M96 320c-53 0-96-43-96-96 0-42.5 27.6-78.6 65.9-91.2-1.3-6.7-1.9-13.7-1.9-20.8 0-61.9 50.1-112 112-112 43.1 0 80.5 24.3 99.2 60 14.7-17.1 36.5-28 60.8-28 44.2 0 80 35.8 80 80 0 5.5-.6 10.8-1.6 16 .5 0 1.1 0 1.6 0 53 0 96 43 96 96s-43 96-96 96L96 320zm80 48c13.3 0 24 10.7 24 24l0 16 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0 0 16c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-16-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-16c0-13.3 10.7-24 24-24zm272 24l0 16 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0 0 16c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-16-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-16c0-13.3 10.7-24 24-24s24 10.7 24 24zM86.8 399.6l-32 96C50.6 508.2 37 515 24.4 510.8S5 493 9.2 480.4l32-96C45.4 371.8 59 365 71.6 369.2S91 387 86.8 399.6zm248 0l-32 96c-4.2 12.6-17.8 19.4-30.4 15.2S253 493 257.2 480.4l32-96c4.2-12.6 17.8-19.4 30.4-15.2S339 387 334.8 399.6z'); const faCloudSnow = customIcon('cloud-snow', 512, 512, 'f742', 'M96 320c-53 0-96-43-96-96 0-42.5 27.6-78.6 65.9-91.2-1.3-6.7-1.9-13.7-1.9-20.8 0-61.9 50.1-112 112-112 43.1 0 80.5 24.3 99.2 60 14.7-17.1 36.5-28 60.8-28 44.2 0 80 35.8 80 80 0 5.5-.6 10.8-1.6 16 .5 0 1.1 0 1.6 0 53 0 96 43 96 96s-43 96-96 96L96 320zm0 72l0 16 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0 0 16c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-16-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-16c0-13.3 10.7-24 24-24s24 10.7 24 24zm184 32l0 16 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0 0 16c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-16-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-16c0-13.3 10.7-24 24-24s24 10.7 24 24zm160-56c13.3 0 24 10.7 24 24l0 16 16 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-16 0 0 16c0 13.3-10.7 24-24 24s-24-10.7-24-24l0-16-16 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l16 0 0-16c0-13.3 10.7-24 24-24z'); const faClouds = customIcon('clouds', 576, 512, 'e47d', 'M112.4 276.4c-5.6 3.5-11 7.4-16 11.6l-.4 0c-53 0-96-43-96-96S43 96 96 96l1.1 0c7.8-54.3 54.4-96 110.9-96 47.9 0 88.8 30.1 104.8 72.4 12-5.4 25.2-8.4 39.2-8.4 53 0 96 43 96 96 0 1.3 0 2.7-.1 4-10.2-2.6-20.9-4-31.9-4-14 0-27.4 2.2-40 6.4-27.9-23.9-64.3-38.4-104-38.4-84.4 0-153.6 65.4-159.6 148.4zM184 480c-48.6 0-88-39.4-88-88 0-40.9 27.8-75.2 65.6-85.1-1-6.1-1.6-12.4-1.6-18.9 0-61.9 50.1-112 112-112 39 0 73.3 19.9 93.3 50.1 13.8-11.3 31.4-18.1 50.7-18.1 44.2 0 80 35.8 80 80 0 .4 0 .9 0 1.3 45.4 7.6 80 47.1 80 94.7 0 53-43 96-96 96l-296 0z'); -const faCommentPen = customIcon('comment-pen', 512, 512, 'f4ae', 'M256 480c141.4 0 256-107.5 256-240S397.4 0 256 0 0 107.5 0 240c0 54.3 19.2 104.3 51.6 144.5L2.8 476.8c-4.8 9-3.3 20 3.6 27.5s17.8 9.8 27.1 5.8l118.4-50.7C183.7 472.6 218.9 480 256 480zM144.4 334.3l12.3-49.4c2.1-8.4 6.5-16.2 12.6-22.3L290.7 141.3c8.5-8.5 20-13.3 32-13.3 25 0 45.3 20.3 45.3 45.3 0 12-4.8 23.5-13.3 32L233.4 326.6c-6.2 6.2-13.9 10.5-22.3 12.6l-49.4 12.3c-1.1 .3-2.3 .4-3.5 .4-7.9 0-14.2-6.4-14.2-14.2 0-1.2 .1-2.3 .4-3.5z'); const faMoonStars = customIcon('moon-stars', 512, 512, 'f755', 'M439.8 89.8c1 3.6 4.4 6.2 8.2 6.2s7.1-2.5 8.2-6.2l11-38.6 38.6-11c3.6-1 6.2-4.4 6.2-8.2s-2.5-7.1-6.2-8.2l-38.6-11-11-38.6c-1-3.6-4.4-6.2-8.2-6.2s-7.1 2.5-8.2 6.2l-11 38.6-38.6 11c-3.6 1-6.2 4.4-6.2 8.2s2.5 7.1 6.2 8.2l38.6 11 11 38.6zM224 64C100.3 64 0 164.3 0 288S100.3 512 224 512c60.2 0 114.9-23.8 155.1-62.4 6.4-6.1 8.2-15.7 4.6-23.8s-12-13-20.8-12.3c-4.3 .3-8.6 .5-12.9 .5-88.9 0-161-72.1-161-161 0-63.1 36.3-117.8 89.3-144.2 7.9-4 12.6-12.5 11.5-21.3s-7.6-16-16.2-18C257.6 65.9 241 64 224 64zM355.2 268.8l16.6 58c1.6 5.5 6.6 9.2 12.2 9.2s10.7-3.8 12.2-9.2l16.6-58 58-16.6c5.5-1.6 9.2-6.6 9.2-12.2s-3.8-10.7-9.2-12.2l-58-16.6-16.6-58c-1.6-5.5-6.6-9.2-12.2-9.2s-10.7 3.8-12.2 9.2l-16.6 58-58 16.6c-5.5 1.6-9.2 6.6-9.2 12.2s3.8 10.7 9.2 12.2l58 16.6z'); -const findMeSpot = customIcon('find-me-spot', 406, 469, 'e900', 'M85.806 195.8c-1-0.8-1.3-2.3-0.6-3.4 11.1-18.2 56.5-85.8 117.3-85.8 49.6 0 90.4 33.4 110.3 53.3 1.2 1.2 2.9 1.9 4.6 1.9s3.4-0.7 4.6-1.9l16.4-16.3c1-1 1.1-2.5 0.2-3.5-5.1-6.1-15.3-17.2-29.8-28.2-31.7-24.1-67.5-36.3-106.3-36.3-79.4 0-129.8 75.4-142.3 96.5-0.8 1.4-2.6 1.7-3.8 0.7l-55.4-43.6c-1-0.8-1.3-2.2-0.7-3.3 5.9-10.8 23-39.4 48.5-63.7 42.8-40.7 95.1-62.2 151.4-62.2 56 0 109.2 18.9 153.9 54.8 27.3 21.9 45.5 43.2 51.3 50.4 0.8 1 0.7 2.5-0.2 3.5l-12.3 12.2c-1.1 1.1-2.9 1-3.8-0.2-7.3-8.9-26.2-30.5-49.7-49.2-41.1-32.7-88-49.2-139.2-49.2-50.9 0-96.5 18.6-135.4 55.4-20.9 19.7-30.4 34.1-35.6 42.3-0.7 1.1-0.5 2.6 0.6 3.5l16.7 13.2c1.2 0.9 2.6 1.4 4.1 1.4 2.2 0 4.2-1.1 5.4-2.9 7.4-10.7 15.9-20.6 26.8-31.1 34.3-33.1 75.7-50.6 119.9-50.6 92 0 151.2 70.7 165.3 89.4 0.8 1.1 0.7 2.5-0.3 3.4l-49.8 49.3c-1.1 1.1-2.8 1-3.8-0.1-15.9-18.1-63-66.5-111.4-66.5-23.6 0-46.6 11.3-68.4 33.5-7.2 7.3-13.9 15.6-19.9 24.4-0.8 1.1-0.5 2.7 0.6 3.6l93.1 73.2c1.1 0.9 1.3 2.5 0.4 3.7l-10.5 13.3c-0.9 1.1-2.5 1.3-3.7 0.4l-108.5-85.3z M205.91 468.9c-56 0-109.2-18.9-153.9-54.8-27.3-21.9-45.5-43.2-51.3-50.4-0.8-1-0.7-2.5 0.2-3.5l12.3-12.2c1.1-1.1 2.9-1 3.8 0.2 7.3 8.9 26.2 30.5 49.7 49.2 41.1 32.7 88 49.2 139.2 49.2 50.9 0 96.5-18.6 135.4-55.4 20.9-19.7 30.4-34.1 35.6-42.3 0.7-1.1 0.5-2.6-0.6-3.5l-16.7-13.2c-1.2-0.9-2.6-1.4-4.1-1.4-2.2 0-4.2 1.1-5.4 2.9-7.4 10.7-15.9 20.6-26.8 31.1-34.3 33.1-75.7 50.6-119.8 50.6-92 0-151.2-70.7-165.3-89.4-0.8-1.1-0.7-2.5 0.3-3.4l49.8-49.3c1.1-1.1 2.8-1 3.8 0.1 15.9 18.1 63 66.5 111.4 66.5 23.6 0 46.6-11.3 68.4-33.5 7.2-7.3 13.9-15.6 19.9-24.4 0.8-1.1 0.5-2.7-0.6-3.6l-93.1-73.2c-1.1-0.9-1.3-2.5-0.4-3.7l10.5-13.3c0.9-1.1 2.5-1.3 3.7-0.4l108.3 85.2c1 0.8 1.3 2.3 0.6 3.4-11.1 18.2-56.5 85.8-117.3 85.8-49.6 0-90.4-33.4-110.3-53.3-1.2-1.2-2.9-1.9-4.6-1.9s-3.4 0.7-4.6 1.9l-16.4 16.3c-1 1-1.1 2.5-0.2 3.5 5.1 6.1 15.3 17.2 29.8 28.2 31.7 24.1 67.5 36.3 106.3 36.3 79.4 0 129.8-75.4 142.3-96.5 0.8-1.4 2.6-1.7 3.8-0.7l55.4 43.6c1 0.8 1.3 2.2 0.7 3.3-5.9 10.8-23 39.4-48.5 63.7-42.6 40.8-95 62.3-151.3 62.3z'); +// Mapping const ICONS = { /* Navigation */ menu: faBars, @@ -95,7 +98,6 @@ const ICONS = { 'main': faPersonHiking, 'hitchhiking': faCarSide, layers: faLayerGroup, - 'elev-chart': faChartArea, distance: faCircleRight, 'elev-drop': faCircleDown, 'elev-gain': faCircleUp, diff --git a/src/scripts/lightbox.js b/src/scripts/lightbox.js index 34fc93a..390434e 100644 --- a/src/scripts/lightbox.js +++ b/src/scripts/lightbox.js @@ -242,7 +242,7 @@ export default class Lightbox { return `${link.getAttribute('data-lightbox') || ''}:${link.getAttribute('data-id')}`; } - getMaxSizes(mediaWidth, mediaHeight, mediaType) { + getMaxSizes(mediaType) { let maxWidth = window.innerWidth - this.containerPadding.left - this.containerPadding.right; let maxHeight = window.innerHeight - this.containerPadding.top - this.containerPadding.bottom - this.options.positionFromTop; const border = mediaType === 'image' ? this.imageBorderWidth : this.videoBorderWidth; @@ -315,7 +315,7 @@ export default class Lightbox { updateSize(index) { const media = this.album[index]; - const maxSizes = this.getMaxSizes(media.width, media.height, media.type); + const maxSizes = this.getMaxSizes(media.type); const maxWidth = this.options.maxWidth ? Math.min(this.options.maxWidth, maxSizes.maxWidth) : maxSizes.maxWidth; const maxHeight = this.options.maxHeight ? Math.min(this.options.maxHeight, maxSizes.maxHeight) : maxSizes.maxHeight; const size = this.fitSizeWithDataContainer(this.getMediaSize(media, maxWidth, maxHeight), media.type);