IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Mise en page CSS Discussion :

[CSS+Java?] Obtenir un menu circulaire (exemple en image)


Sujet :

CSS

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Nouveau candidat au Club
    Homme Profil pro
    Lycéen
    Inscrit en
    Avril 2015
    Messages
    2
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Suisse

    Informations professionnelles :
    Activité : Lycéen

    Informations forums :
    Inscription : Avril 2015
    Messages : 2
    Par défaut [CSS+Java?] Obtenir un menu circulaire (exemple en image)
    Bonjour,
    J'apprends à coder depuis quelques temps en html, css et java. Je me débrouiller en html, un peu moins en css (je connais les bases pour changer la couleur, la forme d'une box, etc.) et encore un peu moins en java malheureusement.
    J'aimerais créer une page d'accueil avec un fond en image ou vidéo et un menu au centre de la page. Ce menu (cliquez sur "menu"):
    http://tympanus.net/Tutorials/Circul...on/index2.html
    En cliquant sur une des rubriques, on est redirigé sur une autre page et j'aimerais que sur cette nouvelle page un menu comme ça soit fixé en haut de la page (cliquez sur le "+"):
    http://tympanus.net/Tutorials/Circul...ion/index.html
    En gros une symétrie.

    Mon problème:
    J'ai téléchargé le code source (sur cette page:http://tympanus.net/codrops/2013/08/...ss-transforms/) et ai supprimé un maximum d'éléments qui me semblaient inutiles (le texte qui ne fait pas parti des menus par exemple) mais le code CSS et java me sont carrément incompréhensibles... pourtant je connais le css et ai des notions de JS.

    Ma question:
    Auriez-vous une méthode pour arriver à créer un menu de ce type facilement et si possible en mettant peu de JS car mon but dans un second temps et vraiment de comprendre à quoi sert chaque élément.

    Je vous remercie d'ores et déjà! Bonne nuit ...

  2. #2
    Rédacteur

    Avatar de Bovino
    Homme Profil pro
    Développeur Web
    Inscrit en
    Juin 2008
    Messages
    23 647
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 55
    Localisation : France, Gironde (Aquitaine)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Juin 2008
    Messages : 23 647
    Billets dans le blog
    20
    Par défaut
    Nom : javascript.gif
