Skip to content
This repository has been archived by the owner on Feb 5, 2024. It is now read-only.

Commit

Permalink
swapped out islands, intentional cloud placement
Browse files Browse the repository at this point in the history
  • Loading branch information
bhivam committed Sep 5, 2023
1 parent 06f60c7 commit 7df0be4
Show file tree
Hide file tree
Showing 10 changed files with 167 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .flutter-plugins-dependencies
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_ios-6.1.4/","native_build":true,"dependencies":[]},{"name":"webview_flutter_wkwebview","path":"/Users/shivam/.pub-cache/hosted/pub.dev/webview_flutter_wkwebview-2.9.5/","native_build":true,"dependencies":[]}],"android":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_android-2.0.24/","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_android-6.0.26/","native_build":true,"dependencies":[]},{"name":"webview_flutter_android","path":"/Users/shivam/.pub-cache/hosted/pub.dev/webview_flutter_android-2.10.4/","native_build":true,"dependencies":[]}],"macos":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_macos-3.0.4/","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.10/","native_build":false,"dependencies":[]},{"name":"url_launcher_linux","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_linux-3.0.4/","native_build":true,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.5/","native_build":false,"dependencies":[]},{"name":"url_launcher_windows","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_windows-3.0.5/","native_build":true,"dependencies":[]}],"web":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_web-2.0.16/","dependencies":[]}]},"dependencyGraph":[{"name":"mobile_scanner","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2023-09-03 15:06:23.113088","version":"3.7.7"}
{"info":"This is a generated file; do not edit or check into version control.","plugins":{"ios":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_ios","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_ios-6.1.4/","native_build":true,"dependencies":[]},{"name":"webview_flutter_wkwebview","path":"/Users/shivam/.pub-cache/hosted/pub.dev/webview_flutter_wkwebview-2.9.5/","native_build":true,"dependencies":[]}],"android":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","native_build":true,"dependencies":[]},{"name":"path_provider_android","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_android-2.0.24/","native_build":true,"dependencies":[]},{"name":"url_launcher_android","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_android-6.0.26/","native_build":true,"dependencies":[]},{"name":"webview_flutter_android","path":"/Users/shivam/.pub-cache/hosted/pub.dev/webview_flutter_android-2.10.4/","native_build":true,"dependencies":[]}],"macos":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","native_build":true,"dependencies":[]},{"name":"path_provider_foundation","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_foundation-2.2.1/","native_build":true,"dependencies":[]},{"name":"url_launcher_macos","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_macos-3.0.4/","native_build":true,"dependencies":[]}],"linux":[{"name":"path_provider_linux","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_linux-2.1.10/","native_build":false,"dependencies":[]},{"name":"url_launcher_linux","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_linux-3.0.4/","native_build":true,"dependencies":[]}],"windows":[{"name":"path_provider_windows","path":"/Users/shivam/.pub-cache/hosted/pub.dev/path_provider_windows-2.1.5/","native_build":false,"dependencies":[]},{"name":"url_launcher_windows","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_windows-3.0.5/","native_build":true,"dependencies":[]}],"web":[{"name":"mobile_scanner","path":"/Users/shivam/.pub-cache/hosted/pub.dev/mobile_scanner-2.1.0/","dependencies":[]},{"name":"url_launcher_web","path":"/Users/shivam/.pub-cache/hosted/pub.dev/url_launcher_web-2.0.16/","dependencies":[]}]},"dependencyGraph":[{"name":"mobile_scanner","dependencies":[]},{"name":"path_provider","dependencies":["path_provider_android","path_provider_foundation","path_provider_linux","path_provider_windows"]},{"name":"path_provider_android","dependencies":[]},{"name":"path_provider_foundation","dependencies":[]},{"name":"path_provider_linux","dependencies":[]},{"name":"path_provider_windows","dependencies":[]},{"name":"url_launcher","dependencies":["url_launcher_android","url_launcher_ios","url_launcher_linux","url_launcher_macos","url_launcher_web","url_launcher_windows"]},{"name":"url_launcher_android","dependencies":[]},{"name":"url_launcher_ios","dependencies":[]},{"name":"url_launcher_linux","dependencies":[]},{"name":"url_launcher_macos","dependencies":[]},{"name":"url_launcher_web","dependencies":[]},{"name":"url_launcher_windows","dependencies":[]},{"name":"webview_flutter","dependencies":["webview_flutter_android","webview_flutter_wkwebview"]},{"name":"webview_flutter_android","dependencies":[]},{"name":"webview_flutter_wkwebview","dependencies":[]}],"date_created":"2023-09-05 13:43:36.589191","version":"3.7.7"}
Binary file added assets/assets-png/little_whale.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 assets/assets-png/side_island.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 assets/assets-png/whale_clouds.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion lib/ui/pages/annoucements/announcement_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ class AnnouncementCard extends StatelessWidget {
var secs = resource.ts?.split('.')[0];
var timeStr =
DateTime.fromMillisecondsSinceEpoch(int.parse(secs!) * 1000).toLocal();
var formattedTime = DateFormat('hh:mm a').format(timeStr);
String formattedTime = DateFormat.yMd().format(timeStr) +
' • ' +
DateFormat.jm().format(timeStr);

return Container(
key: Key(resource.ts!),
Expand Down
38 changes: 26 additions & 12 deletions lib/ui/pages/dashboard/dashboard.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class DashboardState extends State<Dashboard> {
warningDialog(
context,
"Total = " + count.toString(),
Color.fromARGB(255, 19, 61, 53),
const Color.fromARGB(255, 19, 61, 53),
HackRUColors.pale_yellow,
HackRUColors.white);
} on LcsError {
Expand Down Expand Up @@ -258,7 +258,7 @@ class DashboardState extends State<Dashboard> {
alignment: Alignment.center,
child: Text(
userStatus,
style: TextStyle(
style: const TextStyle(
fontSize: 18,
color: HackRUColors.pale_yellow,
),
Expand All @@ -282,15 +282,29 @@ class DashboardState extends State<Dashboard> {
),
],
),
IconButton(
onPressed: () {
_showQrCode();
},
color: HackRUColors.pale_yellow,
icon: const Icon(
Icons.qr_code,
size: 24,
))
Column(
children: [
Row(
children: [
IconButton(
onPressed: () {
_showQrCode();
},
color: HackRUColors.pale_yellow,
icon: const Icon(
Icons.qr_code,
size: 40,
)),
const SizedBox(
width: 5,
)
],
),
const SizedBox(
height: 7,
)
],
)
],
),
),
Expand All @@ -303,7 +317,7 @@ class DashboardState extends State<Dashboard> {
Expanded(
child: DashboardButton(
onPressed: _onLogin,
bgColor: Color.fromARGB(255, 19, 61, 53),
bgColor: const Color.fromARGB(255, 19, 61, 53),
textColor: HackRUColors.pale_yellow,
label: "Login"),
),
Expand Down
85 changes: 71 additions & 14 deletions lib/ui/pages/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -80,40 +80,97 @@ class _HomeState extends State<Home> {
Container(
decoration: const BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xff73bb67),
Color(0xff1e3427),
],
)),
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xff73bb67),
Color(0xff497847),
],
stops: [
0.3,
0.7
])),
),
WeatherBg(
weatherType: WeatherType.sunnyNight,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height),
const Sunrays(),
Clouds(MediaQuery.of(context).size.height),
// whale island group
FloatingIsland(
floatDistance: 0.02,
floatDistance: 0.005,
floatDuration: 2000,
top: 0.225,
left: 0.3,
left: 0.05,
pageController: _pageController,
speed: 0.05,
size: 1,
imageName: "assets/assets-png/whale_clouds.png",
),
FloatingIsland(
floatDistance: 0.01,
floatDuration: 2000,
top: 0.15,
left: 0.2,
pageController: _pageController,
speed: 0.15,
size: 1,
imageName: "assets/assets-png/whale_island.PNG",
),
FloatingIsland(
floatDistance: 0.015,
floatDuration: 2000,
top: 0.475,
left: 0.7,
pageController: _pageController,
speed: 0.15,
size: 0.3,
imageName: "assets/assets-png/small_island4.png",
),
FloatingIsland(
floatDistance: 0.0175,
floatDuration: 2000,
top: 0.465,
left: 0.77,
pageController: _pageController,
speed: 0.15,
size: 0.7,
imageName: "assets/assets-png/frog_island.png",
size: 0.3,
imageName: "assets/assets-png/small_island4.png",
),

