Así que tengo este código, crea algunas estrellas diminutas, ¿cómo puedo hacer que vengan en orden desde la izquierda como venir una por una y formar un contorno de un círculo en el centro de la página, también cómo puedo hacer que las estrellas como las estrellas normales con 5 esquinas, y ¿cómo puedo hacer que el tamaño sea mucho más grande?
.stars { --num: 10; /* the number of stars */ --w: 50vmin; width: var(--w); aspect-ratio: 1 / 1; position: relative; left: 100%; /* out of view to start with */ transition: left 2s; color: #FFD700; } .stars.show { left: 0; } .stars>* { --starw: calc(var(--w) / var(--num)); width: var(--starw); height: 50%; top: 0; left: calc(50% - (var(--starw) / 2)); transform: rotate(calc(var(--n) / var(--num) * 360deg)); transform-origin: 50% bottom; position: absolute; text-align: center; } .stars>*::after { content: '*'; position: absolute; top: 0; text-align: center; z-index: 1; width: 100%; left: 0; font-size: var(--starw); } .stars *:nth-child(1) { --n: 1; } .stars *:nth-child(2) { --n: 2; } .stars *:nth-child(3) { --n: 3; } .stars *:nth-child(4) { --n: 4; } .stars *:nth-child(5) { --n: 5; } .stars *:nth-child(6) { --n: 6; } .stars *:nth-child(7) { --n: 7; } .stars *:nth-child(8) { --n: 8; } .stars *:nth-child(9) { --n: 9; } .stars *:nth-child(10) { --n: 10; } <button onclick="document.querySelector('.stars').classList.add('show');">CLICK ME</button> <div class="stars"> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> </div>Puedes usar:
content: '★'; usar la estrella de cinco puntascolor: #FFD700; para usar tu color doradofont-size: 2.5rem; para aumentar el tamañoAquí hay un ejemplo en ejecución:
.stars { --num: 10; /* the number of stars */ --w: 50vmin; width: var(--w); aspect-ratio: 1 / 1; position: relative; left: 100%; /* out of view to start with */ transition: left 2s; } .stars.show { left: 0; } .stars>* { --starw: calc(var(--w) / var(--num)); width: var(--starw); height: 50%; top: 0; left: calc(50% - (var(--starw) / 2)); transform: rotate(calc(var(--n) / var(--num) * 360deg)); transform-origin: 50% bottom; position: absolute; text-align: center; } .stars>*::after { content: '★'; position: absolute; top: 0; text-align: center; z-index: 1; width: 100%; left: 0; font-size: var(--starw); color: #FFD700; font-size: 1.5rem; } .stars *:nth-child(1) { --n: 1; } .stars *:nth-child(2) { --n: 2; } .stars *:nth-child(3) { --n: 3; } .stars *:nth-child(4) { --n: 4; } .stars *:nth-child(5) { --n: 5; } .stars *:nth-child(6) { --n: 6; } .stars *:nth-child(7) { --n: 7; } .stars *:nth-child(8) { --n: 8; } .stars *:nth-child(9) { --n: 9; } .stars *:nth-child(10) { --n: 10; } <button onclick="document.querySelector('.stars').classList.add('show');">CLICK ME</button> <div class="stars"> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> <div></div> </div>Para el color agregue color: ##FFD700 a las estrellas>* . Para la forma, puedes usar un SVG.