Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notes Release (DRAFT) #968

Draft
wants to merge 27 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4cfb81b
initial attempt of sliding with rectangle
nidhi-mylavarapu Nov 7, 2024
d05304d
moved shifting Note to a separate component
nidhi-mylavarapu Nov 7, 2024
1d2e4a3
sliding notes with lighter color matching course
nidhi-mylavarapu Nov 7, 2024
ff34593
adde
nidhi-mylavarapu Nov 7, 2024
dd90cba
added arrow
nidhi-mylavarapu Nov 7, 2024
bec8497
using input but wrong styles
nidhi-mylavarapu Nov 7, 2024
6ed0d7c
note component setup
nidhi-mylavarapu Nov 7, 2024
d73a1fc
added note ic
nidhi-mylavarapu Nov 7, 2024
03dd540
notes icon in course card menu
nidhi-mylavarapu Nov 7, 2024
7f398e6
note shows up after clicking note option in course menu
nidhi-mylavarapu Nov 10, 2024
ba9c44d
lighter colors for notes
nidhi-mylavarapu Nov 14, 2024
478b155
Merge pull request #960 from cornell-dti/nidhi/notes-basic-frontend
Destaq Nov 15, 2024
a5158d5
checkpoint: mocked (on-enter) note shaking
Destaq Nov 19, 2024
0dfbb06
chore: run prettier
Destaq Nov 19, 2024
a9cb55b
refactor: fix some type issues and support saving + editing notes
Destaq Nov 19, 2024
9425129
feat: collapsing + shaking + refactoring for type-safety and minimalism
Destaq Nov 19, 2024
718dbd7
fix: make note component a proper Vue component for type safety
Destaq Nov 21, 2024
dade6fd
feat: editing & deletion ui footer logic
Destaq Dec 3, 2024
30468d3
fix: proper reactivity on delete
Destaq Dec 3, 2024
b2630b5
style: figma consistency updates for color + icons
Destaq Dec 3, 2024
40c073a
fix: attempt type fixes (not running locally)
Destaq Dec 3, 2024
2ac629b
fix: type cleanup
Destaq Dec 3, 2024
67a9b1b
chore: run prettier
Destaq Dec 3, 2024
31c151c
docs: add many inline comments
Destaq Dec 3, 2024
e60241f
Merge pull request #966 from cornell-dti/shake-animation-and-storage-…
nidhi-mylavarapu Dec 3, 2024
7e33104
frontend fixes
plumshum Dec 4, 2024
f6b240f
Revert "frontend fixes"
plumshum Dec 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added arrow
  • Loading branch information
nidhi-mylavarapu committed Nov 7, 2024
commit dd90cbafcf8148a340779e569233e00c098c0583
3 changes: 3 additions & 0 deletions src/assets/images/notes/arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 2 additions & 24 deletions src/components/Course/Course.vue
Original file line number Diff line number Diff line change
Expand Up @@ -93,35 +93,12 @@
:getCreditRange="getCreditRange || []"
v-click-outside="closeMenuIfOpen"
/>
<!-- Triangle element positioned under the course card -->
<!-- <div class="rectangle"></div> -->
</div>
<!-- Rectangle that slides out on click -->
<!-- <div
class="rectangle"
:class="{ expanded: isExpanded }"
@click.stop="toggleRectangle"
></div>
</div> -->
<!-- Rectangle that slides up and down on click -->
<!-- <div class="rectangle" :class="{ expanded: isExpanded }" @click.stop="toggleRectangle"></div>
</div> -->
<!-- Use Note component here -->
<!-- <Note @toggle="handleToggleNote" />
</div> -->
<!-- Use Note component here with the specified width and initial translate values -->
<!-- <Note
:initialTranslateY="'-60px'"
:expandedTranslateY="'0px'"
:width="'calc(103% - 10px)'"
@toggle="handleToggleNote"
/> -->
<!-- Use Note component with the color prop set to match the course card -->
<Note
:initialTranslateY="'-67px'"
:expandedTranslateY="'-35px'"
:width="'calc(103% - 10px)'"
:color="cssVars['--bg-color']"

Check failure on line 101 in src/components/Course/Course.vue

View workflow job for this annotation

GitHub Actions / check