// side island group
FloatingIsland(
floatDistance: 0.01,
floatDuration: 2000,
top: 0.55,
left: 0.05,
top: 0.5,
left: -0.075,
pageController: _pageController,
speed: 0.05,
size: 0.6,
imageName: "assets/assets-png/side_island.png",
),
FloatingIsland(
floatDistance: 0.015,
floatDuration: 2000,
top: 0.68,
left: 0,
pageController: _pageController,
speed: 0.075,
size: 0.4,
imageName: "assets/assets-png/rabbit_island.png",
imageName: "assets/assets-png/small_island1.png",
),
FloatingIsland(
floatDistance: 0.015,
floatDuration: 2000,
top: 0.7125,
left: -0.095,
pageController: _pageController,
speed: 0.075,
size: 0.4,
imageName: "assets/assets-png/small_island2.png",
),

showHelp
? Help(() => setHelp(false), HackRUColors.transparent,
HackRUColors.pale_yellow, Colors.black26, HackRUColors.blue_grey)
Expand Down
60 changes: 37 additions & 23 deletions lib/ui/widgets/cloud.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,24 @@ import 'package:flutter/src/widgets/placeholder.dart';
class Cloud extends StatefulWidget {
double screenWidth;
double screenHeight;
List<Image> cloudImages;
Image cloudImage;

Cloud(this.screenHeight, this.screenWidth, this.cloudImages, {super.key});
double top;
double left;

double size;
double speed;

Cloud({
required this.screenHeight,
required this.screenWidth,
required this.cloudImage,
required this.top,
required this.left,
required this.size,
required this.speed,
super.key,
});

@override
State<Cloud> createState() => _CloudState();
Expand All @@ -20,30 +35,29 @@ class _CloudState extends State<Cloud> with SingleTickerProviderStateMixin {
late Animation cloudTranslation;

late double x;
late double y;
late double size;
late double speed;
late double startX;
late double endX;
late Image cloudImage;

void reset(AnimationController animationController) {
setState(() {
size = 200 - Random().nextDouble() * 100;
speed = ((size - 200) / -100) * 50 + 30;
int durationms = 100000;
double totalDistanceToTravel =
widget.speed * durationms / 1000 * widget.screenWidth;

x = widget.left * widget.screenWidth;
double end =
widget.screenWidth + (totalDistanceToTravel - widget.screenWidth + x);

animationController.duration =
Duration(milliseconds: (1000 * speed).toInt());
if ((totalDistanceToTravel - widget.screenWidth + x) < 0) {
durationms += 1000 *
(totalDistanceToTravel - widget.screenWidth + x).abs() ~/
(widget.speed * widget.screenWidth);

end = widget.screenWidth;
}

startX = -2000 + Random().nextDouble() * 1800;
endX = widget.screenWidth + 200 - Random().nextDouble() * 100;
x = startX;
y = Random().nextDouble() * widget.screenHeight * 0.66 + 100;
animationController.duration = Duration(milliseconds: durationms);

cloudImage =
widget.cloudImages[Random().nextInt(widget.cloudImages.length - 1)];
cloudTranslation =
Tween<double>(begin: startX, end: endX).animate(animationController);
Tween<double>(begin: x, end: end).animate(animationController);
});

animationController.forward();
Expand All @@ -59,7 +73,7 @@ class _CloudState extends State<Cloud> with SingleTickerProviderStateMixin {
void initState() {
animationController = AnimationController(vsync: this);
animationController.addListener(() {
if (cloudTranslation.value > widget.screenWidth + 100) {
if (cloudTranslation.value > widget.screenWidth) {
animationController.reset();
reset(animationController);
return;
Expand All @@ -76,11 +90,11 @@ class _CloudState extends State<Cloud> with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
return Positioned(
top: y,
top: widget.top * widget.screenHeight,
left: x,
child: SizedBox(
height: size,
child: cloudImage,
width: widget.size * widget.screenWidth,
child: widget.cloudImage,
),
);
}
Expand Down
39 changes: 26 additions & 13 deletions lib/ui/widgets/clouds.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,31 @@ class _CloudsState extends State<Clouds> {

@override
Widget build(BuildContext context) {
return Stack(
children: getAnimatedClouds(context),
);
}

List<Widget> getAnimatedClouds(BuildContext context) {
List<Cloud> animatedClouds = [];
for (int i = 0; i < cloudFrequency; i++) {
animatedClouds.add(Cloud(MediaQuery.of(context).size.height,
MediaQuery.of(context).size.width, cloudImages));
}

return animatedClouds;
return Stack(children: [
Cloud(
cloudImage: cloudImages[1],
top: 0.025,
left: -1.75,
screenHeight: MediaQuery.of(context).size.height,
screenWidth: MediaQuery.of(context).size.width,
size: 0.75,
speed: 0.02),
Cloud(
cloudImage: cloudImages[4],
top: 0.1,
left: -0.75,
screenHeight: MediaQuery.of(context).size.height,
screenWidth: MediaQuery.of(context).size.width,
size: 0.75,
speed: 0.02),
Cloud(
cloudImage: cloudImages[1],
top: 0.6,
left: -1.25,
screenHeight: MediaQuery.of(context).size.height,
screenWidth: MediaQuery.of(context).size.width,
size: 0.75,
speed: 0.02),
]);
}
}
6 changes: 3 additions & 3 deletions lib/ui/widgets/timer_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ class _TimerTextState extends State<TimerText> {
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: <Widget>[
Padding(
padding: EdgeInsets.only(top: 5, bottom: 2, left: 3, right: 3),
padding: EdgeInsets.only(top: 7, bottom: 2, left: 3, right: 3),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
Expand Down Expand Up @@ -232,7 +232,7 @@ class _TimerTextState extends State<TimerText> {
),
),
Padding(
padding: EdgeInsets.only(top: 5, bottom: 2, left: 3, right: 3),
padding: EdgeInsets.only(top: 7, bottom: 2, left: 3, right: 3),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
Expand Down Expand Up @@ -268,7 +268,7 @@ class _TimerTextState extends State<TimerText> {
),
Padding(
padding:
const EdgeInsets.only(top: 5, left: 3, right: 3, bottom: 2),
const EdgeInsets.only(top: 7, left: 3, right: 3, bottom: 2),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
Expand Down

1 comment on commit 7df0be4

@vercel
Copy link

@vercel vercel bot commented on 7df0be4 Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.