Skip to content

Commit

Permalink
Add the simulator
Browse files Browse the repository at this point in the history
  • Loading branch information
PJUllrich committed Feb 15, 2021
1 parent ef235ab commit 59c3766
Show file tree
Hide file tree
Showing 45 changed files with 1,883 additions and 815 deletions.
94 changes: 15 additions & 79 deletions assets/css/app.scss
Original file line number Diff line number Diff line change
@@ -1,91 +1,27 @@
/* This file is for your main application css. */
@import "./phoenix.css";
@import "../node_modules/nprogress/nprogress.css";
@tailwind base;

/* LiveView specific classes for your customizations */
.phx-no-feedback.invalid-feedback,
.phx-no-feedback .invalid-feedback {
display: none;
}
@tailwind components;

.phx-click-loading {
opacity: 0.5;
transition: opacity 1s ease-out;
}
@tailwind utilities;

.phx-disconnected{
cursor: wait;
}
.phx-disconnected *{
pointer-events: none;
}
@import "./page.scss";

.phx-modal {
opacity: 1!important;
position: fixed;
z-index: 1;
left: 0;
top: 0;
width: 100%;
html,
body,
main {
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.4);
min-height: 100%;
min-width: 100%;
}

.phx-modal-content {
background-color: #fefefe;
margin: 15% auto;
padding: 20px;
border: 1px solid #888;
width: 80%;
body {
background-color: rgb(0, 0, 0);
}

.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;
.live-view-wrapper {
height: 100%;
}


/* 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;
}
.invalid-feedback {
color: #a94442;
display: block;
margin: -1rem 0 2rem;
.flex-col-centered {
@apply flex flex-col justify-center items-center;
}
33 changes: 33 additions & 0 deletions assets/css/page.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.phone-button {
@apply w-1/3 h-12 bg-gray-200 flex-col-centered border-t-2 border-white text-xl font-medium;

&:hover {
@apply bg-blue-400 text-white cursor-pointer;
}

&-reset {
@extend .phone-button;
@apply bg-transparent border-none text-sm text-gray-500;

&:hover {
@apply bg-transparent text-blue-400;
}
}

&-call {
@extend .phone-button;
@apply bg-transparent border-none rounded-full text-xl text-black;
}
}

#num-pad .num-row {
.phone-button:nth-child(2) {
@apply border-r-2 border-l-2 border-white;
}

&:first-child() {
.phone-button {
@apply border-t-0;
}
}
}
101 changes: 0 additions & 101 deletions assets/css/phoenix.css

This file was deleted.

8 changes: 4 additions & 4 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import "../css/app.scss"
// import socket from "./socket"
//
import "phoenix_html"
import {Socket} from "phoenix"
import { Socket } from "phoenix"
import NProgress from "nprogress"
import {LiveSocket} from "phoenix_live_view"
import { LiveSocket } from "phoenix_live_view"

let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
let liveSocket = new LiveSocket("/live", Socket, {params: {_csrf_token: csrfToken}})
let liveSocket = new LiveSocket("/live", Socket, { params: { _csrf_token: csrfToken } })

// Show progress bar on live navigation and form submits
window.addEventListener("phx:page-loading-start", info => NProgress.start())
Expand All @@ -31,5 +31,5 @@ liveSocket.connect()
// >> liveSocket.enableDebug()
// >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session
// >> liveSocket.disableLatencySim()
window.liveSocket = liveSocket
// window.liveSocket = liveSocket

Loading

0 comments on commit 59c3766

Please sign in to comment.