File tree Expand file tree Collapse file tree 2 files changed +38
-6
lines changed Expand file tree Collapse file tree 2 files changed +38
-6
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,18 @@ $monitor-height: 271px;
199
199
}
200
200
}
201
201
202
+ @property --floor {
203
+ syntax : ' <integer>' ;
204
+ initial-value : 0 ;
205
+ inherits : false;
206
+ }
207
+
208
+ @property --seed {
209
+ syntax : ' <integer>' ;
210
+ initial-value : #{random (1000 )} ;
211
+ inherits : true;
212
+ }
213
+
202
214
#companies-projects {
203
215
border-top : solid 1px var (--base-border-color );
204
216
@@ -212,6 +224,18 @@ $monitor-height: 271px;
212
224
213
225
li {
214
226
margin : 1em 2em ;
227
+
228
+ $num : 11 ;
229
+ $prime : 97 ;
230
+
231
+ @for $i from 1 through $num {
232
+ & :nth-child (#{$i } ) {
233
+ --prod : calc (var (--seed ) * #{$i } * #{$prime } );
234
+ --floor : calc ((var (--prod ) / #{$num } ) - 0.5 );
235
+
236
+ order : calc (var (--prod ) - (#{$num } * var (--floor )));
237
+ }
238
+ }
215
239
}
216
240
217
241
a {
Original file line number Diff line number Diff line change @@ -60,11 +60,19 @@ <h3>Community</h3>
60
60
< section id ="companies-projects ">
61
61
< h3 class ="text-center "> Products providing Git hosting</ h3 >
62
62
< ul >
63
- < li > < a href ="https://gitlab.com "> {{ partial "company-svg" "company-project-logos/gitlab" }}</ a > </ li >
64
- < li > < a href ="https://github.com "> {{ partial "company-svg" "company-project-logos/github" }}</ a > </ li >
65
- < li > < a href ="https://forgejo.org "> {{ partial "company-svg" "company-project-logos/forgejo" }}</ a > </ li >
66
- < li > < a href ="https://codeberg.org "> {{ partial "company-svg" "company-project-logos/codeberg" }}</ a > </ li >
67
- < li > < a href ="https://sourcehut.org "> {{ partial "company-svg" "company-project-logos/sourcehut" }}</ a > </ li >
68
- < li > < a href ="https://gitea.com "> {{ partial "company-svg" "company-project-logos/gitea" }}</ a > </ li >
63
+ {{ $m := slice
64
+ (dict "name" "gitlab" "url" "https://gitlab.com")
65
+ (dict "name" "github" "url" "https://github.com")
66
+ (dict "name" "forgejo" "url" "https://forgejo.org")
67
+ (dict "name" "codeberg" "url" "https://codeberg.org")
68
+ (dict "name" "sourcehut" "url" "https://sourcehut.org")
69
+ (dict "name" "gitea" "url" "https://gitea.com")
70
+ }}
71
+ {{ range shuffle $m }}
72
+ < li > < a href ="{{ .url }} "> {{ partial "company-svg" (printf "company-project-logos/%s" .name) }}</ a > </ li >
73
+ {{ end }}
69
74
</ ul >
75
+ < script type ="text/javascript ">
76
+ document . getElementById ( "companies-projects" ) . style . setProperty ( "--seed" , Math . floor ( Math . random ( ) * 1000 ) ) ;
77
+ </ script >
70
78
</ section >
You can’t perform that action at this time.
0 commit comments