Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
🎨 Apply color context to pacman loading + remove plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
acollierr17 committed Feb 22, 2021
1 parent ffce6ea commit bccb9a3
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 3 deletions.
3 changes: 2 additions & 1 deletion components/Common.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,12 @@ import { resolveSidebarItems } from '@theme/helpers/utils'
import Password from '@theme/components/Password'
import { setTimeout } from 'timers'
import moduleTransitonMixin from '@theme/mixins/moduleTransiton'
import LoadingPage from "@theme/components/LoadingPage";
export default {
mixins: [moduleTransitonMixin],
components: { Sidebar, Navbar, Password },
components: { Sidebar, Navbar, Password, LoadingPage },
props: {
sidebar: {
Expand Down
115 changes: 115 additions & 0 deletions components/LoadingPage.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
<template>
<div id="loader-wrapper" :style="color">
<!-- <h1>HELLO WORLDDDDDD</h1>-->
<div class="loader-main" :style="color">
<div v-for="item in 4" :key="`out${item}`" :style="color">
</div>
</div>
<h3 class="title" v-if="$frontmatter.home">{{$site.title || this.$themeConfig.title}}</h3>
<p class="description" v-if="$frontmatter.home">{{$site.description || this.$themeConfig.description}}</p>
</div>
</template>

<script>
import accents from '../accents.json'
export default {
name: "LoadingPage",
data () {
return {
currentColor: 'blue'
}
},
computed: {
color() {
return {
'--accent-color': accents[this.currentColor]
}
}
},
mounted () {
this.currentColor = localStorage.getItem('accent-color') || 'blue'
}
}
</script>

<style lang="stylus" scoped>
#loader-wrapper
height:100vh;
width:100vw;
background #fff
background var(--background-color)
.loader-main
position:fixed;
width:120px;
height:50px;
top:45%;
left:50%;
z-index:555;
transform:translate(-50%,0);
div
&:nth-child(2){ animation:pacman-balls 1s 0s infinite linear; }
&:nth-child(3){ animation:pacman-balls 1s 0.33s infinite linear; }
&:nth-child(4){ animation:pacman-balls 1s 0.66s infinite linear; }
&:nth-child(5){ animation:pacman-balls 1s 0.99s infinite linear; }
&:first-of-type
width:0px;
height:0px;
border-right:25px solid transparent;
border-top:25px solid var(--accent-color);
border-left:25px solid var(--accent-color);
border-bottom:25px solid var(--accent-color);
border-radius:25px;
animation:rotate_pacman_half_up 0.5s 0s infinite;
&:nth-child(2)
width:0px;
height:0px;
border-right:25px solid transparent;
border-top:25px solid var(--accent-color);
border-left:25px solid var(--accent-color);
border-bottom:25px solid var(--accent-color);
border-radius:25px;
animation:rotate_pacman_half_down 0.5s 0s infinite;
margin-top:-50px;
&:nth-child(3),&:nth-child(4),&:nth-child(5),&:nth-child(6)
background-color: var(--accent-color);
width:15px;
height:15px;
border-radius:100%;
margin:2px;
width:10px;
height:10px;
position:absolute;
transform:translate(0,-6.25px);
top:25px;
left:100px;
.title
margin 8rem auto 2rem
text-align center
color $textColor
color var(--text-color)
font-size 30px
box-sizing: border-box;
padding: 0 10px;
text-shadow 0 2px 10px rgba(0,0,0,0.2)
.description
margin auto
text-align center
color $textColor
color var(--text-color)
font-size 22px
box-sizing: border-box;
padding: 0 10px;
text-shadow 0 2px 10px rgba(0,0,0,0.2);
@keyframes pacman-balls
75%{opacity:0.7;}
100%{-webkit-transform:translate(-100px,-6.25px);transform:translate(-100px,-6.25px);}
@keyframes rotate_pacman_half_up
0%{-webkit-transform:rotate(270deg);transform:rotate(270deg);}
50%{-webkit-transform:rotate(360deg);transform:rotate(360deg);}
100%{-webkit-transform:rotate(270deg);transform:rotate(270deg);}
@keyframes rotate_pacman_half_down
0%{-webkit-transform:rotate(90deg);transform:rotate(90deg);}
50%{-webkit-transform:rotate(0deg);transform:rotate(0deg);}
100%{-webkit-transform:rotate(90deg);transform:rotate(90deg);}
</style>
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ module.exports = (options, ctx) => ({

plugins: [
'@vuepress-reco/back-to-top',
'@vuepress-reco/loading-page',
'@vuepress-reco/pagation',
'@vuepress-reco/comments',
'@vuepress/active-header-links',
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"dependencies": {
"@vuepress-reco/vuepress-plugin-back-to-top": "^1.4.0",
"@vuepress-reco/vuepress-plugin-comments": "^1.4.6",
"@vuepress-reco/vuepress-plugin-loading-page": "^1.4.0",
"@vuepress-reco/vuepress-plugin-pagation": "^1.4.6",
"@vuepress/plugin-blog": "1.9.2",
"@vuepress/plugin-medium-zoom": "1.5.0",
Expand Down

0 comments on commit bccb9a3

Please sign in to comment.