diff --git a/DESIGN.md b/DESIGN.md index 7e6aa52..1bf9de5 100644 --- a/DESIGN.md +++ b/DESIGN.md @@ -334,6 +334,9 @@ Píldora de vidrio arriba a la derecha de la cabecera, con globo y código del i ### Visor 360 Pie oscuro con la escena, sus puntos y, a la derecha, dos botones circulares para girar 45°. Debajo, «Desde aquí puedes ir a» con una píldora por salida (icono de caminar y destino): la misma navegación que los hotspots, sin tener que encontrarlos. Arriba a la derecha, el interruptor del giroscopio, que se rellena de azul cuando está activo. +### Cómo llegar +La misma cabecera azul con arcos: sobretítulo según la fase («CÓMO LLEGAR», «CAMINANDO HACIA», «LLEGASTE»), el lugar, su categoría y «Parada N de M». A la derecha, Max con la pose del momento (teléfono antes de salir, apenado o pensativo si algo falla, mapa fuera del campus, celebrando al llegar); mientras guía, el anillo de avance con los metros que faltan. La postal del destino (16:9, radio 26) aparece antes de salir, en los avisos y al llegar, para reconocer el lugar. La instrucción va en una tarjeta destacada con la flecha en un círculo de vidrio; «Sin escaleras» y «Terminar» comparten una tarjeta grafito al pie. Al llegar, si queda alguna parada sin ver, una tarjeta destacada lleva directo a su «Cómo llegar». + ### Anillo de avance Trazo de 8 con puntas redondas en azul-claro sobre pista del mismo tono al 18 %; el arranque del trazo es más claro (barrido de gradiente). Se llena desde cero en 850 ms al aparecer. 76 en la cabecera desplegada, 34 compacto. diff --git a/apps/mobile/integration_test/guia_campo_test.dart b/apps/mobile/integration_test/guia_campo_test.dart index d8c5f4d..8367928 100644 --- a/apps/mobile/integration_test/guia_campo_test.dart +++ b/apps/mobile/integration_test/guia_campo_test.dart @@ -124,7 +124,7 @@ void main() { // 8. Llega, y en la puerta: «Estoy en la puerta». await _esperar( tester, - () => _hay('Llegaste a Biblioteca'), + () => _hay('Ver la ficha'), limite: const Duration(seconds: 90), ); await _pausa(tester); diff --git a/apps/mobile/test/navegacion_pantalla_test.dart b/apps/mobile/test/navegacion_pantalla_test.dart index 05b395f..5cff55d 100644 --- a/apps/mobile/test/navegacion_pantalla_test.dart +++ b/apps/mobile/test/navegacion_pantalla_test.dart @@ -212,7 +212,7 @@ void main() { for (var i = 0; i < 5; i++) { await tester.pump(const Duration(milliseconds: 50)); } - expect(find.text('Llegaste a Biblioteca'), findsWidgets); + expect(find.text('Ver la ficha'), findsWidgets); // Tras la llegada siguen los sensores: se puede marcar la puerta real. expect(ubicacion.cambios.hasListener, isTrue); expect(find.textContaining('¿No es la puerta?'), findsOneWidget); @@ -268,7 +268,7 @@ void main() { .vigentes .map((c) => c.tipo); expect(tipos, ['prueba', 'entrada']); - expect(find.text('Llegaste a Biblioteca'), findsWidgets); + expect(find.text('Ver la ficha'), findsWidgets); await tester.tap(find.text('Deshacer')); await tester.pump(const Duration(milliseconds: 100)); @@ -388,10 +388,10 @@ void main() { // Camina hasta la puerta. for (var i = 0; i < 80; i++) { await tester.pump(const Duration(milliseconds: 200)); - if (find.text('Llegaste a Biblioteca').evaluate().isNotEmpty) break; + if (find.text('Ver la ficha').evaluate().isNotEmpty) break; } - expect(find.text('Llegaste a Biblioteca'), findsOneWidget); expect(find.text('Ver la ficha'), findsOneWidget); + expect(find.text('LLEGASTE'), findsOneWidget); expect(voz.dichos.last, 'Llegaste a Biblioteca'); await tester.pumpWidget(const SizedBox.shrink()); diff --git a/packages/tour_virtual/lib/l10n/textos.dart b/packages/tour_virtual/lib/l10n/textos.dart index ca59549..af5fd79 100644 --- a/packages/tour_virtual/lib/l10n/textos.dart +++ b/packages/tour_virtual/lib/l10n/textos.dart @@ -1206,6 +1206,36 @@ abstract class Textos { /// **'Estás fuera del campus. La guía funciona dentro de la UTB: ábrela cuando llegues.'** String get navFueraDelCampus; + /// Sobretítulo de la cabecera mientras guía, sobre el nombre del lugar. + /// + /// In es, this message translates to: + /// **'Caminando hacia'** + String get navCaminandoHacia; + + /// Sobretítulo de la cabecera al llegar, sobre el nombre del lugar. + /// + /// In es, this message translates to: + /// **'Llegaste'** + String get navLlegada; + + /// Cómo funciona la guía, antes de empezar. + /// + /// In es, this message translates to: + /// **'Te llevo por los caminos del campus y te aviso antes de cada giro.'** + String get navIdeaRuta; + + /// Cómo funciona la vista de cámara, antes de empezar. + /// + /// In es, this message translates to: + /// **'Levanta el teléfono y verás una flecha sobre la cámara que marca por dónde ir.'** + String get navIdeaCamara; + + /// Debajo del interruptor «Sin escaleras». + /// + /// In es, this message translates to: + /// **'Evita escalones y gradas en la ruta.'** + String get navSinEscalerasDetalle; + /// La entrada no se ha medido en el campus todavía. /// /// In es, this message translates to: diff --git a/packages/tour_virtual/lib/l10n/textos_de.arb b/packages/tour_virtual/lib/l10n/textos_de.arb index 8633276..3cf9cbe 100644 --- a/packages/tour_virtual/lib/l10n/textos_de.arb +++ b/packages/tour_virtual/lib/l10n/textos_de.arb @@ -182,6 +182,11 @@ "navCalibrar": "Der Kompass ist ungenau: Bewege das Handy in einer Acht.", "navSinRuta": "Ich habe keinen Weg zu {lugar} gefunden.", "navFueraDelCampus": "Du bist außerhalb des Campus. Die Führung funktioniert auf dem UTB-Gelände: Öffne sie, wenn du ankommst.", + "navCaminandoHacia": "Unterwegs zu", + "navLlegada": "Angekommen", + "navIdeaRuta": "Ich führe dich über die Wege des Campus und sage dir vor jeder Abzweigung Bescheid.", + "navIdeaCamara": "Heb das Handy an: Ein Pfeil über dem Kamerabild zeigt dir den Weg.", + "navSinEscalerasDetalle": "Meidet Stufen auf der Route.", "navAproximada": "Der Eingang dieses Ortes ist noch ungefähr.", "navPlanoSemantica": "Karte mit der Route zu {lugar}", "verMapa3d": "3D-Karte anzeigen", diff --git a/packages/tour_virtual/lib/l10n/textos_de.dart b/packages/tour_virtual/lib/l10n/textos_de.dart index 2df90d9..247185c 100644 --- a/packages/tour_virtual/lib/l10n/textos_de.dart +++ b/packages/tour_virtual/lib/l10n/textos_de.dart @@ -681,6 +681,23 @@ class TextosDe extends Textos { String get navFueraDelCampus => 'Du bist außerhalb des Campus. Die Führung funktioniert auf dem UTB-Gelände: Öffne sie, wenn du ankommst.'; + @override + String get navCaminandoHacia => 'Unterwegs zu'; + + @override + String get navLlegada => 'Angekommen'; + + @override + String get navIdeaRuta => + 'Ich führe dich über die Wege des Campus und sage dir vor jeder Abzweigung Bescheid.'; + + @override + String get navIdeaCamara => + 'Heb das Handy an: Ein Pfeil über dem Kamerabild zeigt dir den Weg.'; + + @override + String get navSinEscalerasDetalle => 'Meidet Stufen auf der Route.'; + @override String get navAproximada => 'Der Eingang dieses Ortes ist noch ungefähr.'; diff --git a/packages/tour_virtual/lib/l10n/textos_en.arb b/packages/tour_virtual/lib/l10n/textos_en.arb index eb6c46d..d316f7d 100644 --- a/packages/tour_virtual/lib/l10n/textos_en.arb +++ b/packages/tour_virtual/lib/l10n/textos_en.arb @@ -182,6 +182,11 @@ "navCalibrar": "The compass is inaccurate: move your phone in a figure eight.", "navSinRuta": "I couldn’t find a way to {lugar}.", "navFueraDelCampus": "You’re outside the campus. The guide works inside UTB: open it when you arrive.", + "navCaminandoHacia": "Walking to", + "navLlegada": "You’ve arrived", + "navIdeaRuta": "I take you along the campus paths and tell you before each turn.", + "navIdeaCamara": "Raise your phone to see an arrow over the camera showing the way.", + "navSinEscalerasDetalle": "Avoids steps along the route.", "navAproximada": "This place’s entrance is still approximate.", "navPlanoSemantica": "Map with the route to {lugar}", "verMapa3d": "View 3D map", diff --git a/packages/tour_virtual/lib/l10n/textos_en.dart b/packages/tour_virtual/lib/l10n/textos_en.dart index 40a7d75..134aa9d 100644 --- a/packages/tour_virtual/lib/l10n/textos_en.dart +++ b/packages/tour_virtual/lib/l10n/textos_en.dart @@ -669,6 +669,23 @@ class TextosEn extends Textos { String get navFueraDelCampus => 'You’re outside the campus. The guide works inside UTB: open it when you arrive.'; + @override + String get navCaminandoHacia => 'Walking to'; + + @override + String get navLlegada => 'You’ve arrived'; + + @override + String get navIdeaRuta => + 'I take you along the campus paths and tell you before each turn.'; + + @override + String get navIdeaCamara => + 'Raise your phone to see an arrow over the camera showing the way.'; + + @override + String get navSinEscalerasDetalle => 'Avoids steps along the route.'; + @override String get navAproximada => 'This place’s entrance is still approximate.'; diff --git a/packages/tour_virtual/lib/l10n/textos_es.arb b/packages/tour_virtual/lib/l10n/textos_es.arb index 8676d27..c698a1a 100644 --- a/packages/tour_virtual/lib/l10n/textos_es.arb +++ b/packages/tour_virtual/lib/l10n/textos_es.arb @@ -279,6 +279,16 @@ "@navSinRuta": {"description": "No hay camino en el grafo hasta el lugar.", "placeholders": {"lugar": {"type": "String"}}}, "navFueraDelCampus": "Estás fuera del campus. La guía funciona dentro de la UTB: ábrela cuando llegues.", "@navFueraDelCampus": {"description": "La persona está a más de 150 m del grafo del campus: la guía no inventa una ruta (RF-33)."}, + "navCaminandoHacia": "Caminando hacia", + "@navCaminandoHacia": {"description": "Sobretítulo de la cabecera mientras guía, sobre el nombre del lugar."}, + "navLlegada": "Llegaste", + "@navLlegada": {"description": "Sobretítulo de la cabecera al llegar, sobre el nombre del lugar."}, + "navIdeaRuta": "Te llevo por los caminos del campus y te aviso antes de cada giro.", + "@navIdeaRuta": {"description": "Cómo funciona la guía, antes de empezar."}, + "navIdeaCamara": "Levanta el teléfono y verás una flecha sobre la cámara que marca por dónde ir.", + "@navIdeaCamara": {"description": "Cómo funciona la vista de cámara, antes de empezar."}, + "navSinEscalerasDetalle": "Evita escalones y gradas en la ruta.", + "@navSinEscalerasDetalle": {"description": "Debajo del interruptor «Sin escaleras»."}, "navAproximada": "La entrada de este lugar aún es aproximada.", "@navAproximada": {"description": "La entrada no se ha medido en el campus todavía."}, "navPlanoSemantica": "Plano con la ruta hasta {lugar}", diff --git a/packages/tour_virtual/lib/l10n/textos_es.dart b/packages/tour_virtual/lib/l10n/textos_es.dart index c28df5d..4fa23fa 100644 --- a/packages/tour_virtual/lib/l10n/textos_es.dart +++ b/packages/tour_virtual/lib/l10n/textos_es.dart @@ -676,6 +676,23 @@ class TextosEs extends Textos { String get navFueraDelCampus => 'Estás fuera del campus. La guía funciona dentro de la UTB: ábrela cuando llegues.'; + @override + String get navCaminandoHacia => 'Caminando hacia'; + + @override + String get navLlegada => 'Llegaste'; + + @override + String get navIdeaRuta => + 'Te llevo por los caminos del campus y te aviso antes de cada giro.'; + + @override + String get navIdeaCamara => + 'Levanta el teléfono y verás una flecha sobre la cámara que marca por dónde ir.'; + + @override + String get navSinEscalerasDetalle => 'Evita escalones y gradas en la ruta.'; + @override String get navAproximada => 'La entrada de este lugar aún es aproximada.'; diff --git a/packages/tour_virtual/lib/l10n/textos_fr.arb b/packages/tour_virtual/lib/l10n/textos_fr.arb index 47978da..a37d23c 100644 --- a/packages/tour_virtual/lib/l10n/textos_fr.arb +++ b/packages/tour_virtual/lib/l10n/textos_fr.arb @@ -182,6 +182,11 @@ "navCalibrar": "La boussole est imprécise : bougez le téléphone en dessinant un huit.", "navSinRuta": "Je n’ai pas trouvé de chemin vers {lugar}.", "navFueraDelCampus": "Vous êtes hors du campus. Le guide fonctionne dans l’UTB : ouvrez-le à votre arrivée.", + "navCaminandoHacia": "En route vers", + "navLlegada": "Vous êtes arrivé", + "navIdeaRuta": "Je vous guide par les chemins du campus et vous préviens avant chaque virage.", + "navIdeaCamara": "Levez le téléphone : une flèche sur la caméra vous montre le chemin.", + "navSinEscalerasDetalle": "Évite les marches sur le trajet.", "navAproximada": "L’entrée de ce lieu est encore approximative.", "navPlanoSemantica": "Plan avec l’itinéraire vers {lugar}", "verMapa3d": "Voir la carte en 3D", diff --git a/packages/tour_virtual/lib/l10n/textos_fr.dart b/packages/tour_virtual/lib/l10n/textos_fr.dart index c69dd5d..5e44783 100644 --- a/packages/tour_virtual/lib/l10n/textos_fr.dart +++ b/packages/tour_virtual/lib/l10n/textos_fr.dart @@ -682,6 +682,23 @@ class TextosFr extends Textos { String get navFueraDelCampus => 'Vous êtes hors du campus. Le guide fonctionne dans l’UTB : ouvrez-le à votre arrivée.'; + @override + String get navCaminandoHacia => 'En route vers'; + + @override + String get navLlegada => 'Vous êtes arrivé'; + + @override + String get navIdeaRuta => + 'Je vous guide par les chemins du campus et vous préviens avant chaque virage.'; + + @override + String get navIdeaCamara => + 'Levez le téléphone : une flèche sur la caméra vous montre le chemin.'; + + @override + String get navSinEscalerasDetalle => 'Évite les marches sur le trajet.'; + @override String get navAproximada => 'L’entrée de ce lieu est encore approximative.'; diff --git a/packages/tour_virtual/lib/l10n/textos_it.arb b/packages/tour_virtual/lib/l10n/textos_it.arb index 4b7d3ff..a72e7ed 100644 --- a/packages/tour_virtual/lib/l10n/textos_it.arb +++ b/packages/tour_virtual/lib/l10n/textos_it.arb @@ -182,6 +182,11 @@ "navCalibrar": "La bussola è imprecisa: muovi il telefono disegnando un otto.", "navSinRuta": "Non ho trovato un percorso fino a {lugar}.", "navFueraDelCampus": "Sei fuori dal campus. La guida funziona dentro l’UTB: aprila quando arrivi.", + "navCaminandoHacia": "In cammino verso", + "navLlegada": "Sei arrivato", + "navIdeaRuta": "Ti porto lungo i percorsi del campus e ti avviso prima di ogni svolta.", + "navIdeaCamara": "Alza il telefono: una freccia sulla fotocamera ti indica la strada.", + "navSinEscalerasDetalle": "Evita i gradini lungo il percorso.", "navAproximada": "L’ingresso di questo luogo è ancora approssimativo.", "navPlanoSemantica": "Mappa con il percorso fino a {lugar}", "verMapa3d": "Visualizza mappa 3D", diff --git a/packages/tour_virtual/lib/l10n/textos_it.dart b/packages/tour_virtual/lib/l10n/textos_it.dart index eec7372..2c679dc 100644 --- a/packages/tour_virtual/lib/l10n/textos_it.dart +++ b/packages/tour_virtual/lib/l10n/textos_it.dart @@ -678,6 +678,23 @@ class TextosIt extends Textos { String get navFueraDelCampus => 'Sei fuori dal campus. La guida funziona dentro l’UTB: aprila quando arrivi.'; + @override + String get navCaminandoHacia => 'In cammino verso'; + + @override + String get navLlegada => 'Sei arrivato'; + + @override + String get navIdeaRuta => + 'Ti porto lungo i percorsi del campus e ti avviso prima di ogni svolta.'; + + @override + String get navIdeaCamara => + 'Alza il telefono: una freccia sulla fotocamera ti indica la strada.'; + + @override + String get navSinEscalerasDetalle => 'Evita i gradini lungo il percorso.'; + @override String get navAproximada => 'L’ingresso di questo luogo è ancora approssimativo.'; diff --git a/packages/tour_virtual/lib/l10n/textos_ja.arb b/packages/tour_virtual/lib/l10n/textos_ja.arb index f0f4b03..4adf103 100644 --- a/packages/tour_virtual/lib/l10n/textos_ja.arb +++ b/packages/tour_virtual/lib/l10n/textos_ja.arb @@ -182,6 +182,11 @@ "navCalibrar": "コンパスが不正確です。スマートフォンを 8 の字に動かしてください。", "navSinRuta": "{lugar}までの道が見つかりませんでした。", "navFueraDelCampus": "キャンパスの外にいます。案内はUTBの中で使えます。着いたら開いてください。", + "navCaminandoHacia": "目的地", + "navLlegada": "到着", + "navIdeaRuta": "キャンパスの道を案内し、曲がる前にお知らせします。", + "navIdeaCamara": "スマートフォンを持ち上げると、カメラ画面の矢印が進む方向を示します。", + "navSinEscalerasDetalle": "ルート上の段差を避けます。", "navAproximada": "この場所の入口はまだおおよその位置です。", "navPlanoSemantica": "{lugar}までのルートを示した地図", "verMapa3d": "3Dマップを表示", diff --git a/packages/tour_virtual/lib/l10n/textos_ja.dart b/packages/tour_virtual/lib/l10n/textos_ja.dart index 94c86aa..7a177d1 100644 --- a/packages/tour_virtual/lib/l10n/textos_ja.dart +++ b/packages/tour_virtual/lib/l10n/textos_ja.dart @@ -650,6 +650,21 @@ class TextosJa extends Textos { @override String get navFueraDelCampus => 'キャンパスの外にいます。案内はUTBの中で使えます。着いたら開いてください。'; + @override + String get navCaminandoHacia => '目的地'; + + @override + String get navLlegada => '到着'; + + @override + String get navIdeaRuta => 'キャンパスの道を案内し、曲がる前にお知らせします。'; + + @override + String get navIdeaCamara => 'スマートフォンを持ち上げると、カメラ画面の矢印が進む方向を示します。'; + + @override + String get navSinEscalerasDetalle => 'ルート上の段差を避けます。'; + @override String get navAproximada => 'この場所の入口はまだおおよその位置です。'; diff --git a/packages/tour_virtual/lib/l10n/textos_ko.arb b/packages/tour_virtual/lib/l10n/textos_ko.arb index dfb463b..25f6c3d 100644 --- a/packages/tour_virtual/lib/l10n/textos_ko.arb +++ b/packages/tour_virtual/lib/l10n/textos_ko.arb @@ -182,6 +182,11 @@ "navCalibrar": "나침반이 부정확해요. 휴대폰을 8자 모양으로 움직여 주세요.", "navSinRuta": "{lugar}까지 가는 길을 찾지 못했어요.", "navFueraDelCampus": "캠퍼스 밖에 있어요. 길 안내는 UTB 안에서 작동해요. 도착하면 열어 주세요.", + "navCaminandoHacia": "가는 곳", + "navLlegada": "도착", + "navIdeaRuta": "캠퍼스 길을 따라 안내하고, 방향을 바꾸기 전에 알려 줄게요.", + "navIdeaCamara": "휴대폰을 들면 카메라 화면 위 화살표가 길을 알려 줘요.", + "navSinEscalerasDetalle": "경로의 계단을 피해요.", "navAproximada": "이 장소의 입구 위치는 아직 대략적이에요.", "navPlanoSemantica": "{lugar}까지의 경로가 표시된 지도", "verMapa3d": "3D 지도 보기", diff --git a/packages/tour_virtual/lib/l10n/textos_ko.dart b/packages/tour_virtual/lib/l10n/textos_ko.dart index eb7acf0..301926c 100644 --- a/packages/tour_virtual/lib/l10n/textos_ko.dart +++ b/packages/tour_virtual/lib/l10n/textos_ko.dart @@ -653,6 +653,21 @@ class TextosKo extends Textos { String get navFueraDelCampus => '캠퍼스 밖에 있어요. 길 안내는 UTB 안에서 작동해요. 도착하면 열어 주세요.'; + @override + String get navCaminandoHacia => '가는 곳'; + + @override + String get navLlegada => '도착'; + + @override + String get navIdeaRuta => '캠퍼스 길을 따라 안내하고, 방향을 바꾸기 전에 알려 줄게요.'; + + @override + String get navIdeaCamara => '휴대폰을 들면 카메라 화면 위 화살표가 길을 알려 줘요.'; + + @override + String get navSinEscalerasDetalle => '경로의 계단을 피해요.'; + @override String get navAproximada => '이 장소의 입구 위치는 아직 대략적이에요.'; diff --git a/packages/tour_virtual/lib/l10n/textos_pt.arb b/packages/tour_virtual/lib/l10n/textos_pt.arb index fbaf8e2..183ee67 100644 --- a/packages/tour_virtual/lib/l10n/textos_pt.arb +++ b/packages/tour_virtual/lib/l10n/textos_pt.arb @@ -182,6 +182,11 @@ "navCalibrar": "A bússola está imprecisa: mova o celular desenhando um oito.", "navSinRuta": "Não encontrei um caminho até {lugar}.", "navFueraDelCampus": "Você está fora do campus. O guia funciona dentro da UTB: abra-o quando chegar.", + "navCaminandoHacia": "A caminho de", + "navLlegada": "Você chegou", + "navIdeaRuta": "Levo você pelos caminhos do campus e aviso antes de cada curva.", + "navIdeaCamara": "Levante o celular e verá uma seta sobre a câmera indicando o caminho.", + "navSinEscalerasDetalle": "Evita degraus no caminho.", "navAproximada": "A entrada deste lugar ainda é aproximada.", "navPlanoSemantica": "Mapa com a rota até {lugar}", "verMapa3d": "Ver mapa em 3D", diff --git a/packages/tour_virtual/lib/l10n/textos_pt.dart b/packages/tour_virtual/lib/l10n/textos_pt.dart index 6f3e4bd..10a3b2b 100644 --- a/packages/tour_virtual/lib/l10n/textos_pt.dart +++ b/packages/tour_virtual/lib/l10n/textos_pt.dart @@ -675,6 +675,23 @@ class TextosPt extends Textos { String get navFueraDelCampus => 'Você está fora do campus. O guia funciona dentro da UTB: abra-o quando chegar.'; + @override + String get navCaminandoHacia => 'A caminho de'; + + @override + String get navLlegada => 'Você chegou'; + + @override + String get navIdeaRuta => + 'Levo você pelos caminhos do campus e aviso antes de cada curva.'; + + @override + String get navIdeaCamara => + 'Levante o celular e verá uma seta sobre a câmera indicando o caminho.'; + + @override + String get navSinEscalerasDetalle => 'Evita degraus no caminho.'; + @override String get navAproximada => 'A entrada deste lugar ainda é aproximada.'; @@ -970,6 +987,17 @@ class TextosPtPt extends TextosPt { String get navCalibrar => 'A bússola está imprecisa: mova o telemóvel desenhando um oito.'; + @override + String get navLlegada => 'Chegou'; + + @override + String get navIdeaRuta => + 'Levo-o pelos caminhos do campus e aviso antes de cada curva.'; + + @override + String get navIdeaCamara => + 'Levante o telemóvel e verá uma seta sobre a câmara a indicar o caminho.'; + @override String navPlanoSemantica(String lugar) { return 'Mapa com o percurso até $lugar'; diff --git a/packages/tour_virtual/lib/l10n/textos_pt_PT.arb b/packages/tour_virtual/lib/l10n/textos_pt_PT.arb index cbd84f7..297d2b9 100644 --- a/packages/tour_virtual/lib/l10n/textos_pt_PT.arb +++ b/packages/tour_virtual/lib/l10n/textos_pt_PT.arb @@ -70,5 +70,8 @@ "navCamaraAviso": "Olhe para o caminho, não para o ecrã.", "navCamaraNoDisponible": "Não foi possível abrir a câmara. Siga o percurso no mapa.", "navCalibrar": "A bússola está imprecisa: mova o telemóvel desenhando um oito.", - "navPlanoSemantica": "Mapa com o percurso até {lugar}" + "navPlanoSemantica": "Mapa com o percurso até {lugar}", + "navIdeaRuta": "Levo-o pelos caminhos do campus e aviso antes de cada curva.", + "navIdeaCamara": "Levante o telemóvel e verá uma seta sobre a câmara a indicar o caminho.", + "navLlegada": "Chegou" } diff --git a/packages/tour_virtual/lib/l10n/textos_tr.arb b/packages/tour_virtual/lib/l10n/textos_tr.arb index 25380cd..ba3ad71 100644 --- a/packages/tour_virtual/lib/l10n/textos_tr.arb +++ b/packages/tour_virtual/lib/l10n/textos_tr.arb @@ -182,6 +182,11 @@ "navCalibrar": "Pusula hassas değil: telefonu sekiz çizerek hareket ettirin.", "navSinRuta": "{lugar} için bir yol bulamadım.", "navFueraDelCampus": "Kampüsün dışındasın. Rehber UTB içinde çalışır: vardığında aç.", + "navCaminandoHacia": "Gidilen yer", + "navLlegada": "Vardın", + "navIdeaRuta": "Seni kampüs yollarından götürür, her dönüşten önce haber veririm.", + "navIdeaCamara": "Telefonu kaldır: kameranın üzerindeki ok yolu gösterir.", + "navSinEscalerasDetalle": "Rotadaki basamaklardan kaçınır.", "navAproximada": "Bu yerin girişi henüz yaklaşık.", "navPlanoSemantica": "{lugar} rotasını gösteren harita", "verMapa3d": "3B haritayı göster", diff --git a/packages/tour_virtual/lib/l10n/textos_tr.dart b/packages/tour_virtual/lib/l10n/textos_tr.dart index a662a59..e6231a8 100644 --- a/packages/tour_virtual/lib/l10n/textos_tr.dart +++ b/packages/tour_virtual/lib/l10n/textos_tr.dart @@ -672,6 +672,23 @@ class TextosTr extends Textos { String get navFueraDelCampus => 'Kampüsün dışındasın. Rehber UTB içinde çalışır: vardığında aç.'; + @override + String get navCaminandoHacia => 'Gidilen yer'; + + @override + String get navLlegada => 'Vardın'; + + @override + String get navIdeaRuta => + 'Seni kampüs yollarından götürür, her dönüşten önce haber veririm.'; + + @override + String get navIdeaCamara => + 'Telefonu kaldır: kameranın üzerindeki ok yolu gösterir.'; + + @override + String get navSinEscalerasDetalle => 'Rotadaki basamaklardan kaçınır.'; + @override String get navAproximada => 'Bu yerin girişi henüz yaklaşık.'; diff --git a/packages/tour_virtual/lib/l10n/textos_zh.arb b/packages/tour_virtual/lib/l10n/textos_zh.arb index 3d8e657..2c60939 100644 --- a/packages/tour_virtual/lib/l10n/textos_zh.arb +++ b/packages/tour_virtual/lib/l10n/textos_zh.arb @@ -182,6 +182,11 @@ "navCalibrar": "指南针不准:请将手机按 8 字形移动。", "navSinRuta": "没有找到前往{lugar}的路线。", "navFueraDelCampus": "你在校园外。导航只在UTB校内可用:到达后再打开。", + "navCaminandoHacia": "前往", + "navLlegada": "已到达", + "navIdeaRuta": "我会沿着校园小路带你走,每次转弯前都会提醒你。", + "navIdeaCamara": "举起手机,摄像头画面上的箭头会指出方向。", + "navSinEscalerasDetalle": "避开路线上的台阶。", "navAproximada": "此地点的入口位置仍是大概位置。", "navPlanoSemantica": "显示前往{lugar}路线的地图", "verMapa3d": "查看3D地图", diff --git a/packages/tour_virtual/lib/l10n/textos_zh.dart b/packages/tour_virtual/lib/l10n/textos_zh.dart index 91000bb..7a6acd6 100644 --- a/packages/tour_virtual/lib/l10n/textos_zh.dart +++ b/packages/tour_virtual/lib/l10n/textos_zh.dart @@ -647,6 +647,21 @@ class TextosZh extends Textos { @override String get navFueraDelCampus => '你在校园外。导航只在UTB校内可用:到达后再打开。'; + @override + String get navCaminandoHacia => '前往'; + + @override + String get navLlegada => '已到达'; + + @override + String get navIdeaRuta => '我会沿着校园小路带你走,每次转弯前都会提醒你。'; + + @override + String get navIdeaCamara => '举起手机,摄像头画面上的箭头会指出方向。'; + + @override + String get navSinEscalerasDetalle => '避开路线上的台阶。'; + @override String get navAproximada => '此地点的入口位置仍是大概位置。'; diff --git a/packages/tour_virtual/lib/ui/navegacion/pantalla_navegacion.dart b/packages/tour_virtual/lib/ui/navegacion/pantalla_navegacion.dart index bce6dc7..7f8f119 100644 --- a/packages/tour_virtual/lib/ui/navegacion/pantalla_navegacion.dart +++ b/packages/tour_virtual/lib/ui/navegacion/pantalla_navegacion.dart @@ -9,6 +9,7 @@ import 'package:go_router/go_router.dart'; import '../../configuracion_tour.dart'; import '../../datos/modelos/modelos.dart'; import '../../datos/plano_campus.dart'; +import '../../datos/progreso.dart'; import '../../datos/proveedores.dart'; import '../../l10n/textos.dart'; import '../../navegacion/correcciones.dart'; @@ -19,16 +20,21 @@ import '../../navegacion/pantalla_activa.dart'; import '../../navegacion/seguimiento.dart'; import '../../navegacion/sensores.dart'; import '../../navegacion/voz_guia.dart'; +import '../../nucleo/idiomas.dart'; import '../../nucleo/rutas.dart'; import '../../nucleo/tema.dart'; +import '../comunes/anillo_progreso.dart'; import '../comunes/componentes.dart'; +import '../comunes/fondos.dart'; import '../comunes/ilustracion_max.dart'; import '../ficha_poi.dart'; +import '../postal_escena.dart'; import '../vista_async.dart'; import 'plano_ruta.dart'; import 'vista_camara.dart'; part 'campo_guia.dart'; +part 'piezas_guia.dart'; /// Guía a pie hasta un lugar del campus (F-06, RF-26 a RF-34). /// @@ -446,105 +452,208 @@ class _GuiaState extends ConsumerState<_Guia> with WidgetsBindingObserver { } } + /// La siguiente parada del recorrido que aún no se ha visto, para seguir + /// desde la llegada. + Poi? _siguienteParada() { + final paradas = widget.paradas; + final i = paradas.indexWhere((p) => p.id == widget.poi.id); + if (i < 0) return null; + final vistos = ref.watch(progresoProvider); + for (var k = 1; k < paradas.length; k++) { + final p = paradas[(i + k) % paradas.length]; + if (!vistos.contains(p.id) && p.id != widget.poi.id) return p; + } + return null; + } + @override Widget build(BuildContext context) { final txt = Textos.of(context); final lugar = widget.poi.nombre; - final arriba = MediaQuery.paddingOf(context).top; final abajo = MediaQuery.paddingOf(context).bottom; + final numero = widget.paradas.indexWhere((p) => p.id == widget.poi.id); + final seguimiento = _seguimiento; + final guiando = _fase == _Fase.guiando; + final escena = escenaPrincipalDe(ref, widget.poi); + final postal = escena == null + ? null + : _PostalDestino( + escena: escena, + poi: widget.poi, + numero: numero < 0 ? null : numero + 1, + ); final contenido = switch (_fase) { - _Fase.intro || _Fase.pidiendo => _Panel( - pose: PoseMax.telefono, - titulo: txt.navPermisoTitulo(lugar), - texto: txt.navPermisoTexto, - principal: (txt.navPermitir, _fase == _Fase.pidiendo ? null : _empezar), - ), - _Fase.sinPermiso => _Panel( - pose: PoseMax.apenado, - titulo: txt.navTitulo(lugar), + _Fase.intro || _Fase.pidiendo => _vistaIntro(txt, lugar, postal), + _Fase.sinPermiso => _EstadoGuia( + icono: Icons.location_off_outlined, texto: txt.navSinPermiso, principal: _permiso == PermisoUbicacion.denegadoSiempre ? (txt.navAbrirAjustes, _ubicacion.abrirAjustes) : (txt.navPermitir, _empezar), secundaria: _salidaAl360(txt), + postal: postal, ), - _Fase.gpsApagado => _Panel( - pose: PoseMax.apenado, - titulo: txt.navTitulo(lugar), + _Fase.gpsApagado => _EstadoGuia( + icono: Icons.gps_off_rounded, texto: txt.navGpsApagado, principal: (txt.reintentar, _empezar), secundaria: _salidaAl360(txt), + postal: postal, ), - _Fase.sinRuta => _Panel( - pose: PoseMax.pensativo, - titulo: txt.navTitulo(lugar), + _Fase.sinRuta => _EstadoGuia( + icono: Icons.wrong_location_outlined, texto: txt.navSinRuta(lugar), principal: (txt.volver, _salir), secundaria: _salidaAl360(txt), + postal: postal, ), - _Fase.fueraDelCampus => _Panel( - pose: PoseMax.mapa, - titulo: txt.navTitulo(lugar), + _Fase.fueraDelCampus => _EstadoGuia( + icono: Icons.explore_outlined, texto: txt.navFueraDelCampus, principal: (txt.volver, _salir), secundaria: _salidaAl360(txt), + postal: postal, ), - _Fase.llegada => _Panel( - pose: PoseMax.invitando, - titulo: txt.navLlegaste(lugar), - texto: widget.poi.descripcion ?? '', - principal: ( - txt.navVerFicha, - () => abrirPoi(context, ref, poi: widget.poi, pois: widget.paradas), - ), - secundaria: (txt.navTerminar, _salir), - ), + _Fase.llegada => _vistaLlegada(txt, postal), _Fase.guiando => _vistaGuia(txt), }; + final restantes = seguimiento?.metrosRestantes; + final total = seguimiento?.ruta.metros; return Material( color: ColoresUtb.fondo, - child: Padding( - padding: EdgeInsets.fromLTRB( - MedidasUtb.margen, - arriba + 8, - MedidasUtb.margen, - abajo + 12, - ), - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - Row( - children: [ - BotonCircular( - icono: Icons.arrow_back_rounded, - etiqueta: txt.volver, - alTocar: _salir, - ), - const SizedBox(width: 12), - Expanded( - child: Semantics( - header: true, - child: Text( - txt.navTitulo(lugar), - style: Theme.of(context).textTheme.titleLarge, - maxLines: 2, - overflow: TextOverflow.ellipsis, - ), - ), - ), - ], + child: Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + _CabeceraGuia( + poi: widget.poi, + numero: numero < 0 ? null : numero + 1, + total: widget.paradas.length, + sobretitulo: switch (_fase) { + _Fase.guiando => txt.navCaminandoHacia, + _Fase.llegada => txt.navLlegada, + _ => txt.comoLlegar, + }, + alVolver: _salir, + avance: guiando && restantes != null && total != null && total > 0 + ? (1 - restantes / total).clamp(0.0, 1.0) + : null, + metrosRestantes: guiando && restantes != null + ? _redondear(restantes) + : null, + pose: switch (_fase) { + _Fase.intro || _Fase.pidiendo => PoseMax.telefono, + _Fase.sinPermiso || _Fase.gpsApagado => PoseMax.apenado, + _Fase.sinRuta => PoseMax.pensativo, + _Fase.fueraDelCampus => PoseMax.mapa, + _Fase.llegada => PoseMax.celebrando, + _Fase.guiando => null, + }, + ), + Expanded( + child: Padding( + padding: EdgeInsets.fromLTRB( + MedidasUtb.margen, + guiando ? 14 : 0, + MedidasUtb.margen, + (widget.modoCampo ? 8 : 12) + (widget.modoCampo ? 0 : abajo), + ), + child: contenido, + ), + ), + if (widget.modoCampo) + Padding( + padding: EdgeInsets.fromLTRB( + MedidasUtb.margen, + 0, + MedidasUtb.margen, + abajo + 12, + ), + child: _BarraCampo(guia: this), ), - const SizedBox(height: 12), - Expanded(child: contenido), - if (widget.modoCampo) ...[ - const SizedBox(height: 8), - _BarraCampo(guia: this), + ], + ), + ); + } + + /// Antes de empezar: qué va a pasar, «sin escaleras» y el permiso. + Widget _vistaIntro(Textos txt, String lugar, Widget? postal) { + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Expanded( + child: ListView( + padding: const EdgeInsets.only(top: 20), + children: [ + if (postal != null) ...[postal, const SizedBox(height: 12)], + _TarjetaComoFunciona(titulo: txt.navPermisoTitulo(lugar)), + const SizedBox(height: 12), + TarjetaUtb( + padding: const EdgeInsets.fromLTRB(16, 6, 12, 6), + child: _InterruptorEscaleras( + valor: _sinEscaleras, + alCambiar: (v) => setState(() => _sinEscaleras = v), + ), + ), ], - ], + ), ), - ), + _Acciones( + principal: ( + txt.navPermitir, + _fase == _Fase.pidiendo ? null : _empezar, + ), + ), + ], + ); + } + + /// Al llegar: la postal del lugar, su ficha y, si queda, la siguiente + /// parada del recorrido. La cabecera ya dice «Llegaste» y el lugar. + Widget _vistaLlegada(Textos txt, Widget? postal) { + final textos = Theme.of(context).textTheme; + final paleta = PaletaUtb.de(context); + final siguiente = _siguienteParada(); + return ListView( + padding: const EdgeInsets.only(top: 20), + children: [ + if (postal != null) ...[postal, const SizedBox(height: 16)], + if (widget.poi.descripcion case final d? when d.isNotEmpty) ...[ + TextoDeContenido( + d, + style: textos.bodyLarge?.copyWith(color: paleta.textoSecundario), + ), + const SizedBox(height: 18), + ], + FilledButton( + onPressed: () => + abrirPoi(context, ref, poi: widget.poi, pois: widget.paradas), + style: FilledButton.styleFrom(minimumSize: const Size.fromHeight(52)), + child: Text(txt.navVerFicha), + ), + if (_salidaAl360(txt) case (final etiqueta, final accion)) ...[ + const SizedBox(height: 8), + OutlinedButton.icon( + onPressed: accion, + style: OutlinedButton.styleFrom( + minimumSize: const Size.fromHeight(48), + ), + icon: const Icon(Icons.threesixty_rounded), + label: Text(etiqueta), + ), + ], + if (siguiente != null) ...[ + const SizedBox(height: 20), + _TarjetaSiguiente( + poi: siguiente, + alIr: () => + context.pushReplacement(Rutas.haciaNavegacion(siguiente.id)), + ), + ], + const SizedBox(height: 8), + TextButton(onPressed: _salir, child: Text(txt.navTerminar)), + ], ); } @@ -641,19 +750,26 @@ class _GuiaState extends ConsumerState<_Guia> with WidgetsBindingObserver { children: [ // La indicación: lo que hay que hacer ahora, grande y en una región // viva para el lector de pantalla. - Container( - padding: const EdgeInsets.fromLTRB(18, 16, 18, 16), - decoration: BoxDecoration( - gradient: const LinearGradient( - begin: Alignment.topLeft, - end: Alignment.bottomRight, - colors: [ColoresUtb.destacadaInicio, ColoresUtb.destacadaFin], - ), - borderRadius: BorderRadius.circular(MedidasUtb.radioTarjeta), - ), + _TarjetaDestacada( + padding: const EdgeInsets.fromLTRB(16, 16, 18, 16), child: Row( children: [ - Icon(_icono(maniobra), size: 44, color: ColoresUtb.texto), + Container( + width: 60, + height: 60, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Colors.white.withValues(alpha: 0.16), + border: Border.all( + color: Colors.white.withValues(alpha: 0.26), + ), + ), + child: Icon( + _icono(maniobra), + size: 36, + color: ColoresUtb.texto, + ), + ), const SizedBox(width: 14), Expanded( child: Column( @@ -711,89 +827,25 @@ class _GuiaState extends ConsumerState<_Guia> with WidgetsBindingObserver { ), const SizedBox(height: 12), Expanded(child: vista), - const SizedBox(height: 4), - Row( - children: [ - Expanded( - child: SwitchListTile( - value: _sinEscaleras, - onChanged: _cambiarEscaleras, - secondary: const Icon( - Icons.accessible_rounded, - color: ColoresUtb.azulClaro, + const SizedBox(height: 10), + TarjetaUtb( + radio: 22, + padding: const EdgeInsets.fromLTRB(16, 2, 8, 2), + child: Row( + children: [ + Expanded( + child: _InterruptorEscaleras( + valor: _sinEscaleras, + alCambiar: _cambiarEscaleras, + compacto: true, ), - title: Text(txt.navSinEscaleras, style: textos.titleSmall), - contentPadding: EdgeInsets.zero, ), - ), - TextButton(onPressed: _salir, child: Text(txt.navTerminar)), - ], + const SizedBox(width: 4), + TextButton(onPressed: _salir, child: Text(txt.navTerminar)), + ], + ), ), ], ); } } - -/// Un estado de la guía fuera del recorrido: pedir permiso, un fallo, la -/// llegada. Max pone la cara. -class _Panel extends StatelessWidget { - const _Panel({ - required this.pose, - required this.titulo, - required this.texto, - required this.principal, - this.secundaria, - }); - - final PoseMax pose; - final String titulo; - final String texto; - final (String, VoidCallback?) principal; - final (String, VoidCallback)? secundaria; - - @override - Widget build(BuildContext context) { - final textos = Theme.of(context).textTheme; - final paleta = PaletaUtb.de(context); - return SingleChildScrollView( - child: Column( - crossAxisAlignment: CrossAxisAlignment.stretch, - children: [ - const SizedBox(height: 12), - Center( - child: IlustracionMax(pose: pose, alto: 210, difuminarBase: true), - ), - const SizedBox(height: 18), - Semantics( - header: true, - child: Text( - titulo, - style: textos.headlineSmall, - textAlign: TextAlign.center, - ), - ), - if (texto.isNotEmpty) ...[ - const SizedBox(height: 10), - Text( - texto, - style: textos.bodyLarge?.copyWith(color: paleta.textoSecundario), - textAlign: TextAlign.center, - ), - ], - const SizedBox(height: 24), - FilledButton( - onPressed: principal.$2, - style: FilledButton.styleFrom( - minimumSize: const Size.fromHeight(54), - ), - child: Text(principal.$1), - ), - if (secundaria case (final etiqueta, final accion)) ...[ - const SizedBox(height: 6), - TextButton(onPressed: accion, child: Text(etiqueta)), - ], - ], - ), - ); - } -} diff --git a/packages/tour_virtual/lib/ui/navegacion/piezas_guia.dart b/packages/tour_virtual/lib/ui/navegacion/piezas_guia.dart new file mode 100644 index 0000000..84e0257 --- /dev/null +++ b/packages/tour_virtual/lib/ui/navegacion/piezas_guia.dart @@ -0,0 +1,521 @@ +part of 'pantalla_navegacion.dart'; + +// Piezas visuales de «Cómo llegar», con el lenguaje de la app UTB +// (DESIGN.md): cabecera azul con arcos, tarjetas grafito, tarjeta destacada, +// recuadro informativo, anillo de avance y la postal del lugar. + +/// Cabecera azul de la guía: a dónde vas y, mientras guía, cuánto falta. +class _CabeceraGuia extends StatelessWidget { + const _CabeceraGuia({ + required this.poi, + required this.numero, + required this.total, + required this.sobretitulo, + required this.alVolver, + this.avance, + this.metrosRestantes, + this.pose, + }); + + final Poi poi; + + /// Número de parada, o nulo si el lugar no es una parada. + final int? numero; + final int total; + final String sobretitulo; + final VoidCallback alVolver; + + /// Entre 0 y 1 mientras guía: lo recorrido de la ruta. + final double? avance; + final int? metrosRestantes; + + /// Max a la derecha cuando no hay anillo. + final PoseMax? pose; + + @override + Widget build(BuildContext context) { + final txt = Textos.of(context); + final textos = Theme.of(context).textTheme; + final paleta = PaletaUtb.de(context); + final arriba = MediaQuery.paddingOf(context).top; + final estilo = EstiloCategoria.de(poi.categoria); + final categoria = poi.categoria == null + ? null + : EstiloCategoria.nombre(txt, poi.categoria!); + final detalle = [ + ?categoria, + if (numero != null) txt.paradaNDeTotal(numero!, total), + ].join(' · '); + final letraGrande = MediaQuery.textScalerOf(context).scale(10) > 15; + + final derecha = switch ((avance, pose)) { + (final v?, _) => Semantics( + label: metrosRestantes == null + ? null + : txt.navFaltan( + metrosRestantes!, + (metrosRestantes! / 1.2 / 60).ceil().clamp(1, 99), + ), + excludeSemantics: true, + child: AnilloProgreso( + valor: v, + tamano: 76, + child: metrosRestantes == null + ? null + : Column( + mainAxisSize: MainAxisSize.min, + children: [ + Text( + '$metrosRestantes', + textScaler: TextScaler.noScaling, + style: textos.titleMedium?.copyWith( + fontWeight: FontWeight.w700, + height: 1, + fontFeatures: const [FontFeature.tabularFigures()], + ), + ), + const Text( + 'm', + textScaler: TextScaler.noScaling, + style: TextStyle( + fontFamily: familiaLetra, + fontSize: 12, + color: ColoresUtb.textoSobreAzul, + ), + ), + ], + ), + ), + ), + (_, final p?) => ExcludeSemantics( + child: IlustracionMax(pose: p, alto: 104), + ), + _ => null, + }; + + return FondoCabeceraUtb( + child: Padding( + padding: EdgeInsets.fromLTRB( + MedidasUtb.margen, + arriba + 8, + MedidasUtb.margen, + 22, + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _BotonVolverVidrio(etiqueta: txt.volver, alTocar: alVolver), + const SizedBox(height: 12), + Row( + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Expanded( + child: Semantics( + header: true, + label: txt.navTitulo(poi.nombre), + excludeSemantics: true, + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + mayusculasDe(context, sobretitulo), + style: estiloSobretitulo( + color: paleta.altoContraste + ? ColoresUtb.texto + : Colors.white.withValues(alpha: 0.78), + ), + ), + const SizedBox(height: 6), + TextoDeContenido( + poi.nombre, + style: textos.headlineMedium, + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + if (detalle.isNotEmpty) ...[ + const SizedBox(height: 8), + Row( + children: [ + Icon( + estilo.icono, + size: 16, + color: ColoresUtb.textoSobreAzul, + ), + const SizedBox(width: 6), + Flexible( + child: Text( + detalle, + style: textos.bodyMedium?.copyWith( + color: ColoresUtb.textoSobreAzul, + ), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + ], + ), + ], + ], + ), + ), + ), + if (derecha != null && !letraGrande) ...[ + const SizedBox(width: 12), + derecha, + ], + ], + ), + ], + ), + ), + ); + } +} + +/// Volver, en vidrio sobre la cabecera azul (el circular negro es para +/// flotar sobre fotos). +class _BotonVolverVidrio extends StatelessWidget { + const _BotonVolverVidrio({required this.etiqueta, required this.alTocar}); + + final String etiqueta; + final VoidCallback alTocar; + + @override + Widget build(BuildContext context) { + final contraste = PaletaUtb.de(context).altoContraste; + return Tooltip( + message: etiqueta, + child: Semantics( + button: true, + label: etiqueta, + onTap: alTocar, + excludeSemantics: true, + child: Material( + color: Colors.white.withValues(alpha: contraste ? 0.24 : 0.16), + shape: CircleBorder( + side: BorderSide( + color: Colors.white.withValues(alpha: contraste ? 0.8 : 0.26), + ), + ), + clipBehavior: Clip.antiAlias, + child: InkWell( + onTap: alTocar, + child: const SizedBox.square( + dimension: MedidasUtb.toque, + child: Icon(Icons.arrow_back_rounded, color: ColoresUtb.texto), + ), + ), + ), + ), + ); + } +} + +/// Tarjeta destacada (gradiente diagonal, arcos, resplandor), como la de la +/// próxima parada en inicio. +class _TarjetaDestacada extends StatelessWidget { + const _TarjetaDestacada({ + required this.child, + this.padding = const EdgeInsets.fromLTRB(20, 18, 20, 18), + }); + + final Widget child; + final EdgeInsets padding; + + @override + Widget build(BuildContext context) { + return DecoratedBox( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(MedidasUtb.radioHoja), + gradient: const LinearGradient( + begin: Alignment.topLeft, + end: Alignment.bottomRight, + colors: [ + ColoresUtb.destacadaInicio, + Color(0xFF1C3FAE), + ColoresUtb.destacadaFin, + ], + stops: [0, 0.5, 1], + ), + border: Border.all(color: Colors.white.withValues(alpha: 0.16)), + boxShadow: [ + BoxShadow( + color: ColoresUtb.azul.withValues(alpha: 0.3), + blurRadius: 36, + offset: const Offset(0, 14), + ), + ], + ), + child: ClipRRect( + borderRadius: BorderRadius.circular(MedidasUtb.radioHoja), + child: CustomPaint( + painter: const _ArcosTarjeta(), + child: Padding(padding: padding, child: child), + ), + ), + ); + } +} + +class _ArcosTarjeta extends CustomPainter { + const _ArcosTarjeta(); + + @override + void paint(Canvas canvas, Size size) => pintarArcos(canvas, size); + + @override + bool shouldRepaint(_ArcosTarjeta old) => false; +} + +/// Antes de empezar: cómo funciona la guía, en tres líneas. +class _TarjetaComoFunciona extends StatelessWidget { + const _TarjetaComoFunciona({required this.titulo}); + + final String titulo; + + @override + Widget build(BuildContext context) { + final txt = Textos.of(context); + final textos = Theme.of(context).textTheme; + final paleta = PaletaUtb.de(context); + Widget idea(IconData icono, String texto) => Padding( + padding: const EdgeInsets.only(top: 14), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Container( + width: 40, + height: 40, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: ColoresUtb.azulClaro.withValues(alpha: 0.14), + ), + child: Icon(icono, size: 20, color: ColoresUtb.azulClaro), + ), + const SizedBox(width: 14), + Expanded( + child: Padding( + padding: const EdgeInsets.only(top: 2), + child: Text( + texto, + style: textos.bodyMedium?.copyWith( + color: paleta.textoSecundario, + ), + ), + ), + ), + ], + ), + ); + + return TarjetaUtb( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(titulo, style: textos.titleLarge), + idea(Icons.route_rounded, txt.navIdeaRuta), + idea(Icons.photo_camera_rounded, txt.navIdeaCamara), + idea(Icons.lock_outline_rounded, txt.navPermisoTexto), + ], + ), + ); + } +} + +/// «Sin escaleras», con su explicación, en tarjeta compacta. +class _InterruptorEscaleras extends StatelessWidget { + const _InterruptorEscaleras({ + required this.valor, + required this.alCambiar, + this.compacto = false, + }); + + final bool valor; + final ValueChanged alCambiar; + + /// Durante la guía: sin la explicación, para dejarle sitio al plano. + final bool compacto; + + @override + Widget build(BuildContext context) { + final txt = Textos.of(context); + final textos = Theme.of(context).textTheme; + final paleta = PaletaUtb.de(context); + return SwitchListTile( + value: valor, + onChanged: alCambiar, + contentPadding: EdgeInsets.zero, + secondary: Container( + width: 40, + height: 40, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: ColoresUtb.azulClaro.withValues(alpha: 0.14), + ), + child: const Icon( + Icons.accessible_rounded, + size: 22, + color: ColoresUtb.azulClaro, + ), + ), + title: Text(txt.navSinEscaleras, style: textos.titleSmall), + subtitle: compacto + ? null + : Text( + txt.navSinEscalerasDetalle, + style: textos.bodySmall?.copyWith(color: paleta.textoSecundario), + ), + ); + } +} + +/// La panorámica del destino, que se mira con el dedo: para reconocer el +/// lugar antes de salir y, si no se puede guiar, para conocerlo igual. +class _PostalDestino extends StatelessWidget { + const _PostalDestino({ + required this.escena, + required this.poi, + required this.numero, + }); + + final Escena escena; + final Poi poi; + final int? numero; + + @override + Widget build(BuildContext context) { + return AspectRatio( + aspectRatio: 16 / 9, + child: ClipRRect( + borderRadius: BorderRadius.circular(MedidasUtb.radioTarjeta), + child: PostalEscena( + escena: escena, + estilo: EstiloCategoria.de(poi.categoria), + numero: numero, + interactiva: true, + ), + ), + ); + } +} + +/// Un estado fuera del recorrido: sin permiso, GPS apagado, sin ruta, fuera +/// del campus. Se lee como información, no como error (recuadro informativo), +/// con la postal del lugar debajo. +class _EstadoGuia extends StatelessWidget { + const _EstadoGuia({ + required this.icono, + required this.texto, + required this.principal, + this.secundaria, + this.postal, + }); + + final IconData icono; + final String texto; + final (String, VoidCallback?) principal; + final (String, VoidCallback)? secundaria; + final Widget? postal; + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + Expanded( + child: ListView( + padding: const EdgeInsets.only(top: 20), + children: [ + RecuadroInfo(icono: icono, texto: texto), + if (postal != null) ...[const SizedBox(height: 16), postal!], + ], + ), + ), + _Acciones(principal: principal, secundaria: secundaria), + ], + ); + } +} + +/// El botón lleno principal, abajo, y uno de texto bajo él. +class _Acciones extends StatelessWidget { + const _Acciones({required this.principal, this.secundaria}); + + final (String, VoidCallback?) principal; + final (String, VoidCallback)? secundaria; + + @override + Widget build(BuildContext context) { + return Column( + crossAxisAlignment: CrossAxisAlignment.stretch, + children: [ + const SizedBox(height: 12), + FilledButton( + onPressed: principal.$2, + style: FilledButton.styleFrom(minimumSize: const Size.fromHeight(52)), + child: Text(principal.$1), + ), + if (secundaria case (final etiqueta, final accion)) ...[ + const SizedBox(height: 4), + TextButton(onPressed: accion, child: Text(etiqueta)), + ], + ], + ); + } +} + +/// Al llegar, la siguiente parada del recorrido con su «Cómo llegar». +class _TarjetaSiguiente extends StatelessWidget { + const _TarjetaSiguiente({required this.poi, required this.alIr}); + + final Poi poi; + final VoidCallback alIr; + + @override + Widget build(BuildContext context) { + final txt = Textos.of(context); + final textos = Theme.of(context).textTheme; + final paleta = PaletaUtb.de(context); + return SemanticaConContenido( + etiqueta: '${txt.siguienteParada}: ${poi.nombre}', + contenido: poi.nombre, + boton: true, + alTocar: alIr, + pistaAlTocar: txt.comoLlegar, + child: _TarjetaDestacada( + child: Row( + children: [ + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + mayusculasDe(context, txt.siguienteParada), + style: estiloSobretitulo( + color: paleta.altoContraste + ? ColoresUtb.texto + : Colors.white.withValues(alpha: 0.82), + ), + ), + const SizedBox(height: 6), + Text( + poi.nombre, + style: textos.titleLarge, + maxLines: 2, + overflow: TextOverflow.ellipsis, + ), + ], + ), + ), + const SizedBox(width: 12), + BotonVidrio( + etiqueta: txt.comoLlegar, + icono: Icons.directions_walk_rounded, + alTocar: null, + ), + ], + ), + ), + ); + } +} diff --git a/scripts/max/LEEME.md b/scripts/max/LEEME.md index 535d25f..75d049c 100644 --- a/scripts/max/LEEME.md +++ b/scripts/max/LEEME.md @@ -6,13 +6,14 @@ De aquí salen las poses de Max, la mascota de la UTB, que usa el módulo en Son renders 2D generados con **Codex** (herramienta de generación de imágenes, sesión de ChatGPT) a partir de la hoja de referencia del personaje, y limpiados con estos scripts. Las referencias y los resultados en alta resolución no se -versionan: viven en `inspo_max/` y `max_utb/poses_2d/`. +versionan ni se guardan en el repositorio local (se borraron el 2026-11-22): +para regenerar una pose hay que partir de la hoja oficial del personaje. ## Pasos Todo se corre dentro de una carpeta de trabajo con los scripts y dos referencias: `ref_max_frente.png` (la vista frontal ya limpia) y -`ref_max_4vistas.png` (`inspo_max/max_all.png`). +`ref_max_4vistas.png` (la hoja de cuatro vistas del personaje). 1. **Generar las poses:** `bash poses.sh`, o una sola con `bash generar.sh "" ""`. Se piden sobre magenta