forked from dmjone/dmjone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.html
117 lines (98 loc) · 4.29 KB
/
test.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
/* Course Cards CSS */
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
transition: 0.3s;
height: 100%;
background-size: 200% 200%;
animation: gradient 3s ease infinite;
--angle: 0deg;
--color1: white;
--color2: white;
background: linear-gradient(var(--angle), var(--color1), var(--color2));
}
.card:hover {
box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.2);
}
.card-description {
overflow: hidden;
height: 3.6em;
/* Height for three lines of text, adjust as needed */
}
.card-description:hover {
height: auto;
}
@keyframes gradient {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
.badge {
margin-right: 10px;
color: black;
}
</style>
</head>
<body>
<section id="courses" class="p-3 m-4">
<h1 id="course-title" class="text-center fadein-7"><strong>Our Courses</strong></h1>
<div class="row">
<div class="col-md-4 d-flex align-items-stretch">
<div class="card">
<div class="card-body d-flex flex-column">
<h3 class="card-title">CSU1128</h3>
<h4 class="card-subtitle mb-2 text-muted">Logic Building with Computer Programming in C</h4>
<div class="card-description flex-fill">
<p class="card-text">A brief detail about the subject which excites the users to click it.</p>
</div>
<div class="mt-auto">
<span class="badge badge-primary">CSE</span>
<a href="#csu1128" class="btn btn-primary">Dive in!</a>
</div>
</div>
</div>
</div>
<!-- More cards here... -->
</div>
</section>
<script>
function getRandomLightColor() {
var letters = 'BCDEF'.split('');
var color = '#';
for (var i = 0; i < 6; i++) {
color += letters[Math.floor(Math.random() * letters.length)];
}
// Add opacity
color += (Math.random() * 0.4 + 0.1).toFixed(2);
return color;
}
function getRandomAngle() {
return Math.floor(Math.random() * 360);
}
var cards = document.querySelectorAll('.card');
for (var i = 0; i < cards.length; i++) {
var randomColor1 = getRandomLightColor();
var randomColor2 = getRandomLightColor();
var randomAngle = getRandomAngle();
cards[i].style.setProperty('--color1', randomColor1);
cards[i].style.setProperty('--color2', randomColor2);
cards[i].style.setProperty('--angle', `${randomAngle}deg`);
}
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.3/jquery.min.js" integrity="sha512-STof4xm1wgkfm7heWqFJVn58Hm3EtS31XFaagaa8VMReCXAkQnJZ+jEy8PCC/iT18dFy95WcExNHFTqLyp72eQ==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.2.3/js/bootstrap.bundle.min.js" integrity="sha512-i9cEfJwUwViEPFKdC1enz4ZRGBj8YQo6QByFTF92YXHi7waCqyexvRD75S5NVTsSiTv7rKWqG9Y5eFxmRsOn0A==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
</body>
</html>