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
@import url("https://fonts.googleapis.com/css2?family=Great+Vibes&display=swap"); | |
.container { | |
display: flex; | |
flex-direction: column; | |
justify-content: center; | |
align-items: center; | |
height: 100vh; | |
font-family: "Great Vibes", cursive; | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Image Gallery with CSS Grid</title> | |
<link rel="stylesheet" href="style.css" /> | |
</head> |
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
// Message item | |
const messageBubble = (item) => { | |
return { | |
type: "bubble", | |
header: { | |
type: "box", | |
layout: "vertical", | |
contents: [ | |
{ | |
type: "text", |
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
// Get data and set to cloud firestore | |
exports.getPeaOutage = functions | |
.region(REGION) | |
.pubsub.schedule("0 3 * * *") | |
.timeZone("Asia/Bangkok") | |
.onRun(async (context) => { | |
// console.info("This will be run every 03:00 AM"); | |
// Get data with scraper | |
const data = await scraper(); |
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
// Set today time | |
const year = new Date().getFullYear(); | |
const month = new Date().getMonth(); | |
const day = new Date().getDate(); | |
const today = new Date(year, month, day).getTime(); | |
// Convert date from scrape to time | |
const dateToTime = (dateInput) => { | |
const date = dateInput.split(" ")[0]; |
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
// Event listener for user state changed | |
firebase.auth().onAuthStateChanged((user) => { | |
if (user) { | |
// User is signed in, see docs for a list of available properties | |
// https://firebase.google.com/docs/reference/js/firebase.User | |
const userName = user.displayName; | |
const photoUrl = user.photoURL; | |
document.querySelector(".user-name").textContent = userName; |
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
<!-- The surrounding HTML is left untouched by FirebaseUI. | |
Your app may use that space for branding, controls and other customizations.--> | |
<div class="container-login"> | |
<div class="login-form"> | |
<h1>🔐</h1> | |
<h1>Please Sign In</h1> | |
<div id="firebaseui-auth-container"></div> | |
</div> | |
</div> |
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
.container-login { | |
padding-top: 100px; | |
text-align: center; | |
height: 100vh; | |
background-color: #fafafa; | |
} | |
.login-form { | |
max-width: 330px; | |
padding: 15px; |
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
<script type="text/javascript"> | |
// FirebaseUI config. | |
const uiConfig = { | |
signInSuccessUrl: "dashboard.html", | |
signInOptions: [ | |
// Leave the lines as is for the providers you want to offer your users. | |
firebase.auth.GoogleAuthProvider.PROVIDER_ID, | |
firebase.auth.EmailAuthProvider.PROVIDER_ID, | |
], | |
// tosUrl and privacyPolicyUrl accept either url string or a callback |
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
<!-- Include FirebaseUI --> | |
<script src="https://www.gstatic.com/firebasejs/ui/4.6.1/firebase-ui-auth.js"></script> | |
<link | |
type="text/css" | |
rel="stylesheet" | |
href="https://www.gstatic.com/firebasejs/ui/4.6.1/firebase-ui-auth.css" | |
/> |