-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mix phx.new live_view_counter --no-ecto --live (Phoenix 1.5.3 + LiveV…
…iew 0.13.2) #17
- Loading branch information
Showing
33 changed files
with
3,038 additions
and
1,665 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
/* This file is for your main application css. */ | ||
@import "./phoenix.css"; | ||
@import "../node_modules/nprogress/nprogress.css"; | ||
|
||
/* LiveView specific classes for your customizations */ | ||
.invalid-feedback { | ||
color: #a94442; | ||
display: block; | ||
margin: -1rem 0 2rem; | ||
} | ||
|
||
.phx-no-feedback.invalid-feedback, .phx-no-feedback .invalid-feedback { | ||
display: none; | ||
} | ||
|
||
.phx-click-loading { | ||
opacity: 0.5; | ||
transition: opacity 1s ease-out; | ||
} | ||
|
||
.phx-disconnected{ | ||
cursor: wait; | ||
} | ||
.phx-disconnected *{ | ||
pointer-events: none; | ||
} | ||
|
||
.phx-modal { | ||
opacity: 1!important; | ||
position: fixed; | ||
z-index: 1; | ||
left: 0; | ||
top: 0; | ||
width: 100%; | ||
height: 100%; | ||
overflow: auto; | ||
background-color: rgb(0,0,0); | ||
background-color: rgba(0,0,0,0.4); | ||
} | ||
|
||
.phx-modal-content { | ||
background-color: #fefefe; | ||
margin: 15% auto; | ||
padding: 20px; | ||
border: 1px solid #888; | ||
width: 80%; | ||
} | ||
|
||
.phx-modal-close { | ||
color: #aaa; | ||
float: right; | ||
font-size: 28px; | ||
font-weight: bold; | ||
} | ||
|
||
.phx-modal-close:hover, | ||
.phx-modal-close:focus { | ||
color: black; | ||
text-decoration: none; | ||
cursor: pointer; | ||
} | ||
|
||
|
||
/* Alerts and form errors */ | ||
.alert { | ||
padding: 15px; | ||
margin-bottom: 20px; | ||
border: 1px solid transparent; | ||
border-radius: 4px; | ||
} | ||
.alert-info { | ||
color: #31708f; | ||
background-color: #d9edf7; | ||
border-color: #bce8f1; | ||
} | ||
.alert-warning { | ||
color: #8a6d3b; | ||
background-color: #fcf8e3; | ||
border-color: #faebcc; | ||
} | ||
.alert-danger { | ||
color: #a94442; | ||
background-color: #f2dede; | ||
border-color: #ebccd1; | ||
} | ||
.alert p { | ||
margin-bottom: 0; | ||
} | ||
.alert:empty { | ||
display: none; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,33 @@ | ||
// 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. | ||
import css from "../css/app.css" | ||
import "../css/app.scss" | ||
|
||
// webpack automatically bundles all modules in your | ||
// entry points. Those entry points can be configured | ||
// in "webpack.config.js". | ||
// | ||
// Import dependencies | ||
// Import deps with the dep name or local files with a relative path, for example: | ||
// | ||
// import {Socket} from "phoenix" | ||
// import socket from "./socket" | ||
// | ||
import "phoenix_html" | ||
import {Socket} from "phoenix" | ||
import NProgress from "nprogress" | ||
import {LiveSocket} from "phoenix_live_view" | ||
|
||
// Import local files | ||
// | ||
// Local files can be imported directly using relative paths, for example: | ||
// import socket from "./socket" | ||
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content") | ||
let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}}) | ||
|
||
import {Socket} from "phoenix" | ||
import LiveSocket from "phoenix_live_view" | ||
// Show progress bar on live navigation and form submits | ||
window.addEventListener("phx:page-loading-start", info => NProgress.start()) | ||
window.addEventListener("phx:page-loading-stop", info => NProgress.done()) | ||
|
||
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content"); | ||
let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}}); | ||
// connect if there are any LiveViews on the page | ||
liveSocket.connect() | ||
|
||
// expose liveSocket on window for web console debug logs and latency simulation: | ||
// >> liveSocket.enableDebug() | ||
// >> liveSocket.enableLatencySim(1000) | ||
window.liveSocket = liveSocket |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.