2021-03-28 21:12:55 -04:00
|
|
|
// We need to import the CSS so that webpack will load it.
|
|
|
|
// The MiniCssExtractPlugin is used to separate it out into
|
|
|
|
// its own CSS file.
|
2021-03-29 11:27:44 -04:00
|
|
|
import "../css/app.scss";
|
|
|
|
|
|
|
|
// Import icons for sprite-loader
|
|
|
|
// navbar brand icon
|
|
|
|
import "../node_modules/@mdi/svg/svg/desktop-classic.svg"; // brand
|
|
|
|
// other:///
|
2021-03-29 19:50:47 -04:00
|
|
|
import "../node_modules/@mdi/svg/svg/home.svg";
|
2021-04-03 23:22:35 -04:00
|
|
|
import "../node_modules/@mdi/svg/svg/information.svg";
|
2021-03-29 19:50:47 -04:00
|
|
|
import "../node_modules/@mdi/svg/svg/account.svg";
|
|
|
|
import "../node_modules/@mdi/svg/svg/briefcase-account.svg";
|
|
|
|
import "../node_modules/@mdi/svg/svg/zip-disk.svg";
|
|
|
|
import "../node_modules/@mdi/svg/svg/typewriter.svg";
|
2021-04-03 23:22:35 -04:00
|
|
|
import "../node_modules/@mdi/svg/svg/calendar-clock.svg";
|
|
|
|
import "../node_modules/@mdi/svg/svg/tag-multiple.svg";
|
2021-03-29 19:50:47 -04:00
|
|
|
import "../node_modules/@mdi/svg/svg/rss.svg";
|
|
|
|
import "../node_modules/@mdi/svg/svg/account-hard-hat.svg";
|
|
|
|
// social
|
|
|
|
import "../node_modules/@mdi/svg/svg/linkedin.svg";
|
|
|
|
import "../node_modules/@mdi/svg/svg/github.svg";
|
|
|
|
import "../node_modules/@mdi/svg/svg/key-variant.svg";
|
|
|
|
import "../raw/gitea.svg";
|
|
|
|
import "../node_modules/@mdi/svg/svg/goodreads.svg";
|
|
|
|
import "../node_modules/@mdi/svg/svg/twitter.svg";
|
|
|
|
import "../node_modules/@mdi/svg/svg/facebook.svg";
|
|
|
|
import "../node_modules/@mdi/svg/svg/instagram.svg";
|
|
|
|
import "../node_modules/@mdi/svg/svg/steam.svg";
|
|
|
|
import "../node_modules/@mdi/svg/svg/discord.svg";
|
2021-03-28 21:12:55 -04:00
|
|
|
|
|
|
|
// webpack automatically bundles all modules in your
|
|
|
|
// entry points. Those entry points can be configured
|
|
|
|
// in "webpack.config.js".
|
|
|
|
//
|
|
|
|
// Import deps with the dep name or local files with a relative path, for example:
|
|
|
|
//
|
|
|
|
// import {Socket} from "phoenix"
|
|
|
|
// import socket from "./socket"
|
|
|
|
//
|
2021-03-29 11:27:44 -04:00
|
|
|
import "phoenix_html";
|
|
|
|
import { Socket } from "phoenix";
|
|
|
|
import topbar from "topbar";
|
|
|
|
import { LiveSocket } from "phoenix_live_view";
|
|
|
|
|
2021-04-05 16:51:59 -04:00
|
|
|
// // Prismjs import
|
|
|
|
// import Prism from "prismjs"
|
|
|
|
|
2021-03-29 11:27:44 -04:00
|
|
|
// // Bootstrap v5 js imports
|
2021-03-29 19:50:47 -04:00
|
|
|
// import "bootstrap/js/dist/alert";
|
2021-03-29 11:27:44 -04:00
|
|
|
import "bootstrap/js/dist/collapse";
|
|
|
|
// import "bootstrap/js/dist/dropdown";
|
|
|
|
// Bootstrap helpers
|
|
|
|
import "./_hamburger-helper";
|
2021-03-28 21:12:55 -04:00
|
|
|
|
2021-03-29 11:27:44 -04:00
|
|
|
let csrfToken = document
|
|
|
|
.querySelector("meta[name='csrf-token']")
|
|
|
|
.getAttribute("content");
|
|
|
|
let liveSocket = new LiveSocket("/live", Socket, {
|
|
|
|
params: { _csrf_token: csrfToken },
|
|
|
|
});
|
2021-03-28 21:12:55 -04:00
|
|
|
|
|
|
|
// Show progress bar on live navigation and form submits
|
2021-03-29 11:27:44 -04:00
|
|
|
topbar.config({ barColors: { 0: "#29d" }, shadowColor: "rgba(0, 0, 0, .3)" });
|
|
|
|
window.addEventListener("phx:page-loading-start", (info) => topbar.show());
|
|
|
|
window.addEventListener("phx:page-loading-stop", (info) => topbar.hide());
|
2021-03-28 21:12:55 -04:00
|
|
|
|
|
|
|
// connect if there are any LiveViews on the page
|
2021-03-29 11:27:44 -04:00
|
|
|
liveSocket.connect();
|
2021-03-28 21:12:55 -04:00
|
|
|
|
|
|
|
// expose liveSocket on window for web console debug logs and latency simulation:
|
|
|
|
// >> liveSocket.enableDebug()
|
|
|
|
// >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session
|
|
|
|
// >> liveSocket.disableLatencySim()
|
2021-03-29 11:27:44 -04:00
|
|
|
window.liveSocket = liveSocket;
|