Skip to content

Commit 3c75784

Browse files
Fixes bugs in beta
1 parent 808aeec commit 3c75784

12 files changed

Lines changed: 610 additions & 219 deletions

File tree

lib/authentication/utils/auth0angular.js

Lines changed: 248 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ export async function setupAuth0Angular(state) {
272272
const angMat = "angular-material" === state.uiLibrary;
273273
const daisy = "daisyui" === state.uiLibrary;
274274
const primeng = "primeng" === state.uiLibrary;
275+
const useTailwind = state.styling === "tailwind"
275276
console.log(chalk.blue(`Setting up Auth0 for Angular project: ${projectName}`));
276277

277278
const rootDir = path.isAbsolute(projectName) ? projectName : process.cwd();
@@ -325,7 +326,7 @@ export async function setupAuth0Angular(state) {
325326
// Update app.html
326327
const appHtmlPath = path.join(appDir, 'app.html');
327328
if (fs.existsSync(appHtmlPath)) {
328-
const appHtml = `<main class="relative flex min-h-screen flex-col items-center justify-center p-8 sm:p-24 overflow-hidden
329+
const appHtml = (useTailwind) ? `<main class="relative flex min-h-screen flex-col items-center justify-center p-8 sm:p-24 overflow-hidden
329330
bg-[#0f0f0f]
330331
bg-[radial-gradient(#ff4d5c22_1px,transparent_1px)]
331332
bg-[length:20px_20px] z-0">
@@ -337,7 +338,7 @@ bg-[length:20px_20px] z-0">
337338
338339
<!-- Content: only show when authenticated -->
339340
<ng-container *ngIf="auth.isAuthenticated$ | async; else showSignIn">
340-
<auth-button style="position: absolute; top:15px;left:15px"></auth-button>
341+
<auth-button style="position: absolute; top:15px;right:15px"></auth-button>
341342
<div class="z-10 max-w-6xl w-full text-center">
342343
<h1 class="text-5xl sm:text-6xl font-extrabold mb-6 text-white drop-shadow-xl typewriter-text p-2">
343344
Welcome to <span class="text-[#dd0031]">HackPack</span>
@@ -459,13 +460,51 @@ bg-[length:20px_20px] z-0">
459460
460461
</main>
461462
463+
<ngx-sonner-toaster position="bottom-right" />`: `
464+
<main class="main-container">
465+
466+
<!-- Angular Glow Orbs -->
467+
<div class="glow-orb orb1"></div>
468+
<div class="glow-orb orb2"></div>
469+
<div class="glow-orb orb3"></div>
470+
<div class="content">
471+
<h1 class="heading typewriter-text ">
472+
Welcome to <span class="brand-name">HackPack</span>
473+
</h1>
474+
475+
<p class="subtext">
476+
Harness the power of Angular, styled with class. 💫<br />
477+
This project is wired with Angular, CSS & automation.
478+
</p>
479+
480+
<button class="toast-button"
481+
(click)="toast('🎉 Welcome aboard! HackPack is ready to accelerate your development journey.')">
482+
Launch a toast notification
483+
</button>
484+
485+
<ng-container *ngIf="auth.isAuthenticated$ | async; else showSignIn">
486+
<div class="auth-wrapper">
487+
<auth-button></auth-button>
488+
</div>
489+
</ng-container>
490+
491+
<ng-template #showSignIn>
492+
<router-outlet></router-outlet>
493+
</ng-template>
494+
<p class="start-hint">
495+
Start building from <code class="code-snippet">src/app/app.component.ts or src/app/app.ts</code>
496+
</p>
497+
498+
</div>
499+
500+
</main>
462501
<ngx-sonner-toaster position="bottom-right" />`;
463502
fs.writeFileSync(appHtmlPath, appHtml);
464503
}
465504

466505
const appCssPath = path.join(appDir, 'app.css');
467506
if (fs.existsSync(appCssPath)) {
468-
const appCss = `@keyframes typing {
507+
const appCss = (useTailwind)?`@keyframes typing {
469508
from {
470509
width: 0;
471510
}
@@ -484,8 +523,214 @@ bg-[length:20px_20px] z-0">
484523
overflow: hidden;
485524
border-right: 0.15em solid white;
486525
white-space: nowrap;
526+
margin:0 auto;
527+
margin-bottom:1.5rem;
487528
animation: typing 3.5s steps(30, end), blink 0.75s step-end infinite;
488529
}
530+
`:`
531+
532+
@keyframes blink {
533+
50% {
534+
border-color: transparent;
535+
}
536+
}
537+
538+
.typewriter-text {
539+
overflow: hidden;
540+
border-right: 0.15em solid white;
541+
white-space: nowrap;
542+
animation: typing 3.5s steps(30, end), blink 0.75s step-end infinite;
543+
}
544+
545+
546+
body, html {
547+
margin: 0;
548+
padding: 0;
549+
height: 100%;
550+
background-color: #0f0f0f;
551+
font-family: sans-serif;
552+
}
553+
554+
.main-container {
555+
position: relative;
556+
display: flex;
557+
flex-direction: column;
558+
justify-content: center;
559+
align-items: center;
560+
min-height: 100vh;
561+
overflow: hidden;
562+
background-color: #0f0f0f;
563+
background-image: radial-gradient(#ff4d5c22 1px, transparent 1px);
564+
background-size: 20px 20px;
565+
z-index: 0;
566+
}
567+
568+
/* Angular Glow Orbs */
569+
.glow-orb {
570+
position: absolute;
571+
background-color: #dd0031;
572+
border-radius: 9999px;
573+
pointer-events: none;
574+
animation-name: float;
575+
animation-timing-function: ease-in-out;
576+
animation-iteration-count: infinite;
577+
}
578+
579+
.orb1 {
580+
width: 24rem;
581+
height: 24rem;
582+
top: 33%;
583+
left: 20%;
584+
opacity: 0.25;
585+
filter: blur(48px);
586+
animation-duration: 8s;
587+
}
588+
589+
.orb2 {
590+
width: 20rem;
591+
height: 20rem;
592+
top: 25%;
593+
right: 25%;
594+
opacity: 0.20;
595+
filter: blur(32px);
596+
animation-duration: 10s;
597+
animation-delay: 0.2s;
598+
}
599+
600+
.orb3 {
601+
width: 18rem;
602+
height: 18rem;
603+
bottom: 25%;
604+
left: 50%;
605+
opacity: 0.15;
606+
filter: blur(32px);
607+
animation-duration: 12s;
608+
animation-delay: 0.5s;
609+
}
610+
611+
@keyframes float {
612+
0% {
613+
transform: translate(0px, 0px);
614+
}
615+
50% {
616+
transform: translate(20px, -30px);
617+
}
618+
100% {
619+
transform: translate(0px, 0px);
620+
}
621+
}
622+
623+
624+
.content {
625+
max-width: 64rem;
626+
width: 100%;
627+
text-align: center;
628+
z-index: 10;
629+
}
630+
631+
.heading {
632+
font-size: 3.5rem;
633+
font-weight: 800;
634+
margin-bottom: 1.5rem;
635+
color: white;
636+
text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
637+
margin: 0 auto;
638+
}
639+
640+
.brand-name {
641+
color: #dd0031;
642+
}
643+
644+
.subtext {
645+
font-size: 1.25rem;
646+
color: #e9d5ff;
647+
margin-bottom: 2rem;
648+
}
649+
650+
.toast-button {
651+
background-color: #dd0031;
652+
color: white;
653+
font-weight: 600;
654+
padding: 0.75rem 1.5rem;
655+
border: none;
656+
border-radius: 0.5rem;
657+
box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
658+
cursor: pointer;
659+
transition: background-color 0.3s ease;
660+
}
661+
662+
.toast-button:hover {
663+
background-color: #c3002f;
664+
}
665+
666+
.start-hint {
667+
margin-top: 3rem;
668+
font-size: 0.9rem;
669+
color: #ddd6fe;
670+
}
671+
672+
.code-snippet {
673+
font-family: monospace;
674+
background-color: #6b21a8;
675+
padding: 0.25rem 0.5rem;
676+
border-radius: 0.375rem;
677+
}
678+
679+
@keyframes typing {
680+
from {
681+
width: 0;
682+
}
683+
to {
684+
width: 100%;
685+
}
686+
}
687+
688+
@keyframes blink {
689+
50% {
690+
border-color: transparent;
691+
}
692+
}
693+
694+
.typewriter-text {
695+
overflow: hidden;
696+
border-right: 0.15em solid white;
697+
white-space: nowrap;
698+
animation: typing 3.5s steps(30, end), blink 0.75s step-end infinite;
699+
}
700+
.auth-wrapper {
701+
position: absolute;
702+
top: 16px;
703+
right: 16px;
704+
padding: 6px 10px;
705+
706+
background: rgba(255, 255, 255, 0.12);
707+
backdrop-filter: blur(12px);
708+
-webkit-backdrop-filter: blur(12px);
709+
710+
border-radius: 999px;
711+
box-shadow:
712+
0 8px 30px rgba(0, 0, 0, 0.25),
713+
inset 0 0 0 1px rgba(255, 255, 255, 0.15);
714+
715+
transition: transform 0.25s ease, box-shadow 0.25s ease;
716+
z-index: 50;
717+
}
718+
719+
.auth-wrapper:hover {
720+
transform: translateY(-2px);
721+
box-shadow:
722+
0 12px 40px rgba(0, 0, 0, 0.35),
723+
inset 0 0 0 1px rgba(255, 255, 255, 0.25);
724+
}
725+
726+
/* If auth-button renders a button internally */
727+
.auth-wrapper button {
728+
background: transparent;
729+
color: #fff;
730+
border: none;
731+
font-weight: 500;
732+
cursor: pointer;
733+
}
489734
`;
490735
fs.writeFileSync(appCssPath, appCss);
491736
}

0 commit comments

Comments
 (0)