Skip to content

Commit

Permalink
chore: Remove unused files
Browse files Browse the repository at this point in the history
  • Loading branch information
warnyul committed Nov 27, 2024
1 parent 3a405ec commit 4425602
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 366 deletions.
233 changes: 0 additions & 233 deletions src/index.html

This file was deleted.

58 changes: 0 additions & 58 deletions src/js/app.js

This file was deleted.

63 changes: 53 additions & 10 deletions src/js/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,58 @@
import '../scss/index.scss'

import { initializeApp } from "firebase/app";
import { getAnalytics } from "firebase/analytics";
import { getAnalytics, logEvent } from "firebase/analytics";

// See: https://firebase.google.com/docs/web/learn-more#config-object
const firebaseConfig = {
apiKey: "AIzaSyDJMVkse8Mla3rqrVak1qkfXYxlh2AmUd8",
authDomain: "bvarga-fe600.firebaseapp.com",
projectId: "bvarga-fe600",
storageBucket: "bvarga-fe600.appspot.com",
messagingSenderId: "443364341536",
appId: "1:443364341536:web:d7b91d4ecfa7618f594945",
measurementId: "G-PB70YSPDG1"
apiKey: "AIzaSyDJMVkse8Mla3rqrVak1qkfXYxlh2AmUd8",
authDomain: "bvarga-fe600.firebaseapp.com",
projectId: "bvarga-fe600",
storageBucket: "bvarga-fe600.appspot.com",
messagingSenderId: "443364341536",
appId: "1:443364341536:web:d7b91d4ecfa7618f594945",
measurementId: "G-PB70YSPDG1"
};


// Initialize Firebase
const app = initializeApp(firebaseConfig);
const analytics = getAnalytics(app);

// Initialize Analytics and get a reference to the service
const analytics = getAnalytics(app);

function trackButtonClick(obj) {
const event = obj.innerText || obj.textContent;
logEvent(analytics, "click", { name: event });
}

function trackSocialButtonClick(obj) {
const event = obj.getAttribute('aria-label');
logEvent(analytics, "click-social", { name: event });
}

function copyLink(url) {
window.navigator.clipboard.writeText(url);
confirm("Page URL copied to the clipboard.")
}

// Attach Event Handlers
document.addEventListener('DOMContentLoaded', () => {
document.querySelectorAll('.clazz-button-container a').forEach(a => {
a.addEventListener('click', (e) => {
trackButtonClick(a);
});
});

document.querySelectorAll('.clazz-social-links a').forEach(a => {
a.addEventListener('click', (e) => {
trackSocialButtonClick(a);
});
});

document.querySelectorAll('.clazz-copy-link').forEach(a => {
a.addEventListener('click', (e) => {
e.preventDefault();
copyLink(window.location.href);
});
});
});
Loading

0 comments on commit 4425602

Please sign in to comment.