Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div id="vue"></div>

<script src="https://www.gstatic.com/firebasejs/8.4.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/8.4.1/firebase-firestore.js"></script>

<script>
  // Your web app's Firebase configuration
  // For Firebase JS SDK v7.20.0 and later, measurementId is optional
  var firebaseConfig = {
    apiKey: "AIzaSyAq7Dv_LqmzuGN1bz925RscAsuVQkBioQc",
    authDomain: "final-project-e0578.firebaseapp.com",
    projectId: "final-project-e0578",
    storageBucket: "final-project-e0578.appspot.com",
    messagingSenderId: "599847404632",
    appId: "1:599847404632:web:4a0eb73290cec75244362d",
    measurementId: "G-BV9HP2C8J3"
  };
  // Initialize Firebase
  firebase.initializeApp(firebaseConfig);
</script>
              
            
!

CSS

              
                @import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500&family=Open+Sans&family=Source+Sans+Pro&family=Tinos:wght@400;700&display=swap');

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font: 1.15em "Source Sans Pro", sans-serif;
  letter-spacing: 0.3px;
  background: #252937;
  color: cornsilk;
}

h1 {
  font-size: 3em;
  margin-bottom: 0;
  font-family: 'Tinos', serif;
  font-weight: 700;
  color: beige;
}
h2 {
  font-size: 2.5em;
  margin-bottom: 0;
  font-family: 'Tinos', serif;
  font-weight: 400;
  color: beige;
}
h3{
  color: #363F4A;
  font-size: 1.75em;
  font-family: 'Tinos', serif;
}
h4 {
  margin-top: 2.3px;
  margin-bottom: 18px;
}
p {
  margin-top: 0;
  letter-spacing: 0.1px;
  font-size: 15.9px;
  font-family: 'Montserrat';
  color: #282F38;
  font-weight: 500;
  max-width: 300px;
  text-align: center;
  margin-left:auto;
  margin-right:auto;
  padding-left: 10px;
  padding-right: 10px; 
  flex-wrap: wrap;
}
img {
  max-width: 300px;
  max-height: 200px;
  margin-bottom: 30px;
}

input {
  display: block;
  appearance: none;
  margin: 0.5em auto;
  padding: 0.5em;
  padding-left: 0.1em;
  vertical-align: middle;
  border: 1px solid transparent;
  border-bottom: 1px solid ivory;
  border-radius: 2px;
  color: black;
  background: transparent;
  font: 1.05em "Ubuntu", sans-serif;
  width: 90%;
  width: calc(100% - 1em);
  max-width: 20.25em;
  outline: 0;
}

.vueApp {
  text-align: center;
  padding: 0.5em;
}

.stars {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1200px;
  margin: 0 auto;
}

.star {
  display: inline-block;
  background: #efcec5;
  padding: 0.5em;
  text-align: center;
  margin: 0.5em;
  align-items: flex-end;
  flex-grow: 1;
  transition: all 0.1s;
  cursor: pointer;
}

              
            
!

JS

              
                let db = firebase.firestore();
let starsRef = db.collection('starSign');

let app = new Vue({
  el: '#vue',
    template: `
    <div class="vueApp">
      <h1>Zodiac Sign Search</h1>
      <input placeholder="Search a date (MM/DD  eg.09/07)" v-model="starSearch" />
      <h2>Zodiac Signs</h2>    
      <transition name="openUp">
        <transition-group name="openUp" class="stars">
          <div class="star" v-for="(star, index) in filteredStars" v-bind:key="index"  v-bind:style="{ backgroundColor: star.hex }">
            <h3>{{ star.id }}</h3>
            <img :src="star.pic">
            <p>Date: {{ star.date }}</p>
            <p>Element: {{ star.element }}</p>
            <p>Lucky Color: {{ star.luckyColor }}</p>
            <p>Lucky Number: {{ star.luckyNumber }}</p>
            <p>Symbol: {{ star.symbol }}</p>
            <br>
            <p>Traits:<br>{{ star.traits }}</p> 
          </div>
        </transition-group>
      </transition>
    </div>`,
  
  data: {
    stars: [],
    starSearch: '',
  },
  
  computed: {
    filteredStars: function() {
      let self = this;
      return this.stars.filter(function(star) {
        let parts = self.starSearch.trim().split(" ");
        for(let part of parts) {
          let searchRegex = new RegExp(part, 'i');
          if(!(
            searchRegex.test(star.id) ||
            searchRegex.test(star.datedate) ||
            searchRegex.test(star.element) ||
            searchRegex.test(star.luckyColor) ||
            searchRegex.test(star.luckyNumber) ||
            searchRegex.test(star.symbol)
          )) {
            return false;
          }
        }
        return true;
      })
    }
  },
  
  methods: {
    readStars() {
      let starsArr = [];    starsRef.get().then(querySnapshot => {
        // console.log(querySnapshot)
        querySnapshot.forEach(doc => {
          console.log(doc.data())
          starsArr.push(doc.data())
        })
        this.stars = starsArr
      }).catch(error => {
        console.log(error)
      })
    }
  },
  
  mounted() {
    this.readStars()
  }
});
              
            
!
999px

Console