Element implicitly has an 'any' type because expression of type '"--bg-color"' can't be used to index type 'CSSProperties'.
@toggle="handleToggleNote"
/>
</div>
Expand Down Expand Up @@ -293,8 +270,8 @@
// handleToggleNote(isExpanded) {
// console.log("Note expanded state:", isExpanded);
// },
handleToggleNote(isExpanded) {

Check failure on line 273 in src/components/Course/Course.vue

View workflow job for this annotation

GitHub Actions / check

Parameter 'isExpanded' implicitly has an 'any' type.
console.log('Note expanded state:', isExpanded);

Check warning on line 274 in src/components/Course/Course.vue

View workflow job for this annotation

GitHub Actions / check

Unexpected console statement
},
},
directives: {
Expand Down Expand Up @@ -330,7 +307,8 @@
display: flex;
flex-direction: row;
background-color: $white;
box-shadow: 0px 0px 10px 4px $boxShadowGray;
box-shadow: 0px 10px 15px -10px rgba(0, 0, 0, 0.3); /* Shadow appears only at the bottom */

height: 5.625rem;
cursor: grab;

Expand Down
207 changes: 39 additions & 168 deletions src/components/Notes/Note.vue
Original file line number Diff line number Diff line change
@@ -1,117 +1,12 @@
<!-- <template>
<div
class="note"
:class="{ expanded: isExpanded }"
:style="noteStyle"
@click.stop="toggleNote"
></div>
</template>

<script>
export default {
name: 'Note',
props: {
initialTranslateY: { type: String, default: '20px' },
expandedTranslateY: { type: String, default: '-10px' },
width: { type: String, default: '200px' },
},
data() {
return {
isExpanded: false,
};
},
computed: {
noteStyle() {
return {
transform: `translateX(-50%) translateY(${
this.isExpanded ? this.expandedTranslateY : this.initialTranslateY
})`,
width: this.width,
};
},
},
methods: {
toggleNote() {
this.isExpanded = !this.isExpanded;
this.$emit('toggle', this.isExpanded);
},
},
};
</script>

<style scoped>
.note {
position: absolute;
left: 50%;
height: 80px; /* Full height when expanded */
background-color: #a8e6cf; /* Pastel green */
border-radius: 12.49px;
cursor: pointer;
z-index: 0;
transition: transform 0.3s ease; /* Smooth slide transition */
}
</style> -->
<!-- <template>
<div
class="note"
:class="{ expanded: isExpanded }"
:style="noteStyle"
@click.stop="toggleNote"
></div>
</template>

<script>
export default {
name: "Note",
props: {
initialTranslateY: { type: String, default: "-50px" },
expandedTranslateY: { type: String, default: "-10px" },
width: { type: String, default: "200px" },
color: { type: String, default: "#a8e6cf" }, // Default color for the Note background
},
data() {
return {
isExpanded: false,
};
},
computed: {
noteStyle() {
return {
transform: `translateX(-50%) translateY(${this.isExpanded ? this.expandedTranslateY : this.initialTranslateY})`,
width: this.width,
backgroundColor: this.color, // Set background color based on prop
};
},
},
methods: {
toggleNote() {
this.isExpanded = !this.isExpanded;
this.$emit("toggle", this.isExpanded);
},
},
};
</script>

<style scoped>
.note {
position: absolute;
left: 50%;
height: 80px; /* Full height when expanded */
border-radius: 12.49px;
cursor: pointer;
z-index: 0;
transition: transform 0.3s ease; /* Smooth slide transition */
}
</style> -->
<!-- <template>
<div
class="note"
:class="{ expanded: isExpanded }"
:style="noteStyle"
@click.stop="toggleNote"
></div>
<template>
<div class="note" :class="{ expanded: isExpanded }" :style="noteStyle" @click.stop="toggleNote">
<!-- Show "Add a note..." text only when expanded -->
<div v-if="isExpanded" class="note-content">
<span>Add a note...</span>
<img src="@/assets/images/notes/arrow.svg" alt="Arrow icon" class="note-icon" />
</div>
</div>
</template>

<script>
export default {
name: 'Note',
Expand All @@ -134,7 +29,7 @@ export default {
})`,
width: this.width,
backgroundColor: this.color,
filter: 'brightness(1.3)', // Adjust for a lighter shade
filter: 'brightness(1.7) saturate(0.3)', // Adjust for a lighter, pastel look
};
},
},
Expand All @@ -151,66 +46,42 @@ export default {
.note {
position: absolute;
left: 50%;
height: 80px; /* Full height when expanded */
transform: translateX(-50%);
height: 80px; /* Initial height */
border-radius: 12.49px;
cursor: pointer;
z-index: 0;
transition: transform 0.3s ease, filter 0.3s ease; /* Smooth slide and brightness transition */
transition: transform 0.3s ease, filter 0.3s ease;
display: flex;
justify-content: center;
align-items: flex-end;
padding-bottom: 10px;
overflow: hidden; /* Ensures text stays within bounds */
}
</style> -->
<template>
<div
class="note"
:class="{ expanded: isExpanded }"
:style="noteStyle"
@click.stop="toggleNote"
></div>
</template>

<script>
export default {
name: 'Note',
props: {
initialTranslateY: { type: String, default: '-50px' },
expandedTranslateY: { type: String, default: '-10px' },
width: { type: String, default: '200px' },
color: { type: String, default: '#a8e6cf' },
},
data() {
return {
isExpanded: false,
};
},
computed: {
noteStyle() {
return {
transform: `translateX(-50%) translateY(${
this.isExpanded ? this.expandedTranslateY : this.initialTranslateY
})`,
width: this.width,
backgroundColor: this.color,
// filter: 'brightness(2)', // Increase to make it more pastel
filter: 'brightness(1.7) saturate(0.3)',
};
},
},
methods: {
toggleNote() {
this.isExpanded = !this.isExpanded;
this.$emit('toggle', this.isExpanded);
},
},
};
</script>
.note.expanded {
height: 80px; /* Full height for expanded state */
}

<style scoped>
.note {
/* Style for the "Add a note..." text */
.note-content {
/* font-size: 1rem; */
font-size: 14.48px;
color: #555; /* Text color */
font-family: inherit;
text-align: left;
padding: 2px 10px;
width: 100%;
/* padding-bottom: 5px; */
}
/* Style for the icon */
.note-icon {
width: 20.18px; /* Adjust size as needed */
height: 20.18px;
position: absolute;
left: 50%;
height: 80px; /* Full height when expanded */
border-radius: 12.49px;
cursor: pointer;
z-index: 0;
transition: transform 0.3s ease, filter 0.3s ease; /* Smooth slide and brightness transition */
bottom: 12px;
right: 10px;
color: grey;
opacity: 1;
}
</style>
Loading