From 46c26c8a5efa5880a37d8dde9fc6d47dd5627c1b Mon Sep 17 00:00:00 2001 From: glacials Date: Fri, 11 Oct 2024 19:48:04 -0700 Subject: [PATCH] GDQ banner & logo updates --- app/assets/build/application.js | 12 ++++++++- app/javascript/application.js | 1 + app/javascript/banner.js | 41 ++++++++++++++++++++++++++++++ app/models/duration.rb | 2 +- app/views/layouts/application.slim | 15 +---------- app/views/runs/_landing.slim | 8 +++--- app/views/shared/_banners.slim | 29 +++++++++++++++++++++ 7 files changed, 88 insertions(+), 20 deletions(-) create mode 100644 app/javascript/banner.js create mode 100644 app/views/shared/_banners.slim diff --git a/app/assets/build/application.js b/app/assets/build/application.js index 2d0aa2943..2a745dbc7 100644 --- a/app/assets/build/application.js +++ b/app/assets/build/application.js @@ -26,7 +26,17 @@ eval("document.addEventListener('turbolinks:load', () => {\n // Segment\n !fun /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ 74692);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _vue_race_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vue/race.js */ 97233);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vue */ 14404);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var vue_turbolinks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue-turbolinks */ 29739);\n/* harmony import */ var vue_tippy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue-tippy */ 17823);\n/* harmony import */ var _vue_RaceCreateButton_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./vue/RaceCreateButton.vue */ 13992);\n/* harmony import */ var _vue_EditRunGameAndCategory_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./vue/EditRunGameAndCategory.vue */ 1975);\n/* harmony import */ var _vue_Search_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./vue/Search.vue */ 82787);\n/* harmony import */ var _vue_SpeedRunsLiveRaceList_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vue/SpeedRunsLiveRaceList.vue */ 22227);\n/* harmony import */ var chartkick__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! chartkick */ 67092);\n/* harmony import */ var _analytics_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./analytics.js */ 98233);\n/* harmony import */ var _analytics_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_analytics_js__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _collapse_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./collapse.js */ 77202);\n/* harmony import */ var _collapse_js__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_collapse_js__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _count_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./count.js */ 99854);\n/* harmony import */ var _dropdown_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./dropdown.js */ 8964);\n/* harmony import */ var _dropdown_js__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(_dropdown_js__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var _highchart_theme_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./highchart_theme.js */ 20159);\n/* harmony import */ var _chart_builder_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./chart_builder.js */ 96345);\n/* harmony import */ var _landing_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./landing.js */ 63117);\n/* harmony import */ var _landing_js__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(_landing_js__WEBPACK_IMPORTED_MODULE_16__);\n/* harmony import */ var _like_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./like.js */ 82926);\n/* harmony import */ var _like_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_like_js__WEBPACK_IMPORTED_MODULE_17__);\n/* harmony import */ var _race_attach_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./race_attach.js */ 48354);\n/* harmony import */ var _race_attach_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_race_attach_js__WEBPACK_IMPORTED_MODULE_18__);\n/* harmony import */ var _run_claim_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./run_claim.js */ 65011);\n/* harmony import */ var _run_claim_js__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_run_claim_js__WEBPACK_IMPORTED_MODULE_19__);\n/* harmony import */ var _run_delete_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./run_delete.js */ 9064);\n/* harmony import */ var _run_delete_js__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_run_delete_js__WEBPACK_IMPORTED_MODULE_20__);\n/* harmony import */ var _run_disown_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./run_disown.js */ 33427);\n/* harmony import */ var _run_disown_js__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_run_disown_js__WEBPACK_IMPORTED_MODULE_21__);\n/* harmony import */ var _run_export_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./run_export.js */ 77649);\n/* harmony import */ var _run_export_js__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_run_export_js__WEBPACK_IMPORTED_MODULE_22__);\n/* harmony import */ var _run_parse_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./run_parse.js */ 91188);\n/* harmony import */ var _settings_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./settings.js */ 13008);\n/* harmony import */ var _settings_js__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_settings_js__WEBPACK_IMPORTED_MODULE_24__);\n/* harmony import */ var _srdc_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./srdc.js */ 83745);\n/* harmony import */ var _srdc_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(_srdc_js__WEBPACK_IMPORTED_MODULE_25__);\n/* harmony import */ var _stripe_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./stripe.js */ 81308);\n/* harmony import */ var _stripe_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(_stripe_js__WEBPACK_IMPORTED_MODULE_26__);\n/* harmony import */ var _paypal_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./paypal.js */ 74870);\n/* harmony import */ var _survey_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./survey.js */ 31095);\n/* harmony import */ var _survey_js__WEBPACK_IMPORTED_MODULE_28___default = /*#__PURE__*/__webpack_require__.n(_survey_js__WEBPACK_IMPORTED_MODULE_28__);\n/* harmony import */ var _timeline_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./timeline.js */ 53550);\n/* harmony import */ var _token_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./token.js */ 90816);\n/* harmony import */ var _tooltips_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./tooltips.js */ 8245);\n/* harmony import */ var _twitch_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./twitch.js */ 14102);\n/* harmony import */ var _twitch_js__WEBPACK_IMPORTED_MODULE_32___default = /*#__PURE__*/__webpack_require__.n(_twitch_js__WEBPACK_IMPORTED_MODULE_32__);\n/* harmony import */ var _upload_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./upload.js */ 48000);\n/* harmony import */ var _youtube_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./youtube.js */ 94320);\n/* harmony import */ var _youtube_js__WEBPACK_IMPORTED_MODULE_34___default = /*#__PURE__*/__webpack_require__.n(_youtube_js__WEBPACK_IMPORTED_MODULE_34__);\n/* harmony import */ var _youtube_timestamps_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./youtube_timestamps.js */ 90518);\n/* harmony import */ var _youtube_timestamps_js__WEBPACK_IMPORTED_MODULE_35___default = /*#__PURE__*/__webpack_require__.n(_youtube_timestamps_js__WEBPACK_IMPORTED_MODULE_35__);\n/* eslint no-console:0 */\n// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application logic in\n// a relevant structure within app/javascript and only use these pack files to reference\n// that code so it'll be compiled.\n//\n// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate\n// layout file, like app/views/layouts/application.html.erb\n\n\n(__webpack_require__(/*! @rails/activestorage */ 64276).start)();\n(__webpack_require__(/*! @rails/ujs */ 23337).start)();\n(__webpack_require__(/*! turbolinks */ 6224).start)();\n__webpack_require__(/*! ./channels */ 49898);\nconst moment = __webpack_require__(/*! moment */ 95093);\nconst momentDurationFormatSetup = __webpack_require__(/*! moment-duration-format */ 53395);\n\nmomentDurationFormatSetup(moment);\n\n\n\n\n\n\n\n\n\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_8___default().use(vue_turbolinks__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\nvue__WEBPACK_IMPORTED_MODULE_8___default().use(vue_tippy__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n onShow: (instance) => {\n if (!instance.props.content) {\n return false;\n } // Makes null `content` hide the tooltip, not show a blank one\n },\n});\n\nvue__WEBPACK_IMPORTED_MODULE_8___default().component(\"tippy\", vue_tippy__WEBPACK_IMPORTED_MODULE_3__.TippyComponent);\n\ndocument.addEventListener(\"turbolinks:load\", () => {\n if (!document.getElementById(\"vue\")) {\n return;\n }\n\n const app = new (vue__WEBPACK_IMPORTED_MODULE_8___default())({\n el: \"#vue\",\n components: {\n race: _vue_race_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n RaceCreateButton: _vue_RaceCreateButton_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n EditRunGameAndCategory: _vue_EditRunGameAndCategory_vue__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n Search: _vue_Search_vue__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n SpeedRunsLiveRaceList: _vue_SpeedRunsLiveRaceList_vue__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n },\n });\n});\n\n// Using Google charts for admin dashboards for now (a script tag in app/views/layouts/admin/application.slim) because\n// Chartkick + Highcharts doesn't seem to include axes, and tooltips don't include years (?) with no clear resolution\n\nwindow.Chartkick = chartkick__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://splits-io/./app/javascript/application.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! jquery */ 74692);\n/* harmony import */ var jquery__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _vue_race_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./vue/race.js */ 97233);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! vue */ 14404);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var vue_turbolinks__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! vue-turbolinks */ 29739);\n/* harmony import */ var vue_tippy__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! vue-tippy */ 17823);\n/* harmony import */ var _vue_RaceCreateButton_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./vue/RaceCreateButton.vue */ 13992);\n/* harmony import */ var _vue_EditRunGameAndCategory_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./vue/EditRunGameAndCategory.vue */ 1975);\n/* harmony import */ var _vue_Search_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./vue/Search.vue */ 82787);\n/* harmony import */ var _vue_SpeedRunsLiveRaceList_vue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vue/SpeedRunsLiveRaceList.vue */ 22227);\n/* harmony import */ var chartkick__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! chartkick */ 67092);\n/* harmony import */ var _analytics_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./analytics.js */ 98233);\n/* harmony import */ var _analytics_js__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_analytics_js__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _banner_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./banner.js */ 40);\n/* harmony import */ var _banner_js__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_banner_js__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _collapse_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./collapse.js */ 77202);\n/* harmony import */ var _collapse_js__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(_collapse_js__WEBPACK_IMPORTED_MODULE_12__);\n/* harmony import */ var _count_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./count.js */ 99854);\n/* harmony import */ var _dropdown_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./dropdown.js */ 8964);\n/* harmony import */ var _dropdown_js__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(_dropdown_js__WEBPACK_IMPORTED_MODULE_14__);\n/* harmony import */ var _highchart_theme_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./highchart_theme.js */ 20159);\n/* harmony import */ var _chart_builder_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./chart_builder.js */ 96345);\n/* harmony import */ var _landing_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./landing.js */ 63117);\n/* harmony import */ var _landing_js__WEBPACK_IMPORTED_MODULE_17___default = /*#__PURE__*/__webpack_require__.n(_landing_js__WEBPACK_IMPORTED_MODULE_17__);\n/* harmony import */ var _like_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./like.js */ 82926);\n/* harmony import */ var _like_js__WEBPACK_IMPORTED_MODULE_18___default = /*#__PURE__*/__webpack_require__.n(_like_js__WEBPACK_IMPORTED_MODULE_18__);\n/* harmony import */ var _race_attach_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./race_attach.js */ 48354);\n/* harmony import */ var _race_attach_js__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(_race_attach_js__WEBPACK_IMPORTED_MODULE_19__);\n/* harmony import */ var _run_claim_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./run_claim.js */ 65011);\n/* harmony import */ var _run_claim_js__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(_run_claim_js__WEBPACK_IMPORTED_MODULE_20__);\n/* harmony import */ var _run_delete_js__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./run_delete.js */ 9064);\n/* harmony import */ var _run_delete_js__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(_run_delete_js__WEBPACK_IMPORTED_MODULE_21__);\n/* harmony import */ var _run_disown_js__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./run_disown.js */ 33427);\n/* harmony import */ var _run_disown_js__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(_run_disown_js__WEBPACK_IMPORTED_MODULE_22__);\n/* harmony import */ var _run_export_js__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./run_export.js */ 77649);\n/* harmony import */ var _run_export_js__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_run_export_js__WEBPACK_IMPORTED_MODULE_23__);\n/* harmony import */ var _run_parse_js__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./run_parse.js */ 91188);\n/* harmony import */ var _settings_js__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./settings.js */ 13008);\n/* harmony import */ var _settings_js__WEBPACK_IMPORTED_MODULE_25___default = /*#__PURE__*/__webpack_require__.n(_settings_js__WEBPACK_IMPORTED_MODULE_25__);\n/* harmony import */ var _srdc_js__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./srdc.js */ 83745);\n/* harmony import */ var _srdc_js__WEBPACK_IMPORTED_MODULE_26___default = /*#__PURE__*/__webpack_require__.n(_srdc_js__WEBPACK_IMPORTED_MODULE_26__);\n/* harmony import */ var _stripe_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./stripe.js */ 81308);\n/* harmony import */ var _stripe_js__WEBPACK_IMPORTED_MODULE_27___default = /*#__PURE__*/__webpack_require__.n(_stripe_js__WEBPACK_IMPORTED_MODULE_27__);\n/* harmony import */ var _paypal_js__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./paypal.js */ 74870);\n/* harmony import */ var _survey_js__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./survey.js */ 31095);\n/* harmony import */ var _survey_js__WEBPACK_IMPORTED_MODULE_29___default = /*#__PURE__*/__webpack_require__.n(_survey_js__WEBPACK_IMPORTED_MODULE_29__);\n/* harmony import */ var _timeline_js__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./timeline.js */ 53550);\n/* harmony import */ var _token_js__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./token.js */ 90816);\n/* harmony import */ var _tooltips_js__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./tooltips.js */ 8245);\n/* harmony import */ var _twitch_js__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./twitch.js */ 14102);\n/* harmony import */ var _twitch_js__WEBPACK_IMPORTED_MODULE_33___default = /*#__PURE__*/__webpack_require__.n(_twitch_js__WEBPACK_IMPORTED_MODULE_33__);\n/* harmony import */ var _upload_js__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./upload.js */ 48000);\n/* harmony import */ var _youtube_js__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./youtube.js */ 94320);\n/* harmony import */ var _youtube_js__WEBPACK_IMPORTED_MODULE_35___default = /*#__PURE__*/__webpack_require__.n(_youtube_js__WEBPACK_IMPORTED_MODULE_35__);\n/* harmony import */ var _youtube_timestamps_js__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./youtube_timestamps.js */ 90518);\n/* harmony import */ var _youtube_timestamps_js__WEBPACK_IMPORTED_MODULE_36___default = /*#__PURE__*/__webpack_require__.n(_youtube_timestamps_js__WEBPACK_IMPORTED_MODULE_36__);\n/* eslint no-console:0 */\n// This file is automatically compiled by Webpack, along with any other files\n// present in this directory. You're encouraged to place your actual application logic in\n// a relevant structure within app/javascript and only use these pack files to reference\n// that code so it'll be compiled.\n//\n// To reference this file, add <%= javascript_pack_tag 'application' %> to the appropriate\n// layout file, like app/views/layouts/application.html.erb\n\n\n(__webpack_require__(/*! @rails/activestorage */ 64276).start)();\n(__webpack_require__(/*! @rails/ujs */ 23337).start)();\n(__webpack_require__(/*! turbolinks */ 6224).start)();\n__webpack_require__(/*! ./channels */ 49898);\nconst moment = __webpack_require__(/*! moment */ 95093);\nconst momentDurationFormatSetup = __webpack_require__(/*! moment-duration-format */ 53395);\n\nmomentDurationFormatSetup(moment);\n\n\n\n\n\n\n\n\n\n\n\n\n\nvue__WEBPACK_IMPORTED_MODULE_8___default().use(vue_turbolinks__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\nvue__WEBPACK_IMPORTED_MODULE_8___default().use(vue_tippy__WEBPACK_IMPORTED_MODULE_3__[\"default\"], {\n onShow: (instance) => {\n if (!instance.props.content) {\n return false;\n } // Makes null `content` hide the tooltip, not show a blank one\n },\n});\n\nvue__WEBPACK_IMPORTED_MODULE_8___default().component(\"tippy\", vue_tippy__WEBPACK_IMPORTED_MODULE_3__.TippyComponent);\n\ndocument.addEventListener(\"turbolinks:load\", () => {\n if (!document.getElementById(\"vue\")) {\n return;\n }\n\n const app = new (vue__WEBPACK_IMPORTED_MODULE_8___default())({\n el: \"#vue\",\n components: {\n race: _vue_race_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n RaceCreateButton: _vue_RaceCreateButton_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n EditRunGameAndCategory: _vue_EditRunGameAndCategory_vue__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n Search: _vue_Search_vue__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n SpeedRunsLiveRaceList: _vue_SpeedRunsLiveRaceList_vue__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n },\n });\n});\n\n// Using Google charts for admin dashboards for now (a script tag in app/views/layouts/admin/application.slim) because\n// Chartkick + Highcharts doesn't seem to include axes, and tooltips don't include years (?) with no clear resolution\n\nwindow.Chartkick = chartkick__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://splits-io/./app/javascript/application.js?"); + +/***/ }), + +/***/ 40: +/*!**********************************!*\ + !*** ./app/javascript/banner.js ***! + \**********************************/ +/***/ (function() { + +eval("// Allows any number of dismissable banners to be placed,\n// with dismissal state for each saved in localStorage.\n//\n// To use, give your banner element the class \"banner\" and an ID.\n// (You must never change the ID, or the dismissal state will be lost.)\n// Give the banner an initial display state of \"none\".\n// Inside the banner, place a button with the class \"banner-close\".\n// That's it!\n//\n// Example in Slim:\n//\n// # Note: Do not use the d-none Bootstrap helper, as it uses !important.\n// .banner#my-banner-name style=\"display: none\"\n// | This is a banner.\n// button.btn.btn-secondary.banner-close Close\n\nconst initBanners = function () {\n for (const element of document.getElementsByClassName(\"banner\")) {\n const storageKey = element.id;\n if (localStorage.getItem(storageKey) === \"hide\") {\n return;\n }\n element.style.display = \"block\";\n }\n};\n\ndocument.addEventListener(\"turbolinks:load\", initBanners);\n\ndocument.addEventListener(\"click\", (event) => {\n const element = event.target;\n if (element.classList.contains(\"banner-close\")) {\n const bannerCloseButton = element;\n const banner = bannerCloseButton.closest(\".banner\");\n if (banner === null) {\n return;\n }\n const storageKey = banner.id;\n localStorage.setItem(storageKey, \"hide\");\n banner.style.display = \"none\";\n }\n});\n\n\n//# sourceURL=webpack://splits-io/./app/javascript/banner.js?"); /***/ }), diff --git a/app/javascript/application.js b/app/javascript/application.js index 9e5efb3b3..eeb3665b2 100644 --- a/app/javascript/application.js +++ b/app/javascript/application.js @@ -63,6 +63,7 @@ import Chartkick from "chartkick"; window.Chartkick = Chartkick; import "./analytics.js"; +import "./banner.js"; import "./collapse.js"; import "./count.js"; import "./dropdown.js"; diff --git a/app/javascript/banner.js b/app/javascript/banner.js new file mode 100644 index 000000000..7491d2d42 --- /dev/null +++ b/app/javascript/banner.js @@ -0,0 +1,41 @@ +// Allows any number of dismissable banners to be placed, +// with dismissal state for each saved in localStorage. +// +// To use, give your banner element the class "banner" and an ID. +// (You must never change the ID, or the dismissal state will be lost.) +// Give the banner an initial display state of "none". +// Inside the banner, place a button with the class "banner-close". +// That's it! +// +// Example in Slim: +// +// # Note: Do not use the d-none Bootstrap helper, as it uses !important. +// .banner#my-banner-name style="display: none" +// | This is a banner. +// button.btn.btn-secondary.banner-close Close + +const initBanners = function () { + for (const element of document.getElementsByClassName("banner")) { + const storageKey = element.id; + if (localStorage.getItem(storageKey) === "hide") { + return; + } + element.style.display = "block"; + } +}; + +document.addEventListener("turbolinks:load", initBanners); + +document.addEventListener("click", (event) => { + const element = event.target; + if (element.classList.contains("banner-close")) { + const bannerCloseButton = element; + const banner = bannerCloseButton.closest(".banner"); + if (banner === null) { + return; + } + const storageKey = banner.id; + localStorage.setItem(storageKey, "hide"); + banner.style.display = "none"; + } +}); diff --git a/app/models/duration.rb b/app/models/duration.rb index 3adbb6fa1..81261a0f9 100644 --- a/app/models/duration.rb +++ b/app/models/duration.rb @@ -21,7 +21,7 @@ def format(precise: false, sign: :negatives) return "-" if @duration.nil? format = ["%02d", ":%02d", ":%02d"] - components = [hours, minutes, seconds] + components = [hours || 0, minutes || 0, seconds || 0] if precise format << ".%02d" diff --git a/app/views/layouts/application.slim b/app/views/layouts/application.slim index 26cd1ea92..90b13a664 100644 --- a/app/views/layouts/application.slim +++ b/app/views/layouts/application.slim @@ -129,11 +129,6 @@ html lang='en' h5 Sign in .modal-body.bg-dark = render partial: 'sessions/sign_in' - article.pt-0#survey-container style='display: none' - div.text-right - small: #hide-survey-button.text-secondary style='cursor: pointer' no thanks - a#survey-button.btn.btn-outline-warning.btn-block.mb-0.text-center href=survey_url - ' Help us out by taking the Splits.io survey! - entry = current_user.present? ? current_user.entries.nonghosts.active.first : nil - if entry.present? && request.path != race_path(entry.race) .p-1.col-md-6.mx-auto @@ -141,15 +136,7 @@ html lang='en' => icon('fas', 'flag-checkered') | Return to race header#header.m-1.p-0 = yield(:header) - - if current_user && current_user.email.nil? - .alert.alert-warning - ' You don't have an email attached to your Splits.io account. If - ' you become locked out your account will be irrecoverable. - ' Please add an email address from the - a href=settings_path settings page - ' . - .row.mx-2: #alerts.w-100 data-turbolinks-temporary=true - = render partial: 'shared/alerts' + = render partial: 'shared/banners' = yield - unless on_landing_page? footer#footer diff --git a/app/views/runs/_landing.slim b/app/views/runs/_landing.slim index 2186ad6b6..b6e182033 100644 --- a/app/views/runs/_landing.slim +++ b/app/views/runs/_landing.slim @@ -1,9 +1,9 @@ #chart-holder .position-relative.overflow-hidden.p-3.p-md-5.m-md-3.text-center.bg-darkish - .col-md-5.p-lg-5.mx-auto.text-center - .display-4 - img.d-inline src=asset_path('logo-imageonly.svg') height='75' style='margin-right: 0' alt='Splits.io image only logo' - img.d-sm-inline.d-md-none.d-xl-inline src=asset_path('logo-textonly.svg') height='75' style='margin-top: .1em' alt='Splits.io text only logo' + .col-md-10.col-xs-12.col-sm-10.p-lg-5.mx-auto.text-center + .display-5 + img.d-none.d-sm-inline src=asset_path('logo-imageonly.svg') height='75' style='margin-right: 0' alt='Splits.io image only logo' + img.d-none.d-sm-inline src=asset_path('logo-textonly.svg') height='75' style='margin-top: .1em' alt='Splits.io text only logo' p.lead Statistical analysis & run sharing for speedrunners. Replace mindless grinding with targeted, hard data. a.btn.btn-lg.btn-primary href='#' data={toggle: :modal, target: '#signin'} Get started b.text-secondary.d-block.mt-3 diff --git a/app/views/shared/_banners.slim b/app/views/shared/_banners.slim new file mode 100644 index 000000000..d4ef93614 --- /dev/null +++ b/app/views/shared/_banners.slim @@ -0,0 +1,29 @@ +article.pt-0.mb-3#survey-container style='display: none; max-width: 50em;' + div.text-right + small: #hide-survey-button.text-secondary style='cursor: pointer' no thanks + a#survey-button.btn.btn-secondary.btn-block.mb-0.text-center target='_blank' href=survey_url + ' Help us out by taking the Splits.io survey! +- if current_user && current_user.email.nil? + .alert.alert-warning + ' You don't have an email attached to your Splits.io account. If + ' you become locked out your account will be irrecoverable. + ' Please add an email address from the + a href=settings_path settings page + ' . +/ .banner.alert.alert-success.col-md-6.mx-auto#shutdown-saved-banner style="display: none" +/ ' Thanks to help from +/ a.alert-link target='_blank' href='https://gamesdonequick.com' Games Done Quick +/ ', Splits.io's plans to shut down have been canceled! +/ a.float-right.alert-link.banner-close style="cursor: pointer" X +.m-2: .banner.alert.alert-success.col-md-12.col-lg-10.col-xl-8.mx-auto#gdq-test-banner style="display: none" + a.alert-link target='_blank' href='https://gamesdonequick.com' Awesome Games Done Quick + '< is happening right now! + - button_link = 'https://gamesdonequick.com' + .d-block.d-lg-none.mt-4 + a.btn-sm.btn-success.mr-3.p-2 target='_blank' href='#{button_link}' Watch + a.alert-link.banner-close style="cursor: pointer" Dismiss + .float-right.d-none.d-lg-block + a.btn-sm.btn-success.mr-3.p-2 target='_blank' href='#{button_link}' See Schedule + a.alert-link.banner-close style="cursor: pointer" X +.row.mx-2: #alerts.w-100 data-turbolinks-temporary=true + = render partial: 'shared/alerts'