lbry.tech/.vuepress/components/Hook.vue

190 lines
4.3 KiB
Vue
Raw Normal View History

<template>
2018-05-09 21:13:03 +02:00
<div id="hook">
<div id="hook-navigation">
<div class="step">
2018-04-20 15:17:16 +02:00
<a href="#" v-on:click="activeStep = 1" v-bind:class="{active: (activeStep==1)}">
2018-05-09 21:13:03 +02:00
<span class="number">1</span>
Resolve a claim
2018-04-20 15:17:16 +02:00
</a>
2018-05-09 21:13:03 +02:00
</div>
<div class="step">
2018-04-20 15:17:16 +02:00
<a href="#" v-on:click="activeStep = 2" v-bind:class="{active: (activeStep==2)}">
2018-05-09 21:13:03 +02:00
<span class="number">2</span>
Publish content
2018-04-20 15:17:16 +02:00
</a>
2018-05-09 21:13:03 +02:00
</div>
<div class="step">
2018-04-20 15:17:16 +02:00
<a href="#" v-on:click="activeStep = 3" v-bind:class="{active: (activeStep==3)}">
2018-05-09 21:13:03 +02:00
<span class="number">3</span>
Support with LBC
2018-04-20 15:17:16 +02:00
</a>
2018-05-09 21:13:03 +02:00
</div>
</div>
2018-04-20 15:17:16 +02:00
<Step1 v-if="activeStep == 1"></Step1>
<Step2 v-if="activeStep == 2"></Step2>
<Step3 v-if="activeStep == 3"></Step3>
2018-05-10 10:25:47 +02:00
<div class="modal" v-model="uploadDialog" v-if="uploadDialog != false">
<template v-if="confirmed">
<h3>Your image has been published!</h3>
<p><a v-bind:href="'https://explorer.lbry.io/tx/' + txhash" target="_blank">Check out your content on the LBRY blockchain explorer</a></p>
<a href="#" class="__button-black" v-on:click="uploadDialog = false">Dismiss this dialog</a>
</template>
<template v-else>
<h3><div class="loader small"></div>&nbsp;Waiting for confirmations...</h3>
<p>Your image was uploaded to the LBRY network but we are currently waiting for the first confirmation. This should take just a few minutes. In the mean time, go ahead and try the other steps!</p>
</template>
</div>
2018-05-09 21:13:03 +02:00
</div>
</template>
<script>
2018-05-07 11:04:54 +02:00
import Vue from 'vue'
import VueHighlightJS from 'vue-highlightjs'
2018-04-20 15:17:16 +02:00
import EventBus from '../event-bus';
2018-05-07 11:04:54 +02:00
Vue.use(VueHighlightJS)
export default {
data () {
return {
uploadDialog: false,
txhash: '',
2018-04-20 15:17:16 +02:00
confirmed: false,
activeStep: 1
}
},
watch: {
uploadDialog: function() {
var component = this;
if(this.uploadDialog) {
// Simulate confirmation
setTimeout(function() {
component.confirmed = true;
}, 10000)
}
}
},
created () {
var component = this;
2018-04-27 12:30:56 +02:00
EventBus.$on('HookFileUploaded', function(txhash) {
component.txhash = txhash;
component.uploadDialog = true;
});
2018-04-27 12:30:56 +02:00
EventBus.$on('HookStepUpdate', function(step) {
component.activeStep = step;
});
},
name: 'Hook'
2018-05-09 21:13:03 +02:00
};
</script>
<style lang="scss">
2018-04-20 15:17:16 +02:00
@import '../scss/variables';
2018-04-20 15:17:16 +02:00
@import '../../node_modules/highlight.js/styles/monokai-sublime';
.dialog__content {
align-items: flex-end !important;
justify-content: right !important;
}
#hook {
2018-04-17 12:24:56 +02:00
background: url(https://lbry.io/img/youtube/hero@2x.jpg) no-repeat center center;
background-size: cover;
2018-05-09 21:13:03 +02:00
text-align: center;
h1,
h2,
h3,
h4,
h5,
p {
2018-04-17 12:24:56 +02:00
color: white;
text-shadow: 0px 0px 1rem rgba(0,0,0,0.5);
a {
color: white;
}
}
2018-05-09 21:13:03 +02:00
input[type='text'] {
background: white;
padding: 0.5rem 0.5rem;
}
pre {
text-align: left;
}
2018-04-17 12:24:56 +02:00
.flex {
margin-bottom: 2rem;
}
2018-05-09 21:13:03 +02:00
.loader {
border: 16px solid #f3f3f3; /* Light grey */
border-top: 16px solid #3498db; /* Blue */
border-radius: 50%;
width: 120px;
height: 120px;
animation: spin 2s linear infinite;
2018-05-10 10:25:47 +02:00
&.small {
border: 4px solid #f3f3f3; /* Light grey */
border-top: 4px solid #3498db; /* Blue */
width: 30px;
height: 30px;
}
2018-05-09 21:13:03 +02:00
}
.card {
width: 20%;
display: inline-block;
vertical-align: top;
background: white;
box-shadow: 0 0 5px 5px rgba(0,0,0,0.2);
margin: 0 2.5%;
2018-05-10 10:25:47 +02:00
&:hover {
cursor: pointer;
}
2018-05-09 21:13:03 +02:00
img {
width: 100%;
height: 6rem;
object-fit: cover;
}
2018-05-10 10:25:47 +02:00
h4, .account {
text-align: left;
color: black;
padding: 0.5rem 0.5rem;
text-shadow: none;
}
}
.modal {
position: fixed;
bottom: 0px;
right: 0px;
width: 25rem;
background: white;
text-align: left;
padding: 1rem;
h3, p, p > a {
color: black;
text-shadow: none;
}
2018-05-09 21:13:03 +02:00
}
}
#hook-navigation {
2018-05-10 10:25:47 +02:00
.step {
width: 30%;
float: left;
margin: 0 1.5%;
background: black;
padding: 0.5rem 0;
a {
color: white;
}
}
}
2018-05-09 21:13:03 +02:00
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>