Skip to content

Code improvement#13

Open
LeoCodx62 wants to merge 12 commits into
mainfrom
code-improvement
Open

Code improvement#13
LeoCodx62 wants to merge 12 commits into
mainfrom
code-improvement

Conversation

@LeoCodx62

Copy link
Copy Markdown
Collaborator

Improved quality of code:

  • Separate files for css
  • Improved scanner management separating messages and status
  • improved ios device detection
  • new favicon
  • improved UX for scanner

@LeoCodx62 LeoCodx62 requested a review from MarBert May 13, 2026 12:21
@LeoCodx62 LeoCodx62 self-assigned this May 13, 2026
@MarBert MarBert requested a review from Copilot May 18, 2026 15:51

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Refactors the WebAR scanner and AR experience pages to improve code quality: inline styles are moved to CSS modules, the QR scanner hook splits its single state string into a typed status plus a message, iOS detection is broadened to include iPadOS on MacIntel, and the allowed-IDs list is extracted to a shared config. UI copy on the AR pages is also translated to Italian.

Changes:

  • Extract ALLOWED_IDS to public/config/experiences.ts and split scanner state into status (idle/scanning/success/error) and message in useQrScanner.ts.
  • Replace inline styles across page.tsx, iceCore/page.tsx, glacierInTime/page.tsx, and demoModelViewer/page.tsx with new CSS module files; hoist component-level constants out of render bodies.
  • Broaden iOS detection in arHelper.ts to also match iPadOS (MacIntel + maxTouchPoints > 1) and translate scanner/AR UI strings to Italian.

Reviewed changes

Copilot reviewed 12 out of 13 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/utils/useQrScanner.ts Splits scanner state into typed status and message; imports ALLOWED_IDS from shared config.
src/utils/arHelper.ts Adds iPadOS detection via MacIntel + maxTouchPoints.
public/config/experiences.ts New shared file exporting ALLOWED_IDS.
src/app/page.tsx Switches to style.module.css, uses new status/message, adds scanner guide; copy translated to Italian.
src/app/style.module.css New stylesheet replacing scanner.module.css, adds landing, status, result, and scanner-guide styles.
src/app/scanner.module.css Deleted (superseded by style.module.css).
src/app/iceCore/page.tsx Inline styles → iceCore.module.css; constants hoisted; copy translated; pulse keyframes moved to CSS.
src/app/iceCore/iceCore.module.css New stylesheet for the iceCore page.
src/app/glacierInTime/page.tsx Same refactor as iceCore page; copy translated.
src/app/glacierInTime/glacierInTime.module.css New stylesheet (nearly identical to iceCore's).
src/app/demoModelViewer/page.tsx Inline styles → modelViewer.module.css; adds Manrope font; copy translated.
src/app/demoModelViewer/modelViewer.module.css New stylesheet for the demo model viewer page.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/app/iceCore/page.tsx
>
Frame the image to start
<p className={styles.instructionText}>
Inquadra l`immagine per iniziare
>
Frame the image to start
<p className={styles.instructionText}>
Inquadra l`immagine per iniziare
<p>Interact with the object to rotate it</p>
<main className={`${styles.mainContainer} ${manrope.className}`}>
<p className={styles.instructionText}>
Interagisici con l`oggetto per ruotarlo
Comment on lines +1 to +130
.container {
position: relative;
width: 100vw;
height: 100dvh;
overflow: hidden;
background-color: #000;
}

/* Invisible overlay to catch click*/
.clickOverlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 8;
cursor: pointer;
}

/* Marker image */
.markerImage {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
max-width: 80vw;
max-height: 80vh;
width: auto;
height: auto;
transition: opacity 0.6s ease-in-out;
pointer-events: none;
z-index: 5;
}

/* UI */
.uiContainer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 40px 20px;
z-index: 10;
pointer-events: none;
text-align: center;
box-sizing: border-box;
}

/* Higher text group*/
.textGroup {
display: flex;
flex-direction: column;
gap: 10px;
}

.instructionText {
font-size: 1.2rem;
color: #fff;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
margin: 0;
}

.pulseText {
font-size: 1.5rem;
color: #fff;
font-weight: bold;
animation: pulse 2s infinite;
text-transform: uppercase;
letter-spacing: 1px;
text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.9);
pointer-events: none;
}

/* Lower button group*/
.bottomGroup {
display: flex;
flex-direction: column;
align-items: center;
gap: 20px;
margin-bottom: 20px;
}

.backButton {
pointer-events: auto;
display: inline-block;
padding: 12px 24px;
background-color: #0070f3;
color: white;
text-decoration: none;
border-radius: 8px;
font-size: 16px;
font-weight: bold;
opacity: 0.8;
transition: opacity 0.2s ease;
}

.backButton:hover {
opacity: 1;
}

/* Iframe AR */
.iframeStyle {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
border: none;
z-index: 1;
}

/* Animation */
@keyframes pulse {
0% {
transform: scale(1);
opacity: 0.8;
}
50% {
transform: scale(1.05);
opacity: 1;
}
100% {
transform: scale(1);
opacity: 0.8;
}
}
Comment on lines +1 to +4
/**
* list of allowed ids.
*/
export const ALLOWED_IDS = ["demoModelViewer", "iceCore", "glacierInTime"];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants