Skip to content

Instantly share code, notes, and snippets.

@Kvnbbg
Created October 13, 2024 20:30
Show Gist options
  • Save Kvnbbg/02585468ebf0b1ecfe99202c4af47da2 to your computer and use it in GitHub Desktop.
Save Kvnbbg/02585468ebf0b1ecfe99202c4af47da2 to your computer and use it in GitHub Desktop.
Updated Vue.js Component with Tweet Embed
<template>
<div id="app">
<h1>{{ message }}</h1>
<p>
Learn more with the
<a href="https://vuejs.org/" target="_blank" rel="noopener">
Vue Docs &amp; Resources
</a>
.
</p>
<p>Your current time: {{ localTime }}</p>
<p>Timezone: {{ timeZone }}</p>
<div>
<label for="rdv-time">Choose a date and time for your RDV:</label>
<input type="datetime-local" id="rdv-time" v-model="rdvTime" />
</div>
<button @click="scheduleRdv">Confirm RDV</button>
<div v-if="confirmationMessage" class="confirmation-message">
<h3>{{ confirmationMessage }}</h3>
</div>
<!-- Footer Bar Section -->
<footer class="footer-bar">
<p>Connect with us:</p>
<a href="https://x.com/techandstream" target="_blank" rel="noopener">X</a>
|
<a
href="https://www.threads.net/@techandstream"
target="_blank"
rel="noopener"
>
Threads
</a>
</footer>
</div>
</template>
<script>
export default {
data() {
return {
message: "Welcome to Vue RDV Scheduler!",
localTime: "",
timeZone: "",
rdvTime: "",
confirmationMessage: ""
};
},
created() {
this.setLocalTime();
},
methods: {
setLocalTime() {
const date = new Date();
this.localTime = date.toLocaleString(); // Display local time
this.timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; // Get the user's current time zone
},
scheduleRdv() {
if (this.rdvTime) {
this.confirmationMessage = `Your RDV has been scheduled for ${this.rdvTime} in the ${this.timeZone} timezone.`;
} else {
this.confirmationMessage =
"Please select a valid date and time for your RDV.";
}
}
}
};
</script>
<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
text-align: center;
color: #2c3e50;
margin-top: 40px;
}
a {
color: #4fc08d;
}
button {
background: none;
border: solid 1px;
border-radius: 2em;
font: inherit;
padding: 0.75em 2em;
color: #4fc08d;
cursor: pointer;
}
button:hover {
background-color: #4fc08d;
color: white;
}
.confirmation-message {
margin-top: 20px;
color: #2c3e50;
font-weight: bold;
}
</style>

Updated Vue.js Component with Tweet Embed

Twitter embed integrated into the project structure while maintaining the look and feel of a nice scheduler for your appointements!

A Pen by Kevin Marville on CodePen.

License.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment