Skip to content

Commit

Permalink
add root user and search
Browse files Browse the repository at this point in the history
  • Loading branch information
luisDanielRoviraContreras committed Apr 3, 2019
1 parent 9903e25 commit c2d5594
Show file tree
Hide file tree
Showing 39 changed files with 3,532 additions and 239 deletions.
47 changes: 42 additions & 5 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Expand Up @@ -9,8 +9,11 @@
"deploy": "sh deploy.sh"
},
"dependencies": {
"autosize": "^4.0.2",
"firebase": "^5.3.1",
"highlight.js": "^9.12.0",
"markdown-it": "^8.4.2",
"markdown-it-container": "^2.0.0",
"material-design-icons": "^3.0.1",
"register-service-worker": "^1.0.0",
"vue": "^2.5.16",
Expand Down
Binary file added public/filters/angular.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/filters/github.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/filters/react.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/filters/vue.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
88 changes: 72 additions & 16 deletions src/App.vue
Expand Up @@ -7,9 +7,12 @@
<div v-if="$store.state.openSidebar" @click="$store.state.openSidebar = false" class="dark">
</div>
<!-- <bubbles /> -->
<navx />
<navx :class="{'blurx': $store.state.openUpload}" />
<sidebarx />
<div class="con-app">

<openUpload />

<div :class="{'blurx': $store.state.openUpload}" class="con-app">
<router-view/>
</div>
<!-- <div class="con-ups">
Expand All @@ -22,10 +25,11 @@
Thanks for your understanding and support
</h3>
</div> -->
<footerx />
<footerx :class="{'blurx': $store.state.openUpload}" />
</div>
</template>
<script>
import openUpload from './components/openUpload.vue'
import navx from './components/nav.vue'
import footerx from './components/Footer.vue'
import sidebarx from './components/Sidebar.vue'
Expand All @@ -35,8 +39,31 @@ export default {
navx,
footerx,
sidebarx,
bubbles
bubbles,
openUpload
},
data: () => ({
user: {
bio: '',
skills: [],
email: '',
views: 0,
likes: 0,
followers: {},
follow: {},
web: '',
cover: '',
social: {
twitter: '',
facebook: '',
linkedin: '',
github: '',
instagram: '',
codepen: '',
medium: ''
}
}
}),
mounted () {
// this.getHot()
Expand All @@ -51,22 +78,44 @@ export default {
if (user) {
// User is signed in.
console.log(user)
if (user.displayName === 'ldrovira' || user.displayName === 'ManuelRoviraDesign') {
console.log(user.email == 'luisrovirac@gmail.com')
if (user.displayName === 'ldrovira' || user.displayName === 'ManuelRoviraDesign' || user.email === 'luisrovirac@gmail.com' || this.$store.state.user.email === 'chait7conrom@gmail.com') {
this.$store.state.admin = true
console.log('entro aqui', this.$store.state.admin)
}
this.$store.state.user = user
let userRef = this.$firebase.database().ref('users/' + user.uid)
userRef.update({
name: user.displayName,
email: user.email,
uid: user.uid,
emailVerified: user.emailVerified,
photoURL: user.photoURL
this.$firebase.database().ref('users').once('value', snap => {
let users = snap.val()
let userRef = this.$firebase.database().ref('users/' + user.uid)
if (!users.hasOwnProperty(user.uid)) {
userRef.update({
...this.user,
name: user.displayName,
email: user.email,
uid: user.uid,
emailVerified: user.emailVerified,
photoURL: user.photoURL
})
} else {
let userRef = this.$firebase.database().ref('users/' + user.uid)
userRef.once('value', snap => {
let bduser = snap.val()
this.user = {
...this.user,
...bduser
}
userRef.update(this.user)
})
}
})
fetch(`https://api.github.com/search/users?q=${user.displayName}`)
fetch(`https://api.github.com/search/users?q=${user.displayName || user.email}`)
.then(response => response.json())
.then(json => {
let userRef = this.$firebase.database().ref('users/' + user.uid + '/githubUrl')
userRef.set(json.items[0].html_url)
this.$store.state.githubUrl = json.items[0].html_url
})
} else {
Expand Down Expand Up @@ -118,6 +167,9 @@ export default {
--text-alpha2: rgba(255,255,255,.2)
}
.blurx
filter blur(10px)
.con-ups
width 100%
height 600px
Expand Down Expand Up @@ -177,10 +229,10 @@ input
*::-webkit-scrollbar
width: 5px;
height: 5px;
background: var(--fondo3)
background: var(--fondo)
*::-webkit-scrollbar-thumb
background: var(--fondo2)
background: rgba(255,255,255, .2)
border-radius: 5px;
*::-webkit-scrollbar-thumb:hover
Expand Down Expand Up @@ -209,9 +261,10 @@ input
padding 0px
list-style none
outline none
text-decoration none
font-family OpenSans
box-sizing border-box
a
text-decoration none
h1,h2,h3,h4,h5,h6
font-family Poppins-semi-bold !important
Expand Down Expand Up @@ -259,4 +312,7 @@ body
h3
font-weight normal !important
</style>
12 changes: 7 additions & 5 deletions src/components/Carbon.vue
Expand Up @@ -7,6 +7,10 @@
<script>
export default {
mounted () {
var elem = document.getElementById('_carbonads_projs')
if (elem) {
elem.parentNode.removeChild(elem)
}
this.$nextTick(() => {
const script = document.createElement('script')
script.setAttribute('type', 'text/javascript')
Expand All @@ -18,11 +22,9 @@ export default {
'id',
`_carbonads_js`
)
setTimeout(() => {
if (!document.querySelector('#_carbonads_js')) {
this.$refs.carbonx.appendChild(script)
}
}, 300)
if (!document.querySelector('#_carbonads_js')) {
this.$refs.carbonx.appendChild(script)
}
})
}
}
Expand Down
12 changes: 7 additions & 5 deletions src/components/CarbonPosts.vue
Expand Up @@ -8,6 +8,11 @@
export default {
mounted () {
this.$nextTick(() => {
var elem = document.getElementById('_carbonads_projs')
if (elem) {
elem.parentNode.removeChild(elem)
}
const script = document.createElement('script')
script.setAttribute('type', 'text/javascript')
script.setAttribute(
Expand All @@ -19,10 +24,8 @@ export default {
`_carbonads_js`
)
setTimeout(() => {
if (!document.querySelector('#_carbonads_js')) {
this.$refs.carbonx.appendChild(script)
}
}, 300)
this.$refs.carbonx.appendChild(script)
}, 500)
})
}
}
Expand Down Expand Up @@ -170,7 +173,6 @@ div[id*="carbonads"] a:hover {
margin-bottom: 0;
padding: 8px 20px;
text-align: left;
max-width: calc(100% - 130px - 3em);
}
.carbon-poweredby {
left: 130px;
Expand Down
14 changes: 9 additions & 5 deletions src/components/CarbonView.vue
Expand Up @@ -8,6 +8,12 @@
export default {
mounted () {
this.$nextTick(() => {
var elem = document.getElementById('_carbonads_projs')
if (elem) {
elem.parentNode.removeChild(elem)
}
const script = document.createElement('script')
script.setAttribute('type', 'text/javascript')
script.setAttribute(
Expand All @@ -18,11 +24,9 @@ export default {
'id',
`_carbonads_js`
)
setTimeout(() => {
if (!document.querySelector('#_carbonads_js')) {
this.$refs.carbonview.appendChild(script)
}
}, 300)
if (!document.querySelector('#_carbonads_js')) {
this.$refs.carbonview.appendChild(script)
}
})
}
}
Expand Down

0 comments on commit c2d5594

Please sign in to comment.