Skip to content

Commit

Permalink
[+] Add original readme
Browse files Browse the repository at this point in the history
  • Loading branch information
LS-KR committed Nov 16, 2024
1 parent 968ebf6 commit 1f27c76
Showing 1 changed file with 24 additions and 4 deletions.
28 changes: 24 additions & 4 deletions src/views/ContentField.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<script lang="ts">
import topHtml from '@/assets/top.md';
import ContentCard from "@/components/ContentCard.vue";
import {Content, Data} from "@/logic/data";
import {fetchWithParams, gShuffle} from "@/logic/helper";
import {Vue, Component} from 'vue-facing-decorator';
import ContentCard from "@/components/ContentCard.vue";
import topHtml from '@/assets/top.md';
import {marked} from "marked";
import {Component, Vue} from 'vue-facing-decorator';
@Component({components: {ContentCard}})
@Component({ components: { ContentCard } })
export default class ContentField extends Vue {
contents = [] as Content[]
topHtml = topHtml;
bottomHtml = ''
created() {
fetchWithParams('https://raw.githubusercontent.com/LS-KR/TransDefenseProject/master/institute_list.json')
Expand All @@ -17,6 +19,13 @@ export default class ContentField extends Vue {
console.log(it);
this.contents = gShuffle((JSON.parse(it) as Data).content)
})
fetchWithParams('https://raw.githubusercontent.com/LS-KR/TransDefenseProject/refs/heads/master/README.md')
.then(it => it.text())
.then(it => {
console.log(it);
this.bottomHtml = marked(it).toString().replace(/\n/g, '<br/>');
})
}
}
</script>
Expand All @@ -26,6 +35,7 @@ export default class ContentField extends Vue {
<div class="content-field">
<ContentCard v-for="content in contents" :key="content" :content="content" class="content-card"/>
</div>
<div class="bottom-message markdown" v-html="bottomHtml"/>
</template>

<style lang="scss">
Expand All @@ -50,6 +60,16 @@ export default class ContentField extends Vue {
margin: auto auto 2rem;
}
.bottom-message {
width: 100%;
height: fit-content;
max-width: 1263px;
margin: 2rem auto;
padding: 1rem;
background-color: rgba(255, 255, 255, 0.05);
border-radius: 1rem;
}
@media screen and (max-width: 976px) {
.content-field {
column-count: 2;
Expand Down

0 comments on commit 1f27c76

Please sign in to comment.