Skip to content

Commit

Permalink
buidl initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Heisenburgirs committed Oct 21, 2023
1 parent ece2074 commit 256cc05
Show file tree
Hide file tree
Showing 79 changed files with 668 additions and 324 deletions.
670 changes: 416 additions & 254 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,16 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"autoprefixer": "^10.4.16",
"core-js": "^3.8.3",
"postcss": "^8.4.31",
"tailwindcss": "^3.3.3",
"vue": "^3.2.13"
},
"devDependencies": {
"@babel/core": "^7.12.16",
"@babel/core": "^7.23.2",
"@babel/eslint-parser": "^7.12.16",
"@babel/preset-env": "^7.23.2",
"@vue/cli-plugin-babel": "~5.0.0",
"@vue/cli-plugin-eslint": "~5.0.0",
"@vue/cli-service": "~5.0.0",
Expand Down
7 changes: 7 additions & 0 deletions postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}

14 changes: 4 additions & 10 deletions src/App.vue
Original file line number Diff line number Diff line change
@@ -1,26 +1,20 @@
<template>
<img alt="Vue logo" src="./assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
<BuidlAvatar msg="Buidl Your Avatar"/>
</template>

<script>
import HelloWorld from './components/HelloWorld.vue'
import BuidlAvatar from './components/BuidlAvatar.vue'
export default {
name: 'App',
components: {
HelloWorld
BuidlAvatar
}
}
</script>

<style>
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
margin-top: 60px;
background-color: #11232f;
}
</style>
Binary file added src/assets/Clothes/blue_battle_suit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Clothes/borg_suit_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Clothes/dungarees.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Clothes/green_battle_suit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Clothes/hobbit_clothes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Clothes/jeans_and_tshirt.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Clothes/lumberjack.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Clothes/prisonsuit.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Clothes/scientist.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Clothes/toga.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Clothes/tuxedo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Clothes/vest_and_black_trousars.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Ears/airpods-copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Ears/airpods.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Ears/one_gold_stud-copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Ears/two_diamonds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Ears/two_gold_stud_one_side.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Ears/two_gold_studs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Eyes/Borg_eyes1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Eyes/all_blue_eyes.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Eyes/borg_cyclops.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Eyes/borg_visor_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Eyes/cyclops.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Eyes/default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Eyes/evil_red_and_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/Eyes/glasses_3d.png
Binary file added src/assets/Eyes/old_man_eyes.png
Binary file added src/assets/Eyes/red_dot.png
Binary file added src/assets/Eyes/scar_over_eye.png
Binary file added src/assets/Eyes/skull_mask.png
Binary file added src/assets/Eyes/small_default.png
Binary file added src/assets/Eyes/small_eyeShadow_purple.png
Binary file added src/assets/Eyes/small_green.png
Binary file added src/assets/Eyes/sunglasses_black.png
Binary file added src/assets/Eyes/yellow_dot.png
Binary file added src/assets/Face/Borg_faceMask.png
Binary file added src/assets/Face/eye-patch.png
Binary file added src/assets/Face/green_bandana.png
Binary file added src/assets/Face/red_face_paint.png
Binary file added src/assets/Head/black_bun.png
Binary file added src/assets/Head/black_hair_in_bun-copy.png
Binary file added src/assets/Head/blue_battle_suit.png
Binary file added src/assets/Head/blue_quiff.png
Binary file added src/assets/Head/blue_spikey.png
Binary file added src/assets/Head/borg_mask.png
Binary file added src/assets/Head/borwn_short.png
Binary file added src/assets/Head/brain_in_jar.png
Binary file added src/assets/Head/cap_1.png
Binary file added src/assets/Head/gas_mask.png
Binary file added src/assets/Head/ginger_hair_and_berad.png
Binary file added src/assets/Head/gray_hair_in_bun.png
Binary file added src/assets/Head/gray_hair_with_beard.png
Binary file added src/assets/Head/green_messy.png
Binary file added src/assets/Head/halo.png
Binary file added src/assets/Head/hard_hat_torch.png
Binary file added src/assets/Head/headphones-blue-copy.png
Binary file added src/assets/Head/headphones-blue.png
Binary file added src/assets/Head/headphones.png
Binary file added src/assets/Head/karate_headband.png
Binary file added src/assets/Head/long_purple_hair.png
Binary file added src/assets/Head/mcdonalds_cap.png
Binary file added src/assets/Head/pink_mohawk.png
Binary file added src/assets/Head/pink_short_flowing_hair.png
Binary file added src/assets/Head/purple_spikey-copy.png
Binary file added src/assets/Head/purple_spikey.png
Binary file added src/assets/Head/roman_helmet.png
Binary file added src/assets/Head/viking_helm.png
Binary file added src/assets/Head/yellow_short_flowing_hair.png
Binary file added src/assets/arrow.png
3 changes: 3 additions & 0 deletions src/assets/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@import 'tailwindcss/base';
@import 'tailwindcss/components';
@import 'tailwindcss/utilities';
169 changes: 169 additions & 0 deletions src/components/BuidlAvatar.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
<template>
<div class="flex lg:h-[100vh] sm:px-4 lg:md-0 sm:py-8 lg:py-0 justify-center items-center">
<div class="flex flex-col gap-8 border border-primary border-opacity-30 rounded-10 p-6">
<div class="flex w-full justify-between items-center">
<div class="flex flex-col gap-2">
<div class="text-20 font-bold text-white">Generate Buidl Avatar🚀</div>
<div class="text-14 text-blue">This avatar will represent your Buidl profile on Hackathons</div>
</div>
</div>

