Add Pinned/Popular frontend code

このコミットが含まれているのは:
Midou36O 2023-03-07 17:43:56 +01:00
コミット 6c1e4fe9ea
この署名に対応する既知のキーがデータベースに存在しません
GPGキーID: 08063D5407090BC2
2個のファイルの変更251行の追加233行の削除

ファイルの表示

@ -1,277 +1,284 @@
/* god bless you */
@font-face {
font-family: 'Lato';
src: url('/fonts/Lato-Regular.ttf');
font-display: swap;
font-family: "Lato";
src: url("/fonts/Lato-Regular.ttf");
font-display: swap;
}
:root {
--text: #fff;
--background: #252525;
--secondary-background: #353535;
--background-darker: #151515;
--accent: #00b7c3;
color-scheme: dark;
--text: #fff;
--background: #252525;
--secondary-background: #353535;
--background-darker: #151515;
--accent: #00b7c3;
color-scheme: dark;
}
body {
font-family: 'Lato', sans-serif;
color: #FFF;
background-color: #151515;
transition: ease-in-out .25s;
margin: 0;
font-family: "Lato", sans-serif;
color: #fff;
background-color: #151515;
transition: ease-in-out 0.25s;
margin: 0;
}
::-webkit-scrollbar {
width: 8px;
height: 10px;
width: 8px;
height: 10px;
}
::-webkit-scrollbar-thumb {
border-radius: 8px;
background: #252525;
border-radius: 8px;
background: #252525;
}
main {
margin: 0 24vw;
margin: 0 24vw;
}
.navbar {
display: flex;
align-items: center;
justify-content: space-between;
flex-direction: row;
padding: 8px;
display: flex;
align-items: center;
justify-content: space-between;
flex-direction: row;
padding: 8px;
margin-bottom: 8px;
margin-bottom: 8px;
background-color: var(--background);
background-color: var(--background);
}
.indexGitHub {
background: #252525;
color: #fff;
padding: 4px;
border-radius: 8px;
background: #252525;
color: #fff;
padding: 4px;
border-radius: 8px;
}
.brand {
display: flex;
align-items: center;
gap: 8px;
transition: ease-in-out .25s;
color: var(--text);
display: flex;
align-items: center;
gap: 8px;
transition: ease-in-out 0.25s;
color: var(--text);
}
.navbarSlogan:hover {
text-decoration: underline;
text-underline-offset: 5px;
text-decoration: underline;
text-underline-offset: 5px;
}
.brand:hover {
color: var(--text);
text-decoration: underline;
color: var(--text);
text-decoration: underline;
}
.error {
background-color: #252525;
padding: 8px;
border-radius: 4px;
font-family: 'Lato', sans-serif;
color: #fff;
background-color: #252525;
padding: 8px;
border-radius: 4px;
font-family: "Lato", sans-serif;
color: #fff;
}
.center {
text-align: center;
text-align: center;
}
a {
color: white;
text-decoration: underline;
text-underline-offset: 5px;
color: white;
text-decoration: underline;
text-underline-offset: 5px;
}
a:hover {
color: #00b7c3;
color: #00b7c3;
}
/* URI: /explore */
.exploreIDontKnowWhatToNameThisDiv {
background-color: #252525;
padding: 8px;
border-radius: 4px;
margin: 8px 0 8px 0;
background-color: #252525;
padding: 8px;
border-radius: 4px;
margin: 8px 0 8px 0;
text-overflow: ellipsis;
white-space: wrap;
text-decoration: none;
display: flex;
text-overflow: ellipsis;
white-space: wrap;
text-decoration: none;
display: flex;
transition: ease-in-out .25s;
transition: ease-in-out 0.25s;
}
.exploreIDontKnowWhatToNameThisDiv:hover {
background-color: var(--secondary-background);
color: var(--text);
background-color: var(--secondary-background);
color: var(--text);
}
/* URI: /:user */
.userProfile {
background-color: var(--background);
padding: 8px;
border-radius: 4px;
margin: 8px;
display: flex;
flex-direction: column;
align-items: center;
background-color: var(--background);
padding: 8px;
border-radius: 4px;
margin: 8px;
display: flex;
flex-direction: column;
align-items: center;
}
.userProfile h1 {
color: #00b7c3;
margin: 4px;
word-wrap: nowrap;
text-overflow: ellipsis;
color: #00b7c3;
margin: 4px;
word-wrap: nowrap;
text-overflow: ellipsis;
}
.userProfile h2 {
margin: 4px;
.userProfile h2 {
margin: 4px;
}
.userProfile p {
margin: 4px;
margin: 4px;
}
.userProfile img {
border: 4px solid #00b7c3;
border-radius: 50%;
border: 4px solid #00b7c3;
border-radius: 50%;
}
.userBio, .userReadme {
background-color: var(--background);
padding: 8px;
border-radius: 4x;
margin: 8px;
.userBio,
.userReadme,
.mainRepos {
background-color: var(--background);
padding: 8px;
border-radius: 4x;
margin: 8px;
}
.userBioText, .userReadmeText {
background-color: var(--background-darker);
padding: 8px;
border-radius: 4px;
margin-bottom: 0;
.userBioText,
.userReadmeText,
.mainReposText {
background-color: var(--background-darker);
padding: 8px;
border-radius: 4px;
margin-bottom: 0;
}
.mainReposTextDim {
color: #8c8c8c;
}
.userReadmeText {
margin-top: 0;
margin-top: 0;
}
.sociallinks {
display: flex;
flex-direction: row;
display: flex;
flex-direction: column;
}
/* URI: /:user/:repo */
.button {
background-color: var(--background);
padding: 8px;
border-radius: 4px;
margin: 8px;
color: var(--text);
text-decoration: none;
text-align: center;
display: inline-block;
background-color: var(--background);
padding: 8px;
border-radius: 4px;
margin: 8px;
color: var(--text);
text-decoration: none;
text-align: center;
display: inline-block;
}
.button:hover {
background-color: var(--secondary-background);
color: var(--text);
background-color: var(--secondary-background);
color: var(--text);
}
.buttonParent {
display: flex;
justify-content: center;
align-items: center;
flex-direction: row;
display: flex;
justify-content: center;
align-items: center;
flex-direction: row;
}
.filesList {
list-style-type: none;
padding: 0;
margin: 0;
list-style-type: none;
padding: 0;
margin: 0;
}
.filesUList {
padding: 0;
margin: 0;
list-style-type: none;
padding: 0;
margin: 0;
list-style-type: none;
}
/* URI: /file/:user/:repo/:file */
.userReadme pre {
padding: 8px;
border-radius: 4px;
/*white-space: pre-wrap;*/
overflow-x: auto;
padding: 8px;
border-radius: 4px;
/*white-space: pre-wrap;*/
overflow-x: auto;
}
.userContainer {
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
}
.secondary {
background-color: var(--secondary-background);
background-color: var(--secondary-background);
}
@media screen and (prefers-color-scheme: light) {
:root {
--text: #000;
--background: #ececec;
--secondary-background: #f5f5f5;
--background-darker: #dddddd;
color-scheme: light;
}
body {
background-color: var(--background-darker);
color: #000;
}
a {
color: black;
}
a:hover {
color: #00b7c3;
}
.exploreIDontKnowWhatToNameThisDiv {
background-color: var(--background);
color: #000;
}
:root {
--text: #000;
--background: #ececec;
--secondary-background: #f5f5f5;
--background-darker: #dddddd;
color-scheme: light;
}
body {
background-color: var(--background-darker);
color: #000;
}
a {
color: black;
}
a:hover {
color: #00b7c3;
}
.exploreIDontKnowWhatToNameThisDiv {
background-color: var(--background);
color: #000;
}
}
@media screen and (max-width: 900px) {
main {
margin: 8px;
}
main {
margin: 8px;
}
.navbarSlogan {
display: none;
}
.navbarSlogan {
display: none;
}
.navbarImg {
height: 40px;
}
.navbarImg {
height: 40px;
}
.exploreIDontKnowWhatToNameThisDiv {
margin-left: 0;
margin-bottom: 8px;
margin-right: 0;
}
.exploreIDontKnowWhatToNameThisDiv {
margin-left: 0;
margin-bottom: 8px;
margin-right: 0;
}
.sociallinks {
flex-direction: column;
}
.sociallinks {
flex-direction: column;
}
}

ファイルの表示

@ -1,83 +1,94 @@
{{ template "header" .}}
<main>
{{ if .user }}
{{ range $key, $value := .user}}
<div class="buttonParent">
<a href="https://github.com/{{.Login}}" class="button">View on GitHub</a>
</div>
<div class="userProfile">
<img src="{{ .AvatarUrl }}" alt="{{.Login}}'s avatar" class="avatar" width="150" height="150">
{{ if .Name }}
<h1 class="user-profile-h1">{{.Name}}</h1>
{{ end }}
<h2>{{.Login}}</h2>
{{ if eq .Type "http://schema.org/Person" }}
<p><b>{{.Followers}}</b> followers - <b>{{.Following}}</b> following</p>
{{ else }}
<p><b>{{.Followers}}</b> followers</p>
{{ end }}
{{ if .StatusEmoji}}
<p>{{.StatusEmoji}} {{.Status}}</p>
{{ end }}
{{ if .Location }}
<p>🌍 {{.Location}}</p>
{{ end }}
{{ if .Timezone }}
<p>🕑️ {{.Timezone}}</p>
{{ end }}
{{ if .Link }}
<p>🌐 <a href="https://{{.Link}}" target="_blank">{{.Link}}</a></p>
{{ end }}
{{ if .Email }}
<p>✉️ {{.Email}}</p>
{{ end }}
{{ if .Social }}
<div class="sociallinks">
{{range .Social}}
<p>🔗 <a href="{{.}}" target="_blank">{{.}}</a></p>
{{ end }}
</div>
{{ end }}
{{ if .Organizations }}
<p>Organizations:
{{range .Organizations}}
<a href="/{{.}}" target="_blank">{{.}}</a>
{{ end }}
</p>
{{ end }}
{{ if .OrgMembers }}
<p>Members:
{{range .OrgMembers}}
<a href="/{{.}}" target="_blank">@{{.}}</a>
{{ end }}
</p>
{{ end }}
{{ if .Company }}
<p>🏢 {{.Company}}</p>
{{ end }}
{{ if eq .Type "http://schema.org/Person" }}
<p>✏️ {{ if .Name }} {{.Name}} {{ else }} {{.Login}} {{ end }} has made {{.Contributions}}</p>
{{ end }}
</div>
{{ if .Bio }}
<div class="userBio">
<h3>Bio</h3>
<p class="userBioText">{{.Bio}}</p>
</div>
{{ end }}
{{ if .Readme }}
<div class="userReadme">
<h3>README</h3>
<div class="userReadmeText">{{ unescape .Readme}}</div>
</div>
{{ end }}
{{ end }}
{{ else }}
<h2>User not found</h2>
<p>That user doesn't exist.</p>
{{ if .user }} {{ range $key, $value := .user}}
<div class="buttonParent">
<a href="https://github.com/{{.Login}}" class="button">View on GitHub</a>
</div>
<div class="userProfile">
<img
src="{{ .AvatarUrl }}"
alt="{{.Login}}'s avatar"
class="avatar"
width="150"
height="150"
/>
{{ if .Name }}
<h1 class="user-profile-h1">{{.Name}}</h1>
{{ end }}
<h2>{{.Login}}</h2>
{{ if eq .Type "http://schema.org/Person" }}
<p><b>{{.Followers}}</b> followers - <b>{{.Following}}</b> following</p>
{{ else }}
<p><b>{{.Followers}}</b> followers</p>
{{ end }} {{ if .StatusEmoji}}
<p>{{.StatusEmoji}} {{.Status}}</p>
{{ end }} {{ if .Location }}
<p>🌍 {{.Location}}</p>
{{ end }} {{ if .Timezone }}
<p>🕑️ {{.Timezone}}</p>
{{ end }} {{ if .Link }}
<p>🌐 <a href="https://{{.Link}}" target="_blank">{{.Link}}</a></p>
{{ end }} {{ if .Email }}
<p>✉️ {{.Email}}</p>
{{ end }} {{ if .Social }}
<div class="sociallinks">
{{range .Social}}
<p>🔗 <a href="{{.}}" target="_blank">{{.}}</a></p>
{{ end }}
</div>
{{ end }} {{ if .Organizations }}
<p>
Organizations: {{range .Organizations}}
<a href="/{{.}}" target="_blank">{{.}}</a>
{{ end }}
</p>
{{ end }} {{ if .OrgMembers }}
<p>
Members: {{range .OrgMembers}}
<a href="/{{.}}" target="_blank">@{{.}}</a>
{{ end }}
</p>
{{ end }} {{ if .Company }}
<p>🏢 {{.Company}}</p>
{{ end }} {{ if eq .Type "http://schema.org/Person" }}
<p>
✏️ {{ if .Name }} {{.Name}} {{ else }} {{.Login}} {{ end }} has made
{{.Contributions}}
</p>
{{ end }}
</div>
{{ if .Bio }}
<div class="userBio">
<h3>Bio</h3>
<p class="userBioText">{{.Bio}}</p>
</div>
{{ end }} {{ if .Readme }}
<div class="userReadme">
<h3>README</h3>
<div class="userReadmeText">{{ unescape .Readme}}</div>
</div>
{{ end }} {{ if .MainRepos }}
<div>
<h2>{{.PinOrPopular}}:</h2>
{{range .MainRepos}}
<div class="mainRepos">
<h3 class="">{{.Name}}</h3>
{{if .ForkOf}}
<p class="mainReposTextDim">Forked from: {{.ForkOf}}</p>
{{else}} {{end}}
{{if .Desc}}
<p class="">{{.Desc}}</p>
{{else}} {{end}}
<p class="">{{if .Stars}}⭐ {{.Stars}}{{else}}{{end}} {{if .Forks}} 🍴 {{.Forks}} {{else}}{{end}} {{if .Lang}} 🗒️ {{.Lang}} {{else}}{{end}} </p>
</div>
{{ end }}
</div>
{{ end }} {{ end }} {{ else }}
<h2>User not found</h2>
<p>That user doesn't exist.</p>
{{ end }}
</main>
</body>
</html>