Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
nicomaht committed Dec 19, 2023
2 parents fbcd94d + 4ba6f0a commit 13c90c4
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
chmod 600 ~/.ssh/pkey
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/pkey
ssh ${{ secrets.SECRET_USER }}@${{ secrets.SECRET_HOST }} -p ${{ secrets.SECRET_PORT }} "cd ./project/Swissdle && git pull origin main && cd backend-laravel && php artisan db:wipe --force && php artisan migrate --force && php artisan db:seed --force && composer install && php artisan vendor:publish --provider "L5Swagger\L5SwaggerServiceProvider" && php artisan l5-swagger:generate && cd ../frontend-vue && npm install && npm run build && (crontab -l && crontab -r) || echo '*/5 * * * * cd /home/laravel/project/Swissdle/backend-laravel && /usr/local/bin/php artisan schedule:run >> /home/laravel/project/Swissdle/cron.log' | crontab"
ssh ${{ secrets.SECRET_USER }}@${{ secrets.SECRET_HOST }} -p ${{ secrets.SECRET_PORT }} "cd ./project/Swissdle && git checkout . && git pull origin main && cd backend-laravel && php artisan db:wipe --force && php artisan migrate --force && php artisan db:seed --force && composer install && php artisan vendor:publish --provider "L5Swagger\L5SwaggerServiceProvider" && php artisan l5-swagger:generate && cd ../frontend-vue && npm install && npm run build && (crontab -l && crontab -r) || echo '*/5 * * * * cd /home/laravel/project/Swissdle/backend-laravel && /usr/local/bin/php artisan schedule:run >> /home/laravel/project/Swissdle/cron.log' | crontab"
6 changes: 6 additions & 0 deletions frontend-vue/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions frontend-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"axios": "^1.6.0",
"bootstrap": "^5.3.2",
"core-js": "^3.8.3",
"gsap": "^3.12.4",
"vue": "^3.2.13",
"vue-autocomplete": "^0.0.2",
"vuetify": "^3.4.7"
Expand Down
16 changes: 12 additions & 4 deletions frontend-vue/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
<h1 class="montserrat">Swissdle</h1>
<p class="lato guess-text">Guess the City!</p>
<DailyCity />
<SearchInput />
<HintsDisplay/>
<SearchInput v-show="!win" />
<WinText v-show="win" />
<HintsDisplay />
</div>
</template>

Expand All @@ -15,6 +16,7 @@ import CityService from "./services/CityService";
import DailyCity from './components/DailyCity.vue'
import SearchInput from './components/SearchInput.vue';
import HintsDisplay from './components/HintsDisplay.vue';
import WinText from './components/WinText.vue';
export default {
name: 'App',
Expand All @@ -28,7 +30,8 @@ export default {
components: {
DailyCity,
SearchInput,
HintsDisplay
HintsDisplay,
WinText
},
methods: {
setDailyCity() {
Expand All @@ -52,7 +55,13 @@ export default {
}
}
},
computed: {
win() {
return CityService.getWin() ? CityService.getWin() : false;
},
},
mounted() {
CityService.setWin(false);
this.setDailyCity();
this.setCities();
}
Expand All @@ -78,5 +87,4 @@ h1 {
.guess-text {
font-style: italic;
}
</style>
2 changes: 1 addition & 1 deletion frontend-vue/src/components/DirectionalArrow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</svg>
</template>
<template v-else>
<svg :style="{ transform: `rotate(${populationDiff == -1 ? -90 : 90}deg)`, transformOrigin: 'center' }"
<svg :style="{ transform: `rotate(${populationDiff == -1 ? 90 : -90}deg)`, transformOrigin: 'center' }"
width="28" height="18" viewBox="0 0 14 9" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M13.256 4.91108C13.4512 4.71582 13.4512 4.39923 13.256 4.20397L10.074 1.02199C9.87872 0.82673 9.56213 0.82673 9.36687 1.02199C9.17161 1.21725 9.17161 1.53384 9.36687 1.7291L12.1953 4.55753L9.36687 7.38595C9.17161 7.58121 9.17161 7.8978 9.36687 8.09306C9.56213 8.28832 9.87872 8.28832 10.074 8.09306L13.256 4.91108ZM0.902405 5.05753L12.9024 5.05753V4.05753L0.902405 4.05753V5.05753Z"
Expand Down
5 changes: 4 additions & 1 deletion frontend-vue/src/components/SearchInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ export default {
try {
axios.get(this.apiBaseUrl + this.apiGetGuess + cityId).then((response) => {
(CityService.addGuesses(response.data))
(
CityService.addGuesses(response.data),
CityService.getDailyCity().id == response.data.city.id ? CityService.setWin(true) : ""
)
})
} catch (err) {
alert(err);
Expand Down
43 changes: 43 additions & 0 deletions frontend-vue/src/components/WinText.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<template>
<div id="win-text-container">
<p class="montserrat" ref="winText">Good guess ! Well Done !</p>
</div>
</template>
<script>
import { TweenMax, Power1 } from "gsap";
export default {
name: "WinText",
data() {
return {
winText: null,
};
},
methods: {
animateText() {
TweenMax.to(this.winText, 1, {
y: 10,
ease: Power1.easeInOut,
yoyo: true,
repeat: -1,
});
},
},
mounted() {
this.winText = this.$refs.winText;
this.animateText();
}
}
</script>
<style scoped>
#win-text-container {
padding-top: 20px;
}
p {
margin: 0;
font-size: 24px;
color: #83D881;
}
</style>
9 changes: 9 additions & 0 deletions frontend-vue/src/services/CityService.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ const CityService = {
dailyCity: ref(null),
cities: ref(null),
guesses: ref([]),
win: ref(Boolean),

setDailyCity(city) {
this.dailyCity.value = city;
},

setWin(win) {
this.win.value = win;
},

setCities(cities) {
this.cities.value = cities;
},
Expand All @@ -33,6 +38,10 @@ const CityService = {
return this.dailyCity.value;
},

getWin() {
return this.win.value;
},

getCities() {
return this.cities.value;
},
Expand Down

0 comments on commit 13c90c4

Please sign in to comment.