<div class="flex sm:flex-col lg:flex-row gap-8 w-full">
<div class="flex flex-col gap-8 bg-surface py-4 px-6 rounded-10">
<div class="flex justify-between items-center gap-16">
<div class="text-[24px] font-bold text-white">Traits</div>
<div
@click="resetTraits"
class="w-[90px] px-2 py-1 text-14 border border-green rounded-10 text-green hover:bg-green hover:text-black transition hover:cursor-pointer">
Reset Traits
</div>
</div>
<div class="flex flex-col gap-4">
<div
class="flex w-full justify-between items-center pb-2 py-2 px-4 rounded-10 hover:cursor-pointer"
style="border-color: rgba(255, 255, 255, 0.25)"
@click="selectedFilter = 'Ears'"
:class="{ 'active-filter': selectedFilter === 'Ears' }"
>
<div class="text-16 text-white font-bold">Ears</div>
</div>

<div
class="flex w-full justify-between items-center pb-2 py-2 px-4 rounded-10 hover:cursor-pointer"
style="border-color: rgba(255, 255, 255, 0.25)"
@click="selectedFilter = 'Eyes'"
:class="{ 'active-filter': selectedFilter === 'Eyes' }"
>
<div class="text-16 text-white font-bold">Eyes</div>
</div>

<div
class="flex w-full justify-between items-center pb-2 py-2 px-4 rounded-10 hover:cursor-pointer"
style="border-color: rgba(255, 255, 255, 0.25)"
@click="selectedFilter = 'Face'"
:class="{ 'active-filter': selectedFilter === 'Face' }"
>
<div class="text-16 text-white font-bold">Face</div>
</div>

<div
class="flex w-full justify-between items-center pb-2 py-2 px-4 rounded-10 hover:cursor-pointer"
style="border-color: rgba(255, 255, 255, 0.25)"
@click="selectedFilter = 'Head'"
:class="{ 'active-filter': selectedFilter === 'Head' }"
>
<div class="text-16 text-white font-bold">Head</div>
</div>

<div
class="flex w-full justify-between items-center pb-2 py-2 px-4 rounded-10 hover:cursor-pointer"
style="border-color: rgba(255, 255, 255, 0.25)"
@click="selectedFilter = 'Clothes'"
:class="{ 'active-filter': selectedFilter === 'Clothes' }"
>
<div class="text-16 text-white font-bold">Clothes</div>
</div>
</div>
</div>
<div class="md:w-[400px] h-[324px] grid sm:grid-cols-2 base:grid-cols-3 lg:grid-cols-4 sm:gap-8 lg:gap-6 overflow-auto p-4">
<div v-for="image in images[selectedFilter]" :key="image" class="relative">
<img
:src="require('@/assets/' + selectedFilter + '/' + image)"
:alt="selectedFilter + ' image'"
:class="['w-full', 'h-auto', 'border', 'border-opacity-25', 'rounded-10', getImageClass(selectedFilter, image)]"
@click="selectImage(selectedFilter, image)"
>
<div class="text-center text-white mt-2">{{ formatImageName(image) }}</div>
</div>
</div>

<div class="flex flex-col gap-2 justify-between">
<pre class="text-white border border-positive border-opacity-25 rounded-10 p-12 ">{{ JSON.stringify(selectedNFTs, null, 2) }}</pre>

