Skip to content

Commit

Permalink
Merge pull request #179 from Arquisoft/review2-changes
Browse files Browse the repository at this point in the history
Change .pngs for .svgs, and modify the app style
  • Loading branch information
uo287545 authored Apr 8, 2024
2 parents 711d29c + 45e00a1 commit a66f387
Show file tree
Hide file tree
Showing 15 changed files with 266 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.uniovi.components;

import com.uniovi.components.generators.QuestionGenerator;
import com.uniovi.entities.Category;
import com.uniovi.entities.Question;

import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
package com.uniovi.components;

import com.uniovi.components.generators.geography.CapitalQuestionGenerator;
import com.uniovi.entities.Question;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class QuestionGeneratorTestController {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package com.uniovi.configuration;

import jakarta.persistence.EntityManagerFactory;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.LocaleResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/uniovi/controllers/GameController.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ public String getCheckResult(@PathVariable Long idQuestion, @PathVariable Long i
|| getRemainingTime(gameSession) <= 0) {
model.addAttribute("correctAnswer", gameSession.getCurrentQuestion().getCorrectAnswer());
model.addAttribute("messageKey", "timeRunOut.result");
model.addAttribute("logoImage", "/images/logo_incorrect.png");
model.addAttribute("logoImage", "/images/logo_incorrect.svg");
gameSession.addAnsweredQuestion(gameSession.getCurrentQuestion());
gameSession.addQuestion(false, 0);
}
else if(questionService.checkAnswer(idQuestion, idAnswer)) {
model.addAttribute("messageKey", "correctAnswer.result");
model.addAttribute("logoImage", "/images/logo_correct.png");
model.addAttribute("logoImage", "/images/logo_correct.svg");

if (!gameSession.isAnswered(gameSession.getCurrentQuestion())) {
gameSession.addQuestion(true, getRemainingTime(gameSession));
Expand All @@ -97,7 +97,7 @@ else if(questionService.checkAnswer(idQuestion, idAnswer)) {
} else {
model.addAttribute("correctAnswer", gameSession.getCurrentQuestion().getCorrectAnswer());
model.addAttribute("messageKey", "failedAnswer.result");
model.addAttribute("logoImage", "/images/logo_incorrect.png");
model.addAttribute("logoImage", "/images/logo_incorrect.svg");
gameSession.addAnsweredQuestion(gameSession.getCurrentQuestion());
gameSession.addQuestion(false, 0);
}
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/com/uniovi/controllers/HomeController.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,13 @@
package com.uniovi.controllers;

import com.uniovi.entities.ApiKey;
import com.uniovi.entities.Player;
import com.uniovi.services.ApiKeyService;
import com.uniovi.services.PlayerService;
import com.uniovi.services.QuestionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.Random;

@Controller
public class HomeController{
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/uniovi/dto/AnswerDto.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.uniovi.dto;

import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/uniovi/entities/Answer.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.uniovi.entities;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
package com.uniovi.repositories;

import com.uniovi.entities.Answer;
import com.uniovi.entities.GameSession;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.uniovi.entities.Player;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import java.util.List;

Expand Down
25 changes: 23 additions & 2 deletions src/main/resources/static/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ footer {


/* Estilo personalizado para el botón */
.btn-custom, .page-link {
.btn-custom, .btn-primary, .page-link {
color: #fff;
background-color: transparent;
border: 2px solid #fff;
}

.btn-custom:hover, .page-link:hover {
.btn-custom:hover, .btn-primary:hover, .page-link:hover {
background-color: #fff;
color: #000;
}
Expand All @@ -42,3 +42,24 @@ footer {
.table-hover tbody tr:hover td {
background: white;
}

.col-md-12 .display-4 {
font-size: 10em;
}

.col-md-12 .lead, .col-md-12 .btn {
font-size: 1.75em;
}


.nav {
background-color: transparent !important;
}

.nav .nav-link {
color: white !important; /* Cambia el color del texto del enlace a blanco */
}

.nav .nav-link:hover {
color: rgba(255, 255, 255, 0.7) !important; /* Cambia el color del texto del enlace cuando se pasa el mouse */
}
19 changes: 15 additions & 4 deletions src/main/resources/static/css/game.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
position: relative;
text-align: center;
width: 35%;
margin: auto;
margin: 2% auto;
}

.countdown {
Expand All @@ -11,16 +11,16 @@
left: 50%;
transform: translate(-50%, -50%);
font-size: 2em;
color: black;
color: white;
}
.stopwatch-img {
width: 45%;
height: auto;
}

.game-logo {
margin: 0 0 5% 0;
width: 25%;
margin: auto;
width: 15%;
height: auto;
}

Expand All @@ -45,4 +45,15 @@
.countdown {
font-size: 3em;
}
}

.container .btn {
color: #fff;
background-color: transparent;
border: 2px solid #fff;
}

.container .btn:hover {
background-color: #fff;
color: #000;
}
102 changes: 102 additions & 0 deletions src/main/resources/static/images/logo_correct.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a66f387

Please sign in to comment.