Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config panel #6

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ Este repositório contém a tela de countdown usada no canal do [Código Falado]
4. Rode `npm install` para instalar as dependências.
5. Rode `npm run build` para criar a pasta `dist` contendo o Countdown funcionando.
6. Adicione a url `http://localhost:5000` no OBS via Browser Source
7. Você pode definir os minutos e o título da página através de query string na URL. Ex.: `http://localhost:5000/?minutes=15&title=Meu+T%C3%ADtulo+De+Exemplo`
8. Altere o arquivo `dist/data.json` com o título / subtítulo / parágrafo da sua transmissão **sempre que for começar uma nova Live**.
9. Rode `npm run stream` para iniciar um servidor local com o Countdown na porta 5000 **sempre que for começar uma nova Live**.
7. Rode `npm run stream` para iniciar um servidor local com o Countdown na porta 5000 **sempre que for começar uma nova Live**.
8. Para definir os textos e o tempo da contagem regressiva entre na url `http://localhost:5000` e pressione CTRL + alt + e que um panel de configuração será aberto, para sair basta pressionar as mesmas teclas novamente ou ESC.

# Customizando o Projeto

Expand Down
5 changes: 5 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
"core-js": "^3.6.4",
"node-sass": "^4.14.1",
"sass-loader": "^8.0.2",
"vue": "^2.6.11"
"vue": "^2.6.11",
"vuex": "^3.4.0"
},
"devDependencies": {
"@vue/cli-plugin-babel": "~4.3.0",
Expand Down
42 changes: 18 additions & 24 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,41 +1,35 @@
<template>
<div id="app">
<div class="content">
<h1 v-text="title" />
<h2 v-html="stream_title"></h2>
<h3 v-html="stream_subtitle"></h3>
<Clock />
<p v-html="stream_paragraph"></p>
</div>
<ConfigPanel />
<StreamContent />
</div>
</template>

<script>
import Clock from "@/components/Clock.vue";
import ConfigPanel from "@/components/ConfigPanel.vue"
import StreamContent from "@/components/StreamContent.vue"

export default {
name: "App",
components: {
Clock
ConfigPanel,
StreamContent
},
async mounted() {
const data = await fetch("./data.json");
const config = await data.json();
this.stream_title = config["stream-title"];
this.stream_subtitle = config["stream-subtitle"];
this.stream_paragraph = config["stream-paragraph"];
},
data() {
return {
stream_title: "",
stream_subtitle: "",
stream_paragraph: ""
};
window.addEventListener('keydown', event => {
this.toggleConfigEditor(event)
})
},
computed: {
title() {
const urlParams = new URLSearchParams(location.search);
return urlParams.get("title") || "O live coding está começando!";
isConfigPainelOpen() {
return this.$store.state.configPanel.isConfigPainelOpen
}
},
methods: {
toggleConfigEditor({key, ctrlKey, altKey}) {
if(/e/i.test(key) && ctrlKey && altKey)
this.$store.commit('configPanel/CHANGE_IS_CONFIG_PANEL_OPEN', !this.isConfigPainelOpen)
if(event.key === 'Escape') this.$store.commit('configPanel/CHANGE_IS_CONFIG_PANEL_OPEN', false)
}
}
};
Expand Down
3 changes: 3 additions & 0 deletions src/assets/img/reset.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
53 changes: 0 additions & 53 deletions src/components/Clock.vue

This file was deleted.

Loading