<div class="text-center py-2 px-4 text-14 border border-tertiary rounded-10 text-tertiary hover:bg-tertiary hover:border-tertiary hover:text-black transition hover:cursor-pointer">
+ Create
</div>
</div>
</div>
</div>
</div>
</template>

<script>
import { ref, reactive } from 'vue';
import arrow from '@/assets/arrow.png';
export default {
name: 'BuidlAvatar',
setup() {
// State
const selectedFilter = ref('Ears'); // Default to 'Ears'
const traits = ['Ears', 'Eyes', 'Face', 'Head', 'Clothes',]
const selectedNFTs = reactive({
Ears: '',
Eyes: '',
Face: '',
Head: '',
Clothes: '',
});
function selectImage(category, imageName) {
selectedNFTs[category] = imageName.replace('.png', '');
}
function getImageClass(category, imageName) {
return selectedNFTs[category] === imageName ? 'border-primary border-opacity-100' : '';
}
function resetTraits() {
for (const trait in selectedNFTs) {
selectedNFTs[trait] = '';
}
}
const contexts = {
Ears: require.context('@/assets/Ears', false, /\.(png|jpe?g|svg)$/),
Eyes: require.context('@/assets/Eyes', false, /\.(png|jpe?g|svg)$/),
Face: require.context('@/assets/Face', false, /\.(png|jpe?g|svg)$/),
Head: require.context('@/assets/Head', false, /\.(png|jpe?g|svg)$/),
Clothes: require.context('@/assets/Clothes', false, /\.(png|jpe?g|svg)$/),
};
const images = reactive({
Ears: contexts.Ears.keys().map(key => key.split('/').pop()),
Eyes: contexts.Eyes.keys().map(key => key.split('/').pop()),
Face: contexts.Face.keys().map(key => key.split('/').pop()),
Head: contexts.Head.keys().map(key => key.split('/').pop()),
Clothes: contexts.Clothes.keys().map(key => key.split('/').pop()),
});
return {
arrow,
selectedFilter,
traits,
images,
selectedNFTs,
selectImage,
getImageClass,
resetTraits,
};
},
methods: {
formatImageName(imageName) {
const nameWithoutExtension = imageName.split('.')[0];
return nameWithoutExtension.length > 10 ? `${nameWithoutExtension.slice(0, 10)}...` : nameWithoutExtension;
},
}
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped>
.active-filter {
/* Add styles for the active state, e.g., a different background color */
background-color: #0e1a23;
}

</style>
58 changes: 0 additions & 58 deletions src/components/HelloWorld.vue

This file was deleted.

3 changes: 2 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { createApp } from 'vue'
import App from './App.vue'
import './assets/main.css';

createApp(App).mount('#app')
createApp(App).mount('#app')
3 changes: 3 additions & 0 deletions src/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// testRequireContext.js
const req = require.context('./assets/ears', false, /\.(png|jpe?g|svg)$/);
console.log(req.keys());
59 changes: 59 additions & 0 deletions tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
module.exports = {
purge: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
darkMode: false,
theme: {
screens: {
"sm": "250px",
"base": "420px",
"md": "768px",
"lg": "1100px",
"xl": "1400px"
},
extend: {
backgroundColor: { // If you also want to use them for other utilities (like borderColor, textColor, etc.) just copy them over to those as well.
'background': '#11232f',
'surface': '#1b374a',
'secondary-surface': '#0e1a23',
'primary': '#e54de5',
'secondary': '#16dbbe',
'tertiary': '#ffc900',
'positive': '#46ffc8',
'tentative': '#ffd464',
'destructive': '#ff4444',
'green': '#16dbbe',
},
textColor: {
'white': '#fff1e2',
'blue': '#92bcd8',
'green': '#16dbbe',
'tertiary': '#ffc900',
},
borderRadius: {
'5': '5px',
'10': '10px',
'15': '15px'
},
borderOpacity: {
'10': '0.1',
},
borderColor: {
'green': '#16dbbe',
'surface': '#1b374a',
'secondary-surface': '#0e1a23',
'primary': '#e54de5',
'secondary': '#16dbbe',
'tertiary': '#ffc900',
'positive': '#46ffc8',
'tentative': '#ffd464',
'destructive': '#ff4444',
},
fontSize: {
'14': '14px',
'16': '16px',
'20': '20px'
}
},
},
variants: {},
plugins: [],
}

0 comments on commit 256cc05

Please sign in to comment.