Affichages : 1014
Taille : 26,9 Ko
    Pas de question technique par MP !
    Tout le monde peut participer à developpez.com, vous avez une idée, contactez-moi !
    Mes formations video2brain : La formation complète sur JavaScriptJavaScript et le DOM par la pratiquePHP 5 et MySQL : les fondamentaux
    Mon livre sur jQuery
    Module Firefox / Chrome d'intégration de JSFiddle et CodePen sur le forum

  3. #3
    Invité
    Invité(e)
    Par défaut
    Bonjour,

    • Pour comprendre, il faut apprendre
    • Pour apprendre, il faut bosser

    Donc non. Rien de facile...

  4. #4
    Rédacteur/Modérateur

    Avatar de SylvainPV
    Profil pro
    Inscrit en
    Novembre 2012
    Messages
    3 375
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2012
    Messages : 3 375
    Par défaut
    Déjà, en remplaçant les propriétés CSS bottom par top, on a fait le plus gros du travail. Ensuite tu peux ajouter 180 degrés aux rotations des éléments (.csstransforms .cn-wrapper li:nth-child(1))
    Pour le bouton blanc +/-, il faut un peu toucher aux margin/padding pour bien aligner le texte.

    Voilà le CSS component1 modifié :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    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
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    @import url(http://netdna.bootstrapcdn.com/font-awesome/2.0/css/font-awesome.css);
     
    * {
      -moz-box-sizing: border-box;
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      list-style: none;
      position: relative
    }
     
    html,
    body {
      height: 100%;
    }
     
    body {
      background: #f06060;
      color: #fff;
    }
     
    .csstransforms .cn-wrapper {
      font-size: 1em;
      width: 26em;
      height: 26em;
      overflow: hidden;
      position: fixed;
      z-index: 10;
      top: -13em;
      left: 50%;
      border-radius: 50%;
      margin-left: -13em;
      -webkit-transform: scale(0.1);
      -ms-transform: scale(0.1);
      -moz-transform: scale(0.1);
      transform: scale(0.1);
      pointer-events: none;
      -webkit-transition: all .3s ease;
      -moz-transition: all .3s ease;
      transition: all .3s ease;
    }
     
    .csstransforms .opened-nav {
      border-radius: 50%;
      pointer-events: auto;
      -webkit-transform: scale(1);
      -moz-transform: scale(1);
      -ms-transform: scale(1);
      transform: scale(1);
    }
     
    .cn-overlay {
      width: 100%;
      height: 100%;
      background-color: rgba(0,0,0,0.6);
      position: fixed;
      top: 0;
      left: 0;
      bottom: 0;
      right: 0;
      opacity: 0;
      visibility: hidden;
      -webkit-transition: all .3s ease;
      -moz-transition: all .3s ease;
      transition: all .3s ease;
      z-index: 2;
    }
     
    .cn-overlay.on-overlay {
      visibility: visible;
      opacity: 1;
    }
     
    .cn-button {
      border: none;
      background: none;
      color: #f06060;
      text-align: center;
      font-size: 1.8em;
      padding-bottom: 1em;
      height: 3.5em;
      width: 3.5em;
      background-color: #fff;
      position: fixed;
      left: 50%;
      top: -1.75em;
      margin-left: -1.75em;
      padding-top: 1.75em;
      border-radius: 50%;
      cursor: pointer;
      z-index: 11;
    }
     
    .cn-button:hover,
    .cn-button:active,
    .cn-button:focus {
      color: #aa1010;
    }
     
    .csstransforms .cn-wrapper li {
      position: absolute;
      font-size: 1.5em;
      width: 10em;
      height: 10em;
      -webkit-transform-origin: 100% 100%;
      -moz-transform-origin: 100% 100%;
      -ms-transform-origin: 100% 100%;
      transform-origin: 100% 100%;
      overflow: hidden;
      left: 50%;
      top: 50%;
      margin-top: -1.3em;
      margin-left: -10em;
      -webkit-transition: border .3s ease;
      -moz-transition: border .3s ease;
      transition: border .3s ease;
    }
     
    .csstransforms .cn-wrapper li a {
      display: block;
      font-size: 1.18em;
      height: 14.5em;
      width: 14.5em;
      position: absolute;
      bottom: -7.25em;
      right: -7.25em;
      border-radius: 50%;
      text-decoration: none;
      color: #fff;
      padding-top: 1.8em;
      text-align: center;
      -webkit-transform: skew(-50deg) rotate(-70deg) scale(1);
      -ms-transform: skew(-50deg) rotate(-70deg) scale(1);
      -moz-transform: skew(-50deg) rotate(-70deg) scale(1);
      transform: skew(-50deg) rotate(-70deg) scale(1);
      -webkit-backface-visibility: hidden;
      -webkit-transition: opacity 0.3s, color 0.3s;
      -moz-transition: opacity 0.3s, color 0.3s;
      transition: opacity 0.3s, color 0.3s;
    }
     
    .csstransforms .cn-wrapper li a span {
      font-size: 1.1em;
      opacity: 0.7;
    }
     
    /* for a central angle x, the list items must be skewed by 90-x degrees
    in our case x=40deg so skew angle is 50deg
    items should be rotated by x, minus (sum of angles - 180)2s (for this demo) */
     
    .csstransforms .cn-wrapper li:first-child {
      -webkit-transform: rotate(-10deg) skew(50deg);
      -ms-transform: rotate(-10deg) skew(50deg);
      -moz-transform: rotate(-10deg) skew(50deg);
      transform: rotate(-190deg) skew(50deg);
    }
     
    .csstransforms .cn-wrapper li:nth-child(2) {
      -webkit-transform: rotate(30deg) skew(50deg);
      -ms-transform: rotate(30deg) skew(50deg);
      -moz-transform: rotate(30deg) skew(50deg);
      transform: rotate(210deg) skew(50deg);
    }
     
    .csstransforms .cn-wrapper li:nth-child(3) {
      -webkit-transform: rotate(70deg) skew(50deg);
      -ms-transform: rotate(70deg) skew(50deg);
      -moz-transform: rotate(70deg) skew(50deg);
      transform: rotate(250deg) skew(50deg);}
     
    .csstransforms .cn-wrapper li:nth-child(4) {
      -webkit-transform: rotate(110deg) skew(50deg);
      -ms-transform: rotate(110deg) skew(50deg);
      -moz-transform: rotate(110deg) skew(50deg);
      transform: rotate(290deg) skew(50deg);
    }
     
    .csstransforms .cn-wrapper li:nth-child(5) {
      -webkit-transform: rotate(150deg) skew(50deg);
      -ms-transform: rotate(150deg) skew(50deg);
      -moz-transform: rotate(150deg) skew(50deg);
      transform: rotate(330deg) skew(50deg);
    }
     
    .csstransforms .cn-wrapper li:nth-child(odd) a {
      background-color: #a11313;
      background-color: hsla(0, 88%, 63%, 1);
    }
     
    .csstransforms .cn-wrapper li:nth-child(even) a {
      background-color: #a61414;
      background-color: hsla(0, 88%, 65%, 1);
    }
     
    /* active style */
    .csstransforms .cn-wrapper li.active a {
      background-color: #b31515;
      background-color: hsla(0, 88%, 70%, 1);
    }
     
     
    /* hover style */
    .csstransforms .cn-wrapper li:not(.active) a:hover,
    .csstransforms .cn-wrapper li:not(.active) a:active,
    .csstransforms .cn-wrapper li:not(.active) a:focus {
      background-color: #b31515;
      background-color: hsla(0, 88%, 70%, 1);
    }
    .csstransforms .cn-wrapper li:not(.active) a:focus
    {
        position:fixed;
    }
     
     
    /* fallback */
    .no-csstransforms .cn-button {
      display: none;
    }
     
    .no-csstransforms .cn-wrapper li {
      position: static;
      float: left;
      font-size: 1em;
      height: 5em;
      width: 5em;
      background-color: #eee;
      text-align: center;
      line-height: 5em;
    }
     
    .no-csstransforms .cn-wrapper li a {
      display: block;
      width: 100%;
      height: 100%;
      text-decoration: none;
      color: inherit;
      font-size: 1.3em;
      border-right: 1px solid #ddd;
    }
     
    .no-csstransforms .cn-wrapper li a:last-child {
      border: none;
    }
     
    .no-csstransforms .cn-wrapper li a:hover,
    .no-csstransforms .cn-wrapper li a:active,
    .no-csstransforms .cn-wrapper li a:focus {
      background-color: white;
    }
     
    .no-csstransforms .cn-wrapper li.active a {
      background-color: #6F325C;
      color: #fff;
    }
     
    .no-csstransforms .cn-wrapper {
      font-size: 1em;
      height: 5em;
      width: 25.15em;
      bottom: 0;
      margin-left: -12.5em;
      overflow: hidden;
      position: fixed;
      z-index: 10;
      left: 50%;
      border: 1px solid #ddd;
    }
     
    @media screen and (max-width:480px) {
      .csstransforms .cn-wrapper {
        font-size: .68em;
      }
     
      .cn-button {
        font-size: 1em;
      }
     
      .csstransforms .cn-wrapper li {
        font-size: 1.52em;
      }
    }
     
    @media screen and (max-width:320px) {
      .no-csstransforms .cn-wrapper {
        width: 15.15px;
        margin-left: -7.5em;
      }
     
      .no-csstransforms .cn-wrapper li {
        height: 3em;
        width: 3em;
      }
    }
    Quelques petites retouches à faire, mais le gros est là.

  5. #5
    Nouveau candidat au Club
    Homme Profil pro
    Lycéen
    Inscrit en
    Avril 2015
    Messages
    2
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Suisse

    Informations professionnelles :
    Activité : Lycéen

    Informations forums :
    Inscription : Avril 2015
    Messages : 2
    Par défaut
    Merci pour vos réponses.
    @Bovino: désolé
    @jreaux62: votre interventions n'était pas nécessaire. Je demande si le code proposé par le forum (cf:mon premier poste) est simplifié au maximum car l'on ne peut pas demander à un collégien d'étudier les équations différentielles s'il n'a jamais appris le concept de dérivée...
    Je ne veux pas qu'on fasse le boulot à ma place, j'aimerais qu'on me mette dans les meilleurs conditions pour comprendre ce code et ne pas passer trois nuits dessus...

    @SylvainPV: Merci pour votre réponse. Je vais étudier ce que vous m'avez transmis et j'éditerai ce message si des questions se posent.
    Mais je sais déjà que je vais devoir chercher à quoi correspondent:
    - le "*" au tout début du code
    - .csstranforms.cn-wrapper (cn-wrapper étant un ID)
    - -webkit-transform: scale(0.1);
    - -ms-transform: scale(0.1);
    - -moz-transform: scale(0.1);
    - transform: scale(0.1);
    - pointer-events: none;
    - -webkit-transition: all .3s ease;
    - -moz-transition: all .3s ease;
    - transition: all .3s ease;

    etc. etc.

    Bonne soirée et merci de m'avoir lu

  6. #6
    Membre chevronné
    Profil pro
    Chef Gérant
    Inscrit en
    Octobre 2005
    Messages
    230
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Chef Gérant
    Secteur : Santé

    Informations forums :
    Inscription : Octobre 2005
    Messages : 230
    Par défaut
    bonsoir,

    si cela t'aide, voici un menu camembert que j'avais fait sur dabblet il y a un peu plus de deux ans ( commentaire/explication en français , fôte d'orthographes offertes pour le coté rustique). http://dabblet.com/gist/5020631

    Pour les sélecteurs voir : http://www.w3.org/Style/css3-selecto...010126.fr.html
    pour les autres régles css en générale , ceci est pas mal fait : https://developer.mozilla.org/fr/docs/Web/CSS

    CSS évolue au fil du temps, certaines règles sont standardisées et validées par le W3C, d'autres sont encore en phase de test/réflexion, certains navigateurs les intègres en version test et ne sont émulés que si le préfixe vendeur est ajouté.
    Certains navigateur implemente des régles prefixer qui leur sont propres, c'est d'ailleurs cette guéguerre entre navigateurs du début du web qui a en partie motive Le W3C et les standards pour nivelés un peut tout ça et qui a finis par tordre le coup au blink et marquee (<= anecdote l'essentiel c'est pas ça).
    Durant cette période de test/reflexion, la syntaxe peut changer, la règle peut tout simplement disparaitre (ex: :contains , overflow-style:marquee; le sélecteur parent, .. ont disparu des brouillons . la syntaxe des fond gradient ou du flex modèle a aussi changer au fil du temps).

    Voilou, bon courage / apprentissage

Discussions similaires

  1. probleme affichage menu déroulant CSS/java sous IE
    Par ex6s10z dans le forum Mise en page CSS
    Réponses: 5
    Dernier message: 14/06/2007, 15h38
  2. [CSS] petit problème avec menu déroulant et frame
    Par SylvainB dans le forum Mise en page CSS
    Réponses: 1
    Dernier message: 14/02/2006, 14h54
  3. [CSS ou HTML] Creation menu
    Par Manio 54 dans le forum Mise en page CSS
    Réponses: 7
    Dernier message: 19/11/2005, 09h45
  4. [Java] Obtenir le XPath d'un noeud DOM
    Par krappa dans le forum XSL/XSLT/XPATH
    Réponses: 2
    Dernier message: 26/09/2005, 16h06
  5. [CSS] espace avant affichage menu
    Par calimero82 dans le forum Mise en page CSS
    Réponses: 4
    Dernier message: 25/05/2005, 09h36

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo